IMP 0020851 (LimitTolerance).

This commit is contained in:
jfa 2010-07-15 10:43:21 +00:00
parent da9569a425
commit ac79803473
4 changed files with 63 additions and 18 deletions

View File

@ -5,18 +5,32 @@
\n To produce a <b>Limit Tolerance</b> operation in the <b>Main
Menu</b> select <b>Repair - > Limit Tolerance</b>.
\image html limit_tolerance_dlg.png
\n <b>Arguments:</b> Name + 1 shape + 1 value (new tolerance).
\n It is possible on all kind of shapes.
\n The \b Result will be a \b GEOM_Object.
\n This functionality tries to set new value of tolerance for the
given shape. But the final tolerance value depends also on the
initial shape topology (regards existing gaps) in order to obtain
valid resulting shape.
\n Example of usage:
<ol>
<li>Try a partition on objects obj1 and obj2.</li>
<li>Partition fails.</li>
<li>Perform Limit Tolerance on objects obj1 and obj2.</li>
<li>Try again the partition.</li>
</ol>
See also \ref tui_limit_tolerance "TUI example".
\n <b>TUI Command:</b> <em>geompy.LimitTolerance(Shape, Tolerance),</em>
where \em Shape is a shape with presumably incorrect tolerance, \em
Tolerance is a desired value of tolerance.
\image html limit_tolerance_dlg.png
\n <b>Arguments:</b> Name + 1 shape + 1 value (new tolerance).
Our <b>TUI Scripts</b> provide you with useful examples of the use of
\ref tui_limit_tolerance "Repairing Operations".

View File

@ -37,6 +37,12 @@ the box, see corresponding \ref partition_picture_3 "picture" below).
\n <b>Advanced option:</b>
\ref restore_presentation_parameters_page "Set presentation parameters and subshapes from arguments".
\note Partition is a kind of complex operation, result of it depends
on the initial shapes quality. Sometimes, if partition fails,
some healing operations could help. Try <b>Shape Processing</b>
and <b>Limit Tolerance</b> in such cases. See also \ref
tui_limit_tolerance "TUI example" of shape healing.
\n <b>TUI Command:</b> <em>geompy.MakePartition(ListOfShapes,
ListOfTools, ListOfKeepInside, ListOfRemoveInside, Limit, RemoveWebs,
ListOfMaterials, KeepNonlimitShapes),</em> where where \em

View File

@ -3,7 +3,7 @@
\page shape_processing_operation_page Shape Processing
\n To produce a <b>Shape Processing</b> operation in the <b>Main Menu</b>
select <b>Repair - > Shape Processing</b>.
select <b>Repair - > Shape Processing</b>.
\n This operation processes one or more shapes using various operators.
\n The \b Result will be a \b GEOM_Object.
@ -15,6 +15,19 @@ is a list of operators ("FixShape", "SplitClosedFaces", etc.),
etc), \em Values is a list of values of parameters placed in the same
order as in the list of Parameters.
\note <b>Shape Processing</b> is usefull not only on invalid shapes,
but sometimes also on shapes, that are classified as valid by
the <b>Check</b> functionality. Use it, if some operation (for
example, <b>Partition</b>) fails.
Example of usage:
<ol>
<li>Try a partition on objects obj1 and obj2.</li>
<li>Partition fails.</li>
<li>Perform Shape Processing on objects obj1 and obj2.</li>
<li>Try again the partition.</li>
</ol>
See also \ref tui_limit_tolerance "TUI example".
\n In this dialog box you can select the object that you need to
process, define its name and operators applied to it during
processing.

View File

@ -297,21 +297,33 @@ import geompy
gg = salome.ImportComponentGUI("GEOM")
# import initial topology
bad_shape = geompy.ImportBREP("my_bad_shape.brep")
shape1 = geompy.ImportBREP("my_shape_1.brep")
shape2 = geompy.ImportBREP("my_shape_2.brep")
# limit tolerance
tolerance = 1e-07
good_shape = geompy.LimitTolerance(bad_shape, tolerance)
geompy.addToStudy(shape1, "Shape 1")
geompy.addToStudy(shape2, "Shape 2")
# add objects in the study
id_bad_shape = geompy.addToStudy(bad_shape, "My Bad Shape")
id_good_shape = geompy.addToStudy(good_shape, "My Good Shape")
# perform partition
try:
part = geompy.MakePartition([shape1, shape2])
except:
# limit tolerance
tolerance = 1e-07
shape1_lt = geompy.LimitTolerance(shape1, tolerance)
shape2_lt = geompy.LimitTolerance(shape2, tolerance)
# display the results
gg.createAndDisplayGO(id_bad_shape)
gg.setDisplayMode(id_bad_shape, 1)
gg.createAndDisplayGO(id_good_shape)
gg.setDisplayMode(id_good_shape, 1)
# process shape
good_shape1 = geompy.ProcessShape(shape1_lt, ["FixShape"], ["FixShape.Tolerance3d"], ["1e-7"])
good_shape2 = geompy.ProcessShape(shape2_lt, ["FixShape"], ["FixShape.Tolerance3d"], ["1e-7"])
geompy.addToStudy(good_shape1, "Shape 1 corrected")
geompy.addToStudy(good_shape2, "Shape 2 corrected")
# perform partition on corrected shapes
part = geompy.MakePartition([good_shape1, good_shape2])
pass
geompy.addToStudy(part, "Partition")
\endcode
\anchor tui_add_point_on_edge