Unusable Wire from Section

Need help, or want to share a macro? Post here!
frwi5432
Posts: 3
Joined: Wed Jun 10, 2015 5:20 am

Unusable Wire from Section

Postby frwi5432 » Wed Jul 08, 2015 6:33 pm

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 766 times
Attachments
Path0904.txt
Please rename the extension from .txt to .FCMacro
(8.17 KiB) Downloaded 16 times
Last edited by frwi5432 on Thu Jul 09, 2015 7:37 am, edited 1 time in total.
Regards,
Willy
ickby
Posts: 2462
Joined: Wed Oct 05, 2011 7:36 am

Re: Unusable Wire from Section

Postby ickby » Wed Jul 08, 2015 7:28 pm

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: 3
Joined: Wed Jun 10, 2015 5:20 am

Re: Unusable Wire from Section

Postby frwi5432 » Wed Jul 08, 2015 9:49 pm

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
Posts: 1864
Joined: Wed May 16, 2012 2:13 pm

Re: Unusable Wire from Section

Postby mario52 » Thu Jul 09, 2015 8:22 am

hi
if you want to create a special helical try Macro_FCSpring_Helix_Variable

Image
mario
Windows 10
Maybe you need a special feature, go into Macros_recipes and Code_snippets. My macros on Gist.github
ickby
Posts: 2462
Joined: Wed Oct 05, 2011 7:36 am

Re: Unusable Wire from Section

Postby ickby » Thu Jul 09, 2015 8:27 am

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
Posts: 679
Joined: Thu Jan 05, 2017 9:03 pm

Re: Unusable Wire from Section

Postby Kunda1 » Thu Jan 19, 2017 1:10 pm

Quick question: What is the verdict with issue #2187 then? Thanks!
User avatar
Kunda1
Posts: 679
Joined: Thu Jan 05, 2017 9:03 pm

Re: Unusable Wire from Section

Postby Kunda1 » Thu Jan 19, 2017 1:11 pm

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
User avatar
Chris_G
Posts: 385
Joined: Tue Dec 31, 2013 4:10 pm
Location: France

Re: Unusable Wire from Section

Postby Chris_G » Thu Jan 19, 2017 2:54 pm

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 ?
DeepSOIC
Posts: 4689
Joined: Fri Aug 29, 2014 12:45 am
Location: Saint-Petersburg, Russia

Re: Unusable Wire from Section

Postby DeepSOIC » Thu Jan 19, 2017 3:31 pm

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

Re: Unusable Wire from Section

Postby Kunda1 » Sat Jan 28, 2017 1:22 pm

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 ?