integration between ose-piping-workbench and flamingo-wb
Posted: Fri Mar 23, 2018 3:12 pm
Hello.
Recently I discovered the OSE-piping-Workbench (https://github.com/rkrenzler/ose-piping-workbench) and have been invited to collaborate to it by the developer. This seems a good opportunity to make one set of objects dealing with pipes that can be used throughout different workbenches: flamingo and OSE-piping-Workbench.
Therefore I open this thread in order to share with all the ideas useful for this integration and gather any contribution from the community.
To start with, following to the first exchange of ideas done on github (https://github.com/oddtopus/flamingo/issues/6), below it's attached one example of FeaturePython (for FC 0.17: I tried it also with earlier versions but it won't work correctly) for one of the piping elements provided in OSE-piping-Workbench (let me shorten it to OPWB in future), i.e. one elbow element for plastic piping. It includes:
- Elbow() -> the proxy class for the FeaturePython object
- makeElbow() -> the function to insert one Elbow() in the active document
- insertTheTube() -> one sample utility function that uses some tools from the flamingo's modules
To see it working just put the file in the FreeCAD's path and import it as a python module using the Console.
Then you may try
Beside this, it's attached also a brief cheat-sheet that describes briefly the mandatory (red+green) suggested (yellow) and optional names for properties that should be used when creating a FeaturePython object compatible with flamingo tools. This is a working document so I will update it from time to time in the github repository, in the /tutorial folder.
It's important to remember some rules about the geometry of Shapes, so that flamingo's commands can work:
1) the Shape of "long" parts (pipes, tees) have the main axis aligned with Z axis
2) the Shape of "flat" parts (curves, u-bolts, tees etc) lay in the X-Y plane
3) fittings to join the tubes shall make their axis intersect in (0,0,0): so take care how to draw the shape to make the Placement attribute congruent to that
4) "long" parts have always the attribute "Height", like the objects "Structure" of the workbench Arch
Recently I discovered the OSE-piping-Workbench (https://github.com/rkrenzler/ose-piping-workbench) and have been invited to collaborate to it by the developer. This seems a good opportunity to make one set of objects dealing with pipes that can be used throughout different workbenches: flamingo and OSE-piping-Workbench.
Therefore I open this thread in order to share with all the ideas useful for this integration and gather any contribution from the community.
To start with, following to the first exchange of ideas done on github (https://github.com/oddtopus/flamingo/issues/6), below it's attached one example of FeaturePython (for FC 0.17: I tried it also with earlier versions but it won't work correctly) for one of the piping elements provided in OSE-piping-Workbench (let me shorten it to OPWB in future), i.e. one elbow element for plastic piping. It includes:
- Elbow() -> the proxy class for the FeaturePython object
- makeElbow() -> the function to insert one Elbow() in the active document
- insertTheTube() -> one sample utility function that uses some tools from the flamingo's modules
To see it working just put the file in the FreeCAD's path and import it as a python module using the Console.
Code: Select all
import sampleElbow as se
Code: Select all
c=se.makeElbow() # that creates one elbow with standard properties; you can change it afterwards in the "Data" attributes panel
import pipeCmd as pc # from "flamingo" just to create one tube
t=pc.makePipe(['OD20',20,2.5,100])
se.insertTheTube(c,t) # ...and select the green arrow where you want to insert the tube.
1) the Shape of "long" parts (pipes, tees) have the main axis aligned with Z axis
2) the Shape of "flat" parts (curves, u-bolts, tees etc) lay in the X-Y plane
3) fittings to join the tubes shall make their axis intersect in (0,0,0): so take care how to draw the shape to make the Placement attribute congruent to that
4) "long" parts have always the attribute "Height", like the objects "Structure" of the workbench Arch