Distorted in AdditiveLoft with peoperty of Ruled and Closed

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!
littlecat
Posts: 11
Joined: Fri Aug 05, 2022 7:16 am

Distorted in AdditiveLoft with peoperty of Ruled and Closed

Post by littlecat »

Hello everyone!

I get problem when I using AdditiveLoft with peoperty of Ruled and Closed. I create three sketch and set different placement to generate a body using AdditiveLoft. But I find the end of body is distorted. I guess it maybe algorithm problem but not sure.

First thanks if anyone can help me solve the problem.

See detail in attachment, and see screenshot below.
additiveloft_distorted.png
additiveloft_distorted.png (16.54 KiB) Viewed 907 times
Also my FreeCAD is version 0.20, Windows 10 64-bit.
Attachments
additiveloft_distorted.FCStd
(21.31 KiB) Downloaded 10 times
User avatar
Shalmeneser
Veteran
Posts: 9474
Joined: Wed Dec 23, 2020 12:04 am
Location: Fr

Re: Distorted in AdditiveLoft with peoperty of Ruled and Closed

Post by Shalmeneser »

In wireframe view, we can see that the loft is twisting the form : you need to draw all your forms clockwise (or anti-...)

(you should always add Sketcher_ConstrainCoincident if no other constraints.)
Attachments
additiveloft_distorted_SHALM.FCStd
(21.13 KiB) Downloaded 10 times
Capture d’écran 2022-08-05 144221.jpg
Capture d’écran 2022-08-05 144221.jpg (8.45 KiB) Viewed 889 times
littlecat
Posts: 11
Joined: Fri Aug 05, 2022 7:16 am

Re: Distorted in AdditiveLoft with peoperty of Ruled and Closed

Post by littlecat »

Shalmeneser wrote: Fri Aug 05, 2022 12:44 pm In wireframe view, we can see that the loft is twisting the form : you need to draw all your forms clockwise (or anti-...)
Thanks for you reply very much. I create one sckech named Sketch, and copy the Geometry of Sketch using Python to Sketch001, Sketch002. And then using Python to set the Placement of those three sketch like the screenshot.
So I just have a question? how to check the clockwise or anti- of my sketches by Python, because I have checked the three Placement of my sketches and that is right for that along one direction.
additiveloft_distorted_order.png
additiveloft_distorted_order.png (14.11 KiB) Viewed 789 times
littlecat
Posts: 11
Joined: Fri Aug 05, 2022 7:16 am

Re: Distorted in AdditiveLoft with peoperty of Ruled and Closed

Post by littlecat »

Shalmeneser wrote: Fri Aug 05, 2022 12:44 pm (you should always add Sketcher_ConstrainCoincident if no other constraints.)
Yeah, I just lazy for not using Sketcher_ConstrainCoincident, because I using Python script to create those sketch, and not more GUI handle. But I think it is OK, just only the two point of sketch in the same place, FreeCAD will create the right closed sketch shape.
Jee-Bee
Veteran
Posts: 2566
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: Distorted in AdditiveLoft with peoperty of Ruled and Closed

Post by Jee-Bee »

Shalmeneser wrote: Fri Aug 05, 2022 12:44 pm In wireframe view, we can see that the loft is twisting the form : you need to draw all your forms clockwise (or anti-...)
I just tested it with the normal loft. but there i doesn't change anything based on start position, direction of lines. And most importantly i don't have any control on the result.
For me there are two reasons to use a loft. when changing shape (from rectangular to triangular, round etc etc) and when i need twists.
On both properties i have any control.
User avatar
Shalmeneser
Veteran
Posts: 9474
Joined: Wed Dec 23, 2020 12:04 am
Location: Fr

Re: Distorted in AdditiveLoft with peoperty of Ruled and Closed

Post by Shalmeneser »

@onekk can you help us ?
User avatar
onekk
Veteran
Posts: 6144
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: Distorted in AdditiveLoft with peoperty of Ruled and Closed

Post by onekk »

Not immediately, I'm not at home, so no computer to test code till tomorrow.

But Loft is delicate as you should have at least two requisite:

- same number of edges in profiles
- order of build (clockwise or better counterclockwise, as arcs are drawn in counterclockwise order)
- not crossing profiles (ie when the curve should do a "bend" sometimes it is better to add some more profiles to guide the loft.

Closed could pose some problems (in theory closed is closing start profile to end profile) so it is better to model as wire and then obtain the first and last profile and make a face, make a shell and then promote as a solid.


If you can wait till tomorrow and maybe put some code... to start from I will try to put together a working script.

Regards

Carlo D.

Post Edited
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
littlecat
Posts: 11
Joined: Fri Aug 05, 2022 7:16 am

Re: Distorted in AdditiveLoft with peoperty of Ruled and Closed

Post by littlecat »

Hi everyone, I find one thing that, if I use the Sketch001 and Sketch002 to generate AdditiveLoft, the body is not distorted, and If I use the Sketch, Sketch001 and Sketch002 to generate AdditiveLoft, the body is distorted. That is strange to me. Any guy knows why?

Two sketch of screenshot is below. And attachment is detail.
additiveloft_distorted_two.png
additiveloft_distorted_two.png (7.85 KiB) Viewed 589 times
Attachments
additiveloft_distorted_two.FCStd
(22.65 KiB) Downloaded 9 times
littlecat
Posts: 11
Joined: Fri Aug 05, 2022 7:16 am

Re: Distorted in AdditiveLoft with peoperty of Ruled and Closed

Post by littlecat »

Shalmeneser wrote: Mon Aug 08, 2022 8:49 am @onekk can you help us ?
I find the same problem in this thread: https://forum.freecadweb.org/viewtopic. ... ft#p282033.
Maybe we can get inspiration from that discuss.
User avatar
onekk
Veteran
Posts: 6144
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: Distorted in AdditiveLoft with peoperty of Ruled and Closed

Post by onekk »

littlecat wrote: Tue Aug 09, 2022 1:42 am Hi everyone, I find one thing that, if I use the Sketch001 and Sketch002 to generate AdditiveLoft, the body is not distorted, and If I use the Sketch, Sketch001 and Sketch002 to generate AdditiveLoft, the body is distorted. That is strange to me. Any guy knows why?

Two sketch of screenshot is below. And attachment is detail.
additiveloft_distorted_two.png
Probably there is some quirks in the loft operation, if you run this script program with your first file:
20220809-adloft.py
(2.1 KiB) Downloaded 12 times
The problem is in the order of the loft:

see:

Code: Select all

# makeLoft(list of wires,[solid=False,ruled=False,closed=False,maxDegree=5]) -- Create a loft shape.
loft = Part.makeLoft([wir_2, wir_1, wir_0], True, True, False, 5)
Part.show(loft, "loft")
ad_loft.png
ad_loft.png (5.79 KiB) Viewed 493 times
versus the wrong shape:

Code: Select all

# makeLoft(list of wires,[solid=False,ruled=False,closed=False,maxDegree=5]) -- Create a loft shape.
loft = Part.makeLoft([wir_0, wir_1, wir_2], True, True, False, 5)
Part.show(loft, "loft")
So the order is important, some note:

- I've tried to change the order of edges, in the sketch_002 points. (I had to extract from the Content property of the sketch the lines and use Placement property to have correct points to make a proper Polygon).
- I've used Part.makeLoft as it seems similar to the AdditiveLoft of PD in results.

Why is not clear, as I've checked the order of edges, it is easily done with the polygon changing starting and ending point, (note that to make a polygon you must have first and end point coincident, to close it properly)

Hope it helps.

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
Post Reply