[merged] PR #4835 New sketch object rounded rectangle

Post here if you have re-based and finalised code to integrate into master, which was discussed, agreed to and tested in other forums. You can also submit your PR directly on github.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: PR #4835 New sketch object rounded rectangle

Post by uwestoehr »

uwestoehr wrote: Sat Jun 19, 2021 6:17 pm Very good. I will start doing this hopefully tomorrow.
I did the work. I use the horizontal/vertical constraints and grouped the feature under rectangle.
I could also fix the DrawSketchHandlerOblong issue - now the preview looks exactly as the final object.

So from my point of view ready to be merged.

While you are at merging, can you please also merge the PR's 4836 - 4839?
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: PR #4835 New sketch object rounded rectangle

Post by abdullah »

uwestoehr wrote: Sun Jun 20, 2021 2:09 am I did the work. I use the horizontal/vertical constraints and grouped the feature under rectangle.
I could also fix the DrawSketchHandlerOblong issue - now the preview looks exactly as the final object.

So from my point of view ready to be merged.
Thank you. It is merged now.

The new tool to remove alignment to axes is also merged (I have included an icon by merging two preexisting icons to have a temporary icon while the real experts are at work). This icon is next to the rectangular array.
uwestoehr wrote: Sun Jun 20, 2021 2:09 am While you are at merging, can you please also merge the PR's 4836 - 4839?
Yes, I have merged all icons. I have not checked one by one.

Now this other PR is conflicted. I would appreciate if you could take a look (sorry I am being so lazy, I am tightly time constraint):
https://github.com/FreeCAD/FreeCAD/pull/4843
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: PR #4835 New sketch object rounded rectangle

Post by abdullah »

I coded some extra goodie:
CenteredRectangle.gif
CenteredRectangle.gif (92.15 KiB) Viewed 5138 times
Now I fear someone is going to ask for a centered rounded rectangle... :lol:
chrisb
Veteran
Posts: 54201
Joined: Tue Mar 17, 2015 9:14 am

Re: PR #4835 New sketch object rounded rectangle

Post by chrisb »

abdullah wrote: Sun Jun 20, 2021 6:27 am I coded some extra goodie:
+1
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Syres
Veteran
Posts: 2899
Joined: Thu Aug 09, 2018 11:14 am

Re: PR #4835 New sketch object rounded rectangle

Post by Syres »

Unfortunately the new centred rectangle shows up fine in the toolbar but is missing from the menu causing the following in the report view:

Code: Select all

Unknown command 'Sketcher_CreateRectangle_Center'


Also, not specifically related but shouldn't line 1190 in src\Mod\Sketcher\Gui\CommandCreateGeo.cpp be changed from:

Code: Select all

    rectangle3->setStatusTip(rectangle2->toolTip());
to:

Code: Select all

    rectangle3->setStatusTip(rectangle3->toolTip());

OS: Linux Mint 19.3 (X-Cinnamon/cinnamon)
Word size of FreeCAD: 64-bit
Version: 0.20.25135 (Git)
Build type: Release
Branch: master
Hash: b7f8f249b26682772a624c2962d0fa88a8047cc2
Python version: 3.6.9
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedKingdom (en_GB)
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: PR #4835 New sketch object rounded rectangle

Post by uwestoehr »

abdullah wrote: Sun Jun 20, 2021 4:51 am The new tool to remove alignment to axes is also merged (I have included an icon by merging two preexisting icons to have a temporary icon while the real experts are at work).
Many thanks!
However, note that we had in the past issues with SVGs that third-party programs like browsers could not show then correctly because they contained Inkscape-specific code. Since we use the icons also for the Wiki, please save them in Inkscape as "plain SVG".
I did this in https://github.com/FreeCAD/FreeCAD/pull/4873

(When you merge this, can you please also merge https://github.com/FreeCAD/FreeCAD/pull/4866 since this is exactly the same thing.)

As Syres reported, there is not yet a menu entry for centered rectangles. This, and also some other issues are fixed by this PR: https://github.com/FreeCAD/FreeCAD/pull/4874

Concerning the new feature to make rectangles rotateable, I have a remark: So save time, I would like to set the rotateable feature before I create the rectangles. Because as it is, I first have to create the rectangles, then to select it completely first then I can make it rotateable.
So can the new icon be a toggle icon. When it is toggled, new rectangles would already be created being rotateable.
edi
Posts: 482
Joined: Fri Jan 17, 2020 1:32 pm

Re: PR #4835 New sketch object rounded rectangle

Post by edi »

abdullah wrote: Sun Jun 20, 2021 6:27 am I coded some extra goodie:
....
Now I fear someone is going to ask for a centered rounded rectangle... :lol:
Thank you very much for that extra goodie. It is exactly what I recommend in
edi wrote: Mon Jun 14, 2021 5:38 am IMO desirable features are a centered rectangle and a centered rounded corner rectangle.
See there attached preversion of a Python script.
To expand the centered rectangle to a centered rounded corner rechtangle (in Python) only four calls of "makeFillet" have to be added. I think in C++ it will be similar.
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: PR #4835 New sketch object rounded rectangle

Post by uwestoehr »

abdullah wrote: Sun Jun 20, 2021 4:51 am Now this other PR is conflicted. I would appreciate if you could take a look
https://github.com/FreeCAD/FreeCAD/pull/4843
I rebased this PR onto master and resolved the merge conflicts. So it it should be ready to be merged.
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: PR #4835 New sketch object rounded rectangle

Post by abdullah »

Syres wrote: Sun Jun 20, 2021 9:04 am Unfortunately the new centred rectangle shows up fine in the toolbar but is missing from the menu causing the following in the report view:
Thank you very much for taking the time to track these down (and to uwestoehr for the PR). :D :D :D
abdullah
Veteran
Posts: 4935
Joined: Sun May 04, 2014 3:16 pm
Contact:

Re: PR #4835 New sketch object rounded rectangle

Post by abdullah »

uwestoehr wrote: Sun Jun 20, 2021 1:16 pm
abdullah wrote: Sun Jun 20, 2021 4:51 am The new tool to remove alignment to axes is also merged (I have included an icon by merging two preexisting icons to have a temporary icon while the real experts are at work).
Many thanks!
However, note that we had in the past issues with SVGs that third-party programs like browsers could not show then correctly because they contained Inkscape-specific code. Since we use the icons also for the Wiki, please save them in Inkscape as "plain SVG".
I did this in https://github.com/FreeCAD/FreeCAD/pull/4873

(When you merge this, can you please also merge https://github.com/FreeCAD/FreeCAD/pull/4866 since this is exactly the same thing.)

As Syres reported, there is not yet a menu entry for centered rectangles. This, and also some other issues are fixed by this PR: https://github.com/FreeCAD/FreeCAD/pull/4874
Thanks for providing these PRs. All are merged now. I did not know about the plain SVG thing.
uwestoehr wrote: Sun Jun 20, 2021 1:16 pm Concerning the new feature to make rectangles rotateable, I have a remark: So save time, I would like to set the rotateable feature before I create the rectangles. Because as it is, I first have to create the rectangles, then to select it completely first then I can make it rotateable.
So can the new icon be a toggle icon. When it is toggled, new rectangles would already be created being rotateable.
So you mean the new icon in the sketcher toolbar be made into a pseudo-toggle (similar to the construction geometry button or the reference constraints button). So when clicked without a selection, it functions as toggle, setting a status for the creation of the complex geometries that support this function. When clicked with selection, it just works as now. Is this what you mean?

It is unlikely I will be able to code within the next couple of weeks. But I can take a look later on (or if you want to do it yourself I will look into the PR when I have some time).
Post Reply