Multi-Section Sweep messing up

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
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!
Post Reply
Spindoctor
Posts: 189
Joined: Fri Sep 25, 2015 6:19 pm

Multi-Section Sweep messing up

Post by Spindoctor »

Hi again :)

In order to solve my "nose" issue from yesterday and with the hint @chrisb gave me, I tried to sweep a thread along a helix path.

My idea is to utilize a subtractive multi-section sweep along a helix, so that the thread profile changes over the whole thread:
Bildschirmfoto vom 2022-08-13 22-40-47.png
Bildschirmfoto vom 2022-08-13 22-40-47.png (47.65 KiB) Viewed 763 times
The two left and the two right profiles are all the same. They are also "convex" so a "nose" like in the post from yesterday would be avoided.

The two profiles in the middle are also the same. However, they are not convex but would represent the thread profile that I would like to have over the major part of the object.

Although this should work fine in theory, in reality the multi-section sweep is completely messed up
Bildschirmfoto vom 2022-08-13 22-53-10.png
Bildschirmfoto vom 2022-08-13 22-53-10.png (110.28 KiB) Viewed 763 times
.

The sweep tool for some reason chooses not to follow the path in a regular way
Bildschirmfoto vom 2022-08-13 23-00-21.png
Bildschirmfoto vom 2022-08-13 23-00-21.png (93.7 KiB) Viewed 763 times
Please find my example file attached.

Am I doing something wrong?

(How) can this be repaired?

Thank you in advance!

Code: Select all

OS: Debian GNU/Linux bookworm/sid (GNOME/gnome)
Word size of FreeCAD: 64-bit
Version: 0.21.29393 (Git) AppImage
Build type: Release
Branch: master
Hash: 6820e0a9ec85203a6f342ca72a2ff8fd417beaf1
Python 3.10.5, Qt 5.12.9, Coin 4.0.0, Vtk 9.1.0, OCC 7.5.3
Locale: German/Austria (de_AT)
Installed mods: 
  * fasteners 0.3.46
  * 3D_Printing_Tools
  * POV-Ray-Rendering
  * 3DfindIT 1.2.0
  * Manipulator 1.4.9
  * Curves 0.5.1
Attachments
M24 Test.FCStd
(972.91 KiB) Downloaded 11 times
User avatar
onekk
Veteran
Posts: 6146
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: Multi-Section Sweep messing up

Post by onekk »

Probably the profile is not correctly placed on the helix, so it intersect itself when doing turns.

https://forum.freecadweb.org/viewtopic.php?f=22&t=65875

And maybe this thread to see how delicate is profile placement.

https://forum.freecadweb.org/viewtopic.php?f=22&t=65467

Sadly these are related to scripting, but the underlying problems and explanation are relative to the OCC engine, maybe it will help to point out the problem at least in a theoretical way.

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/
Spindoctor
Posts: 189
Joined: Fri Sep 25, 2015 6:19 pm

Re: Multi-Section Sweep messing up

Post by Spindoctor »

Thanks for looking at it!

So I made sure all the sketches are in the right place (they actually were already, still I did the positioning again). With a pitch of 3 mm and using the carbon copy tool this is not a very hard calculation ;)

Still, the thread does not work as intended and strangely also changes position in the x axis
Bildschirmfoto vom 2022-08-14 08-48-02.png
Bildschirmfoto vom 2022-08-14 08-48-02.png (7.02 KiB) Viewed 672 times
@onekk, can you find any misplaced sketches in my file?

Otherwise, can it be something different?
Attachments
M24 Test.FCStd
(918.4 KiB) Downloaded 8 times
User avatar
onekk
Veteran
Posts: 6146
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: Multi-Section Sweep messing up

Post by onekk »

No I haven't not searched due to my limited knowledge of FC GUI.

I'm modelling almost exclusively using scripting.

I hope you have seen examples in links I have posted, as when profiles are crossing when doing turns, problem will arise.

usually it is better to place the path to the inner part of profile so when you make turns inner path will revolve profile.

Another thing to see if the method used when revolving, I know the terms of the scripting part, but GUI may use different terms.

In one of the link you will see some consideration about different types of path. But I think that for standard cylinders there will be not many problems.

Now I'm on mobile so it is difficult to post reference.

Regards

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/
user1234
Veteran
Posts: 3345
Joined: Mon Jul 11, 2016 5:08 pm

Re: Multi-Section Sweep messing up

Post by user1234 »

Spindoctor wrote: Sat Aug 13, 2022 9:01 pm Am I doing something wrong?
Yes. two things:

First of all the (for me) most obvious one. The outer radius of the bolt and the short little cut plane are touching. When this happens, it often does not work. Reason: a helix is just a very good interpolation of an exact helix, so the radius is not absolutely perfect and therefore you can call it bistable or in a superposition (inside and outside of the cut in the same time). Since in CAD, every kernel calculates not in an algebraic way, but in a numerical way, the result can be unexpected. That is the first thing what happens here (also with the second issue). Besides that, that short flat line is unnecessary.

1.png
1.png (31.25 KiB) Viewed 580 times



If you have more then 3 sections, it interpolates inbetween the path in a spline way, not linear. So even when you have 3 Sections and the section no. 2 + 3 have the same shape, inbetween will be interpolated depended from the section no. 1. You can imagine it like a spline in the sketcher with three points, where point no. 1 is on x0, y0, no. 2 on x1, y1 and no. 3 on x2, y1. Even when the y value on no. 2 + 3 are on the height, in a spline the value inbetween is different. I hope you undstand what i mean. So because the "constant" shape between in the middle is not constant, even worse, through the interpolating, it gets selfintersecting.

2.png
2.png (43.53 KiB) Viewed 580 times


So i solved it in a very fast and dirty way:

- diameter of the bolt to 11.95mm (just for testing)
- made two cuts, the first with the transitions (sweep with Freenet = true! ; two shapes will be better, but just for testing), the second with the helix cut tool.

3.png
3.png (154.02 KiB) Viewed 580 times


Greetings
user1234
Spindoctor
Posts: 189
Joined: Fri Sep 25, 2015 6:19 pm

Re: Multi-Section Sweep messing up

Post by Spindoctor »

Thanks, @user1234!

I finally did it somehow similar. I divided the thread in five parts:
  1. The (constant) start part
  2. The transition from start to main profile
  3. The (constant) main part
  4. The transition from main to end (= start) profile
  5. The constant end (= start) part
I then cut the parts 1, 3 and 5 with the part design helix tool and only used the part helix sweep for parts 2 and 4.

This worked.

However, I still have to figure out problem #1 that you pointed out... it seems that I was able to "work around" that, but this might become a problem in the future.

Thank you once more.
Last edited by Spindoctor on Mon Aug 15, 2022 1:08 pm, edited 1 time in total.
user1234
Veteran
Posts: 3345
Joined: Mon Jul 11, 2016 5:08 pm

Re: Multi-Section Sweep messing up

Post by user1234 »

Spindoctor wrote: Mon Aug 15, 2022 12:54 pm However, I still have to figure out problem #1 that you pointed out... it seems that I was able to "work around" that, but this might become a problem in the future.
Never saw a CAD, even with an excellent kernel, which had no problem with that.

Greetings
user1234
User avatar
mfro
Posts: 664
Joined: Sat Sep 23, 2017 8:15 am

Re: Multi-Section Sweep messing up

Post by mfro »

Just out of curiosity, may I ask what's the purpose of this "special" thread?

Besides, I would assume it's difficult if not impossible to manufacture. Because of the undercut of the "spoon shaped" profile, you'd be forced to do the cut in one single infeed which will most likely damage the tool (if you don't cut in wax or something)?
Cheers,
Markus
Spindoctor
Posts: 189
Joined: Fri Sep 25, 2015 6:19 pm

Re: Multi-Section Sweep messing up

Post by Spindoctor »

... it might be because I mostly used the part design helix tool and I was just lucky with the few part helixes I used
User avatar
onekk
Veteran
Posts: 6146
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: Multi-Section Sweep messing up

Post by onekk »

Here some code, as a proof of concepts:
20220815-thread_profile.py
(3.53 KiB) Downloaded 10 times
There are some quirks, as I had to rencostruct the profile using sketch vertexes and make some approximations.

Final "bolt" should be cut to eliminate leftovers or profile should be modified to make a more clean cut, but the concept is correct, you could maybe create a "positive thread" and add it to the bolt "minor radius" cylinder, so as additive it will not present leftovers.

Probably I could put together some code, but not in short time.

I have done some rough calculations for the helix, but, in great approximation is simply a projection on the "bent face" of the cylinder,

Note that make_thread method could be tuned modifying some values:

Code: Select all

    c_s.setTransitionMode(1)
    c_s.setFrenetMode(True)
And it is not dissimilar from the Gui part, only some calculations could be done in an automatic way using scripting so it could be a valid alternative.

I know that is not a solution for your problem, but it could be "another arrow" to use in future.

Hope it helps.

Regards
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