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!
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 »

ikua wrote: Fri Mar 30, 2018 9:18 pm ...
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
Hello ikua.

I am new to FreeCAD and piping and I and I still learning to use the Tools. A lot of thinks which I currently do, is very experimental.
As you correctly noticed, my current workbench is focused on detailed representation of the fittings. This is because we also want to 3D-print the parts. The Flamingo workbench is more abstract, which makes it more sutable to lay pipes in a house. I suppose your code has similar application as Flamingo.
Soon I will join another projects to construct CAD piping within a house. Maybe your code can be usefull for this task too.

But even if our goals are different, I see following areas where we can collaborate.
  • I am neither a civil engineer nor a plumber, I would be glad to receive some constructive critics or tips. For example, in the very beginning I used outer and inner diameters to describe a pipe, but then I realized that Flamingo also uses thicknes. Making some brief internet-reaserach showed, that the common way to specify a pipe is outer dimension + wall thickness.
  • For sure all of us tried to create very similar fitting objects in FreeCAD, we can share our code and expirience. (Today I spent hours just to make a simple bent cylinder programmatically)
  • Adding fittings to a pipe and then move them together -- is an interesting feature for me. I think Flamingo can add things to pipes too, but I am not sure about subsequent moving together.
Ruslan
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 sweep elbow to the workbench. In contrast to a "normal" elbow, the bent part of the fitting hase a larger bend radius.
Attachments
create-sweep-elbow-screenshot.png
create-sweep-elbow-screenshot.png (99.22 KiB) Viewed 2753 times
ikua
Posts: 159
Joined: Fri Apr 07, 2017 1:32 pm

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

Post by ikua »

thank you for you answer rus!

I think we are not totally on the same way, but there are, like you mentioned, some overlapping points. I will upload next week some examples of my tools, maybe some of the code could be usefull for you.

Regarding to the pipes, working a bit in these field (in Germany) pipes, as far i know, standard measurements are used (DN), at least in pipes made out of iron. But there are different DINs they are based on so, the exact measurement of DN s can be quite different.

The following link shows a bit the complexity of that thing:
https://www.google.es/url?sa=t&rct=j&q= ... KMBo4s6SGz

In general it depens a bit what is the most important task of your pipe. If you have to transport a lot of quanitiy and this is the most limiting thing, you will focus on the inner diameter, if the medium has high pressure you will specialy focus on wall thickness.

If I may ask, why and for what purpose to you want to print pipes? I could not see here any advantage of costs, saftey or convenience.

About Flamingo: The last time i used it, there was no connection between pipes and flanges, so i decided to do it myself. My approach is especialy taking the workflow of planing in counter, which is highly iterative, so if i have to change the position of a pipe i would like to do that with as less clicks as possible.

greets ikua
oddtopus
Posts: 142
Joined: Tue Sep 20, 2016 6:17 pm

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

Post by oddtopus »

I added the pipe to to the create pipe dialog in OPWB.
The elbow is integrated.
Added support for tees and for couplings.
Added flamingo support to corners and bushings.
Thank You for that!
Now that OSE objects can create parts with the same structure of pypes I thought about a way to join them quickly.
For this I wrote the simple pipeCmd.join() function which, among the others, can be used in any script that deals with OSE or pype objects.
An application of this is a new tool in flamingo toolbar:
icon-join.png
icon-join.png (28.15 KiB) Viewed 2724 times
Obviously it works as well with OSE parts.

1) Select the target object
2) select the target port (green arrows)
3) select the part to move
4) select the port to join (blue arrows)
5) go to point 2) or press 'ESC'

Also, for instance, apply the function pipeCmd.placeTheElbow() to elbows created with OSE-piping-workbench: it definetly works well.

See below an example.
join-example.png
join-example.png (64.38 KiB) Viewed 2724 times
Also few answers to previous post:
line 14 in Elbow.__init__(...). Why the argument name is assigned to the attribute obj.PSize ?
PSize is the standard designation of one part's size, such as DN50 or OD16 accordy any norm (DIN / ISO / ASME etc.): that is what is written in the first column of your GUIs, which is called "name".
I used "name" in the arguments of __init__ because it s the title of that column in your gui.
lines 10-12 in Elbow.__init__(...) Are ports attributes missing? Something like
Yes. I wrote that class in short time just for example. Maybe I missed something.
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?
Each rule to build the Shape of the parts is intended to make the commands apply in the same way on similar objects. For example when using "spin by 45" I want to rotate a flange around the axis. Also to make coding easier: when I want to move a curve, generally it's to put it at the intersection of two axis, which correspond to its Placement.Base. Also with Ports its possible to join two parts in one simple way, by aligning the vectors and translating.
I added some pictures to the cheat-sheet about that.
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 »

Hi ikua,

thank your for the comments and for the link.
If I may ask, why and for what purpose to you want to print pipes? I could not see here any advantage of costs, saftey or convenience.
Well, I asked a similar question :), and the answer is now in our FAQ http://opensourceecology.org/wiki/PVC_P ... ibrary#FAQ:
Do we really want to 3D-print pipe fittings? Somehow I have doubt about mechanical properties of the 3D-printed products.

Yes. For high pressure applications - 300 PSI - we would have to be very careful. For low pressure, such as 5 PSI, it's not a problem. Eventually, we want to refine printing techniques where our fittings can do what standard schedule 80 ABS fittings can do.

Also with things such as part baking/anealing, composite filaments, and SLA or SLS Printers, very durable parts can be made
The fittings from my workbench are also used to constract a frame for a D3D printer. For this task, a possible advantage of 3d printer parts could be to print expensive parts like PVC corners (3-Wege Ellenbogen). In Germany, I can only order them from AliExpress with long shipment time or with very expesive shipment costs from Amazon.
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: Sat Mar 31, 2018 2:16 pm Thank You for that!
Now that OSE objects can create parts with the same structure of pypes I thought about a way to join them quickly.
For this I wrote the simple pipeCmd.join() function which, among the others, can be used in any script that deals with OSE or pype objects.
An application of this is a new tool in flamingo toolbar:
...
This is soo cool. :D :D . Thak you very much!
Also few answers to previous post:
...
Thank you for your replies.
PSize is the standard designation of one part's size, such as DN50 or OD16 accordy any norm (DIN / ISO / ASME etc.): that is what is written in the first column of your GUIs, which is called "name"
I use the column name as a part number but I will try to adopt more from your workbench.
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?
Each rule to build the Shape of the parts is intended to make the commands apply in the same way on similar objects. For example when using "spin by 45" I want to rotate a flange around the axis. Also to make coding easier: when I want to move a curve, generally it's to put it at the intersection of two axis, which correspond to its Placement.Base. Also with Ports its possible to join two parts in one simple way, by aligning the vectors and translating.
I added some pictures to the cheat-sheet about that.
I see an advatage to put the center of the fitting into intersection of the x-y axis. When I made the weep elbow I took it in account. When ask guys from our development team how they would project a 2D dawing, they will project them into x-z plane.
For my fittings I mostly use data and drawings from Aetna plastics. (I have no connection to this company, it was just suggested by a web-search engine, when I was looking for fittings dimensions)
oddtopus
Posts: 142
Joined: Tue Sep 20, 2016 6:17 pm

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

Post by oddtopus »

Dear @rus,
as anticipated I'm developing other tools that should work with all types of curves (OSE and flamingo).
One of those (already committed) is intended to place any elbow at the intersection of two tubes.
flat.png
flat.png (1.17 KiB) Viewed 2631 times
It uses the function pipeCmd.placeTheElbow(). The matter is that I realized that the angle of OSE_Elbow inside flElbow.py is still named "alpha" instead of "BendAngle", so the function fails when the following line is executed.

c.BendAngle=ang

I could insert a conditional clause like (if PType=="OSE-Elbow":) but it's what we are trying to avoid. Also it would be not efficient to make that each time and for any other elbow-part that may be added in future.
So in the attached file I renamed the attribute "alpha" to "BendAngle". For your convenience I commented the modified lines with ## alpha-->BendAngle ##.
Just replace the flElbow.py in the /Mod folder with this one: I already checked that doing so the new tool works properly with both elbow types (and any future elbow-like part).
flElbow(patched).py
(4.72 KiB) Downloaded 60 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 »

Dear @oddtopus,

thank you for the new greate feature!
oddtopus wrote: Sun Apr 01, 2018 12:33 pm Dear @rus,
as anticipated I'm developing other tools that should work with all types of curves (OSE and flamingo).
One of those (already committed) is intended to place any elbow at the intersection of two tubes.
flat.png
It uses the function pipeCmd.placeTheElbow(). The matter is that I realized that the angle of OSE_Elbow inside flElbow.py is still named "alpha" instead of "BendAngle", so the function fails when the following line is executed.

c.BendAngle=ang
I could insert a conditional clause like (if PType=="OSE-Elbow":) but it's what we are trying to avoid. Also it would be not efficient to make that each time and for any other elbow-part that may be added in future.
So in the attached file I renamed the attribute "alpha" to "BendAngle". For your convenience I commented the modified lines with ## alpha-->BendAngle ##.
Just replace the flElbow.py in the /Mod folder with this one: I already checked that doing so the new tool works properly with both elbow types (and any future elbow-like part).

flElbow(patched).py
You answered a question, which I wanted you to ask :lol: ! I was not happy with my alpha dimension in my elbows, because It is one of the dimensions, for which I did not find a name in documentations (in oposit to H, G, and J). I just take an first greek letter to make it different from the distant dimensions. I wanted to ask you to suggest a better name, and you already gave one. I will change it to "BendAngle" in the new version of the elbow.

Ruslan
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 »

New elbow dimensions. The white dimensions are used to calculate the elbow geometry. (The blue values are temporary auxiliary reference points for the elbow constructions -- they are calculated from white elbow dimensions.)
Attachments
elbow-calculations.png
elbow-calculations.png (6.25 KiB) Viewed 2601 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 »

I made a short video tutorial how to use flamingo with OSE-pipe-workbench
phpBB [video]
Last edited by rus on Mon Apr 02, 2018 3:57 pm, edited 1 time in total.
Post Reply