Loft has troubles
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!
Re: Loft has troubles
I don't know what you mean with snails, but thanks for the tip ^^
Re: Loft has troubles
Ha, sorry, it's French jargon, a spiral shape, we used to call it in the shape of "snail shell"what you mean with snails
This is our good food side with frog legs
Re: Loft has troubles
I'm also french But I thought you meant it like a technical word or something ^^
Re: Loft has troubles
(Newbee, first post) I am having a similar problem with loft in a script flipping sides so the result collapses in places.
Could you please explain this more. If I understand correctly, the first three items create a D-shaped closed wire that replaces the rectangles in your first post. But then "Loft with solid=True" can still have the flipping sides problem. What did you do differently in that last step? Did you have more sections, or improve the smoothness, or change the maxDegree, or what? (Also, of course, it would be nice to see the details in the script.)
Re: Loft has troubles
@PaulG
Basically, since lofting 'Closed Edges' did not work, but lofting 'Open Edges' did work, I created a Wire from the 'Open Edges' + A straight line to close it. The solid loft then worked.
It looks like this:
I think of it as HEXA-BLOCK meshing if you ever did this. The more you divide your model, the more you have control on it, but the more it's a pain. Fortunately, here it is not a pain ^^. Hope this helps you
Basically, since lofting 'Closed Edges' did not work, but lofting 'Open Edges' did work, I created a Wire from the 'Open Edges' + A straight line to close it. The solid loft then worked.
It looks like this:
Code: Select all
# This is in a loop, where the increasing sections are created
Open-edge = section.toShape() # This is my C-Shaped open edge
# Now I close it with a straight line, which is fine for me
section_inlet = Part.makeLine(section.value(0), section.value(section.LastParameter))
# I make it a Wire
section_full = Part.Wire([section.toShape(), section_inlet])
# Place my wire in space
section_full.rotate(FreeCAD.Vector(0,0,0), FreeCAD.Vector(0,0,1), psi)
# Create the list of Wires to loft
section_list.append(section_full)
# And there we go, that does the job
loft = Part.makeLoft(section_list,True)
Re: Loft has troubles
Okay, I made some experiment, it turns out I was lucky when it worked for my case ^^'.
I'm lost again with this tool.
1st picture : B-Spline that looks like a C
2nd picture : Same + a line
3rd picture : Same + 3 lines
I'm lost again with this tool.
1st picture : B-Spline that looks like a C
2nd picture : Same + a line
3rd picture : Same + 3 lines
- Attachments
-
- loft_is_love.png (454.97 KiB) Viewed 1091 times
Re: Loft has troubles
Lookid, thank you for confirming that you were lucky. That is what I had suspected, I've been luck fairly often too. I speculate that the problem has to do with the sections curving in a way that the smoothest or shortest curve between some section is achieved by a flip, so that is what the loft algorithm does. If that is the case, then the problem can probably be solved by increasing the number of sections so the space between them is not very large, maybe half the width of the section profile.
I'm hoping there is an easier solution, so if anyone can provide insight it would be much appreciated.
I'm hoping there is an easier solution, so if anyone can provide insight it would be much appreciated.
Re: Loft has troubles
Unfortunately, this also is not a solution. I tried with a ridiculous amount of Wires, and the result is the same.
FYI, I create my sections on the XY-Plane and they are then place with a rotation.
FYI, I create my sections on the XY-Plane and they are then place with a rotation.
- Attachments
-
- loft_i_cri_everitim.png (205 KiB) Viewed 1048 times
Re: Loft has troubles
Hi guys,
Just thought I'd share my experience with this. I come from a solidworks background and I'm still quite new to freeCAD.
In solidworks we can define the connection points when lofting between two profiles to avoid problems like this:
but i need FreeCAD for scripting purposes and I dont think theres any option for this?
I have noticed a few things when trying to recreate this same geometry in FreeCAD. Despite giving freecad the points list for each loft profile in the exact same anticlockwise order, or even cloning and scaling the same Bspline, I would never get a reliable result. However, when i went into each profile, and manually sketched the BSpline with the start and end points in the order i wanted them to connect, it worked!?
I had previously been defining the bspline in my script like this:
This would only work if i removed the last point in the points list like Lookid has done, but would give me this result:
If i dont use interpolate() and define the bspline like what is displayed in the console when using the GUI, I no longer need to remove any points (start point = end point) and get the result i want:
It still looks like some kind of interpolation is happening? I have no idea what those input arguments are without getting lost in the source code but it looks like the integer (1) in there, defines some kind of precision?
Maybe this will help some people with similar problems until someone with more knowledge of the source code could shed some light on this.
Ben
Just thought I'd share my experience with this. I come from a solidworks background and I'm still quite new to freeCAD.
In solidworks we can define the connection points when lofting between two profiles to avoid problems like this:
but i need FreeCAD for scripting purposes and I dont think theres any option for this?
I have noticed a few things when trying to recreate this same geometry in FreeCAD. Despite giving freecad the points list for each loft profile in the exact same anticlockwise order, or even cloning and scaling the same Bspline, I would never get a reliable result. However, when i went into each profile, and manually sketched the BSpline with the start and end points in the order i wanted them to connect, it worked!?
I had previously been defining the bspline in my script like this:
Code: Select all
curve = Part.BSplineCurve()
curve.interpolate(points,True)
If i dont use interpolate() and define the bspline like what is displayed in the console when using the GUI, I no longer need to remove any points (start point = end point) and get the result i want:
Code: Select all
Part.BSplineCurve(points,None,None,True,1,None,False)
Maybe this will help some people with similar problems until someone with more knowledge of the source code could shed some light on this.
Ben