How to think around midpoint snapping

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!
Post Reply
run_the_race
Posts: 161
Joined: Mon Feb 01, 2021 7:22 pm

How to think around midpoint snapping

Post by run_the_race »

There are many posts about snapping to the mid point of an item. The general answer you can do the same without them. So I am trying, but I think I need a little eye opening.

In the below *Sketcher* example, I wish to place the rectangle vertically and horizontally centered between the two circles.
midpoint snapping.png
midpoint snapping.png (11.62 KiB) Viewed 467 times
In solid edge 2D drafting I would draw a diagonal construction line on the rectangle, then snap the mid point of the diagonal to the mid point of a construction line between the two circles.

So now without midpoint snapping. I can create a symmetric constraint to center it vertically by selecting the line between the circles and the two points circle in green below:
midpoint sym.png
midpoint sym.png (13.19 KiB) Viewed 467 times
Now I cant think of a idiomatic way to center it horizontally. How would you center the rectangle horz/vert between the two circles?

Code: Select all

OS: Windows 10 Version 2004
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24276 (Git)
Build type: Release
Branch: releases/FreeCAD-0-19
Hash: a88db11e0a908f6e38f92bfc5187b13ebe470438
Python version: 3.8.6+
Qt version: 5.15.1
Coin version: 4.0.1
OCC version: 7.5.0
Locale: English/United Kingdom (en_GB)
drmacro
Veteran
Posts: 8984
Joined: Sun Mar 02, 2014 4:35 pm

Re: How to think around midpoint snapping

Post by drmacro »

add a point object to each construction line
add symmetry constraints to the point with the ends of its associated line
add point coincident between the point objects


just a guess...not at a pc ATM. 8-)
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: How to think around midpoint snapping

Post by jmaustpc »

one very simple option.
1) create a "point" roughly in the middle of the rectangle
2) select firstly two diagonally opposing end points of the rectangle, then select the point near the centre
3) click on symmetry constraint.
4) select each centre of the two circles and then the "point", then click symmetry constraint again

Jim

we posted much the same thing at the same time. :)
Syres
Veteran
Posts: 2900
Joined: Thu Aug 09, 2018 11:14 am

Re: How to think around midpoint snapping

Post by Syres »

A pciture is worth a thousand words but the thing to note is the use of two diagonal construction lines both parallel and equal (praise to @Celica_Supra aka Joko Engineering for bringing this to my attention in his Cylinder Head tutorial):
Rect_inBetween_Circles.jpg
Rect_inBetween_Circles.jpg (49.02 KiB) Viewed 452 times
OS: Windows 7 Version 6.1 (Build 7601: SP 1)
Word size of FreeCAD: 64-bit
Version: 0.20.24694 (Git)
Build type: Release
Branch: master
Hash: 111a21e45cd63e0d84b5c16e09ad599712ee11ae
Python version: 3.8.6+
Qt version: 5.15.1
Coin version: 4.0.1
OCC version: 7.5.0
Locale: English/United Kingdom (en_GB)
run_the_race
Posts: 161
Joined: Mon Feb 01, 2021 7:22 pm

Re: How to think around midpoint snapping

Post by run_the_race »

drmacro wrote: Tue Apr 20, 2021 11:43 am add a point object to each construction line
add symmetry constraints to the point with the ends of its associated line
add point coincident between the point objects

just a guess...not at a pc ATM. 8-)
Thanks for that suggestion. When I add the extra point on the construction line, and then try add the symmetry constraint to the 3 points, it gets messed up. How does it know which points need to be symmetrical around which other point, and along which axis? I guess you need a line for the symmertry axis, but that is what we are trying to create. Chicken egg scenario. :(
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: How to think around midpoint snapping

Post by jmaustpc »

here is a demo file
and a screen shot of the sketch in edit mode fully constrained.

Just note that with symmetry, selection order is important, you must select the geometry that is to be the centre of the symmetry last.
Screenshot_20210420_215647.png
Screenshot_20210420_215647.png (68.76 KiB) Viewed 449 times
Jim

OS: Ubuntu 20.04.2 LTS (KDE/plasma)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19. stable PPA
Build type: Release
Branch: unknown
Hash: 9e3b630bbfb6807e93eeffb655e6c20f218644fc
Python version: 3.8.5
Qt version: 5.12.8
Coin version: 4.0.0
OCC version: 7.5.1
Locale: English/Australia (en_AU)
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: How to think around midpoint snapping

Post by jmaustpc »

run_the_race wrote: Tue Apr 20, 2021 11:56 am
drmacro wrote: Tue Apr 20, 2021 11:43 am add a point object to each construction line
add symmetry constraints to the point with the ends of its associated line
add point coincident between the point objects

just a guess...not at a pc ATM. 8-)
Thanks for that suggestion. When I add the extra point on the construction line, and then try add the symmetry constraint to the 3 points, it gets messed up. How does it know which points need to be symmetrical around which other point, and along which axis? I guess you need a line for the symmertry axis, but that is what we are trying to create. Chicken egg scenario. :(
To be clear, you do not need the construction line at all.

the centre of the symmetry can be either a point or a line.

The "centre" of the symmetry is just whatever you selected last. The first two selections are the object to be symmetrical around the third selected item.

If you just hold your mouse point over the symmetry icon, the tool tip will tell you this.

Jim
run_the_race
Posts: 161
Joined: Mon Feb 01, 2021 7:22 pm

Re: How to think around midpoint snapping

Post by run_the_race »

jmaustpc wrote: Tue Apr 20, 2021 11:50 am one very simple option.
1) create a "point" roughly in the middle of the rectangle
2) select firstly two diagonally opposing end points of the rectangle, then select the point near the centre
3) click on symmetry constraint.
4) select each centre of the two circles and then the "point", then click symmetry constraint again

Jim

we posted much the same thing at the same time. :)
Brillant, that worked very well! Thank you! The key point here is the order in which one select points for symmetry. Might be useful to have prompts in the bottom bar ("select point, select other point, select symmetry axis or point")... I have seen that in other SW.
run_the_race
Posts: 161
Joined: Mon Feb 01, 2021 7:22 pm

Re: How to think around midpoint snapping

Post by run_the_race »

jmaustpc wrote: Tue Apr 20, 2021 12:05 pmIf you just hold your mouse point over the symmetry icon, the tool tip will tell you this.
Jim
Oh I see that is very nice to have that documented there, great!
drmacro
Veteran
Posts: 8984
Joined: Sun Mar 02, 2014 4:35 pm

Re: How to think around midpoint snapping

Post by drmacro »

I see @jmaustpc has got you going.

As noted the construction lines are superfluous in this instance. ;)
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
Post Reply