[Feature Request] Rectangle from 3 corners

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!
balrobs
Posts: 449
Joined: Fri Apr 24, 2020 8:58 pm

Re: [Feature Request] Rectangle from 3 corners

Post by balrobs »

paddle wrote: Fri Aug 12, 2022 6:59 pm Yes it was a deliberate choice. It looks better imo.
Thanks for the explanation.

While testing the "rectangle by 3 corners" tool I noticed another strange behaviour.
If you start typing the rectangle by fixing all variables ("x of the 1st corner", "y of the first corner", "length", "angle (to HAxis)", "width") except "angle to the first edge", then move the mouse to find a suitable value for this variable and block it by typing its value in the input field, you get a completely different geometry than previously suggested in the preview.
This is what you see in the preview with "angle to first edge"=135°:
pic01.PNG
pic01.PNG (23.55 KiB) Viewed 525 times
and this is what you get after typing in the value:
pic02.PNG
pic02.PNG (24.14 KiB) Viewed 525 times
The same happens for the "rectangle by center and two points" command.
User avatar
paddle
Veteran
Posts: 1392
Joined: Mon Feb 03, 2020 4:47 pm

Re: [Feature Request] Rectangle from 3 corners

Post by paddle »

Hmm the angle gets applied on the wrong side. I'm not sure how to specify which angle needs to be set I need to search a bit.
User avatar
Shalmeneser
Veteran
Posts: 9474
Joined: Wed Dec 23, 2020 12:04 am
Location: Fr

Re: [Feature Request] Rectangle from 3 corners

Post by Shalmeneser »

Jee-Bee
Veteran
Posts: 2566
Joined: Tue Jun 16, 2015 10:32 am
Location: Netherlands

Re: [Feature Request] Rectangle from 3 corners

Post by Jee-Bee »

paddle wrote: Sat Aug 13, 2022 12:46 pm Hmm the angle gets applied on the wrong side. I'm not sure how to specify which angle needs to be set I need to search a bit.
I like it that there are option to choose what angle you prefer
- Inner angle
- Outer angle up to 180 degrees
- Outer angle up to 360 degrees

nice for later ;)
User avatar
paddle
Veteran
Posts: 1392
Joined: Mon Feb 03, 2020 4:47 pm

Re: [Feature Request] Rectangle from 3 corners

Post by paddle »

Ok so there is a 'angle' constraint command that takes in parameters the pointPos of the lines and in this case it uses the correct angle automatically.
So now it's working properly. I pushed an additional commit fixing this problem.


For reference :

Code: Select all

Gui::cmdAppObjectArgs(handler->sketchgui->getObject(), "addConstraint(Sketcher.Constraint('Angle',%d,%d,%d,%d,%f)) ",
         firstCurve + 1, 1, firstCurve, 2, innerAngle);
Instead of

Code: Select all

Gui::cmdAppObjectArgs(handler->sketchgui->getObject(), "addConstraint(Sketcher.Constraint('Angle',%d,%d,%f)) ",
         firstCurve + 1, firstCurve, innerAngle);
Regarding allowing outer angles, it would add yet one more layer of complexity to the code and I'm not sure it's worth it.
Post Reply