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: 3464
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

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

Post by freedman »

Can't change the size, other than being able to reduce it a few pixels.
This is what I planned, I wanted to make it wide enough for you to see everything and allow it to be scaled down for me in my view. You can see the entire dialog so all is good. It looks like the dialog needs to be a little longer, some of the checkboxes are being cut off.

The reason your pipe didn't work was the edge selection, the selected edge needs to be an arc or circle. If the wrong one is selected you can restart the pipe by erasing the pipe from the tree and then start a new pipe. If a straight edge is selected the "SectionOfRevolution" fails and you end up with a typical sketch that is FlatFace. Sorry about that, I will put that on the list of things to fix. I'm so used to selecting the right thing I didn't think about a filter for the edge.

If you want to look at the major process in the macro look at "def do_additive(self,my_face,my_edge)", most everything in it is right out of the Python console. You can see (in order) I create a sketch, create an attachment "SectionOfRevolution" to and edge, draw a line in the sketch, create a additive pipe using the face/Pad and edge selection, assign the prior sketch as the spine.

I do very little in the macro and it's kind of raw but I am always trying new approaches. In this one I wanted to guide the user by only showing what you could use in the dialog and only work with an Active body. I missed the edge filter. :?
Last edited by freedman on Mon Jun 27, 2022 4:41 am, edited 1 time in total.
drmacro
Veteran
Posts: 8978
Joined: Sun Mar 02, 2014 4:35 pm

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

Post by drmacro »

freedman wrote: Wed Jun 01, 2022 4:31 pm ...
Aha...I missed the requirement of the edge needing to be a arc or circle.

So, back to a question I asked before.

Some of the things I linked to had arbitrary 3D splines being followed. These are the ones that regularly fail geometry check.

The splines were made with Curves workbench, Freehand B-spline tool. Since they are not planer (i.e. not in a sketch), they won't work with your tool, right?
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
freedman
Veteran
Posts: 3464
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

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

Post by freedman »

Since they are not planer (i.e. not in a sketch), they won't work with your tool, right?
That's correct.

That's why I explicitly say designing in 3D view not 3D routing. :) The goal was to make the planar approach easy enough to use and get some work done without all the hassles of Additive piping. The attachment mode is very effective and durable, and because it's a circular attachment, only the closest connections to a rotation are moved (most of the time). For instance, if you modify an elbow in the middle of a long chain the free end might not move like you would think, all the attachments kind of rotate freely on their individual attachment axis.

Thanks for testing
freedman
Veteran
Posts: 3464
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 "Route5". I added curved edge and planar face filtering for better selection and fixed a problem with alignment. All the prior versions modeled the pipe on a slight angle so the model ended up not aligned with the origin planes. I will move this to my Github along with the documentation. I will post a link here when I move it.

Thanks for the input and comments from the users.
Attachments
Route5.FCMacro
(34.1 KiB) Downloaded 34 times
Last edited by freedman on Mon Jun 27, 2022 4:42 am, edited 1 time in total.
freedman
Veteran
Posts: 3464
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

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

Post by freedman »

I wanted to see how far I could go with advanced piping because I have been following the motorcycle frame.
https://forum.freecadweb.org/viewtopic.php?f=24&t=67784.
I made the main pipe in green and then tried to figure out how best to attach branches. I ended up with each branch being a new body, targeting a face in the main pipe. I attached a dependent sketch to a section face and padded it thin for my new branch pipe. You can see that every branch emanates from a section interface. The sketch is attached so it's rotatable with AttachmentOffset and could also be the start of a different size pipe, typical for any branch. You see in the second pic where I modified the main pipe path and the branch stays attached.

Now what I would like to do is attach the end of a branch to another main pipe :) , I have No idea how I would do that. It would take some kind of new attachment and then I think there would need to be a Solver. Geez!

I also get some weird artifacts internally when I do a boolean fuse on the whole pipe. To do this and have flow thru will take more work.

I will need to work on the piping macro (sometime) to be able to rotate the branches easily.
Attachments
multi.png
multi.png (259.24 KiB) Viewed 727 times
multi_1.FCStd
(111.33 KiB) Downloaded 26 times
freedman
Veteran
Posts: 3464
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

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

Post by freedman »

I haven't had much time to work on the macro but I have had some thoughts:

I noticed that piping could simplify building solids in FreeCAD or at least my version of FreeCAD. Piping can be a Pad, a Loft, a Pipe, a Revolve, a helix. These 5 things can be additive or subtractive which means that one dialog could replace 10 icons and ultimately change the interface for solid creation. The spine is a sketch that defines the length of a Pad for instance which is very intuitive. My goals would be to standardize the solid creation process and focus on one approach instead of 10 different screens. I'm not sure about 2 direction padding as yet.

There could be some questions about this so I will go thru each of the above:
Pad, a pad is a sketch face with a straight line spine.
Loft, is a pipe using multi-section with 2 sketches and a spine.
Pipe, is a sketch face with a curved or straight line spine.
Revolve, is a sketch face with a spine that rotates in 360 degrees or less.
helix, is a sketch face that follows a spine that is a helix.

My goals are focused on finding the simplest (lowest common denominator) approaches to modeling such that new users (school kids) could easily understand how to create. My FreeCAD will default to 3D sketch viewing with an option to switch to 2D to make dimensional sketches. I see 3D modeling as an immersion tool, once the user is used to 3D viewing then sketching in 2D is just a tool to input values.

The pic shows how sketching in 3D view gives a perspective of a pad, mouse select the sketch vertex and real-time drag to the desired length or try something ridiculous for those crazy what-ifs in a design, IMO that's 3D CAD!
Attachments
Pipe_dim.png
Pipe_dim.png (98.03 KiB) Viewed 610 times
Post Reply