Feature request : round corner rectangle
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Feature request : round corner rectangle
Under the rectangle tool, adding a 'round corner rectangle' tool.
First and second click as in rectangle tool.
Openning a message-box to prompt for radius and preview of the fillet following mouse.
Optionally a tick box "Same radius for all corners". .
If this box is ticked then third click or pressing enter set the radius of the 4 fillets to the same dimensions with an egal constraint.
If this box is unticked, then third click set the angle of one corner, then message boxe prompt for next corner.
What do you think? It's a small tool, but could be usefull to make design faster.
Optionally a 'chamfered corner rectangle' tool could be also nice. Maybe less frequently of use, but it would not take much work to do as it would mostly be copy paste of the previous one.
First and second click as in rectangle tool.
Openning a message-box to prompt for radius and preview of the fillet following mouse.
Optionally a tick box "Same radius for all corners". .
If this box is ticked then third click or pressing enter set the radius of the 4 fillets to the same dimensions with an egal constraint.
If this box is unticked, then third click set the angle of one corner, then message boxe prompt for next corner.
What do you think? It's a small tool, but could be usefull to make design faster.
Optionally a 'chamfered corner rectangle' tool could be also nice. Maybe less frequently of use, but it would not take much work to do as it would mostly be copy paste of the previous one.
Support me on Patreon: https://www.patreon.com/FreeCadDevDiary
FreeCad Dev Diary channel:[/b] https://www.youtube.com/channel/UCGMTmJ ... NiPSSEhBHA
FreeCad Dev Diary channel:[/b] https://www.youtube.com/channel/UCGMTmJ ... NiPSSEhBHA
Re: Feature request : round corner rectangle
Hello paddle,
I wrote a macro doing something similar to what you want.
The macro draws centered figures in sketcher: rectangle, square, rectangle with rounded corners, square with rounded corners, circle and hexagon.
Each figure can be drawn with or without constraints. If you coose "Add constraints" you can change the values of the constraints after drawing. The figures keep always centered.
How to use the macro:
1. Open a new sketch in SKETCHER or PART DESIGN
2. Start the macro
3. Select what you want to be drawn
4. Draw the figure by pressing "draw figure"
5. End the macro by pressing "close window" .
I wrote a macro doing something similar to what you want.
The macro draws centered figures in sketcher: rectangle, square, rectangle with rounded corners, square with rounded corners, circle and hexagon.
Each figure can be drawn with or without constraints. If you coose "Add constraints" you can change the values of the constraints after drawing. The figures keep always centered.
How to use the macro:
1. Open a new sketch in SKETCHER or PART DESIGN
2. Start the macro
3. Select what you want to be drawn
4. Draw the figure by pressing "draw figure"
5. End the macro by pressing "close window" .
Re: Feature request : round corner rectangle
Thank you, guy.edi wrote: ↑Tue Feb 11, 2020 5:25 pm Hello paddle,
I wrote a macro doing something similar to what you want.
The macro draws centered figures in sketcher: rectangle, square, rectangle with rounded corners, square with rounded corners, circle and hexagon.
Each figure can be drawn with or without constraints. If you coose "Add constraints" you can change the values of the constraints after drawing. The figures keep always centered.
How to use the macro:
1. Open a new sketch in SKETCHER or PART DESIGN
2. Start the macro
3. Select what you want to be drawn
4. Draw the figure by pressing "draw figure"
5. End the macro by pressing "close window"
CenteredFiguresInSketcher.FCMacro.
I just tried you macro script. It prompted error message in Report View.
Could you give it a look, please.Traceback (most recent call last):
File "MacroUser/CenteredFiguresInSketcher.FCMacro", line 251, in <module>
rechteckSkizze() # Programm ausführen
File "MacroUser/CenteredFiguresInSketcher.FCMacro", line 18, in __init__
self.dialogFenster() # meine HauptFunktion
File "MacroUser/CenteredFiguresInSketcher.FCMacro", line 87, in dialogFenster
self.wait() # erzeugt eine Fehlermeldung, aber ohne diese Zeile bleibt das Fenster nicht offen
<class 'AttributeError'>: 'rechteckSkizze' object has no attribute 'wait'
OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.20052 (Git)
Build type: Release
Branch: master
Hash: 6291921e9abe737e4440ff5814ca58547defadef
Python version: 3.8.2
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: Chinese/China (zh_CN)
Re: Feature request : round corner rectangle
Symmetry was quite often the cause of problems in the past. So I try to avoid them if possible. Here I need only one of them:
- Attachments
-
- Snip macro screenshot-592a88.png (8.03 KiB) Viewed 3999 times
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: Feature request : round corner rectangle
I definitely agree in having this feature. The round corners square is something I always use.
- adrianinsaval
- Veteran
- Posts: 5551
- Joined: Thu Apr 05, 2018 5:15 pm
Re: Feature request : round corner rectangle
Hi, this post made remember your macro so I tried it out today and I found it didn't work well when using stylesheets: So I added this line to it:
Code: Select all
self.setPalette(FreeCADGui.getMainWindow().palette())
And with that it looks fine: I attach the modified macro.
- Attachments
-
- CenteredFiguresInSketcher.FCMacro
- (17.05 KiB) Downloaded 92 times
Re: Feature request : round corner rectangle
Great!
This tool is worth being known be more people.
Re: Feature request : round corner rectangle
If at all you probably mean Sketch_Proifle.FCMacro or Sketcher_Profile.FCMacro. But for my taste that is far too global. Profiles are as far as I know used in lofts and sweeps, and can have arbitrary shapes. But using the prefix "Sketcher seems a good idea.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: Feature request : round corner rectangle
I just tested the macro and have the following remarks:
- The default should be AddConstraints checked.
- The constraints in the Rounded Rectangle should be revisited: The symmetry constraints consume only one DOF instead of two. That has lead in the past to troubles and if you generate them anyway you should avoid this. Using proper tangencies has turned out to work best if using such sketches in lofts and sweeps. I propose to constrain it like this, it means less constraints and less trouble: Similar holds for the rectangle, we recommend to use symmetry on the diagonal and you should do it in your macro as well.
- The default should be AddConstraints checked.
- The constraints in the Rounded Rectangle should be revisited: The symmetry constraints consume only one DOF instead of two. That has lead in the past to troubles and if you generate them anyway you should avoid this. Using proper tangencies has turned out to work best if using such sketches in lofts and sweeps. I propose to constrain it like this, it means less constraints and less trouble: Similar holds for the rectangle, we recommend to use symmetry on the diagonal and you should do it in your macro as well.
- Attachments
-
- centered.FCStd
- (5.45 KiB) Downloaded 86 times
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.