So I'm playing with building rules lofts along splines by auto-generating the loft sections from a master sketch, then aligning them normal to the spline at a fixed interval.
It works really well! However, there's one small issue. Every once in a while, the loft "twists" between sections - the edges cross over to opposite points between two sections.
In the image below, I'm using a sketch of a rectangle, so each section consists of four points. All sections are the same dimenstions, they only differ in their position and orientation.
If I set the section interval to 5 feet or less, it looks fine (top picture), but once I set it to 6 feet or higher, the "twist" appears (bottom picture). The sections, incidentally, are about 12 feet wide and 1 foot thick.
Is this a bug or just something I don't understand about lofting?
Loft twisting between sections
Forum rules
and Helpful information
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help
Also, be nice to others! Read the FreeCAD code of conduct!
Also, be nice to others! Read the FreeCAD code of conduct!
- Joel_graff
- Veteran
- Posts: 1949
- Joined: Fri Apr 28, 2017 4:23 pm
- Contact:
Loft twisting between sections
FreeCAD Trails workbench for transportation engineering: https://www.github.com/joelgraff/freecad.trails
pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
Re: Loft twisting between sections
I don't know if it's pertinent, or even entirely correct, but I seem to remember reading somewhere that the order of creation of lofts can cause this....
meaning the sections should be created in the order that they are lofted through?
Hope someone more enlightened can help more.
Steve.
meaning the sections should be created in the order that they are lofted through?
Hope someone more enlightened can help more.
Steve.
- Joel_graff
- Veteran
- Posts: 1949
- Joined: Fri Apr 28, 2017 4:23 pm
- Contact:
Re: Loft twisting between sections
I didn't know that, but I assumed it was likely the case. That said, they're generated programmatically, stepping incrementally along the path, so, yes, they're in order.Bance wrote: ↑Wed Jan 23, 2019 11:37 pm I don't know if it's pertinent, or even entirely correct, but I seem to remember reading somewhere that the order of creation of lofts can cause this....
meaning the sections should be created in the order that they are lofted through?
Hope someone more enlightened can help more.
FreeCAD Trails workbench for transportation engineering: https://www.github.com/joelgraff/freecad.trails
pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
pivy_trackers 2D coin3D library: https://www.github.com/joelgraff/pivy_trackers
- microelly2
- Veteran
- Posts: 4688
- Joined: Tue Nov 12, 2013 4:06 pm
- Contact:
Re: Loft twisting between sections
If the curvature changes into the other direction the binormal vector flips too.
To avoid this these vectors (tangent, normal) must be monitored along the path and when a flip is detected there must be a flag in the calculation which switches back.
This can be done in a extra script. Loft does not handle this.
I have this method soemwhere in my scripts to compute ways on terrains. I must look where it is exactly
this was the use case
https://youtu.be/ZwJ26sdSN_E
To avoid this these vectors (tangent, normal) must be monitored along the path and when a flip is detected there must be a flag in the calculation which switches back.
This can be done in a extra script. Loft does not handle this.
I have this method soemwhere in my scripts to compute ways on terrains. I must look where it is exactly
this was the use case
https://youtu.be/ZwJ26sdSN_E