This commit is contained in:
Alexey SOZINOV 2022-08-17 13:56:30 +03:00
parent 2e1fa094cd
commit a54acf3ead
5 changed files with 108 additions and 0 deletions

View File

@ -0,0 +1,45 @@
# Check Conformity
import salome
salome.salome_init_without_session()
import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()
O = geompy.MakeVertex(0, 0, 0)
OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)
Vertex_1 = geompy.MakeVertex(-30, -70, 0)
Vertex_2 = geompy.MakeVertex(-30, 50, 0)
Line_1 = geompy.MakeLineTwoPnt(Vertex_2, Vertex_1)
Vertex_3 = geompy.MakeVertex(0, -50, 0)
Vertex_4 = geompy.MakeVertex(-40, -10, 0)
Vertex_5 = geompy.MakeVertex(0, 40, 0)
Arc_1 = geompy.MakeArc(Vertex_5, Vertex_4, Vertex_3)
Vertex_6 = geompy.MakeVertex(10, -50, 4)
Vertex_7 = geompy.MakeVertex(10, -50, 10)
Vertex_8 = geompy.MakeVertex(10, 40, 10)
Arc_1_vertex_3 = geompy.GetSubShape(Arc_1, [3])
Line_2 = geompy.MakeLineTwoPnt(Arc_1_vertex_3, Vertex_6)
Line_3 = geompy.MakeLineTwoPnt(Vertex_6, Vertex_7)
Line_4 = geompy.MakeLineTwoPnt(Vertex_7, Vertex_8)
Vertex_9 = geompy.MakeVertex(15, 40, 10)
Vertex_10 = geompy.MakeVertex(17, 0, 6)
Vertex_11 = geompy.MakeVertex(17, 0, 3)
Line_5 = geompy.MakeLineTwoPnt(Vertex_8, Vertex_9)
Line_6 = geompy.MakeLineTwoPnt(Vertex_9, Vertex_10)
Line_7 = geompy.MakeLineTwoPnt(Vertex_10, Vertex_11)
Arc_1_vertex_2 = geompy.GetSubShape(Arc_1, [2])
Line_8 = geompy.MakeLineTwoPnt(Vertex_11, Arc_1_vertex_2)
Wire_1 = geompy.MakeWire([Arc_1, Line_2, Line_3, Line_4, Line_5, Line_6, Line_7, Line_8], 1e-07)
Wire_2 = geompy.MakeWire([Line_1], 1e-07)
Compound_1 = geompy.MakeCompound([Wire_1, Wire_2])
# Get CheckConformity tool
cc = geompy.CheckConformity(Compound_1)
valid = cc.isValid()
dist = cc.distantShapes()
small = cc.smallEdges()
interfer = cc.interferingSubshapes()
intersect = cc.selfIntersected2D()

View File

@ -0,0 +1,55 @@
/*!
\page check_conformity_page Check Conformity
The Check Conformity tool provides the user with a simple python API to analyze, available shape for Boolean Operations or not. \n
Also tool provide advanced output to indicate imperfections in the input shape.
This is just a TUI functionality.
<b>TUI Commands:</b>
<UL>
<LI>
<em>geompy.CheckConformity(shape),</em> \n
where \n
\em shape is the shape checked for validity. \n
</LI>
The following functionality is available from the tool:
<LI>
<em>geompy.isValid()</em>
</LI>
<LI>
<em>geompy.selfIntersected2D()</em>
</LI>
<LI>
<em>geompy.interferingSubshapes(shapeType1, shapeType2),</em>
where \n
\em shapeType1 is the first type of subshape. \n
\em shapeType2 is the second type of subshape. \n
</LI>
<LI>
<em>geompy.smallEdges()</em>
</LI>
<LI>
<em>geompy.distantShapes(shapeType, subShapeType, tolerance),</em>
where \n
\em shapeType is the type of shape. \n
\em subShapeType is the type of subshape. \n
\em tolerance is available tolerance, by default used tolerance of sub-shape.
</LI>
<LI>
<em>geompy.updateTolerance()</em>
</LI>
</UL>
See also a \ref tui_check_conformity_page "TUI example".
*/

View File

@ -0,0 +1,6 @@
/*!
\page tui_check_conformity_page Check Conformity
\tui_script{check_conformity.py}
*/

View File

@ -22,6 +22,7 @@
<li>\subpage tui_check_self_intersections_fast_page</li>
<li>\subpage tui_fast_intersection_page</li>
<li>\subpage tui_shape_proximity_page</li>
<li>\subpage tui_check_conformity_page</li>
</ul>
*/

View File

@ -30,6 +30,7 @@
<li>\subpage boundaries_page "Check Free Boundaries"</li>
<li>\subpage free_faces_page "Check Free Faces"</li>
<li>\subpage check_shape_page "Check Shape"</li>
<li>\subpage check_conformity_page "Check Conformity"</li>
<li>\subpage check_compound_of_blocks_page "Check compound of blocks"</li>
<li>\subpage get_non_blocks_page "Get non blocks"</li>
<li>\subpage check_self_intersections_page "Detect Self-intersections"</li>