Piping macro, designing in 3D view "Route5"

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!
freedman
Veteran
Posts: 3440
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Piping macro, designing in 3D view "Route5"

Post by freedman »

I want to use the macro a little more before I release it but here is one design and some pics. The tubing took me about an hour to draw and a couple hours to adjust just right, that might actually be good in terms of 3D CAD. :)

You can see from the side view there is a lot going on at angles.
Attachments
route_3.FCStd
(280.29 KiB) Downloaded 46 times
route1.png
route1.png (363.79 KiB) Viewed 3234 times
route2.png
route2.png (216.36 KiB) Viewed 3234 times
Last edited by freedman on Thu Jun 02, 2022 7:25 pm, edited 2 times in total.
User avatar
M4x
Veteran
Posts: 1472
Joined: Sat Mar 11, 2017 9:23 am
Location: Germany

Re: Piping macro, designing in 3D view

Post by M4x »

Interesting, I'm looking forward to your next post regarding this macro.
freedman
Veteran
Posts: 3440
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Re: Piping macro, designing in 3D view "Route1"

Post by freedman »

Here is a new macro "Route2". It automates many tasks of creating an additive pipe. It will do all the work of creating a map-mode attachment and a basic sketch. It uses map-mode "sectionOfRevolution" so the attachment edge needs to be an arc or circle. Each Additive pipe will have only one sketch in the tree, this is the path or Spine. The path is parametric but it has limits to what it can keep connected when there are many pipe sections.

I have included a starting file but the requirement is very simple; create a sketch with a circle or arc and pad it. I normally pad this very thin (.001 mm) because it is for reference only, it's the face that will be piped. Obviously any face could be piped using the correct attachment rules.

Certain tools will only be available depending on what is selected, a sketch and an Active Body for instance.

Note: Updating to "Route2". Added subtractive piping.

Sketch 3D view
The first checkbox (if checked) allows you to view and create in 3D, including Sketcher, once you get used to this it is very fun. While in Sketcher, ALT key plus the left mouse button allows you 3D rotation in FreeCAD. Sometimes you need to rotate around to the other side to select vertex.

Subtractive piping
If you want to remove material then do subtractive piping. You need to do the same operation as below where we create a pipe i.e make a sketch, pad it thin, this is the pattern for the subtractive pipe.

Pipe building:
Add Pipe or Add Elbow will start a pipe process, a pipe is a straight section and the elbow is a 90 degree section. The spine sketch is created for you to edit the spine path, you can add additional sketch geometry. The dialog turns yellow when in creation mode and the Actions at the bottom of the dialog give you an idea of what to select, you can uncheck the Pipe build checkbox to cancel the pipe.
You need a circular or curved edge and a face selection to build the pipe, once both are selected the dialog will turn bright red, please wait!. Once finished the dialog will change back to normal and you will be in sketch edit mode ready to edit the spine path. Close the sketch when finished and you should have a pipe. You might need to zoom-in to select a face.

Rotator:
Rotator options are for editing when a sketch is selected in the tree. Once a sketch is selected the rotator allows you to rotate the path direction. Turn ccw and turn cw perform the actual rotation. The two Angle adjustments give some options, click on them multiple times to set, one is small increments and the other large. The rotations could of coarse be set manually by using sketch attachment offset.

180 degree sketch changes face sides for sketch Normal-to.

Map reversed rotates the sketch by 180 degrees.

Visibility:
See inside changes visibility of the Active Body. Clicks will toggle back and forth. (Active body only)

See path will show only the sketch segments or back to full viewing. (Active body only)
The See path is useful when editing, once the sketch items are clickable in the 3D they can be identified in the tree to edit.

The first pic shows forms that could be piped. The second pic is a knot I created in about 10 minutes, I'm getting much faster at creating.

Let me know if you have problems with dialog.
Attachments
Pipe_flat.FCStd
(12.13 KiB) Downloaded 34 times
patterns1.png
patterns1.png (141.49 KiB) Viewed 2963 times
panel1.png
panel1.png (314.46 KiB) Viewed 2963 times
Last edited by freedman on Thu Jun 02, 2022 7:16 pm, edited 8 times in total.
drmacro
Veteran
Posts: 8865
Joined: Sun Mar 02, 2014 4:35 pm

Re: Piping macro, designing in 3D view "Route1"

Post by drmacro »

Have you done a geometry check on the resulting pipe solid?(with BOP check enabled)
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
freedman
Veteran
Posts: 3440
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Re: Piping macro, designing in 3D view "Route1"

Post by freedman »

Outdated, Deleted
Last edited by freedman on Mon Jun 27, 2022 4:34 am, edited 2 times in total.
drmacro
Veteran
Posts: 8865
Joined: Sun Mar 02, 2014 4:35 pm

Re: Piping macro, designing in 3D view "Route1"

Post by drmacro »

freedman wrote: Wed May 25, 2022 2:31 pm
Have you done a geometry check on the resulting pipe solid?(with BOP check enabled)
No errors!

I didn't expect errors because the macro doesn't create any geometry it just makes using FreeCAD easier.

Here is a complex shape (pic), No errors and easy to make. I'm running low on time right now but my next feature to add is subtractive piping. I will need to automate face/edge selections inside a solid because FreeCAD has some limitations selecting inside a solid. I really want to be able to make a fluid path inside a 3D printed part.
Thanks
Hmm...I have yet to find a construct in FreeCAD that will consistently create good geometry in such cases.

Are the pipes the macro produce following arcs or splines?
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
freedman
Veteran
Posts: 3440
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Re: Piping macro, designing in 3D view "Route1"

Post by freedman »

Are the pipes the macro produce following arcs or splines?
They follow spline sketches. Some confusion might be the map-mode, I expected a comment about usage :) . I found that 'SectionOfRevolution' is very unique in that it creates an attachment that is perpendicular to the object normal. This allows me to create the sketch viewing from the side which is perfect for editing a spline. Once I found this attachment process I knew I could exploit it and do spline editing.

I have created dozens of models with no issues in stability. The only issues I have seen come from making the radius so tight that the model turns on itself, that can be fixed by spline modification. The only problem I see is if the user needs to add a new pipe in the middle somewhere, you really need to be a pro user to do it.
drmacro
Veteran
Posts: 8865
Joined: Sun Mar 02, 2014 4:35 pm

Re: Piping macro, designing in 3D view "Route1"

Post by drmacro »

freedman wrote: Wed May 25, 2022 3:37 pm
Are the pipes the macro produce following arcs or splines?
They follow spline sketches. Some confusion might be the map-mode, I expected a comment about usage :) . I found that 'SectionOfRevolution' is very unique in that it creates an attachment that is perpendicular to the object normal. This allows me to create the sketch viewing from the side which is perfect for editing a spline. Once I found this attachment process I knew I could exploit it and do spline editing.

I have created dozens of models with no issues in stability. The only issues I have seen come from making the radius so tight that the model turns on itself, that can be fixed by spline modification. The only problem I see is if the user needs to add a new pipe in the middle somewhere, you really need to be a pro user to do it.
I'll dig up some of the files that have never worked and you can see if your magic works on them. I have posted about them in the Curves thread several times.

https://forum.freecadweb.org/viewtopic. ... 11#p570311

https://forum.freecadweb.org/viewtopic. ... 42#p570642
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
freedman
Veteran
Posts: 3440
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Re: Piping macro, designing in 3D view "Route1"

Post by freedman »

Here are my results, both pass BOP. I took a little different approach with the 3-way, I created 3 solid trunks and then hollowed them out with subtractive piping. I had a little trouble with the 3_way, there was a BOP error on an outer edge of the solid. I rotated the trunk 2 degrees and the BOP was fine, I guess that's cheating but the angle was random in the first place. :)

The pipe with angles, well, I feel like I could do that all day with 100% BOP.

I have updated the macro to do subtractive piping but it will have limits, we can't select internal (in solid) faces currently.
Attachments
trunk_test.FCStd
(416.88 KiB) Downloaded 36 times
pipe_test.FCStd
(279.91 KiB) Downloaded 27 times
test_pic.png
test_pic.png (185.12 KiB) Viewed 2637 times
Last edited by freedman on Thu May 26, 2022 5:20 pm, edited 1 time in total.
freedman
Veteran
Posts: 3440
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

Re: Piping macro, designing in 3D view "Route1"

Post by freedman »

Here is another interesting concept of usage, we normally need a bunch of sketches and pad/pocket to do something like this; we have a stair-step solid using only one sketch001 for the pattern, a couple clicks of the macro, set your depth! Again 100% Bop. This took about two minutes to accomplish. Using one sketch has a big advantage. :)

This was modeled with "Route2", the updated macro with subtractive piping.

I have noticed that TNP can make a big mess using the Piping since all the Spline sketches are attached to edges. I would say don't use this if you need to go back and edit. This should work great when TNP is fixed.
Attachments
step_1.FCStd
(86.84 KiB) Downloaded 24 times
step_1.png
step_1.png (178.58 KiB) Viewed 2616 times
Post Reply