FreeCAD — параметрический 3d CAD-редактор с открытым исходным кодом (т. е. бесплатная программа).
FreeCAD активно развивается и, похоже, скоро сможет стать заменой профессиональным платным CAD-программам типа AutoCAD для подавляющего большинства случаев.

Scaling 3d object challenge

Александр » 15 ноя 2020, 00:07

The essence of the problem of scaling objects in FreeCAD up to 0.19 inclusive

Topological naming problem:
What can we scale:
Creating a simple model in Part:
About Draft Tool -> Scale:
FreeCAD Toolbar Customization:
Trying to work with Draft -> Scale:

Sometimes, when working in FreeCAD, you may want to scale an object composed of different bodies, with modifications applied to them.
And here you come across the fact that in the Part and PartDesign workbenches there is simply no such seemingly primary function.
The question arises: "Why?" In short, somewhere I saw an explanation in the English forum that in fact such a need to scale the entire object as a whole may arise, very rarely, and this is the lot of beginners in CAD.
In addition, FreeCAD is only a developing program, apparently, the implementation of the correct scaling of complex objects is not an easy task. After all, FreeCAD is a parametric CAD system, and in PartDesign, moreover, bodies are mainly formed from sketches with the subsequent application of so-called features (parametric modifications) to them.
In the discussions on the English forum that I studied, the developers make it clear that if you are serious about working, then editing the sketch and editing the parameterized operations applied further along the chain should be enough for you to scale the object.
And if you still have a desire to scale everything at once, then it is easier to use another software program that will stupidly take your imported file in some STEP format and resize everything in it at once, rather than force a constantly "thinking" that maintains a modification tree FreeCAD strain and calculate the interaction of all parameters.
(When such a need may arise?.. well, for example, you make a mold for casting something and the material shrinkage has not been calculated, or you are making a model for 3d printing). For example, in the case of 3D printing, if you are making an STL model, there is a scaling function in 3D printers.
If you want to scale not the whole model at once, but part of it, then the task is even more difficult. This is where the "Topological naming problem" comes into play ... ng_problem. An article in English, briefly about the fact that when individual elements are changed, subelements, such as faces, can be formed or deleted, and at the moment the problem inside FreeCAD (and many other CAD systems) of correct tracking of what became what after the operation has not been solved, that is, for example an internal permutation of the identifiers of vertices, edges, faces that is incomprehensible to the user may occur, and if, in turn, on the basis of some face another object was created, then it may unexpectedly move somewhere in an incomprehensible direction .. Probably better I will make a separate video on topic "Topological naming problem".
Upd See the comment below Topological naming problem in CADs.

So, scaling 3d objects directly in FreeCAD (I'll make a reservation, without any third-party plugins) is possible only if these objects are not parameterized. If the object is parameterized (and in most cases we work just with parameterized objects created in the Part, PartDesign workbenches), then at the moment there is no way to directly scale the parameterized objects! At most, you can create a scaled copy or clone of this object. The resulting clone or copy will be a single solid body without any components and their parameters. I think there is no need to explain the difference between a clone and a copy, just saying the clone after creation changes when the original object changes, and the copy does not depend on the original object. This body itself will have only a set of standard parameters (position, etc.). The clone will have one more specific parameter - the scale, which you can change in the object properties panel on the "Data" tab.
The Scale tool itself is initially available in the Draft workbench. But this does not mean that it only works with 2D-Draft objects.
This tool works with objects of type Part, and in freeCAD almost all objects, including 2D objects, inherit from the Part class:
FreeCAD classes scheme
FreeCAD classes scheme
it is therefore not surprising that this tool works with all types of objects.
The fact that the "Scale" button is initially available in the "Draft" workbench is a convention. If suddenly (I do not know in what cases such a need may arise), you often need to use the "Scale" tool, then you can slightly customize the toolbar and make the "Scale" tool appear in any workbench or even in all workbenches at once.
By the way, the online documentation for the Draft → Scale tool says so:
Modify original. The original object will have its size modified. This will only work with Draft objects and non-parametric Part shapes.
Create a copy. A scaled copy of the original object will be created. This will work for all object types, but only the copies of Draft objects will be parametric.
Note: a copy is a completely different object from the original shape; it will be created at the specified scale, and then will have its own set of properties. On the other hand, a Draft Clone is linked to the original shape and the only property that can be changed is the scale.

I wanna mention that in versions 0.18 & 0.19 the copying option with parameterized objects works poorly, cloning works.
Последний раз редактировалось Александр 15 ноя 2020, 01:01, всего редактировалось 2 раз(а).
Сообщения: 394
Зарегистрирован: 20 мар 2014, 17:05

Topological naming problem in CADs

Александр » 15 ноя 2020, 00:36

CAD models break sometimes..

In many CAD systems and in FreeCAD in particular, models sometimes break. That is, something moves somewhere, disappears, etc.
One of the reasons for this phenomenon is the “Topological naming problem”.
For now, I will briefly describe the essence of the problem of organizing topological data in FreeCAD

Inside FreeCAD, which is based on the Open CASCADE (OCCT) technology, information about graphic objects is built on the basis of primitives (vertices, edges, faces), respectively, this information must somehow be stored in some structured form. To do this, each primitive receives its own unique identifier (id), moreover, this id does not exist by itself, but is embedded in the graph describing the structure of the 3d model.
Naturally, this graph is built according to strict principles, its branches represent a hierarchy of objects with a lot of additional information.
For example, if there is a point, then it belongs to some edge that belongs to some face, which belongs to some object, which is part of some Body, which is a component of some Part. Plus, there are also bindings to coordinate systems, and the numbers of id-schnicks can be assigned to object primitives not just sequentially, but taking into account their orientation (for example, edge numbers can be assigned on one face not by contiguity, but by being on one axis). This is an approximate simplified description of the essence of topological names. Add to this that many sub-objects can have their own coordinate systems and transformations applied to them. Other objects can be attached to subjects, add here that some objects can be clones of others with all the following horror stories from this ..
In fact, the essence of the problem of topological naming is that, sadly enough to admit, a simplified approach to describing the topological model was initially chosen (here it is difficult for me to blame the FreeCAD developers, since there are similar problems in many CAD systems, about AutoCAD I'm not into course, although I heard that it is buggy sometimes).
Now it turns out that when changing individual elements of the model, formation or removal of sub-elements, such as faces, can occur, respectively, changes must be correctly made to the graph describing the model, and this is often associated with the need for a serious restructuring of the entire graph in order for it to remain correct , you will need to change the id-schnicks for a large chain of elements, again taking into account coordinate systems, transformations, clones and other things.
At the moment, FreeCAD developers are actively working to solve this problem, I don’t know how much effort it will take, but at least it’s obvious that there will be a big backward compatibility problem.
Сообщения: 394
Зарегистрирован: 20 мар 2014, 17:05

Вернуться в FreeCAD