oddtopus / flamingo

FreeCAD - flamingo workbench
GNU Lesser General Public License v3.0
32 stars 13 forks source link

Can we collaborate? #6

Closed rkrenzler closed 6 years ago

rkrenzler commented 6 years ago

Hello @oddtopus, I develop some macros for OSE project, which create pipes and fittings. Can we collaborate?

luzpaz commented 6 years ago

@oddtopus this would be so cool if this relationship is more established.

oddtopus commented 6 years ago

Dear @rkrenzler I just cloned your repository and will have a look to it in next days, but at first glance it seems very interesting and well suited to share some properties with the "pypes" objects. As I see it, it will be a great opportunity to make a set of featurepython dedicated to piping design and that share common tools such as pypelines, assembly commands, pressure loss data u.s.w. Let me look better at it. In the meantime I suggest to open a thread in the FreeCAD forum, so that we can take advices also from the community.

rkrenzler commented 6 years ago

Dear @oddtopus,

I made several piping project. The active now is ose-piping-workbench. The ose-piping-library is no more developed.

Considering the forum thread -- it is a good idea. I still learn the the FreeCAD API and community support will for sure be very helpful.

oddtopus commented 6 years ago

Dear @rkrenzler, I looked at the way objects are created in OSE-piping-workbench and saw some difficulties in integrating them with tools provided in flamingo WB.

To start, let me talk a little about such differences. "Pype" objects in flamingo WB are type "FeaturePython", the proxy classes of which are defined in the file pipeFeatures.py. This means that parts created with this type are objects customized with specific attributes and methods necessary to draw and manage them. Instead, parts created with OSE-piping-Workbench are type "Part.Feature": as for my understanding, the code of "pipe.py", "elbow.py" etc. is only draws the part using standard classes of the Part module. Unfortunately this creates objects which don't have the necessary attributes to define and modify easily the part geometry and orientation.

One example: in pipe.py first the outer_cylinder is added to the ActiveDocument , then is added the inner_cylinder, then is created the pipe as the difference of outer_cylinder and inner_cylinder, finally the solid is created and the document structure is purged deleting inner_cylinder and outer_cylinder. The result is a static Part::Cut object with only Placement and Label attributes. For instance, it's missing the attribute "Height" to change the length of the pipe because it's been deleted with the two parents Part::Cylinder objects. As a consequence, to change the geometry of the pipe it is necessary to delete it and redraw a new one. Instead the pipeFeatures.Pipe() class, which is used in flamingoWB, creates a part that has already integrated the properties "Height" (the length), "OD" (the outside diameter) and "thk" (the thickness). It is always the difference of two cyclinders but its shape is recomputed each time one attribute is changed! This makes much easier operations such as changing the diameter size or moving the pipe in the model. Also it will be possible to add an attribute "flow-factor" to allow calculation of pressure losses.

My advice is to re-code all fittings as FeaturePython and use the same attributes names that I used in pipeFeatures.py to define the common properties. I guess it will not take too much to do that. In this way you will be able to reuse the functions already defined in flamingoWB, such as frameCmd.placeTheBeam() or frameCmd.rotateTheBeamAround(); please note that despite the name of the functions, they apply also to "pipe" objects, which are regarded as beams with a ring section.

For your convenience I'll post in FC forum a little cheat-sheet to explain the basic structures to make the parts compatible with the functions of flamingoWB.

rkrenzler commented 6 years ago

Dear @oddtopus,

Unfortunately this creates objects which don't have the necessary attributes to define and modify easily the part geometry and orientation ... [list of disadvantages].

I agree with you completely -- that is why I plan to add "FeaturePython"/"Flamingo" option. I already moved my parameters from outer diameter + Inner diameter + lenght to Flamingos outer diameter + thickness + height to make this transition easier.

Also it will be possible to add an attribute "flow-factor" to allow calculation of pressure losses.

This sounds like a usiful feature to me. But I think, we need more geometry information to go "full fluid dynamic mode" 🤓.

My advice is to re-code all fittings as FeaturePython and use the same attributes names that I used in pipeFeatures.py to define the common properties.

I will do it as far as possible. The tube is not a problem, but the elbow can become complicated. There is some features wich I would like to have in my workbench. But I will post it in a separate message

For your convenience I'll post in FC forum a little cheat-sheet to explain the basic structures to make the parts compatible with the functions of flamingoWB.

Thank you very much.

P.S. We can keep the tradition to use italian/spanish names for the parts 😀.

rkrenzler commented 6 years ago

I would like to have a special GUI mode for placement and rotation of the parts on the contact faces. Sometimes these faces are not visible. See pipe-gui

What do you think about it?

rkrenzler commented 6 years ago

There is also a large difference between your and my workbenches. I tried to make the description of the parts closer to the description given by their manufacture. That is why my elbow has more paramters than yours. For sure, this is an overhead for the flow calculation but it is important to print the parts. Maybe it is possible to have the same abstract representation and your workbench will see this complicated parts it as a special type of an abstract pipe, elbow, tee, ...?

oddtopus commented 6 years ago

This sounds like a usiful feature to me. But I think, we need more geometry information to go "full fluid dynamic mode"

Rather than making resource-consuming cfd calculations (which are already well developed in other workbenches) I'm thinking of quick pressure-loss calculations along the pipes with macro-formula. I recently added this feature under the "Utils" menu, thanks to the gorgeous "fluids.py" library of Dr. Caleb. (link here): this and the "thermo" modules must be installed separately using pip. Up to now it's possible to calculate the Delta-p across pipes and curves drawn in the model by selecting them or the "PypeBranch" which they belong to, but the target is to include all the local pressure losses that could be calculated with a Cv or Kv factor (valves, orifices, fittings etc.). These parameters are standard technical informations that can be found in the catalogs or calculated once for all. This is the reason why it would be interesting to have that attribute inside the object. CAVEAT: the PypeBranch feature is under development. It works pretty good with FC 0.17 but, I don't know why, with previous versions it does not update the graphic scene, though the lengths of pipes is correct in the model. If you have any idea why this happens, I'll appreciate any suggestion.

oddtopus commented 6 years ago

I would like to have a special GUI mode for placement and rotation of the parts on the contact faces. Sometimes these faces are not visible.

I don't think it's necessary because to move and rotate you can right now use some already existing tool: for instance, Mate circular edges or Rotate around an axis. Then, for further placements and assembly, the solution for that is the use of the attribute Ports:it is a list of vectors that are used to refer quickly to the inlets and outlets of fittings. In pipeFeatures.py see the parent class pypeType() and how it's used in Elbow().

rkrenzler commented 6 years ago

oddtopus notifications@github.com schrieb am So., 18. März 2018, 20:49:

I would like to have a special GUI mode for placement and rotation of the parts on the contact faces. Sometimes these faces are not visible.

I don't think it's necessary because to move and rotate you can right now use some already existing tool: for instance, Mate circular edges or Rotate around an axis.

The problem is that some edges are hidden within the fitting. That is why I want a special GUI to easily select them. Bit maybe you are right - I will first try to do it without special GUI.

Then, for further placements and assembly, the solution for that is the use of the attribute Ports:it is a list of vectors that are used to refer quickly to the inlets and outlets of fittings. In pipeFeatures.py see the parent class pypeType() and how it's used in Elbow().

OK. I will implement a pipe and a tee fitting using your library and then I will test it with your workbench. If the moving and the rotation operations are sufficient easy, I will integrate all the remaining fittings.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/oddtopus/flamingo/issues/6#issuecomment-374038492, or mute the thread https://github.com/notifications/unsubscribe-auth/ATMY4piZAyhXp2h-_kB9p4x2GagXIv0zks5tfrpVgaJpZM4SJRec .

oddtopus commented 6 years ago

There is also the chance to use what I call handles. It is a graphic element that appears next to the object when you perform a special action (for example to insert a tube in an hole) but that disappear when the operation is done. see the class arrow() and the command'quick move'. Let's say that me too will try to change one of your fittings to show how it could look like. But it will take some time...

rkrenzler commented 6 years ago

oddtopus notifications@github.com schrieb am So., 18. März 2018, 19:15:

This sounds like a usiful feature to me. But I think, we need more geometry information to go "full fluid dynamic mode"

Rather than making resource-consuming cfd calculations (which are already well developed in other workbenches) I'm thinking of quick pressure-loss calculations along the pipes with macro-formula. I recently added this feature under the "Utils" menu, thanks to the gorgeous "fluids.py" library of Dr. Caleb. (link here https://github.com/CalebBell/fluids): this and the "thermo" modules must be installed separately using pip. Up to now it's possible to calculate the Delta-p across pipes and curves drawn in the model by selecting them or the "PypeBranch" which they belong to, but the target is to include all the local pressure losses that could be calculated with a Cv or Kv factor (valves, orifices, fittings etc.). These parameters are standard technical informations that can be found in the catalogs or calculated once for all. This is the reason why it would be interesting to have that attribute inside the object.

Thank you for the link!

CAVEAT: the PypeBranch feature is under development. It works pretty good with FC 0.17 but, I don't know why, with previous versions it does not update the graphic scene, though the lengths of pipes is correct in the model. If you have any idea why this happens, I'll appreciate any suggestion.

I am not very familar with FreeCAD but if I will find out, why this happens, I will tell you.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/oddtopus/flamingo/issues/6#issuecomment-374026451, or mute the thread https://github.com/notifications/unsubscribe-auth/ATMY4mHkNp25XcLZmlwOcGC2OVYgqDZzks5tfqQsgaJpZM4SJRec .

rkrenzler commented 6 years ago

oddtopus notifications@github.com schrieb am Mo., 19. März 2018, 20:08:

There is also the chance to use what I call handles. It is a graphic element that appears next to the object when you perform a special action (for example to insert a tube in an hole) but that disappear when the operation is done. see the class arrow() and the command'quick move'.

This is precisely what I need.

Let's say that me too will try to change one of your fittings to show how it could look like. But it will take some time...

OK.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/oddtopus/flamingo/issues/6#issuecomment-374331749, or mute the thread https://github.com/notifications/unsubscribe-auth/ATMY4jbHQ1s7opGA2gs75E42hXU7xWG2ks5tgAI1gaJpZM4SJRec .

oddtopus commented 6 years ago

Dear @rkrenzler, I moved this talk to the forum here

rkrenzler commented 6 years ago

Dear @oddtopus Cool! Thank you for the example and for the documentation!

rkrenzler commented 6 years ago

Collaboration started!