Best Practice: Centering ?

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
rich61
Posts: 6
Joined: Sat Jul 20, 2019 9:56 am

Best Practice: Centering ?

Postby rich61 » Sat Jul 20, 2019 3:21 pm

I made a mistake in the graphic, the left construction line did not quite reach the point on line constraint, so its wasn't quite centered.

In order to center the circle between the two vertical lines, I created a line from the circle center to the left line and one to the right. Then I set an equal constrain on my two construction ( blue ) lines.

Is this the best way to center my circle ?
Centering.jpg
Centering.jpg (6.85 KiB) Viewed 195 times
Last edited by rich61 on Sun Jul 21, 2019 2:22 pm, edited 1 time in total.
openBrain
Posts: 1589
Joined: Fri Nov 09, 2018 5:38 pm

Re: Best Practice: Centering ?

Postby openBrain » Sat Jul 20, 2019 3:57 pm

Without more, I'd rather do it using 2 Sketcher CreatePoint (not to be confused with coincident constraint) constrained with a point-on-line on the vertical lines, then add a symmetry between these 2 points and the circle center. ;)
center_circle.png
center_circle.png (2.77 KiB) Viewed 181 times
However, as much as you can, the best is probably to use the sketch axis by setting your circle center on the Y axis, and setting a symmetry between the 2 horizontal line endpoints against the Y axis (in that case, the horizontal constraint on the line is redundant and shall be removed) :
center_circle_Y.png
center_circle_Y.png (2.54 KiB) Viewed 181 times
freecad-heini-1
Posts: 5594
Joined: Tue Jan 07, 2014 11:10 am
Contact:

Re: Best Practice: Centering ?

Postby freecad-heini-1 » Sat Jul 20, 2019 4:08 pm

center_circle.gif
center_circle.gif (258.4 KiB) Viewed 175 times
TheMarkster
Posts: 984
Joined: Thu Apr 05, 2018 1:53 am

Re: Best Practice: Centering ?

Postby TheMarkster » Sat Jul 20, 2019 6:02 pm

If you want it centered not just between the 2 vertical lines, but also centered in the rectangle you could select (in this order) the upper left point, the lower right point, then the center of the circle and apply symmetry constraint. No extra points are lines need to be created for that.
chrisb
Posts: 16877
Joined: Tue Mar 17, 2015 9:14 am

Re: Best Practice: Centering ?

Postby chrisb » Sat Jul 20, 2019 9:07 pm

Plese note in freecad-heini-1's post how he avoids creating an automated point-on-line constraint, which would become redundant as soon as the symmetry is applied.
rich61
Posts: 6
Joined: Sat Jul 20, 2019 9:56 am

Re: Best Practice: Centering ?

Postby rich61 » Sun Jul 21, 2019 2:18 pm

Chrisb, I assume you mean creating the point initially off the line before application of symmetry. I didn't try alternatives, but maybe auto remove redundants would remove point-on-line anyway.

So, I do know several ways to center things now.

Seems like it might be possible someday to create a center function where one clicks on the point or element to be centered, then clicks on two elements within which to center. 3 clicks.

It could apply one of the strategies described, behind the scene, sort of like a constraint macro.
chrisb
Posts: 16877
Joined: Tue Mar 17, 2015 9:14 am

Re: Best Practice: Centering ?

Postby chrisb » Sun Jul 21, 2019 4:00 pm

rich61 wrote:
Sun Jul 21, 2019 2:18 pm
Chrisb, I assume you mean creating the point initially off the line before application of symmetry.
yes
I didn't try alternatives, but maybe auto remove redundants would remove point-on-line anyway.
yes.