Ticket #2187 - Unusable Wire from Section

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
frwi5432
Posts: 6
Joined: Wed Jun 10, 2015 5:20 am

Ticket #2187 - Unusable Wire from Section

Post by frwi5432 »

Hello,
attached you can find a macro creating eventually two sweeps.
The sweep result with the standard helix is ok, but trying to use the special helix, created by a section, ends in an ugly structure.
What are the exact steps to get a correct wire (path) for the sweep out of a section?
Or is my approach to get the special helix and sweep completely wrong? I tried to follow the hints
on http://blogs.solidworks.com/solidworksb ... rings.html
Many thanks for your help.
Path0904.jpg
Path0904.jpg (146.17 KiB) Viewed 3859 times
Attachments
Path0904.txt
Please rename the extension from .txt to .FCMacro
(8.17 KiB) Downloaded 83 times
Last edited by frwi5432 on Thu Jul 09, 2015 7:37 am, edited 1 time in total.
Regards,
Willy
ickby
Veteran
Posts: 3116
Joined: Wed Oct 05, 2011 7:36 am

Re: Unusable Wire from Section

Post by ickby »

the solidworks guys have gone the easy way: with a circle as profile the profile orientation becomes irrelevant and always works. Your sweep does work with frenet=false flawless, so you could easily reproduce the solid works example. Of course with your triangle profile orientation becomes relevant.

Now I'm not totally sure what the problem with the path is, but the frenet formula seems to completely fail with it. I was able to get the desired result with a binormal profile orientation mode, however, this is not yet exposed to the freecad python api. It only exists in the experimental part design branch.
frwi5432
Posts: 6
Joined: Wed Jun 10, 2015 5:20 am

Re: Unusable Wire from Section

Post by frwi5432 »

ickby wrote:the solidworks guys have gone the easy way: with a circle as profile the profile orientation becomes irrelevant and always works. Your sweep does work with frenet=false flawless, so you could easily reproduce the solid works example. Of course with your triangle profile orientation becomes relevant.

Now I'm not totally sure what the problem with the path is, but the frenet formula seems to completely fail with it. I was able to get the desired result with a binormal profile orientation mode, however, this is not yet exposed to the freecad python api. It only exists in the experimental part design branch.
ickby,
that's correct with Frenet=False the sweep is ok.
My conclusion is, that the Sweep-Tool has a bug. Should I report it?
Unfortunately a circle as sketch and Frenet=False are no options for me.
Is there a way to verify if the path is valid? Or a way to recompute it to a valid wire?
What are now my possibilities? Is there another way to get the desired structure with the existing tools?
I just created the bug report http://www.freecadweb.org/tracker/view.php?id=2187
Regards,
Willy
mario52
Veteran
Posts: 4673
Joined: Wed May 16, 2012 2:13 pm

Re: Unusable Wire from Section

Post by mario52 »

hi
if you want to create a special helical try Macro_FCSpring_Helix_Variable

Image
mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
ickby
Veteran
Posts: 3116
Joined: Wed Oct 05, 2011 7:36 am

Re: Unusable Wire from Section

Post by ickby »

My conclusion is, that the Sweep-Tool has a bug. Should I report it?
That is not a valid conclusion. It is quite likely that the orientation is correctly calculated for the frenet orientation, and that the correct result is just not what you expect. Further analysis is needed to see why the result looks like it does.

Starting from the frenet-seret formulas https://en.wikipedia.org/wiki/Frenet%E2 ... t_formulas you could analyse your path by calculating the frame at a few positions where the direction changes happen for th eprofile. Maybe you get some insight why this change occurs and from there can find out what is wrong with the profile. (or maybe in your calculation the frenet-serret frame is always correct and the sweep tool has a bug)
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Unusable Wire from Section

Post by Kunda1 »

Quick question: What is the verdict with issue #2187 then? Thanks!
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
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Unusable Wire from Section

Post by Kunda1 »

ickby wrote:
My conclusion is, that the Sweep-Tool has a bug. Should I report it?
That is not a valid conclusion. It is quite likely that the orientation is correctly calculated for the frenet orientation, and that the correct result is just not what you expect. Further analysis is needed to see why the result looks like it does.
Sorry, forgot to quote ickby
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
User avatar
Chris_G
Veteran
Posts: 2579
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: Unusable Wire from Section

Post by Chris_G »

Hi,
The red spiral, in the above picture, is made of 4 BsplineCurves of degree 1 :
Edge 1, with 1026 poles
Edge 2, with 1026 poles
Edge 3, with 2463 poles
Edge 4, with 1003 poles
If I try to pick a normal somewhere on the first edge, I get :

Code: Select all

>>> elt.normalAt(600)
Traceback (most recent call last):
  File "<input>", line 1, in <module>
Part.OCCError: LProp_CLProps::Normal(...):Curvature is null or infinity
That should explain why Frenet mode is failing.
The solution is probably to discretize the faulty wire and recreate a clean BSplineCurve by interpoation or approximation.
But is it a FreeCAD bug ?
Maybe the Sweep tool should check the sweep path more strictly ?
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Unusable Wire from Section

Post by DeepSOIC »

This is why I created Macro Section some while ago.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Unusable Wire from Section

Post by Kunda1 »

Inquiring about the fate of issue #2187. Please weigh in. Is it a bug?
Chris_G wrote: The solution is probably to discretize the faulty wire and recreate a clean BSplineCurve by interpoation or approximation.
But is it a FreeCAD bug ?
Maybe the Sweep tool should check the sweep path more strictly ?
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
Post Reply