Topological naming problem: Difference between revisions

From FreeCAD Documentation
(Naming project)
mNo edit summary
 
(32 intermediate revisions by 11 users not shown)
Line 2: Line 2:
<translate>
<translate>
== Introduction == <!--T:1-->
== Introduction == <!--T:1-->

</translate>
{{TOCright}}
<translate>


<!--T:2-->
<!--T:2-->
The [[topological naming problem|topological naming problem]] in FreeCAD refers to the issue of a shape changing its internal name after a modelling operation (pad, cut, union, chamfer, fillet, etc.) is performed. This will result in other parametric features that depend on that shape to break or be incorrectly computed. This issue affects all objects in FreeCAD but is especially notable when building solids with the [[PartDesign Workbench|PartDesign Workbench]], and when dimensioning those solids with the [[TechDraw Workbench|TechDraw Workbench]].
The [[topological naming problem|topological naming problem]] in FreeCAD refers to the issue of a shape changing its internal name after a modelling operation (pad, cut, union, chamfer, fillet, etc.) is performed. This will result in other parametric features that depend on that shape to break or be incorrectly computed. This issue affects all objects in FreeCAD but is especially notable when building solids with the [[Image:Workbench_PartDesign.svg|24px]] [[PartDesign Workbench|PartDesign Workbench]], and when dimensioning those solids with the [[Image:Workbench_TechDraw.svg|24px]] [[TechDraw Workbench|TechDraw Workbench]].
* In PartDesign, if a feature is supported on a face (or edge or vertex), the feature may break if the underlying solid changes size or orientation, as the original face (or edge or vertex) may be internally renamed.
* In [[Image:Workbench_PartDesign.svg|24px]] [[PartDesign Workbench|PartDesign]], if a feature is supported on a face (or edge or vertex), the feature may break if the underlying solid changes size or orientation, as the original face (or edge or vertex) may be internally renamed.
* In TechDraw, if a dimension is measuring the length of a projected edge, the dimension may break if the 3D model is changed, as the vertices may be renamed thus changing the measured edge.
* In [[Image:Workbench_TechDraw.svg|24px]] [[TechDraw Workbench|TechDraw]], if a dimension is measuring the length of a projected edge, the dimension may break if the 3D model is changed, as the vertices may be renamed thus changing the measured edge.


<!--T:3-->
<!--T:3-->
The topological naming issue is a complex problem in CAD modelling that stems from the way the internal FreeCAD routines handle updates of the geometrical shapes created with the OCCT kernel. As of FreeCAD 0.18 there are ongoing efforts to improve the core handling of shapes in order to reduce or eliminate such issues.
The topological naming issue is a complex problem in CAD modelling that stems from the way the internal FreeCAD routines handle updates of the geometrical shapes created with the [[OpenCASCADE|OCCT kernel]]. As of FreeCAD 0.19 there are ongoing efforts to improve the core handling of shapes in order to reduce or eliminate such issues.
* Forum thread: [https://forum.freecadweb.org/viewtopic.php?t=27278 Topological Naming, My Take]


<!--T:4-->
<!--T:4-->
Line 17: Line 22:


<!--T:6-->
<!--T:6-->
1. In the [[PartDesign Workbench|PartDesign Workbench]], create a [[PartDesign Body|PartDesign Body]], then use [[PartDesign NewSketch|PartDesign NewSketch]] and select the XY plane to draw the base sketch; then perform a [[PartDesign Pad|PartDesign Pad]] to create a first solid.
1. In the [[Image:Workbench_PartDesign.svg|24px]] [[PartDesign Workbench|PartDesign Workbench]], create a [[Image:PartDesign_Body.svg|24px]] [[PartDesign Body|PartDesign Body]], then use [[Image:PartDesign_NewSketch.svg|24px]] [[PartDesign NewSketch|PartDesign NewSketch]] and select the XY plane to draw the base sketch; then perform a [[Image:PartDesign_Pad.svg|24px]] [[PartDesign Pad|PartDesign Pad]] to create a first solid.


</translate>
</translate>
Line 24: Line 29:


<!--T:7-->
<!--T:7-->
2. Select the top face of the previous solid, and then use [[PartDesign NewSketch|PartDesign NewSketch]] to draw another sketch; then perform a second pad.
2. Select the top face of the previous solid, and then use [[Image:PartDesign_NewSketch.svg|24px]] [[PartDesign NewSketch|PartDesign NewSketch]] to draw another sketch; then perform a second pad.


</translate>
</translate>
Line 51: Line 56:


<!--T:10-->
<!--T:10-->
5. Now, double click the second sketch again, and adjust its points so that a portion of it is outside the limits defined by the first pad. By doing this, the second pad will recompute correctly, however, when looking at the tree view, an error will be indicated in the third pad.
5. Now, double click the second sketch again, and adjust its points so that a portion of it is outside the limits defined by the first pad. By doing this, the second pad will recompute correctly, however, when looking at the [[tree view]], an error will be indicated in the third pad.


</translate>
</translate>
Line 59: Line 64:
<translate>
<translate>


</translate>
<!--T:11-->
[[Image:FreeCAD_topological_problem_12_broken_tree.png]]
[[Image:FreeCAD_topological_problem_12_broken_tree.png]]
<translate>


<!--T:12-->
<!--T:12-->
6. By making visible the third sketch and pad, it is clear that the computation of the new solid did not proceed correctly. The third sketch, instead of being supported by the top face of the second pad, appears in a strange place, with its normal oriented towards the X direction. This results in an invalid pad, as this pad would be disconnected from the rest of the [[PartDesign Body|PartDesign Body]], which is not allowed.
6. By making visible the third sketch and pad, it is clear that the computation of the new solid did not proceed correctly. The third sketch, instead of being supported by the top face of the second pad, appears in a strange place, with its normal oriented towards the X direction. This results in an invalid pad, as this pad would be disconnected from the rest of the [[Image:PartDesign_Body.svg|24px]] [[PartDesign Body|PartDesign Body]], which is not allowed.


<!--T:13-->
<!--T:13-->
Line 77: Line 83:
7. To fix the issue, the third sketch should be mapped to the top face again. Select the sketch, click on the ellipsis (three dots) next to the {{PropertyData|Map Mode}} property, and choose the top face of the second pad again. Then the sketch moves to the top of the existing solid, and the third pad is generated without issues.
7. To fix the issue, the third sketch should be mapped to the top face again. Select the sketch, click on the ellipsis (three dots) next to the {{PropertyData|Map Mode}} property, and choose the top face of the second pad again. Then the sketch moves to the top of the existing solid, and the third pad is generated without issues.


</translate>
<!--T:15-->
[[Image:FreeCAD_topological_problem_13_remap_sketch_2.png]]
[[Image:FreeCAD_topological_problem_13_remap_sketch_2.png]]
<translate>


</translate>
</translate>
Line 90: Line 97:


== Solution == <!--T:17-->
== Solution == <!--T:17-->

</translate>
[[Image:FreeCAD_topological_problem_16_dependency_graph.png|left]]
<translate>


<!--T:18-->
<!--T:18-->
The [[Dependency Graph|dependency graph]] is a tool that is helpful to observe the relationships between the different bodies in the document. Using the original modelling workflow reveals the direct relationship that exists between the sketches and the pads. Like a chain, it is easy to see that this direct dependence will be subject to topological naming problems if any of the links in the sequence changes.
The [[Std_DependencyGraph|dependency graph]] is a tool that is helpful to observe the relationships between the different bodies in the document. Using the original modelling workflow reveals the direct relationship that exists between the sketches and the pads. Like a chain, it is easy to see that this direct dependence will be subject to topological naming problems if any of the links in the sequence changes.

<!--T:19-->
[[Image:FreeCAD_topological_problem_16_dependency_graph.png]]


<!--T:20-->
<!--T:20-->
As explained in the [[feature editing|feature editing]] page, a solution to this problem is to support sketches not on faces but on datum planes which are offset from the main planes of the [[PartDesign Body|PartDesign Body's]] Origin.
As explained on the [[Feature_editing|feature editing]] page, a solution to this problem is to support sketches not on faces but on datum planes which are attached to, and offset from, the main planes of the [[PartDesign_Body|PartDesign Body's]] Origin.


<!--T:21-->
<!--T:21-->
Line 107: Line 115:


</translate>
</translate>
{{clear}}
{|
{|
| [[Image:FreeCAD_topological_problem_17_datum_plane_1.png|x400px]] || [[Image:FreeCAD_topological_problem_18_datum_plane_2.png|x400px]]
| [[Image:FreeCAD_topological_problem_17_datum_plane_1.png|x400px]] || [[Image:FreeCAD_topological_problem_18_datum_plane_2.png|x400px]]
Line 121: Line 130:
5. The dependency graph now shows that the sketches and pads are supported by the datum planes. This model is more stable as each sketch can be modified essentially independently from each other.
5. The dependency graph now shows that the sketches and pads are supported by the datum planes. This model is more stable as each sketch can be modified essentially independently from each other.


</translate>
<!--T:26-->
[[Image:FreeCAD_topological_problem_19_dependency_graph_datum_planes.png]]
[[Image:FreeCAD_topological_problem_19_dependency_graph_datum_planes.png]]
<translate>


<!--T:27-->
<!--T:27-->
Line 152: Line 162:
Datum objects, [[PartDesign Point|points]], [[PartDesign Line|lines]], [[PartDesign Plane|planes]], and [[PartDesign CoordinateSystem|coordinate systems]], may also be useful as reference geometry, that is, as visual aids to show the important features in the model, even if no sketch is directly attached to them.
Datum objects, [[PartDesign Point|points]], [[PartDesign Line|lines]], [[PartDesign Plane|planes]], and [[PartDesign CoordinateSystem|coordinate systems]], may also be useful as reference geometry, that is, as visual aids to show the important features in the model, even if no sketch is directly attached to them.


== Links ==
== Links == <!--T:38-->


<!--T:39-->
[[Naming_project|Naming project]]: Effort to implement a robust topological naming in FreeCAD
* [[PartDesign_Fillet#Topological_naming|PartDesign Fillet - Topological naming]]
* [https://forum.freecadweb.org/viewtopic.php?t=27278 Topological Naming, My Take]: a possible solution, by realthunder.
* [[Topological_Naming_Project|Topological Naming Project]]: idea to solve the problem, by ickby.
* [[Topological_data_scripting|Topological data scripting]]
* [[Feature_editing|Feature editing]]: contains alternate advice for stable modelling techniques.


<!--T:34-->
== Videos == <!--T:40-->
{{TechDraw Tools navi}}


<!--T:35-->
<!--T:41-->
* [https://youtu.be/6p2vqEEmWq4 Why do my FreeCAD models break? - "Topological Naming Problem"]: A Video explanation of the underlying issues of [[Topological_naming_problem|Topological naming problem]]
{{PartDesign Tools navi}}
* [https://www.youtube.com/watch?v=QSsVFu929jo FreeCAD Is Fundamentally Broken! - Now what... Help Me Decide...]: A Maker Tales Video


<!--T:36-->
{{Part Tools navi}}


<!--T:37-->
{{Userdocnavi}}
</translate>
</translate>
{{Userdocnavi{{#translation:}}}}
{{TechDraw Tools navi{{#translation:}}}}
{{PartDesign Tools navi{{#translation:}}}}
{{Part Tools navi{{#translation:}}}}
[[Category:Common Questions{{#translation:}}]]

Latest revision as of 09:47, 31 October 2022

Introduction

The topological naming problem in FreeCAD refers to the issue of a shape changing its internal name after a modelling operation (pad, cut, union, chamfer, fillet, etc.) is performed. This will result in other parametric features that depend on that shape to break or be incorrectly computed. This issue affects all objects in FreeCAD but is especially notable when building solids with the PartDesign Workbench, and when dimensioning those solids with the TechDraw Workbench.

  • In PartDesign, if a feature is supported on a face (or edge or vertex), the feature may break if the underlying solid changes size or orientation, as the original face (or edge or vertex) may be internally renamed.
  • In TechDraw, if a dimension is measuring the length of a projected edge, the dimension may break if the 3D model is changed, as the vertices may be renamed thus changing the measured edge.

The topological naming issue is a complex problem in CAD modelling that stems from the way the internal FreeCAD routines handle updates of the geometrical shapes created with the OCCT kernel. As of FreeCAD 0.19 there are ongoing efforts to improve the core handling of shapes in order to reduce or eliminate such issues.

The topological naming problem most often affects and confuses new users of FreeCAD. In PartDesign, the user is advised to follow the best practices discussed in the feature editing page. Use of supporting datum objects like planes and local coordinate systems is strongly recommended to produce models that aren't easily subject to such topological errors. In TechDraw, the user is advised to add dimensions only when the 3D model is complete and won't be modified further.

Example

1. In the PartDesign Workbench, create a PartDesign Body, then use PartDesign NewSketch and select the XY plane to draw the base sketch; then perform a PartDesign Pad to create a first solid.

2. Select the top face of the previous solid, and then use PartDesign NewSketch to draw another sketch; then perform a second pad.

3. Select the top face of the previous extrusion, and once again create a sketch, and a pad.

4. Now, double click the second sketch, and modify it so that its length is along the X direction; doing this will recreate the second pad. The third sketch and pad will stay in the same place.

5. Now, double click the second sketch again, and adjust its points so that a portion of it is outside the limits defined by the first pad. By doing this, the second pad will recompute correctly, however, when looking at the tree view, an error will be indicated in the third pad.

6. By making visible the third sketch and pad, it is clear that the computation of the new solid did not proceed correctly. The third sketch, instead of being supported by the top face of the second pad, appears in a strange place, with its normal oriented towards the X direction. This results in an invalid pad, as this pad would be disconnected from the rest of the PartDesign Body, which is not allowed.

The problem appears to be that when the second sketch was modified, the top face of the second pad was renamed from Face13 to Face14. The third sketch is attached to Face13 as it originally was, but since this face is now on the side (not at the top), the sketch follows its orientation and now is incorrectly positioned.

7. To fix the issue, the third sketch should be mapped to the top face again. Select the sketch, click on the ellipsis (three dots) next to the DataMap Mode property, and choose the top face of the second pad again. Then the sketch moves to the top of the existing solid, and the third pad is generated without issues.

Remapping a sketch in this way can be done every time there is a topological naming error, however, this may be tedious if the model is complicated and there are many such sketches that need to be adjusted.

Solution

The dependency graph is a tool that is helpful to observe the relationships between the different bodies in the document. Using the original modelling workflow reveals the direct relationship that exists between the sketches and the pads. Like a chain, it is easy to see that this direct dependence will be subject to topological naming problems if any of the links in the sequence changes.

As explained on the feature editing page, a solution to this problem is to support sketches not on faces but on datum planes which are attached to, and offset from, the main planes of the PartDesign Body's Origin.

1. Select the origin of the PartDesign Body and make sure that it is visible. Then select the XY plane, and click on PartDesign Plane. In the attachment offset dialog, give it an offset in the Z direction so that the datum plane is coplanar with the top face of the first pad.

2. Repeat the process but this time add a larger offset so that the second datum plane is coplanar with the top face of the second pad.

3. Select the second sketch, click on the ellipsis next to the DataMap Mode property, and then select the first datum plane. The datum plane is already offset from the body's XY plane, so no further Z offset is required for the sketch.

4. Repeat the process with the third sketch, and select the second datum plane as support. Again, no further Z offset is necessary.

5. The dependency graph now shows that the sketches and pads are supported by the datum planes. This model is more stable as each sketch can be modified essentially independently from each other.

6. Double click the second sketch and modify the shape. The second pad should update immediately without causing topological problems with the third sketch and the third pad.

7. In fact, every sketch can be modified without interfering with each other's pads. As long as the pads have sufficient extrusion length, so that they touch and form a contiguous solid, the entire body will be valid.

Final remarks

Adding datum objects is more work for the user but ultimately produces more stable models that are less subject to the topological naming problem.

Naturally, datum objects can be created before any sketches are drawn, and pads are produced. This may be helpful to visualize the approximate shape and dimensions of the final body.

Datum planes can also be based on other datum planes. This creates a chain of dependencies that could also result in topological problems; however, since datum planes are very simple objects, the risks of having these issues is less than if the face of a solid object is used as support.

Datum objects, points, lines, planes, and coordinate systems, may also be useful as reference geometry, that is, as visual aids to show the important features in the model, even if no sketch is directly attached to them.

Links

Videos