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!
User avatar
Stemfie3D
Posts: 24
Joined: Thu Oct 15, 2020 8:26 pm
Location: Sweden
Contact:

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

Post by Stemfie3D »

This is an excellent tool you made! :) Thank you for sharing this with the community.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

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

Post by Kunda1 »

+1
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
drmacro
Veteran
Posts: 8870
Joined: Sun Mar 02, 2014 4:35 pm

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

Post by drmacro »

Sigh, download the macros, execute the macros, get this:
Snip macro screenshot-2b6030.png
Snip macro screenshot-2b6030.png (98.29 KiB) Viewed 1343 times
Select a Body, nothing changes...

Edit: and the dialog size can't be changed.

Open the macro file, figure there will be helpful comments as to what the code does.

Wrong, eight lines of license BS at the top of the file, essentially no comments. (you would not last long in a code review... :lol: )

So, how does one get it to run and once the dialog is correct, how do I make these magic pipes you show?

:mrgreen:
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
freedman
Veteran
Posts: 3441
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

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

Post by freedman »

Select a Body, nothing changes...

Edit: and the dialog size can't be changed.

Open the macro file, figure there will be helpful comments as to what the code does.

Wrong, eight lines of license BS at the top of the file, essentially no comments. (you would not last long in a code review... :lol: )

So, how does one get it to run and once the dialog is correct, how do I make these magic pipes you show?
The Body selection needs to be set "Active Body". This should show more dialog options.
The instructions for usage are located on the third post of this thread.
If you help me finish my house I will write more code comments. :)

Simple instructions if the dialog is working.
To rotate a pipe section a sketch needs to be selected. This will show more dialog options.
To make a pipe you need a solid face, then select the face and select an edge (curve or round), that should do it.

Thanks for testing. I wish there is some way to know how other computers affect viewing.

Here is a version "Route3" that has some adjustablity to the dialog window. There are also a couple variables in the first few lines of the code if you need more width or height.
Last edited by freedman on Mon Jun 27, 2022 4:36 am, edited 2 times in total.
freedman
Veteran
Posts: 3441
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

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

Post by freedman »

With the topological naming problem (TNP) I think it's best to make the pipe a single Body. If your routing a tube, wires or conduit, make your start and ending connectors first and then start a new Body for the pipe. Also to reduce TNP errors, don't add new edges to the piping profile.

When I run a pipe I set the OD to the required value and set the inner diameter to a small hole, this allows me to have a large face to select as I route. Once the pipe is done I go back and set the pipe inner dia. to the correct value.
drmacro
Veteran
Posts: 8870
Joined: Sun Mar 02, 2014 4:35 pm

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

Post by drmacro »

freedman wrote: Mon May 30, 2022 2:04 am
Select a Body, nothing changes...

Edit: and the dialog size can't be changed.

Open the macro file, figure there will be helpful comments as to what the code does.

Wrong, eight lines of license BS at the top of the file, essentially no comments. (you would not last long in a code review... :lol: )

So, how does one get it to run and once the dialog is correct, how do I make these magic pipes you show?
The Body selection needs to be set "Active Body". This should show more dialog options.
The instructions for usage are located on the first post of this thread.
If you help me finish my house I will write more code comments. :)

Simple instructions if the dialog is working.
To rotate a pipe section a sketch needs to be selected. This will show more dialog options.
To make a pipe you need a solid face, then select the face and select an edge (curve or round), that should do it.

Thanks for testing. I wish there is some way to know how other computers affect viewing.

Here is a version "Route3" that has some adjustablity to the dialog window. There are also a couple variables in the first few lines of the code if you need more width or height.
Ok, so I got through that an made a pipe. But, what if I want to follow and arbitrary spline of my making?
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
drmacro
Veteran
Posts: 8870
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
How did you do this? I can't your macro to work with anything other than a circle-in-a-circle or on the XY_Plane. :?
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
freedman
Veteran
Posts: 3441
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

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

Post by freedman »

How did you do this? I can't get your macro to work with anything other than a circle-in-a-circle or on the XY_Plane.
I haven't seen any issue with plane restrictions. Remember that to pipe requires a solid face i.e a padded surface no matter what the angle (as far as I know). I have been able to pipe any solid face as long as I have a curve in it somewhere to select.


In general, the mapmode requires an edge that is curved, an additivepipe requires a face to pipe. All the macro does is collect that info and make a pipe, it stops the process at sketching the pipe spline as you have seen. The sketch can be modified in any way, you can delete or add elements but I give a default curve or a strait line to work on. Any sketch element added will immediately be piped.

The sketch of coarse is plane based but the sketch can be rotated.

I started the hex pad (pic) on the XZ plane. I won't say this easy to build but it's not that hard once you get used to it.
Attachments
hex_a_pod.png
hex_a_pod.png (128.49 KiB) Viewed 1091 times
freedman
Veteran
Posts: 3441
Joined: Thu Mar 22, 2018 3:02 am
Location: Washington State, USA

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

Post by freedman »

Piping a wire bundle and coloring faces looks pretty good, this could be very effective in production using a color printer. The bundle is actually a solid piped face "Pad002" until I want to split the wires out individually"Pad003".

I noticed that everytime I add a new pipe the colors get reset. Is this a known issue? I would wait until everything is routed and then apply color.

I'm also updating to Route4:
Route3 produced some long pipes as a default. When I can get some time I want to size the elbow radius to the pipe size and make it work correctly. I put a reasonable elbow radius in this version.
Attachments
connector1.FCStd
(334.93 KiB) Downloaded 31 times
wire_color1.png
wire_color1.png (197.14 KiB) Viewed 1079 times
Last edited by freedman on Thu Jun 02, 2022 7:14 pm, edited 1 time in total.
drmacro
Veteran
Posts: 8870
Joined: Sun Mar 02, 2014 4:35 pm

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

Post by drmacro »

Downloaded Route4.

Can't change the size, other than being able to reduce it a few pixels.
Peek 2022-06-01 07-52.gif
Peek 2022-06-01 07-52.gif (259.22 KiB) Viewed 998 times
Start with this:
Snip macro screenshot-b7d2f9.png
Snip macro screenshot-b7d2f9.png (76.35 KiB) Viewed 998 times
Run macro, end up with this:
Peek 2022-06-01 07-53.gif
Peek 2022-06-01 07-53.gif (427.27 KiB) Viewed 998 times
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
Post Reply