[Feature Request] Curved slot tool in the Sketcher

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!
User avatar
NewJoker
Veteran
Posts: 3016
Joined: Sun Oct 11, 2020 7:49 pm

[Feature Request] Curved slot tool in the Sketcher

Post by NewJoker »

Hi,

curved slots are quite common in machine design and yet FreeCAD has a tool only for straight ones. Two years ago a user shared his macro for curved slots but it was abandoned: https://forum.freecadweb.org/viewtopic.php?t=43630

I think that it would be great to have a tool for curved slots implemented in FreeCAD. Drawing them manually is really tedious: https://youtu.be/hFnM78IVjkE?t=3717

curved slot.png
curved slot.png (21.22 KiB) Viewed 1100 times

What are your thoughts about this ? Such a tool could operate similarly to arc drawing tools - a user would be able to draw it based on 3 point arc or arc from center.
drmacro
Veteran
Posts: 8865
Joined: Sun Mar 02, 2014 4:35 pm

Re: [Feature Request] Curved slot tool in the Sketcher

Post by drmacro »

You can have a look at ArcSlot here: https://github.com/macdroid53/FreeCADScripts

I even include an icon so you can add it your toolbar in Sketcher. ;)

User extensible software is the bees knees. :mrgreen:
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
User avatar
NewJoker
Veteran
Posts: 3016
Joined: Sun Oct 11, 2020 7:49 pm

Re: [Feature Request] Curved slot tool in the Sketcher

Post by NewJoker »

@drmacro Thanks, I haven't seen it. I would still prefer a built-in tool since curved slots are very common but a macro is fine for a start.

A rounded rectangle tool was implemented in 0.20 so maybe you could extract the script for curved slots from that repository and add it to Addon Manager ?
User avatar
onekk
Veteran
Posts: 6144
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: [Feature Request] Curved slot tool in the Sketcher

Post by onekk »

NewJoker wrote: Fri Sep 30, 2022 10:22 am curved slots are quite common in machine design and yet FreeCAD has a tool only for straight ones.
...

I've seen something similar discussed and probably implemented in Path WB.

You could make a "Feature Python Object" with:

Slot Center (center of the slot, ie)
Slot Center of curvature (with "Slot Center" it will define "circle radius" of the center line)
Slot angle (it will define "portion of circle you have to obtain")
Slot width

Something similar to this script:
20220930-slot.py
(3.12 KiB) Downloaded 28 times
20220930-slot_img1.png
20220930-slot_img1.png (4.75 KiB) Viewed 1066 times

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/
User avatar
paddle
Veteran
Posts: 1391
Joined: Mon Feb 03, 2020 4:47 pm

Re: [Feature Request] Curved slot tool in the Sketcher

Post by paddle »

NewJoker wrote: Fri Sep 30, 2022 10:22 am curved slots are quite common in machine design and yet FreeCAD has a tool only for straight ones.
+1

I already made this tool in c++: https://youtu.be/OBmrKX8_K1Q?t=302
It's still pending review and should come after tool setting merge.
User avatar
NewJoker
Veteran
Posts: 3016
Joined: Sun Oct 11, 2020 7:49 pm

Re: [Feature Request] Curved slot tool in the Sketcher

Post by NewJoker »

paddle wrote: Sat Oct 01, 2022 12:20 pm I already made this tool in c++: https://youtu.be/OBmrKX8_K1Q?t=302
It's still pending review and should come after tool setting merge.
Great, thanks for letting me know :-)
wieszak17
Posts: 250
Joined: Fri Jan 10, 2014 7:59 pm

Re: [Feature Request] Curved slot tool in the Sketcher

Post by wieszak17 »

Generally +1, but... I think all such tools (rectangle, centered rectangle, rounded rectangle, create regular polygon and slot(s)) should be dropped from FC code and replaced by one universal tool "Insert predefined sketch fragment" plus library (user editable) of definitions for such things. So when next person wants another common element one could just add definition to file (for eg. by creating simple sketch and importing it as that element).
User avatar
NewJoker
Veteran
Posts: 3016
Joined: Sun Oct 11, 2020 7:49 pm

Re: [Feature Request] Curved slot tool in the Sketcher

Post by NewJoker »

wieszak17 wrote: Sat Oct 01, 2022 12:47 pm Generally +1, but... I think all such tools (rectangle, centered rectangle, rounded rectangle, create regular polygon and slot(s)) should be dropped from FC code and replaced by one universal tool "Insert predefined sketch fragment" plus library (user editable) of definitions for such things. So when next person wants another common element one could just add definition to file (for eg. by creating simple sketch and importing it as that element).
This could make sense for really uncommon shapes (some fancy polygons, for instance - people ask for them from time to time) but for such important geometries like rectangles and slots, I would definitely stay with the current approach, used in all CAD programs.

Paddle’s approach is the way to go in my opinion. He groups tools and thus reduces the number of toolbar buttons by turning additional variants of sketcher geometries into options for more general tools. So for example there will be one rectangle tool and options to draw it from the center or with rounded corners and so on.
wieszak17
Posts: 250
Joined: Fri Jan 10, 2014 7:59 pm

Re: [Feature Request] Curved slot tool in the Sketcher

Post by wieszak17 »

Well, they are still same thing. Such universal tool should have some grouping ability anyway to be user friendly, so just some shapes could be marked 'core' and maybe cannot be deleted from library. One could place on toolbar buttons with specific shape or with group of shapes, and by default core groups are added. This way you have one code to implement all this shapes.
User avatar
onekk
Veteran
Posts: 6144
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: [Feature Request] Curved slot tool in the Sketcher

Post by onekk »

If the tool is generalized it will suffice to add a custom menu item that will load an external sketch, (maybe in the document itself), probably if the reference point is in a predictable place like the sketch origin (it is easy to code a polygon around his center).

Only a suggestion.

Regards

Carlo D.
Last edited by onekk on Wed Aug 09, 2023 8:04 am, edited 1 time in total.
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