integration between ose-piping-workbench and flamingo-wb

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Post Reply
oddtopus
Posts: 142
Joined: Tue Sep 20, 2016 6:17 pm

integration between ose-piping-workbench and flamingo-wb

Post by oddtopus »

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.
sampleElbow.py
(4.39 KiB) Downloaded 130 times
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
Then you may try

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.
sample-elbow-integration.png
sample-elbow-integration.png (38.15 KiB) Viewed 5293 times
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.
pypeAttributes.xls
(13 KiB) Downloaded 81 times
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
User avatar
yorik
Founder
Posts: 13659
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: integration between ose-piping-workbench and flamingo-wb

Post by yorik »

Wow... Everyday a new, baffling workbench being developed! :o
User avatar
rus
Posts: 73
Joined: Wed Feb 22, 2017 6:37 pm

Re: integration between ose-piping-workbench and flamingo-wb

Post by rus »

Thank you for the documentation and for the code!

I started to integrate Flamingo pipes into OPWB to prepare the GUI for more complex objects like elbows.
User avatar
rus
Posts: 73
Joined: Wed Feb 22, 2017 6:37 pm

Re: integration between ose-piping-workbench and flamingo-wb

Post by rus »

I added the pipe to to the create pipe dialog in OPWB. I will proceed with elbows.
@oddtopus how do you want to be credited in the code?
Attachments
create-flamingo-pipe-screenshot.png
create-flamingo-pipe-screenshot.png (101.27 KiB) Viewed 5115 times
User avatar
rus
Posts: 73
Joined: Wed Feb 22, 2017 6:37 pm

Re: integration between ose-piping-workbench and flamingo-wb

Post by rus »

oddtopus wrote: Fri Mar 23, 2018 3:12 pm sampleElbow.py
I have a couple of questions about the sampleElbow.py:
  1. line 14 in Elbow.__init__(...). Why the argument name is assigned to the attribute obj.PSize ?
  2. lines 10-12 in Elbow.__init__(...) Are ports attributes missing? Something like

    Code: Select all

    		obj.addProperty("App::PropertyVectorList","Ports","Elbow","Ports relative position").Ports = self.getPorts(obj)
    
    wich you have in PipeFeatures.Elbow.__init__(...).
    I added this line to my modification of the Elbow, but I cannot see it in GUI. Do you know why?
  3. Is there a particular reason to have flat parts in x-y plane? How can I rotate them to move them within Elbow.execute into x-z plane?
User avatar
rus
Posts: 73
Joined: Wed Feb 22, 2017 6:37 pm

Re: integration between ose-piping-workbench and flamingo-wb

Post by rus »

The elbow is integrated.
Attachments
create-elbow-screenshot.png
create-elbow-screenshot.png (60.83 KiB) Viewed 5010 times
User avatar
rus
Posts: 73
Joined: Wed Feb 22, 2017 6:37 pm

Re: integration between ose-piping-workbench and flamingo-wb

Post by rus »

Added support for tees and for couplings.
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: integration between ose-piping-workbench and flamingo-wb

Post by triplus »

Nice to see developer collaboration at play.
User avatar
rus
Posts: 73
Joined: Wed Feb 22, 2017 6:37 pm

Re: integration between ose-piping-workbench and flamingo-wb

Post by rus »

Added flamingo support to corners and bushings.
Attachments
create-bushing-screenshot.png
create-bushing-screenshot.png (72.79 KiB) Viewed 4873 times
ikua
Posts: 159
Joined: Fri Apr 07, 2017 1:32 pm

Re: integration between ose-piping-workbench and flamingo-wb

Post by ikua »

Hello!

I found your post, cause i am also trying to optimize my workflow for piping in freecad. Maybe my approach to this point is quite different, cause i saw you are working really on details and i have more my planning approach. I will describe my workflow at the moment and some tools i have developed for my own use and would I see also as usefull to develope in the future. To my person, I am working in a small engnieering company and we do mostly work with Waste Water treatment plant, and there in special renovation work of old systems.

My Workflow at the moment:
-Drawing the center line of the pipe with draft-dwire (so i can manipulate it easily later one)
- Make a pipe with the arch pipe tool

Tools i have developed for myself:
-I can selected created pipe (one or multiple): DN, medium, material and some export options
extras of this: the fillets of the dwire and therefore the radius of the elbow ajust automatically with the DN
if the filling medium is selected the material get selected automatically and also a color is automatically assigned
(for this 2 function is use and external csv to assign color to material DN to diameter ....)
-I can hide/unhide all pipes from the drawing (so i can easily manipulate the dwires)
-I can hide/unide the all base dwire form the drawing
-adding flanges at the end of the pipe which move with the pipe
-with the export options i can autmatically create a bill of quantities for tender issues in the German GAEB format.

Future developments i would like to make:
-add fitting which move with the basic dwire and can be relativly or absolutly fixed on an edge of the dwire (for example in the middle of it)
-add possibilities or insulation to pipes (and use them also in export)
-add pipesupports to the closesd wall automatically
-add an export "token" which you can connect to parts which are not part of an pipe to include them in the bill of quantities

The final idea would be to also develop and P&ID tool in freecad which you could connect to the 3d drawing an check both for completness.

So the ideal workflow would be for me:
PI&D->3d-Drawing->bill of quanities all made based on freecad

I am at the moment at home, but if you are interested in my stuff i can upload some fill next week from my office.

So are we working in the same direction and should join up, or do you see my approach totally different from yours and i would make at the moment no sence to work together?

greets ikua
Post Reply