Spiral path on 3d surface mesh

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
jbi
Posts: 117
Joined: Sun Apr 24, 2016 3:28 pm

Spiral path on 3d surface mesh

Post by jbi »

I had some time, so I decided to try creation of a spiral path on 3d surface mesh. I cannot think of a particular use case for this except maybe overlay welding or repair welding of castings, but I do not have an actual use case for this. I created a spiral on a sphere mesh and so far the preliminary results look good. It is not ready, and of course on other surfaces this may fail.
sphere_with_spiral.jpg
sphere_with_spiral.jpg (32.44 KiB) Viewed 1167 times
For those interested please find attached the scripts and parts for the spiral path creation. You need to have scipy installed. My scipy.__version__ is '1.4.1', which works with FreeCAD 0.19. In case someone need to create own points of the outline of another part you can download weldslicer workbench. Explanation here https://forum.freecadweb.org/viewtopic. ... 1abf5e149a or directly
https://www.weldslicer.com/examples/
Attachments
spiral curve_1.FCStd
(653.56 KiB) Downloaded 20 times
spiralpath_clean.py
(11.24 KiB) Downloaded 20 times
pts.csv
(99.3 KiB) Downloaded 13 times
basesphere_clean.FCStd
(101.6 KiB) Downloaded 17 times
Hayden
Posts: 50
Joined: Thu Aug 31, 2023 12:50 pm

Re: Spiral path on 3d surface mesh

Post by Hayden »

jbi wrote: Fri Jul 22, 2022 2:30 pm I had some time, so I decided to try creation of a spiral path on 3d surface mesh. I cannot think of a particular use case for this except maybe overlay welding or repair welding of castings, but I do not have an actual use case for this. I created a spiral on a sphere mesh and so far the preliminary results look good. It is not ready, and of course on other surfaces this may fail.

sphere_with_spiral.jpg
spiralpath_clean.py", line 165, in <module>
mesh=sf[0].Object.Mesh
<class 'IndexError'>: list index out of range
jbi
Posts: 117
Joined: Sun Apr 24, 2016 3:28 pm

Re: Spiral path on 3d surface mesh

Post by jbi »

you need to pick the surface with in the GUI, and afterwards you run the 2 lines

Code: Select all

#load the stl mesh
sf = FreeCADGui.Selection.getSelectionEx() #pick the surface first at the GUI
mesh=sf[0].Object.Mesh

from there one you can copy the entire code and paste into the python console.
Hayden
Posts: 50
Joined: Thu Aug 31, 2023 12:50 pm

Re: Spiral path on 3d surface mesh

Post by Hayden »

jbi wrote: Sun Sep 10, 2023 9:59 am you need to pick the surface with in the GUI, and afterwards you run the 2 lines

Code: Select all

#load the stl mesh
sf = FreeCADGui.Selection.getSelectionEx() #pick the surface first at the GUI
mesh=sf[0].Object.Mesh

from there one you can copy the entire code and paste into the python console.
QQ20230910182036.png
QQ20230910182036.png (77.52 KiB) Viewed 457 times
jbi
Posts: 117
Joined: Sun Apr 24, 2016 3:28 pm

Re: Spiral path on 3d surface mesh

Post by jbi »

use "baseface" from spiral curve_1.FCStd
Post Reply