Helix tool in PartDesign - feature proposal including Pull request

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!
Post Reply
davidosterberg
Posts: 482
Joined: Fri Sep 18, 2020 5:40 pm

Helix tool in PartDesign - feature proposal including Pull request

Post by davidosterberg »

Hi all,

I hope that you all have had a lovely Holiday so far!

I recently found myself looking for a helix tool in the PartDesign workbench to create some custom threads.
I could be wrong, but it seems like the standard way currently is to use the Helix feature in the Part WB, and import the result for further work in PartDesign. After trying it I found it a little tedius to switch to Part WB, and I also found that the model tree does not look so tidy afterwards.

I went looking in the forum and saw that others have requested a Helix tool in PD before (for example here: https://forum.freecadweb.org/viewtopic.php?f=8&t=32720).

The proposal
I have made a proposal implementation so that we can have something concrete to discuss.
https://github.com/FreeCAD/FreeCAD/pull/4209

I would love to discuss the details of it, how to extend it, and hopefully help integrating it into mainline FreeCAD when we are happy with it.
If you think it should not be part of FreeCAD it is also fine, I learned a lot implementing it.

The main idea is to have a simple way to sweep arbitrary sketch profiles along a helix in any direction. As I have implemented it, the workflow is similar to the revolution tool (and the groove tool).

To use it you start by making a sketch like below:
sketch.png
sketch.png (4.42 KiB) Viewed 1527 times
Next click the icon:
new_icons.png
new_icons.png (21.37 KiB) Viewed 1386 times
Next you select the axis of the helix (Options are the same as the revolve tool) and the other parameters:
add_dialog_and_result.png
add_dialog_and_result.png (62.95 KiB) Viewed 1529 times
Same workflow for the subtractive helix:
sketch_and_construction_line.png
sketch_and_construction_line.png (35.17 KiB) Viewed 1529 times
dialog_and_result.png
dialog_and_result.png (80.66 KiB) Viewed 1529 times
Your contributions with respect to how to improve the UI, better icons, cleaver features etc are very welcome and much of the point of this post.

What works
  • Additive helixes in any direction from a sketch profile
  • Subtractive helixes in any direction from a sketch profile
What doesn't work yet
  • Alternate input modes: pitch-turns and height-turns
Wont fix
  • Up to next face and similar features
Edits
2020-12-31: Updated with latest development status
2020-01-01: Updated with improved icons, thanks to @bitacovir
Last edited by davidosterberg on Fri Jan 01, 2021 12:08 pm, edited 5 times in total.
Bance
Posts: 2264
Joined: Wed Feb 11, 2015 3:00 pm
Location: London

Re: Helix tool in PartDesign - feature proposal including Pull request

Post by Bance »

Does it attach like ordinary sketches? I mean, there doesn't appear to be a path the sketch translates along, so is there a method of positioning the object?

Looks really good, by the way.
davidosterberg
Posts: 482
Joined: Fri Sep 18, 2020 5:40 pm

Re: Helix tool in PartDesign - feature proposal including Pull request

Post by davidosterberg »

Bance wrote: Mon Dec 28, 2020 4:53 pm Does it attach like ordinary sketches? I mean, there doesn't appear to be a path the sketch translates along, so is there a method of positioning the object?
It works just like the revolve tool. Only difference is that you specify a height and pitch instead of angle.

Edit: I.e, you can position the object by moving the profile in the sketch, by moving the sketch itself, or by using a construction line as the revolution axis.
The helix will fuse with any object that it intersects.
chrisb
Posts: 37745
Joined: Tue Mar 17, 2015 9:14 am

Re: Helix tool in PartDesign - feature proposal including Pull request

Post by chrisb »

It would be good to present the sweep options in the GUI as well, especially the Frenet option is used frequently. Multiple sections are probably not needed.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
davidosterberg
Posts: 482
Joined: Fri Sep 18, 2020 5:40 pm

Re: Helix tool in PartDesign - feature proposal including Pull request

Post by davidosterberg »

chrisb wrote: Mon Dec 28, 2020 8:22 pm It would be good to present the sweep options in the GUI as well, especially the Frenet option is used frequently. Multiple sections are probably not needed.
Thanks, currently Frenet mode is hard coded default for the helix. The Pipe tool uses another default, which I am sure is good for many cases, but when sweeping e.g a thread, frenet seems best at keeping the resulting shape consistent. I think frenet should be default for this tool, as I believe the user almost always will want a consistent helix. No harm in adding the other options though.
User avatar
watsug
Posts: 100
Joined: Sat Sep 26, 2020 10:51 pm

Re: Helix tool in PartDesign - feature proposal including Pull request

Post by watsug »

Look like an useful feature, well done!

UX thought: A helix could be defined by pitch and height or pitch and number of revolutions. This could be with another input field (nr of revolutions), that maybe is connected where eg height is driven (calculated) by pitch and number of revolutions. So when one is changed, the others are reflected (though could be hard as which parameter should be driving/driven?).

Or with three modes that can be selected (pitch-height, pitch-revolutions, revolutions-height). (probably less confusing)

In different use-cases the different modes could be better. Do you think it's worth to have these options in the interface, don't want to add "clutter".
davidosterberg
Posts: 482
Joined: Fri Sep 18, 2020 5:40 pm

Re: Helix tool in PartDesign - feature proposal including Pull request

Post by davidosterberg »

watsug wrote: Thu Dec 31, 2020 9:40 am Or with three modes that can be selected (pitch-height, pitch-revolutions, revolutions-height). (probably less confusing)
I think it is a good idea. Having pitch-revolution would allow us to to create a flat spiral. Something that the current UI does not allow.

Edit:
I have a doubt: Is "revolutions" or "turns" the easier to understand? Another alternative to turns could be angle, that could be useful in some circumstances.
user1234
Posts: 725
Joined: Mon Jul 11, 2016 5:08 pm

Re: Helix tool in PartDesign - feature proposal including Pull request

Post by user1234 »

Hello!

I tested the branch and this works really fine. I thought that i would be handier with only a helix line primitive in PartDesign (as skeleton) and do the rest with a Sketch and the Sweep tool. But i was wrong. As mentioned above a few setting like mode and other definitions are missing, but it works really great (and fast, much faster as the Sweep, also on a debug build). Good Job!

tested with:

Code: Select all

OS: Debian GNU/Linux bullseye/sid (X-Cinnamon/lightdm-xsession)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.Unknown (b78c1bbded066db4e6157083fe8b0909b02d7e43)
Build type: Debug
Python version: 3.9.1
Qt version: 5.15.2
Coin version: 4.0.0
OCC version: 7.5.0
Locale: English/United States (en_US)

Greetings
user1234
Attachments
test.FCStd
(298.75 KiB) Downloaded 18 times
01.png
01.png (628.4 KiB) Viewed 1502 times
User avatar
failedtocreatefillet
Posts: 1
Joined: Thu Dec 10, 2020 5:07 am

Re: Helix tool in PartDesign - feature proposal including Pull request

Post by failedtocreatefillet »

Really nice work. I'll try to compile it and test it out on my projects that use threads and knurls. Would it be possible to add an option for the number of starts, to allow creating multi-start threads and knurls without needing a polar pattern?
ickby
Posts: 3090
Joined: Wed Oct 05, 2011 7:36 am

Re: Helix tool in PartDesign - feature proposal including Pull request

Post by ickby »

That looks sweet! I like the idea of smaller tools for special purpose instead of huge tools with a million options.

One proposal: it seems to be a specialisation of the pipe tools, and also most likely not one of the most used ones. Maybe it makes sense to add it in drop-down menu with the pipe tools, the same way as primitives are handled? This gives a logical grouping and keeps the toolbars small.
Post Reply