Scaling objects

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
perot
Posts: 146
Joined: Wed Aug 30, 2017 5:40 pm

Scaling objects

Post by perot »

Hi,

I'm trying to scale some object. The obvious choice would be using the Draft:Scale command. Unexplicably, the Draft:Scale command only works by cloning the object, if the object is not a Draft object (docs say so and it indeed appears to be the case). If I do so, I have some zombie object laying around afterwards, as only the scaled object is needed.

How to I scale a say, Part workbench, object, without creating zombies?

Cheers Peter
User avatar
Shalmeneser
Veteran
Posts: 9591
Joined: Wed Dec 23, 2020 12:04 am
Location: Fr

Re: Scaling objects

Post by Shalmeneser »

chrisb
Veteran
Posts: 54302
Joined: Tue Mar 17, 2015 9:14 am

Re: Scaling objects

Post by chrisb »

perot wrote: Wed Jun 16, 2021 8:29 pm and it indeed appears to be the case).
How to I scale a say, Part workbench, object, without creating zombies?
That's how parametric design works, you always keep the predecessors. If you don’t want them, use a simple copy.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
perot
Posts: 146
Joined: Wed Aug 30, 2017 5:40 pm

Re: Scaling objects

Post by perot »

chrisb wrote: Wed Jun 16, 2021 8:38 pm
perot wrote: Wed Jun 16, 2021 8:29 pm and it indeed appears to be the case).
How to I scale a say, Part workbench, object, without creating zombies?
That's how parametric design works, you always keep the predecessors. If you don’t want them, use a simple copy.
I do not understand.

If I, say, chamfer an object, then the predecessor is kept as an invisible object in the modell tree under the Chamfer object node.

If I Draft:Scale an object I would therefore have expected to have kept the predecessor under some Scale object node. But it does not work this way. Instead I have to use the clone option, which means I get a Clone object beside, or next to, the predecessor, which from the point of view of the model tree only makes sense if a clone indeed is needed.

So that means that on the top level of the object tree I have an object lying aroung that serves no other purpose than being a predecessor. As such it should be located under the object it is the predecessor of. This is why I called it a zombie.

Cheers Peter
perot
Posts: 146
Joined: Wed Aug 30, 2017 5:40 pm

Re: Scaling objects

Post by perot »

Shalmeneser wrote: Wed Jun 16, 2021 8:34 pm Part_Offset ?
That is a very different operation. For one thing, it seems to be incapable of scaling down (making smaller) - this is what I need. For another, it works with fixed (absolute) offsets. A scaling operation would need "relative offsets", depending on the distance to some fixpoint.

Cheers Peter
chrisb
Veteran
Posts: 54302
Joined: Tue Mar 17, 2015 9:14 am

Re: Scaling objects

Post by chrisb »

perot wrote: Wed Jun 16, 2021 8:58 pm As such it should be located under the object it is the predecessor of.
The scale's source could indeed well be placed under the clone, but that doesn't make it a zombie. You get a zombie if you clone an object and then delete its source.

The different handling of clones and other operations such as fillets may be driven by frequent use cases: In both cases you can use the source object for further operations, but that is rather rare for the source of booleans, fillets etc. while it is quite normal to use a clone and its source for different purposes, e.g. in order to move the clone around.

Scaling is in parametric design a rather uncommon operation. The idea is to make the size change by changing the appropriate parameters.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
perot
Posts: 146
Joined: Wed Aug 30, 2017 5:40 pm

Re: Scaling objects

Post by perot »

chrisb wrote: Wed Jun 16, 2021 9:17 pm
perot wrote: Wed Jun 16, 2021 8:58 pm As such it should be located under the object it is the predecessor of.
The scale's source could indeed well be placed under the clone, but that doesn't make it a zombie. You get a zombie if you clone an object and then delete its source.
Is that the official definition of a zombie? If not, then here is mine: A zombie is something preventing a tidy model tree by laying around in the top level without any further usage, so that it has to be made invisible manually.

What you're describing is a broken data structure, something that should be prevented by FreeCAD. I consider it a bug that FreeCAD allows deletion of objects that other objects depend on.

Since I specifically asked (had to ask) for a clone during parametrising the scale operation, the behaviour of FreeCAD here is correct: I "wanted" a clone, therefore I got one (see paragraph under second citation below for discussing clones). What I'm critizising is that during parametrising the scale operation FreeCAD does not leave me a choice whether I want a clone or not.

In my opinion, it should be this way: The "clone" checkbox in the scale parameter menu should be discarded, and the scale command should work an any object where the semantics of scale make sense (right now, the only case to exclude that comes to my mind is points). A user can create a clone before the scale operation, if he needs one. You may detect a hint of the Unix philosophy in my words, of which I'm a big fan: "Do one thing at a time, and do it well". Doing cloning and scaling at the same time does not make sense to me, it make the UI less concise, complicates the code and thus creates opportunities for bugs. What's more, requiring special parametrisation and delivering a unintuitive outcome in a very common situation (solids, in case of the scale command) is quite something else than "do it well".

The different handling of clones and other operations such as fillets may be driven by frequent use cases: In both cases you can use the source object for further operations, but that is rather rare for the source of booleans, fillets etc. while it is quite normal to use a clone and its source for different purposes, e.g. in order to move the clone around.
The whole point of a clone is that you need a second object, and you want to use both for further operations. This makes specifically the clone a special operation in this respect (well, "link" as well I guess, even though I still haven't figured out the main use case for it), and every other operation should hide their source objects as nodes beneath the new object. After all, one of the purposes of a model tree is to visualise object dependencies (which is broken for clones, but that is due to, and justified by, their special semantics).

Scaling is in parametric design a rather uncommon operation. The idea is to make the size change by changing the appropriate parameters.
My particular use case right now is an object obtained from extruding an external SVG. There is no parameter, except for the extrude length, the latter being not what I want to scale. Is that so uncommon? I guess it'd happen every time a modeler has to put a 3D logo of some company onto their model. Of course the logo could be scaled to the required size outside of FreeCAD, but that's not just clumsy, it's also quite the opposite of parametric design.
mario52
Veteran
Posts: 4698
Joined: Wed May 16, 2012 2:13 pm

Re: Scaling objects

Post by mario52 »

hi

tray Macro_CloneConvert Image just for see if is good for you

mario
Maybe you need a special feature, go into Macros_recipes and Code_snippets, Topological_data_scripting.
My macros on Gist.github here complete macros Wiki and forum.
Post Reply