Sketcher : Scale geometries

Info about new community or project announcements, implemented features, classes, modules or APIs. Might get technical!
PLEASE DO NOT POST HELP REQUESTS OR OTHER DISCUSSIONS HERE!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
paddle
Veteran
Posts: 1413
Joined: Mon Feb 03, 2020 4:47 pm

Sketcher : Scale geometries

Post by paddle »

Hey guys,
Scale geometries tool in sketcher :
phpBB [video]


Let me know your thoughts.
User avatar
NewJoker
Veteran
Posts: 3082
Joined: Sun Oct 11, 2020 7:49 pm

Re: Sketcher : Scale geometries

Post by NewJoker »

paddle wrote: Thu Mar 03, 2022 12:19 pm Let me know your thoughts.
Like all your tools created so far, it looks great and for sure will be very useful.

Just a small improvement idea - would it be possible to make the Scale factor field show the current value when dragging the line ?
User avatar
paddle
Veteran
Posts: 1413
Joined: Mon Feb 03, 2020 4:47 pm

Re: Sketcher : Scale geometries

Post by paddle »

NewJoker wrote: Thu Mar 03, 2022 12:55 pm
paddle wrote: Thu Mar 03, 2022 12:19 pm Let me know your thoughts.
Like all your tools created so far, it looks great and for sure will be very useful.

Just a small improvement idea - would it be possible to make the Scale factor field show the current value when dragging the line ?
Yes, with Abdullah we are currently reworking toolSettings framework and in reworked version the spinbox values will update on mouse move to get an idea of the value we're currently at. So when it will merge in the future it will have that.
openBrain
Veteran
Posts: 9041
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Sketcher : Scale geometries

Post by openBrain »

I don't see any real life need for that. My sketches are well constrained so I can scale them changing one or 2 dimensions... :?
User avatar
adrianinsaval
Veteran
Posts: 5551
Joined: Thu Apr 05, 2018 5:15 pm

Re: Sketcher : Scale geometries

Post by adrianinsaval »

Does it work with bsplines? It can be useful with them IMO.
chrisb
Veteran
Posts: 54201
Joined: Tue Mar 17, 2015 9:14 am

Re: Sketcher : Scale geometries

Post by chrisb »

openBrain wrote: Thu Mar 03, 2022 4:34 pm I don't see any real life need for that. My sketches are well constrained so I can scale them changing one or 2 dimensions... :?
Scaling can be useful when starting a sketch with a more or less rough outline - Polyline plus M key comes to mind. When applying the first dimension it can happen that the whole sketch gets out of whack because the rough size is completely wrong.

In this case I would like to see the following: When the first distance or length dimension is applied, for determining the scale factor you use the ratio between the existing distance and the wanted distance and scale the whole sketch accordingly.

I may add that I almost never use the grid, and I know from many forum posts that other power users don't use it either.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
Shalmeneser
Veteran
Posts: 9560
Joined: Wed Dec 23, 2020 12:04 am
Location: Fr

Re: Sketcher : Scale geometries

Post by Shalmeneser »

chrisb wrote: Thu Mar 03, 2022 5:34 pm Scaling can be useful when starting a sketch with a more or less rough outline - Polyline plus M key comes to mind. When applying the first dimension it can happen that the whole sketch gets out of whack because the rough size is completely wrong.

In this case I would like to see the following: When the first distance or length dimension is applied, for determining the scale factor you use the ratio between the existing distance and the wanted distance and scale the whole sketch accordingly.
+100
.
I may add that I almost never use the grid, and I know from many forum posts that other power users don't use it either.
Grid is PITA.
TheMarkster
Veteran
Posts: 5513
Joined: Thu Apr 05, 2018 1:53 am

Re: Sketcher : Scale geometries

Post by TheMarkster »

Consider this model. I have cube and a sketch. The sketch has links to external geometry to the edges of one of the cube faces.
Snip macro screenshot-fb2c34.png
Snip macro screenshot-fb2c34.png (25.61 KiB) Viewed 5220 times
Snip macro screenshot-5d466f.png
Snip macro screenshot-5d466f.png (39.81 KiB) Viewed 5220 times
I made normal mode line segments and constrain them coincidentally to the vertices:
Snip macro screenshot-5ee93b.png
Snip macro screenshot-5ee93b.png (40.25 KiB) Viewed 5220 times
Could this be scaled to 1.05? or will the coincidence constraints to the external geometry prevent it from scaling? I think there could be value in this for creating clearance. If this can be scaled and if I want the new scaled elements to remain centered to the externally linked geometry which point should I used for reference? Or should I make a new point and constrain it to the center of the rectangle for use as the dragging reference?
Attachments
scale_test.FCStd
(4.93 KiB) Downloaded 64 times
shamanths13
Posts: 80
Joined: Mon Feb 21, 2022 3:02 pm

Re: Sketcher : Scale geometries

Post by shamanths13 »

TheMarkster wrote: Thu Mar 03, 2022 6:11 pm Consider this model. I have cube and a sketch. The sketch has links to external geometry to the edges of one of the cube faces.

Snip macro screenshot-fb2c34.png

Snip macro screenshot-5d466f.png

I made normal mode line segments and constrain them coincidentally to the vertices:

Snip macro screenshot-5ee93b.png

Could this be scaled to 1.05? or will the coincidence constraints to the external geometry prevent it from scaling? I think there could be value in this for creating clearance. If this can be scaled and if I want the new scaled elements to remain centered to the externally linked geometry which point should I used for reference? Or should I make a new point and constrain it to the center of the rectangle for use as the dragging reference?
I think the sketcher WB offset feature that our developer Paddle is working on is exactly what will be useful for the use case you gave as an example.
User avatar
fred-3d
Posts: 16
Joined: Sat Sep 26, 2020 5:09 am

Re: Sketcher : Scale geometries

Post by fred-3d »

Sketcher allows a constraint's value to be assigned a name for subsequent use in other constraints. I am curious how you will handle cases where one or more of the constraints in a sketch have ExpressionEngine values rather than simple numeric values?

For example, consider the case where you create a centered rectangle with these constraints:
  • a "Constrain Vertical Distance" set to value "50mm" and assigned name "width"
  • a "Constrain Horizontal Distance" set to value "Constraints.width + 5mm"
What happens (or should happen) if you try to scale this rectangle?

I am not sure there is one correct answer because different people may want different behaviors. Here are just a few options:
  • Some users may want the scale operation to fail (do nothing) and preserve the original ExressionEngine values.
  • Other users may want the scale operation to scale only constraints that have simple numeric values and leave any constraints with ExpressionEngine values unchanged.
  • Yet other users may want constraints with ExpressionEngine values to be scaled, but without replacing expressions with computed result values. For example, if you scale to 200%, the expression "Constraints.width + 5mm" might be rewritten as "200/100 * (Constraints.width + 5mm)", not the computed result value "110mm".
I prefer the last option. But, perhaps users should be able to specify how constraints with ExpressionEngine values should be handled in Sketcher preferences.

Thanks for your efforts to improve FreeCAD!
The first principle is that you must not fool yourself, and you are the easiest person to fool.
-Richard Feynman
Post Reply