NPAL18500: Add some examples of python interface usage.

This commit is contained in:
jfa 2008-05-28 10:31:14 +00:00
parent 13ab87530f
commit a60fa47bca
12 changed files with 670 additions and 247 deletions

View File

@ -20,6 +20,7 @@ INPUT = @srcdir@/input
FILE_PATTERNS = *.doc
EXCLUDE =
IMAGE_PATH = @srcdir@/images
EXAMPLE_PATH = @top_srcdir@/src/GEOM_SWIG
#---------------------------------------------------------------------------
#HTML related options

View File

@ -19,6 +19,7 @@ WARNINGS = YES
INPUT = @srcdir@/input
FILE_PATTERNS = tui_*.doc
IMAGE_PATH = @srcdir@/images
EXAMPLE_PATH = @top_srcdir@/src/GEOM_SWIG
#---------------------------------------------------------------------------
#HTML related options

View File

@ -131,6 +131,12 @@
<li>\ref tui_repairing_operations_page</li>
</ul>
<li>\ref tui_measurement_tools_page</li>
<li>\ref tui_swig_examples_page</li>
<ul>
<li>\ref tui_test_others_page</li>
<li>\ref tui_test_spanner_page</li>
<li>\ref tui_test_all_page</li>
</ul>
</ul>
</ul>

View File

@ -3,26 +3,32 @@
\page tui_scripts_page TUI Scripts
<ul>
<li>\subpage tui_viewing_geom_objs_page</li>
<li>\subpage tui_creating_geom_objs_page</li>
<ul>
<li>\ref tui_basic_geom_objs_page</li>
<li>\ref tui_primitives_page</li>
<li>\ref tui_complex_objs_page</li>
<li>\ref tui_working_with_groups_page</li>
<li>\ref tui_building_by_blocks_page</li>
<li>\ref tui_sketcher_page</li>
<li>\ref tui_advanced_geom_objs_page</li>
</ul>
<li>\subpage tui_transformation_page</li>
<ul>
<li>\ref tui_basic_operations_page</li>
<li>\ref tui_boolean_operations_page</li>
<li>\ref tui_transformation_operations_page</li>
<li>\ref tui_blocks_operations_page</li>
<li>\ref tui_repairing_operations_page</li>
</ul>
<li>\subpage tui_measurement_tools_page</li>
<li>\subpage tui_viewing_geom_objs_page</li>
<li>\subpage tui_creating_geom_objs_page</li>
<ul>
<li>\ref tui_basic_geom_objs_page</li>
<li>\ref tui_primitives_page</li>
<li>\ref tui_complex_objs_page</li>
<li>\ref tui_working_with_groups_page</li>
<li>\ref tui_building_by_blocks_page</li>
<li>\ref tui_sketcher_page</li>
<li>\ref tui_advanced_geom_objs_page</li>
</ul>
<li>\subpage tui_transformation_page</li>
<ul>
<li>\ref tui_basic_operations_page</li>
<li>\ref tui_boolean_operations_page</li>
<li>\ref tui_transformation_operations_page</li>
<li>\ref tui_blocks_operations_page</li>
<li>\ref tui_repairing_operations_page</li>
</ul>
<li>\subpage tui_measurement_tools_page</li>
<li>\subpage tui_swig_examples_page</li>
<ul>
<li>\ref tui_test_others_page</li>
<li>\ref tui_test_spanner_page</li>
<li>\ref tui_test_all_page</li>
</ul>
</ul>
*/

View File

@ -0,0 +1,11 @@
/*!
\page tui_swig_examples_page Examples, generated from GEOM_SWIG test scripts
<ul>
<li>\subpage tui_test_others_page</li>
<li>\subpage tui_test_spanner_page</li>
<li>\subpage tui_test_all_page</li>
</ul>
*/

View File

@ -0,0 +1,69 @@
/*!
\page tui_test_all_page GEOM_TestAll.py
\anchor swig_All
<br><h2>GEOM_TestAll.py</h2>
\dontinclude GEOM_TestAll.py
\skipline def TestAll
\until vxyz
\anchor swig_MakeMarker
\until cs3
\until MakePlaneThreePnt
\anchor swig_MakeArc
\until MakeArcCenter
\anchor swig_MakeCircle
\until Circle2
\until MakeVertexOnCurve
\anchor swig_MakeVertexOnLinesIntersection
\until p_on_l1l2
\anchor swig_MakeTangentOnCurve
\until tan_on_arc
\until MakeCompound
\anchor swig_MakeVertexOnSurface
\until p_on_face
\until S = geompy.MakeRotation
\anchor swig_MakeLineTwoFaces
\until Line3
\anchor swig_all_advanced
\until MakeSewing
\anchor swig_all_trsf
\until MakeOffset
\anchor swig_ChangeOrientation
\until ChangeOrientation
\anchor swig_FilletChamfer
\until End of Local operations
\anchor swig_all_patterns
\until MultiRot2D
\anchor swig_all_measure
\until "CheckShape(Prism) = "
\anchor swig_all_partition
\until Partition1
\anchor swig_all_addtostudy
\until id_Partition1
\anchor swig_all_decompose
\until print "DONE"
*/

View File

@ -0,0 +1,159 @@
/*!
\page tui_test_others_page GEOM_TestOthers.py
\anchor swig_TestOthers
<br><h2>GEOM_TestOthers.py</h2>
\dontinclude GEOM_TestOthers.py
\skipline import os
\anchor swig_Import_Export
\until print "OK"
\until id_w3
\anchor swig_MakeFaces
\until id_f12
\until TestExportImport
\anchor swig_OrientationChange
\until id_Orientation
\anchor swig_MakeCommon
\until id_Section
\anchor swig_Partition
\until id_Partition
\anchor swig_MakeMultiRotation
\until id_MultiRot2D
\anchor swig_MakeFilletAll
\until id_MakeFilletAll
\anchor swig_MakeChamferAll
\until id_MakeChamferAll
\anchor swig_MakeChamfer
\until id_MakeChamfer
\anchor swig_NumberOfFaces
\until Bad number of faces
\anchor swig_NumberOfEdges
\until Bad number of edges
\anchor swig_MakeBlockExplode
\until id_MakeBlockExplode
\anchor swig_CheckCompoundOfBlocks
\until The Box is VALID
\anchor swig_GetSame
\until id_Cone_ss
\anchor swig_CreateGroup
\until id_CreateGroup
\anchor swig_AddObject
\until Now contains
\anchor swig_UnionList
\until Now contains
\anchor swig_RemoveObject
\until Now contains
\anchor swig_DifferenceList
\until Now contains
\anchor swig_GetObjectIDs
\until print " ", ObjectID
\anchor swig_GetMainShape
\until BoxCopy
\anchor swig_DifferenceIDs
\until Now contains
\anchor swig_UnionIDs
\until print " ", ObjectID
\anchor swig_GetType
\until Type of elements
\until freeFaces, "freeFaces"
\anchor swig_RemoveExtraEdges
\until "freeFacesWithoutExtra"
\anchor swig_GetSharedShapes
\until "sharedFace"
\anchor swig_CheckAndImprove
\until "blocksComp"
\anchor swig_Propagate
\until "propagation chain"
\anchor swig_GetPoint
\until blocksComp (-50, -50, -50)
\anchor swig_GetEdgeNearPoint
\until edge near point
\anchor swig_GetBlockByParts
\until "b0 image"
\anchor swig_GetShapesOnPlane
\until Face on Plane
\anchor swig_GetShapesOnPlaneIDs
\until Group of faces
\anchor swig_GetShapesOnPlaneWithLocation
\until Edge on Plane
\anchor swig_GetShapesOnPlaneWithLocationIDs
\until group_edges_on_pln, grname
\anchor swig_GetShapesOnCylinder
\until Edge out of Cylinder
\anchor swig_GetShapesOnCylinderIDs
\until Group of edges
\anchor swig_GetShapesOnSphere
\until Vertex on Sphere
\anchor swig_GetShapesOnSphereIDs
\until Group of vertices
\anchor swig_GetShapesOnQuadrangle
\until Error in GetShapesOnQuadrangle
\anchor swig_GetShapesOnQuadrangleIDs
\until Group of vertices
\anchor swig_GetShapesOnBox
\until "Error in GetShapesOnBox()"
\anchor swig_GetShapesOnBoxIDs
\until Group of faces
\anchor swig_GetShapesOnShape
\until "Error in GetShapesOnShape()"
\anchor swig_GetShapesOnShapeAsCompound
\until (as compound)
\anchor swig_GetShapesOnShapeIDs
\until "Error in GetShapesOnShapeIDs()"
\anchor swig_GetInPlace
\until #END
*/

View File

@ -0,0 +1,41 @@
/*!
\page tui_test_spanner_page GEOM_Spanner.py
\anchor swig_Spanner
<br><h2>GEOM_Spanner.py</h2>
\dontinclude GEOM_Spanner.py
\skipline def MakeSpanner
\until vxy
\anchor swig_MakeQuad4Vertices
\until id_face11
\anchor swig_MakeTranslationTwoPoints
\until id_face12
\anchor swig_MakeHexa2Faces
\until id_block1
\until p_15_10_1
\anchor swig_GetFaceNearPoint
\until id_face31
\until not a hexahedral
\anchor swig_SubShapeAllSorted
\until ii + 1
\anchor swig_MakeHexa
\until id_block3
\anchor swig_GetOppositeFace
\until id_face41
\anchor spanner_continue
\until return Spanner
*/

View File

@ -16,7 +16,7 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
#
#
@ -25,6 +25,11 @@
# Module : GEOM
# $Header$
# ! Please, if you edit this example file, update also
# ! GEOM_SRC/doc/salome/gui/GEOM/input/tui_test_spanner.doc
# ! as some sequences of symbols from this example are used during
# ! documentation generation to identify certain places of this file
############# MakeSpanner #############
def MakeSpanner (geompy, math, isBlocksTest = 0, isMeshTest = 0, smesh = None):

View File

@ -1,7 +1,6 @@
# GEOM GEOM_SWIG : binding of C++ omplementaion with Python
#
# Copyright (C) 2003 CEA
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@ -17,7 +16,7 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
#
# File : GEOM_usinggeom.py
@ -25,6 +24,10 @@
# Module : GEOM
# $Header$
# ! Please, if you edit this example file, update also
# ! GEOM_SRC/doc/salome/gui/GEOM/input/tui_test_all.doc
# ! as some sequences of symbols from this example are used during
# ! documentation generation to identify certain places of this file
def TestAll (geompy, math):
@ -76,13 +79,14 @@ def TestAll (geompy, math):
vxyz = geompy.MakeVectorDXDYDZ(100., 100., 100.) #(3 Doubles)->GEOM_Object_ptr
#Create local coordinate systems
cs1 = geompy.MakeMarker(50,50,50, 1,0,0, 0,1,0)
cs2 = geompy.MakeMarker(70,80,10, 1,0,1, 1,1,0)
cs1 = geompy.MakeMarker(50,50,50, 1,0,0, 0,1,0) #(9 Doubles)->GEOM_Object_ptr
cs2 = geompy.MakeMarker(70,80,10, 1,0,1, 1,1,0) #(9 Doubles)->GEOM_Object_ptr
cs3 = geompy.MakeMarkerPntTwoVec(pz, vxy, vz) #(3 GEOM_Object_ptr)->GEOM_Object_ptr
#Create base geometry 2D
Line = geompy.MakeLineTwoPnt(p0, pxyz) #(2 GEOM_Object_ptr)->GEOM_Object_ptr
Line1 = geompy.MakeLine(pz, vxy) #(2 GEOM_Object_ptr)->GEOM_Object_ptr
Line2 = geompy.MakeLineTwoPnt(pxyz, pz) #(2 GEOM_Object_ptr)->GEOM_Object_ptr
Line2 = geompy.MakeLineTwoPnt(pxyz, pz) #(2 GEOM_Object_ptr)->GEOM_Object_ptr
Plane = geompy.MakePlane(pz, vxyz, trimsize) #(2 GEOM_Object_ptr, Double)->GEOM_Object_ptr
Plane1 = geompy.MakePlaneThreePnt(px, pz, p200, trimsize) #(4 Doubles)->GEOM_Object_ptr
@ -102,7 +106,10 @@ def TestAll (geompy, math):
p_on_arc = geompy.MakeVertexOnCurve(Arc, 0.25) #(GEOM_Object_ptr, Double)->GEOM_Object_ptr
#Test point on lines intersection
pLine = geompy.MakeVertexOnLinesIntersection( Line1, Line2 )
p_on_l1l2 = geompy.MakeVertexOnLinesIntersection(Line1, Line2) #(2 GEOM_Object_ptr)->GEOM_Object_ptr
#Test tangent on curve creation
tan_on_arc = geompy.MakeTangentOnCurve(Arc, 0.7) #(GEOM_Object_ptr, Double)->GEOM_Object_ptr
#Create base geometry 3D
Box = geompy.MakeBoxTwoPnt(p0, p200) #(2 GEOM_Object_ptr)->GEOM_Object_ptr
@ -148,6 +155,9 @@ def TestAll (geompy, math):
i = i + 1
Compound = geompy.MakeCompound(ShapeListCompound) #(List of GEOM_Object_ptr)->GEOM_Object_ptr
#Test point on surface creation
p_on_face = geompy.MakeVertexOnSurface(Face, 0.1, 0.8) #(GEOM_Object_ptr, Double, Double)->GEOM_Object_ptr
# Test plane from existing face creation
Plane2 = geompy.MakePlaneFace(Face, trimsize) #(GEOM_Object_ptr, Double)->GEOM_Object_ptr
@ -155,7 +165,7 @@ def TestAll (geompy, math):
S = geompy.MakeRotation(Face, vxy, angle1)
#Test Line on Faces Intersection
Line3 = geompy.MakeLineTwoFaces( prism1_faces[0], prism1_faces[1]) #(2 GEOM_Object_ptr)->GEOM_Object_ptr
Line3 = geompy.MakeLineTwoFaces(prism1_faces[0], prism1_faces[1]) #(2 GEOM_Object_ptr)->GEOM_Object_ptr
#Create advanced objects
Copy = geompy.MakeCopy(Box) #(GEOM_Object_ptr)->GEOM_Object_ptr
@ -218,6 +228,8 @@ def TestAll (geompy, math):
IDlist_e) #(GEOM_Object_ptr, 2 Doubles, ListOfLong)->GEOM_Object_ptr
Chamfer4 = geompy.MakeChamferFacesAD(Prism, d1, 20. * math.pi / 180.,
IDlist_f) #(GEOM_Object_ptr, 2 Doubles, ListOfLong)->GEOM_Object_ptr
#End of Local operations
#Create Patterns
MultiTrans1D = geompy.MakeMultiTranslation1D(Fillet, vz, step1, nbtimes1)
MultiTrans2D = geompy.MakeMultiTranslation2D(Fillet, vz, step1, nbtimes1, vy, step2, nbtimes2)
@ -229,6 +241,9 @@ def TestAll (geompy, math):
CDG = geompy.MakeCDG(Prism) #(GEOM_Object_ptr)->GEOM_Object_ptr
Archimede = geompy.Archimede(Box, weight, waterdensity,
meshingdeflection) #(GEOM_Object_ptr, 3 Doubles)->GEOM_Object_ptr
mindist = geompy.MinDistanceComponents(TranslVect, Mirror) #(2 GEOM_Object_ptr)->4 Doubles
print "Minumal distance between TranslVect and Mirror is", mindist[0],
print "by components:", mindist[1], ",", mindist[2], ",", mindist[3]
CheckShape = geompy.CheckShape(Prism) #(GEOM_Object_ptr)->Boolean
print "CheckShape(Prism) = ", CheckShape
@ -237,14 +252,12 @@ def TestAll (geompy, math):
Partition1 = geompy.MakeHalfPartition(Box, Plane) #(2 GEOM_Object_ptr)->GEOM_Object_ptr
#Add In Study
id_p0 = geompy.addToStudy(p0, "Vertex 0")
id_px = geompy.addToStudy(px, "Vertex X")
id_py = geompy.addToStudy(py, "Vertex Y")
id_pz = geompy.addToStudy(pz, "Vertex Z")
id_pxyz = geompy.addToStudy(pxyz, "Vertex XYZ")
id_p200 = geompy.addToStudy(p200, "Vertex 200")
id_pLine = geompy.addToStudy(pLine, "Vertex on Lines Intersection")
id_vx = geompy.addToStudy(vx, "Vector X")
id_vy = geompy.addToStudy(vy, "Vector Y")
@ -254,6 +267,7 @@ def TestAll (geompy, math):
id_cs1 = geompy.addToStudy(cs1, "CS 50,50,50, 1,0,0, 0,1,0")
id_cs2 = geompy.addToStudy(cs2, "CS 70,80,10, 1,0,1, 1,1,0")
id_cs3 = geompy.addToStudy(cs3, "CS: pz, vxy, vz")
id_Line = geompy.addToStudy(Line, "Line")
id_Line1 = geompy.addToStudy(Line1, "Line by point and vector")
@ -271,7 +285,10 @@ def TestAll (geompy, math):
id_Interpol = geompy.addToStudy(Interpol, "Interpol")
id_Sketcher = geompy.addToStudy(Sketcher, "Sketcher")
id_p_on_arc = geompy.addToStudy(p_on_arc, "Vertex on Arc")
id_p_on_arc = geompy.addToStudy(p_on_arc, "Vertex on Arc (0.25)")
id_p_on_l1l2 = geompy.addToStudy(p_on_l1l2, "Vertex on Lines Intersection")
id_tan_on_arc = geompy.addToStudy(tan_on_arc, "Tangent on Arc (0.7)")
id_Box = geompy.addToStudy(Box, "Box")
id_Box1 = geompy.addToStudy(Box1, "Box 10x20x30")
@ -298,6 +315,8 @@ def TestAll (geompy, math):
id_Face2 = geompy.addToStudy(Face2, "Face from Sketcher")
id_Shell = geompy.addToStudy(Shell, "Shell")
id_p_on_face = geompy.addToStudy(p_on_face, "Vertex on Face (0.1, 0.8)")
id_Prism1 = geompy.addToStudy(Prism1, "Prism by Two Pnt")
id_Shell1 = geompy.addToStudy(Shell1, "Shell from Prism1 faces")
id_Solid = geompy.addToStudy(Solid, "Solid")
@ -347,20 +366,40 @@ def TestAll (geompy, math):
id_Partition1 = geompy.addToStudy(Partition1, "Half Partition")
#Decompose objects
# SubShape
SubFace = geompy.SubShape(Box, geompy.ShapeType["FACE"], [2])
name = geompy.SubShapeName(SubFace, Box)
id_SubFace = geompy.addToStudyInFather(Box, SubFace, name)
# SubShapeSorted
SubFaceS = geompy.SubShapeSorted(Box, geompy.ShapeType["FACE"], [5])
nameS = geompy.SubShapeName(SubFaceS, Box)
id_SubFace = geompy.addToStudyInFather(Box, SubFaceS, nameS)
# SubShapeAll
SubEdgeList = geompy.SubShapeAll(SubFace, geompy.ShapeType["EDGE"])
i=0
for SubEdge in SubEdgeList :
name = geompy.SubShapeName(SubEdge, SubFace)
id_SubEdge = geompy.addToStudyInFather(SubFace, SubEdge, name)
#-------------------
# SubShapeAllIDs
SubEdgeIDsList = geompy.SubShapeAllIDs(SubFace, geompy.ShapeType["EDGE"])
print "IDs of edges of SubFace:", SubEdgeIDsList, "(unsorted)"
group = geompy.CreateGroup(SubFace, geompy.ShapeType["EDGE"])
geompy.UnionIDs(group, SubEdgeIDsList)
geompy.addToStudyInFather(SubFace, group, "Group of all edges")
# SubShapeAllSortedIDs
SubEdgeIDsList = geompy.SubShapeAllSortedIDs(SubFace, geompy.ShapeType["EDGE"])
print "IDs of edges of SubFace:", SubEdgeIDsList, "(sorted)"
# GetSubShape and GetSubShapeID
for ind in SubEdgeIDsList:
edge = geompy.GetSubShape(SubFace, [ind])
ind_e = geompy.GetSubShapeID(SubFace, edge)
if ind_e != ind:
print "Error in GetSubShape or GetSubShapeID"
print "DONE"

View File

@ -16,7 +16,7 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
#
# File : GEOM_TestOthers.py
@ -24,6 +24,11 @@
# Module : GEOM
# $Header$
# ! Please, if you edit this example file, update also
# ! GEOM_SRC/doc/salome/gui/GEOM/input/tui_test_others.doc
# ! as some sequences of symbols from this example are used during
# ! documentation generation to identify certain places of this file
import os
def TestExportImport (geompy, shape):
@ -94,7 +99,11 @@ def TestExportImport (geompy, shape):
def TestOtherOperations (geompy, math):
# MakeFaces
# prepare data for further operations
vx = geompy.MakeVectorDXDYDZ( 1, 0, 0)
vy = geompy.MakeVectorDXDYDZ( 0, 1, 0)
vz = geompy.MakeVectorDXDYDZ( 0, 0, 1)
p11 = geompy.MakeVertex( 0, 0, 0)
p12 = geompy.MakeVertex(30, 0, 0)
p13 = geompy.MakeVertex(30, 30, 0)
@ -123,6 +132,7 @@ def TestOtherOperations (geompy, math):
id_w2 = geompy.addToStudy(w2, "Inside Wire")
id_w3 = geompy.addToStudy(w3, "Inside Wire, translated along OZ")
# MakeFaces
f12 = geompy.MakeFaces([w1, w2], 0)
id_f12 = geompy.addToStudy(f12, "MakeFaces WO + WI")
@ -232,6 +242,10 @@ def TestOtherOperations (geompy, math):
else:
print "The Box is VALID"
# GetSame
Cone_ss = geompy.GetSame(Compound1, Cone)
id_Cone_ss = geompy.addToStudyInFather(Compound1, Cone_ss, "Cone subshape")
# test geometrical groups
# CreateGroup
@ -269,6 +283,7 @@ def TestOtherOperations (geompy, math):
for ObjectID in GetObjectIDs:
print " ", ObjectID
# GetMainShape
BoxCopy = geompy.GetMainShape(CreateGroup)
# DifferenceIDs
@ -289,7 +304,8 @@ def TestOtherOperations (geompy, math):
# -----------------------------------------------------------------------------
# enumeration ShapeTypeString as a dictionary
# -----------------------------------------------------------------------------
ShapeTypeString = {'0':"COMPOUND", '1':"COMPSOLID", '2':"SOLID", '3':"SHELL", '4':"FACE", '5':"WIRE", '6':"EDGE", '7':"VERTEX", '8':"SHAPE"}
ShapeTypeString = {'0':"COMPOUND", '1':"COMPSOLID", '2':"SOLID", '3':"SHELL",
'4':"FACE", '5':"WIRE", '6':"EDGE", '7':"VERTEX", '8':"SHAPE"}
GroupType = geompy.GetType(CreateGroup)
print "Type of elements of the created group is ", ShapeTypeString[`GroupType`]
@ -303,66 +319,67 @@ def TestOtherOperations (geompy, math):
id_s0 = geompy.addToStudy(s0, "s0")
v_0pp = geompy.MakeVectorDXDYDZ( 0, 1, 1)
v_0np = geompy.MakeVectorDXDYDZ( 0, -1, 1)
v_p0p = geompy.MakeVectorDXDYDZ( 1, 0, 1)
v_n0p = geompy.MakeVectorDXDYDZ(-1, 0, 1)
v_pp0 = geompy.MakeVectorDXDYDZ( 1, 1, 0)
v_np0 = geompy.MakeVectorDXDYDZ(-1, 1, 0)
#v_0np = geompy.MakeVectorDXDYDZ( 0, -1, 1)
#v_p0p = geompy.MakeVectorDXDYDZ( 1, 0, 1)
#v_n0p = geompy.MakeVectorDXDYDZ(-1, 0, 1)
#v_pp0 = geompy.MakeVectorDXDYDZ( 1, 1, 0)
#v_np0 = geompy.MakeVectorDXDYDZ(-1, 1, 0)
v_0n0 = geompy.MakeVectorDXDYDZ( 0, -1, 0)
pln_0pp = geompy.MakePlane(p0, v_0pp, 300)
pln_0np = geompy.MakePlane(p0, v_0np, 300)
pln_p0p = geompy.MakePlane(p0, v_p0p, 300)
pln_n0p = geompy.MakePlane(p0, v_n0p, 300)
pln_pp0 = geompy.MakePlane(p0, v_pp0, 300)
pln_np0 = geompy.MakePlane(p0, v_np0, 300)
#part_tool_1 = geompy.MakePartition([b0, pln_0pp, pln_0np, pln_p0p, pln_n0p, pln_pp0, pln_np0],
# [],
# [],
# [b0])
part_tool_1 = geompy.MakePartition([b0, pln_0pp, pln_0np, pln_p0p, pln_n0p, pln_pp0, pln_np0])
id_part_tool_1 = geompy.addToStudy(part_tool_1, "part_tool_1")
pt_pnt_1 = geompy.MakeVertex( 55, 0, 55)
pt_pnt_2 = geompy.MakeVertex( 0, 55, 55)
pt_pnt_3 = geompy.MakeVertex(-55, 0, 55)
pt_pnt_4 = geompy.MakeVertex( 0, -55, 55)
pt_pnt_5 = geompy.MakeVertex( 55, 55, 0)
pt_pnt_6 = geompy.MakeVertex( 55, -55, 0)
pt_pnt_7 = geompy.MakeVertex(-55, 55, 0)
pt_pnt_8 = geompy.MakeVertex(-55, -55, 0)
pt_pnt_9 = geompy.MakeVertex( 55, 0, -55)
pt_pnt_10 = geompy.MakeVertex( 0, 55, -55)
pt_pnt_11 = geompy.MakeVertex(-55, 0, -55)
pt_pnt_12 = geompy.MakeVertex( 0, -55, -55)
pt_face_1 = geompy.GetFaceNearPoint(part_tool_1, pt_pnt_1)
pt_face_2 = geompy.GetFaceNearPoint(part_tool_1, pt_pnt_2)
pt_face_3 = geompy.GetFaceNearPoint(part_tool_1, pt_pnt_3)
pt_face_4 = geompy.GetFaceNearPoint(part_tool_1, pt_pnt_4)
pt_face_5 = geompy.GetFaceNearPoint(part_tool_1, pt_pnt_5)
pt_face_6 = geompy.GetFaceNearPoint(part_tool_1, pt_pnt_6)
pt_face_7 = geompy.GetFaceNearPoint(part_tool_1, pt_pnt_7)
pt_face_8 = geompy.GetFaceNearPoint(part_tool_1, pt_pnt_8)
pt_face_9 = geompy.GetFaceNearPoint(part_tool_1, pt_pnt_9)
pt_face_10 = geompy.GetFaceNearPoint(part_tool_1, pt_pnt_10)
pt_face_11 = geompy.GetFaceNearPoint(part_tool_1, pt_pnt_11)
pt_face_12 = geompy.GetFaceNearPoint(part_tool_1, pt_pnt_12)
#pln_0pp = geompy.MakePlane(p0, v_0pp, 300)
#pln_0np = geompy.MakePlane(p0, v_0np, 300)
#pln_p0p = geompy.MakePlane(p0, v_p0p, 300)
#pln_n0p = geompy.MakePlane(p0, v_n0p, 300)
#pln_pp0 = geompy.MakePlane(p0, v_pp0, 300)
#pln_np0 = geompy.MakePlane(p0, v_np0, 300)
#
#part_objs = [b0, pln_0pp, pln_0np, pln_p0p, pln_n0p, pln_pp0, pln_np0]
#part_tool_1 = geompy.MakePartition(part_objs, [], [], [b0])
#part_tool_1 = geompy.MakePartition(part_objs)
#
#id_part_tool_1 = geompy.addToStudy(part_tool_1, "part_tool_1")
#
#pt_pnt_1 = geompy.MakeVertex( 55, 0, 55)
#pt_pnt_2 = geompy.MakeVertex( 0, 55, 55)
#pt_pnt_3 = geompy.MakeVertex(-55, 0, 55)
#pt_pnt_4 = geompy.MakeVertex( 0, -55, 55)
#pt_pnt_5 = geompy.MakeVertex( 55, 55, 0)
#pt_pnt_6 = geompy.MakeVertex( 55, -55, 0)
#pt_pnt_7 = geompy.MakeVertex(-55, 55, 0)
#pt_pnt_8 = geompy.MakeVertex(-55, -55, 0)
#pt_pnt_9 = geompy.MakeVertex( 55, 0, -55)
#pt_pnt_10 = geompy.MakeVertex( 0, 55, -55)
#pt_pnt_11 = geompy.MakeVertex(-55, 0, -55)
#pt_pnt_12 = geompy.MakeVertex( 0, -55, -55)
#
#pt_face_1 = geompy.GetFaceNearPoint(part_tool_1, pt_pnt_1)
#pt_face_2 = geompy.GetFaceNearPoint(part_tool_1, pt_pnt_2)
#pt_face_3 = geompy.GetFaceNearPoint(part_tool_1, pt_pnt_3)
#pt_face_4 = geompy.GetFaceNearPoint(part_tool_1, pt_pnt_4)
#pt_face_5 = geompy.GetFaceNearPoint(part_tool_1, pt_pnt_5)
#pt_face_6 = geompy.GetFaceNearPoint(part_tool_1, pt_pnt_6)
#pt_face_7 = geompy.GetFaceNearPoint(part_tool_1, pt_pnt_7)
#pt_face_8 = geompy.GetFaceNearPoint(part_tool_1, pt_pnt_8)
#pt_face_9 = geompy.GetFaceNearPoint(part_tool_1, pt_pnt_9)
#pt_face_10 = geompy.GetFaceNearPoint(part_tool_1, pt_pnt_10)
#pt_face_11 = geompy.GetFaceNearPoint(part_tool_1, pt_pnt_11)
#pt_face_12 = geompy.GetFaceNearPoint(part_tool_1, pt_pnt_12)
#
#pt_box = geompy.GetBlockNearPoint(part_tool_1, p0)
#part_tool = geompy.MakeCompound([pt_face_1, pt_face_4, pt_face_7, pt_face_10,
# pt_face_2, pt_face_5, pt_face_8, pt_face_11,
# #pt_face_3, pt_face_6, pt_face_9, pt_face_12, pt_box])
# pt_face_3, pt_face_6, pt_face_9, pt_face_12)
#
#comp_parts = [pt_face_1, pt_face_4, pt_face_7, pt_face_10,
# pt_face_2, pt_face_5, pt_face_8, pt_face_11,
# #pt_face_3, pt_face_6, pt_face_9, pt_face_12, pt_box]
# pt_face_3, pt_face_6, pt_face_9, pt_face_12]
#part_tool = geompy.MakeCompound(comp_parts)
#id_part_tool = geompy.addToStudy(part_tool, "part_tool")
#
#part = geompy.MakePartition([s0], [part_tool])
#part = geompy.MakePartition([s0], [ pt_face_1, pt_face_4, pt_face_7, pt_face_10,
# pt_face_2, pt_face_5, pt_face_8, pt_face_11,
# pt_face_3, pt_face_6, pt_face_9, pt_face_12, b0] )
#
#part_tools = [pt_face_1, pt_face_4, pt_face_7, pt_face_10,
# pt_face_2, pt_face_5, pt_face_8, pt_face_11,
# pt_face_3, pt_face_6, pt_face_9, pt_face_12, b0]
#part = geompy.MakePartition([s0], part_tools)
p1 = geompy.MakeVertex(50, 0, 0)
p2 = geompy.MakeVertex(-50, 0, 0)
@ -371,10 +388,6 @@ def TestOtherOperations (geompy, math):
p5 = geompy.MakeVertex(0, 0, 50)
p6 = geompy.MakeVertex(0, 0, -50)
vx = geompy.MakeVectorDXDYDZ( 1, 0, 0)
vy = geompy.MakeVectorDXDYDZ( 0, 1, 0)
vz = geompy.MakeVectorDXDYDZ( 0, 0, 1)
plnX1 = geompy.MakePlane(p1, vx, 300)
plnX2 = geompy.MakePlane(p2, vx, 300)
plnY1 = geompy.MakePlane(p3, vy, 300)
@ -403,7 +416,8 @@ def TestOtherOperations (geompy, math):
geompy.addToStudy(freeFacesWithoutExtra, "freeFacesWithoutExtra")
# GetSharedShapes
sharedFaces = geompy.GetSharedShapes(part, freeFacesWithoutExtra, geompy.ShapeType["FACE"])
sharedFaces = geompy.GetSharedShapes(part, freeFacesWithoutExtra,
geompy.ShapeType["FACE"])
for shFace in sharedFaces:
geompy.addToStudy(shFace, "sharedFace")
@ -465,11 +479,12 @@ def TestOtherOperations (geompy, math):
geompy.addToStudy(edge_i, "Edge on Plane (N = (0, -1, 0) & Location = (0, -50, 0)")
# GetShapesOnPlaneWithLocationIDs
edges_on_pln_ids = geompy.GetShapesOnPlaneWithLocationIDs(blocksComp, geompy.ShapeType["EDGE"],
v_0n0, Loc, geompy.GEOM.ST_ON)
edges_on_pln_ids = geompy.GetShapesOnPlaneWithLocationIDs(
blocksComp, geompy.ShapeType["EDGE"], v_0n0, Loc, geompy.GEOM.ST_ON)
group_edges_on_pln = geompy.CreateGroup(blocksComp, geompy.ShapeType["EDGE"])
geompy.UnionIDs(group_edges_on_pln, edges_on_pln_ids)
geompy.addToStudy(group_edges_on_pln, "Group of edges on Plane (N = (0, -1, 0) & Location = (0, -50, 0))")
grname = "Group of edges on Plane (N = (0, -1, 0) & Location = (0, -50, 0))"
geompy.addToStudy(group_edges_on_pln, grname)
# GetShapesOnCylinder
edges_out_cyl = geompy.GetShapesOnCylinder(blocksComp, geompy.ShapeType["EDGE"],
@ -489,7 +504,6 @@ def TestOtherOperations (geompy, math):
p0, 100, geompy.GEOM.ST_ON)
for vertex_i in vertices_on_sph:
geompy.addToStudy(vertex_i, "Vertex on Sphere (center = (0, 0, 0), r = 100)")
pass
# GetShapesOnSphereIDs
vertices_on_sph_ids = geompy.GetShapesOnSphereIDs(blocksComp, geompy.ShapeType["VERTEX"],
@ -513,13 +527,12 @@ def TestOtherOperations (geompy, math):
quadrangle = geompy.MakeWire([qe1, qe2, qe3, qe4])
geompy.addToStudy(quadrangle, "Quadrangle")
edges_onin_quad = geompy.GetShapesOnQuadrangle( f12, geompy.ShapeType["EDGE"],
tl, tr, bl, br, geompy.GEOM.ST_ONIN)
edges_onin_quad = geompy.GetShapesOnQuadrangle(f12, geompy.ShapeType["EDGE"],
tl, tr, bl, br, geompy.GEOM.ST_ONIN)
comp = geompy.MakeCompound(edges_onin_quad)
geompy.addToStudy(comp, "Edges of F12 ONIN Quadrangle")
if len( edges_onin_quad ) != 4:
print "Error in GetShapesOnQuadrangle()"
pass
# GetShapesOnQuadrangleIDs
vertices_on_quad_ids = geompy.GetShapesOnQuadrangleIDs(f12, geompy.ShapeType["VERTEX"],
@ -528,6 +541,55 @@ def TestOtherOperations (geompy, math):
geompy.UnionIDs(vertices_on_quad, vertices_on_quad_ids)
geompy.addToStudy(vertices_on_quad, "Group of vertices on Quadrangle F12")
# GetShapesOnBox
edges_on_box = geompy.GetShapesOnBox(b0, part, geompy.ShapeType["EDGE"],
geompy.GEOM.ST_ON)
comp = geompy.MakeCompound(edges_on_box)
geompy.addToStudy(comp, "Edges of part ON box b0")
if len( edges_on_box ) != 12:
print "Error in GetShapesOnBox()"
# GetShapesOnBoxIDs
faces_on_box_ids = geompy.GetShapesOnBoxIDs(b0, part, geompy.ShapeType["FACE"],
geompy.GEOM.ST_ON)
faces_on_box = geompy.CreateGroup(part, geompy.ShapeType["FACE"])
geompy.UnionIDs(faces_on_box, faces_on_box_ids)
geompy.addToStudyInFather(part, faces_on_box, "Group of faces on box b0")
# Prepare arguments for GetShapesOnShape
sph1 = geompy.MakeSphere(50, 50, 50, 40)
sph2 = geompy.MakeSphere(50, 50, -50, 40)
pcyl = geompy.MakeVertex(50, 50, -50)
cyli = geompy.MakeCylinder(pcyl, vz, 40, 100)
fuse = geompy.MakeFuse(sph1, cyli)
fuse = geompy.MakeFuse(fuse, sph2)
# As after Fuse we have a compound, we need to obtain a solid from it
shsh = geompy.SubShapeAll(fuse, geompy.ShapeType["SOLID"])
sh_1 = shsh[0]
geompy.addToStudy(sh_1, "sh_1")
# GetShapesOnShape
faces_in_sh = geompy.GetShapesOnShape(sh_1, part, geompy.ShapeType["FACE"],
geompy.GEOM.ST_IN)
comp = geompy.MakeCompound(faces_in_sh)
geompy.addToStudy(comp, "Faces of part IN shape sh_1")
if len(faces_in_sh) != 11:
print "Error in GetShapesOnShape()"
# GetShapesOnShapeAsCompound
faces_in_sh_c = geompy.GetShapesOnShapeAsCompound(sh_1, part, geompy.ShapeType["FACE"],
geompy.GEOM.ST_IN)
geompy.addToStudy(faces_in_sh_c, "Faces of part IN shape sh_1 (as compound)")
# GetShapesOnShapeIDs
edges_in_sh_ids = geompy.GetShapesOnShapeIDs(sh_1, part, geompy.ShapeType["EDGE"],
geompy.GEOM.ST_IN)
edges_in_sh = geompy.CreateGroup(part, geompy.ShapeType["EDGE"])
geompy.UnionIDs(edges_in_sh, edges_in_sh_ids)
geompy.addToStudyInFather(part, edges_in_sh, "Group of edges in shape sh_1")
if len(edges_in_sh_ids) != 15:
print "Error in GetShapesOnShapeIDs()"
# Prepare arguments for GetInPlace and GetInPlaceByHistory
box5 = geompy.MakeBoxDXDYDZ(100, 100, 100)
box6 = geompy.MakeTranslation(box5, 50, 50, 0)
@ -541,15 +603,9 @@ def TestOtherOperations (geompy, math):
box5_faces = geompy.SubShapeAll(box5, geompy.ShapeType["FACE"])
box6_faces = geompy.SubShapeAll(box6, geompy.ShapeType["FACE"])
ifa = 1
for aface in box5_faces:
geompy.addToStudyInFather(box5, aface, "Face" + `ifa`)
ifa = ifa + 1
ifa = 1
for aface in box6_faces:
geompy.addToStudyInFather(box6, aface, "Face" + `ifa`)
ifa = ifa + 1
for ifa in range(6):
geompy.addToStudyInFather(box5, box5_faces[ifa], "Face" + `ifa + 1`)
geompy.addToStudyInFather(box6, box6_faces[ifa], "Face" + `ifa + 1`)
# GetInPlace(theShapeWhere, theShapeWhat)
ibb = 5
@ -557,19 +613,17 @@ def TestOtherOperations (geompy, math):
for afaces in faces_list:
ifa = 1
for aface in afaces:
refl_box_face = geompy.GetInPlace(part, aface)
if ibb == 6 and (ifa == 2 or ifa == 4):
# use IDL interface directly to avoid error message appearence in Python console
refl_box_face = geompy.ShapesOp.GetInPlace(part, aface)
# For two faces of the tool box
# there is no reflection in the result.
if refl_box_face is not None:
geompy.addToStudyInFather(part, refl_box_face,
"Reflection of face " + `ifa` + " of box " + `ibb`)
error = "Result of GetInPlace must be NULL for face " + `ifa` + " of box " + `ibb`
error = "Result of GetInPlace must be NULL for face "
error += `ifa` + " of box " + `ibb`
raise RuntimeError, error
else:
# use geompy interface
refl_box_face = geompy.GetInPlace(part, aface)
geompy.addToStudyInFather(part, refl_box_face,
"Reflection of face " + `ifa` + " of box " + `ibb`)
ssname = "Reflection of face " + `ifa` + " of box " + `ibb`
geompy.addToStudyInFather(part, refl_box_face, ssname)
ifa = ifa + 1
ibb = ibb + 1
@ -582,18 +636,20 @@ def TestOtherOperations (geompy, math):
for afaces in faces_list:
ifa = 1
for aface in afaces:
ssname = "Reflection of face " + `ifa` + " of box " + `ibb` + " (by history)"
if ibb == 6 and (ifa == 2 or ifa == 4):
# use IDL interface directly to avoid error message appearence in Python console
refl_box_face = geompy.ShapesOp.GetInPlaceByHistory(part, aface)
if refl_box_face is not None:
geompy.addToStudyInFather(part, refl_box_face,
"Reflection of face " + `ifa` + " of box " + `ibb` + " (by history)")
error = "Result of GetInPlaceByHistory must be NULL for face " + `ifa` + " of box " + `ibb`
geompy.addToStudyInFather(part, refl_box_face, ssname)
error = "Result of GetInPlaceByHistory must be NULL for face "
error += `ifa` + " of box " + `ibb`
raise RuntimeError, error
else:
# use geompy interface
refl_box_face = geompy.GetInPlaceByHistory(part, aface)
geompy.addToStudyInFather(part, refl_box_face,
"Reflection of face " + `ifa` + " of box " + `ibb` + " (by history)")
geompy.addToStudyInFather(part, refl_box_face, ssname)
ifa = ifa + 1
ibb = ibb + 1
#END

View File

@ -159,7 +159,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
## Get name for sub-shape aSubObj of shape aMainObj
#
# @ref tui_todo "Example"
# @ref swig_SubShapeAllSorted "Example"
def SubShapeName(self,aSubObj, aMainObj):
# Example: see GEOM_TestAll.py
@ -182,7 +182,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# these arguments description
# \return study entry of the published shape in form of string
#
# @ref tui_todo "Example"
# @ref swig_MakeQuad4Vertices "Example"
def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
# Example: see GEOM_TestAll.py
@ -198,7 +198,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
## Publish in study aShape with name aName as sub-object of previously published aFather
#
# @ref tui_todo "Example"
# @ref swig_SubShapeAllSorted "Example"
def addToStudyInFather(self, aFather, aShape, aName):
# Example: see GEOM_TestAll.py
try:
@ -294,8 +294,8 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @param theVParameter Value of V-parameter on the referenced surface.
# @return New GEOM_Object, containing the created point.
#
# @ref tui_todo "Example"
def MakeVertexOnSurface(self,theRefSurf, theUParameter, theVParameter):
# @ref swig_MakeVertexOnSurface "Example"
def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter):
# Example: see GEOM_TestAll.py
anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
RaiseIfFailed("MakePointOnSurface", self.BasicOp)
@ -305,7 +305,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @param theRefLine1, theRefLine2 The referenced lines.
# @return New GEOM_Object, containing the created point.
#
# @ref tui_todo "Example"
# @ref swig_MakeVertexOnLinesIntersection "Example"
def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2):
# Example: see GEOM_TestAll.py
anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
@ -317,8 +317,8 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @param theParameter Value of parameter on the referenced curve.
# @return New GEOM_Object, containing the created tangent.
#
# @ref tui_todo "Example"
def MakeTangentOnCurve(self,theRefCurve, theParameter):
# @ref swig_MakeTangentOnCurve "Example"
def MakeTangentOnCurve(self, theRefCurve, theParameter):
anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
return anObj
@ -378,7 +378,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @param theFace2 Second of two faces, defining the line.
# @return New GEOM_Object, containing the created line.
#
# @ref tui_todo "Example"
# @ref swig_MakeLineTwoFaces "Example"
def MakeLineTwoFaces(self, theFace1, theFace2):
# Example: see GEOM_TestAll.py
anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
@ -431,8 +431,8 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @param YDX,YDY,YDZ Three components of OY direction
# @return New GEOM_Object, containing the created coordinate system.
#
# @ref tui_todo "Example"
def MakeMarker(self,OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ):
# @ref swig_MakeMarker "Example"
def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ):
# Example: see GEOM_TestAll.py
anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
RaiseIfFailed("MakeMarker", self.BasicOp)
@ -443,7 +443,9 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @param theXVec Vector of X direction
# @param theYVec Vector of Y direction
# @return New GEOM_Object, containing the created coordinate system.
def MakeMarkerPntTwoVec(self,theOrigin, theXVec, theYVec):
#
# @ref swig_MakeMarker "Example"
def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec):
O = self.PointCoordinates( theOrigin )
OXOY = []
for vec in [ theXVec, theYVec ]:
@ -471,7 +473,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @param thePnt3 End point of the arc.
# @return New GEOM_Object, containing the created arc.
#
# @ref tui_todo "Example"
# @ref swig_MakeArc "Example"
def MakeArc(self,thePnt1, thePnt2, thePnt3):
# Example: see GEOM_TestAll.py
anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
@ -485,7 +487,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @param theSense Orientation of the arc
# @return New GEOM_Object, containing the created arc.
#
# @ref tui_todo "Example"
# @ref swig_MakeArc "Example"
def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False):
# Example: see GEOM_TestAll.py
anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
@ -522,7 +524,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
# @return New GEOM_Object, containing the created circle.
#
# @ref tui_todo "Example"
# @ref swig_MakeCircle "Example"
def MakeCircleCenter2Pnt(self,thePnt1, thePnt2, thePnt3):
# Example: see GEOM_example6.py
anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
@ -901,7 +903,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
# @return New GEOM_Object, containing the created shell or solid.
#
# @ref tui_todo "Example"
# @ref swig_todo "Example"
def MakeThruSections(self,theSeqSections,theModeSolid,thePreci,theRuled):
# Example: see GEOM_TestAll.py
anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
@ -935,7 +937,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# orthogonal to the spine tangent in the correspondent point
# @return New GEOM_Object, containing the created pipe.
#
# @ref tui_todo "Example"
# @ref swig_todo "Example"
def MakePipeWithDifferentSections(self, theSeqBases,
theLocations, thePath,
theWithContact, theWithCorrection):
@ -962,7 +964,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# orthogonal to the spine tangent in the correspondent point
# @return New GEOM_Object, containing the created solids.
#
# @ref tui_todo "Example"
# @ref swig_todo "Example"
def MakePipeWithShellSections(self,theSeqBases, theSeqSubBases,
theLocations, thePath,
theWithContact, theWithCorrection):
@ -1008,7 +1010,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @param theLocations - list of corresponding vertexes
# @return New GEOM_Object, containing the created solids.
#
# @ref tui_todo "Example"
# @ref swig_todo "Example"
def MakePipeShellsWithoutPath(self, theSeqBases, theLocations):
anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
@ -1071,7 +1073,8 @@ class geompyDC(GEOM._objref_GEOM_Gen):
## Shortcut to MakeFaceWires()
#
# @ref tui_creation_face "Example"
# @ref tui_creation_face "Example 1"
# \n @ref swig_MakeFaces "Example 2"
def MakeFaces(self,theWires, isPlanarWanted):
# Example: see GEOM_TestOthers.py
anObj = self.MakeFaceWires(theWires, isPlanarWanted)
@ -1120,7 +1123,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @param theShape Shape to count faces of.
# @return Quantity of faces.
#
# @ref tui_todo "Example"
# @ref swig_NumberOfFaces "Example"
def NumberOfFaces(self,theShape):
# Example: see GEOM_TestOthers.py
nb_faces = self.ShapesOp.NumberOfFaces(theShape)
@ -1131,7 +1134,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @param theShape Shape to count edges of.
# @return Quantity of edges.
#
# @ref tui_todo "Example"
# @ref swig_NumberOfEdges "Example"
def NumberOfEdges(self,theShape):
# Example: see GEOM_TestOthers.py
nb_edges = self.ShapesOp.NumberOfEdges(theShape)
@ -1148,7 +1151,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @param theShape Shape to be reversed.
# @return The reversed copy of theShape.
#
# @ref tui_todo "Example"
# @ref swig_ChangeOrientation "Example"
def ChangeOrientation(self,theShape):
# Example: see GEOM_TestAll.py
anObj = self.ShapesOp.ChangeOrientation(theShape)
@ -1157,7 +1160,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
## Shortcut to ChangeOrientation()
#
# @ref tui_todo "Example"
# @ref swig_OrientationChange "Example"
def OrientationChange(self,theShape):
# Example: see GEOM_TestOthers.py
anObj = self.ChangeOrientation(theShape)
@ -1187,7 +1190,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @param theShapeType Type of sub-shapes to be retrieved.
# @return List of sub-shapes of theShape1, shared with theShape2.
#
# @ref tui_todo "Example"
# @ref swig_GetSharedShapes "Example"
def GetSharedShapes(self,theShape1, theShape2, theShapeType):
# Example: see GEOM_TestOthers.py
aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
@ -1205,7 +1208,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
# @return List of all found sub-shapes.
#
# @ref tui_todo "Example"
# @ref swig_GetShapesOnPlane "Example"
def GetShapesOnPlane(self,theShape, theShapeType, theAx1, theState):
# Example: see GEOM_TestOthers.py
aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
@ -1214,7 +1217,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
## Works like the above method, but returns list of sub-shapes indices
#
# @ref tui_todo "Example"
# @ref swig_GetShapesOnPlaneIDs "Example"
def GetShapesOnPlaneIDs(self,theShape, theShapeType, theAx1, theState):
# Example: see GEOM_TestOthers.py
aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
@ -1233,7 +1236,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
# @return List of all found sub-shapes.
#
# @ref tui_todo "Example"
# @ref swig_GetShapesOnPlaneWithLocation "Example"
def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState):
# Example: see GEOM_TestOthers.py
aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
@ -1243,7 +1246,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
## Works like the above method, but returns list of sub-shapes indices
#
# @ref tui_todo "Example"
# @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
# Example: see GEOM_TestOthers.py
aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
@ -1262,7 +1265,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
# @return List of all found sub-shapes.
#
# @ref tui_todo "Example"
# @ref swig_GetShapesOnCylinder "Example"
def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState):
# Example: see GEOM_TestOthers.py
aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
@ -1271,7 +1274,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
## Works like the above method, but returns list of sub-shapes indices
#
# @ref tui_todo "Example"
# @ref swig_GetShapesOnCylinderIDs "Example"
def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
# Example: see GEOM_TestOthers.py
aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
@ -1288,7 +1291,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
# @return List of all found sub-shapes.
#
# @ref tui_todo "Example"
# @ref swig_GetShapesOnSphere "Example"
def GetShapesOnSphere(self,theShape, theShapeType, theCenter, theRadius, theState):
# Example: see GEOM_TestOthers.py
aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
@ -1297,7 +1300,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
## Works like the above method, but returns list of sub-shapes indices
#
# @ref tui_todo "Example"
# @ref swig_GetShapesOnSphereIDs "Example"
def GetShapesOnSphereIDs(self,theShape, theShapeType, theCenter, theRadius, theState):
# Example: see GEOM_TestOthers.py
aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
@ -1316,7 +1319,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
# @return List of all found sub-shapes.
#
# @ref tui_todo "Example"
# @ref swig_GetShapesOnQuadrangle "Example"
def GetShapesOnQuadrangle(self, theShape, theShapeType,
theTopLeftPoint, theTopRigthPoint,
theBottomLeftPoint, theBottomRigthPoint, theState):
@ -1329,7 +1332,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
## Works like the above method, but returns list of sub-shapes indices
#
# @ref tui_todo "Example"
# @ref swig_GetShapesOnQuadrangleIDs "Example"
def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
theTopLeftPoint, theTopRigthPoint,
theBottomLeftPoint, theBottomRigthPoint, theState):
@ -1349,15 +1352,18 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
# @return List of all found sub-shapes.
#
# @ref tui_todo "Example"
def GetShapesOnBox(self,theBox, theShape, theShapeType, theState):
# @ref swig_GetShapesOnBox "Example"
def GetShapesOnBox(self, theBox, theShape, theShapeType, theState):
# Example: see GEOM_TestOthers.py
aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
return aList
## Works like the above method, but returns list of sub-shapes indices
#
def GetShapesOnBoxIDs(self,theBox, theShape, theShapeType, theState):
# @ref swig_GetShapesOnBoxIDs "Example"
def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
# Example: see GEOM_TestOthers.py
aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
return aList
@ -1372,8 +1378,9 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
# @return List of all found sub-shapes.
#
# @ref tui_todo "Example"
# @ref swig_GetShapesOnShape "Example"
def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState):
# Example: see GEOM_TestOthers.py
aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
theShapeType, theState)
RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
@ -1381,7 +1388,9 @@ class geompyDC(GEOM._objref_GEOM_Gen):
## Works like the above method, but returns result as compound
#
# @ref swig_GetShapesOnShapeAsCompound "Example"
def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState):
# Example: see GEOM_TestOthers.py
anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
theShapeType, theState)
RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
@ -1389,7 +1398,9 @@ class geompyDC(GEOM._objref_GEOM_Gen):
## Works like the above method, but returns list of sub-shapes indices
#
# @ref swig_GetShapesOnShapeIDs "Example"
def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
# Example: see GEOM_TestOthers.py
aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
theShapeType, theState)
RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
@ -1401,7 +1412,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @param theShapeWhat Shape, specifying what to find.
# @return Group of all found sub-shapes or a single found sub-shape.
#
# @ref tui_todo "Example"
# @ref swig_GetInPlace "Example"
def GetInPlace(self,theShapeWhere, theShapeWhat):
# Example: see GEOM_TestOthers.py
anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
@ -1422,7 +1433,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# building history of the ShapeWhere).
# @return Group of all found sub-shapes or a single found sub-shape.
#
# @ref tui_todo "Example"
# @ref swig_GetInPlace "Example"
def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat):
# Example: see GEOM_TestOthers.py
anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
@ -1435,7 +1446,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @param theShapeWhat Shape, specifying what to find.
# @return New GEOM_Object for found sub-shape.
#
# @ref tui_todo "Example"
# @ref swig_GetSame "Example"
def GetSame(self,theShapeWhere, theShapeWhat):
anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
RaiseIfFailed("GetSame", self.ShapesOp)
@ -1450,7 +1461,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
# of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
#
# @ref tui_todo "Example"
# @ref swig_all_decompose "Example"
def GetSubShape(self, aShape, ListOfID):
# Example: see GEOM_TestAll.py
anObj = self.AddSubShape(aShape,ListOfID)
@ -1458,7 +1469,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
#
# @ref tui_todo "Example"
# @ref swig_all_decompose "Example"
def GetSubShapeID(self, aShape, aSubShape):
# Example: see GEOM_TestAll.py
anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
@ -1468,7 +1479,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# end of l4_access
## @}
## @addtogroup l4_decompose Decompose objects
## @addtogroup l4_decompose
## @{
## Explode a shape on subshapes of a given type.
@ -1476,7 +1487,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @param aType Type of sub-shapes to be retrieved.
# @return List of sub-shapes of type theShapeType, contained in theShape.
#
# @ref tui_todo "Example"
# @ref swig_all_decompose "Example"
def SubShapeAll(self, aShape, aType):
# Example: see GEOM_TestAll.py
ListObj = self.ShapesOp.MakeExplode(aShape,aType,0)
@ -1488,7 +1499,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @param aType Type of sub-shapes to be retrieved.
# @return List of IDs of sub-shapes.
#
# @ref tui_todo "Example"
# @ref swig_all_decompose "Example"
def SubShapeAllIDs(self, aShape, aType):
ListObj = self.ShapesOp.SubShapeAllIDs(aShape,aType,0)
RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
@ -1500,7 +1511,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @param aType Type of sub-shapes to be retrieved.
# @return List of sub-shapes of type theShapeType, contained in theShape.
#
# @ref tui_working_with_groups_page "Example"
# @ref swig_SubShapeAllSorted "Example"
def SubShapeAllSorted(self, aShape, aType):
# Example: see GEOM_TestAll.py
ListObj = self.ShapesOp.MakeExplode(aShape,aType,1)
@ -1513,7 +1524,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @param aType Type of sub-shapes to be retrieved.
# @return List of IDs of sub-shapes.
#
# @ref tui_todo "Example"
# @ref swig_all_decompose "Example"
def SubShapeAllSortedIDs(self, aShape, aType):
ListIDs = self.ShapesOp.SubShapeAllIDs(aShape,aType,1)
RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
@ -1523,7 +1534,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# selected by they indices in list of all sub-shapes of type <VAR>aType</VAR>.
# Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
#
# @ref tui_todo "Example"
# @ref swig_all_decompose "Example"
def SubShape(self, aShape, aType, ListOfInd):
# Example: see GEOM_TestAll.py
ListOfIDs = []
@ -1537,7 +1548,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
# Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
#
# @ref tui_todo "Example"
# @ref swig_all_decompose "Example"
def SubShapeSorted(self,aShape, aType, ListOfInd):
# Example: see GEOM_TestAll.py
ListOfIDs = []
@ -1663,7 +1674,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @param theObject Shape to be processed.
# @update given shape
#
# @ref tui_todo "Example"
# @ref swig_todo "Example"
def ChangeOrientationShell(self,theObject):
theObject = self.HealOp.ChangeOrientation(theObject)
RaiseIfFailed("ChangeOrientation", self.HealOp)
@ -1673,7 +1684,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @param theObject Shape to be processed.
# @return New GEOM_Object, containing processed shape.
#
# @ref tui_todo "Example"
# @ref swig_todo "Example"
def ChangeOrientationShellCopy(self,theObject):
anObj = self.HealOp.ChangeOrientationCopy(theObject)
RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
@ -1715,7 +1726,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# which can be considered as coincident.
# @return ListOfGO.
#
# @ref tui_todo "Example"
# @ref swig_todo "Example"
def GetGlueFaces(self, theShape, theTolerance):
# Example: see GEOM_Spanner.py
anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
@ -1733,7 +1744,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @return New GEOM_Object, containing a copy of theShape
# without some faces.
#
# @ref tui_todo "Example"
# @ref swig_todo "Example"
def MakeGlueFacesByList(self, theShape, theTolerance, theFaces, doKeepNonSolids=True):
# Example: see GEOM_Spanner.py
anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces, doKeepNonSolids)
@ -1767,28 +1778,32 @@ class geompyDC(GEOM._objref_GEOM_Gen):
## Shortcut to MakeBoolean(s1, s2, 1)
#
# @ref tui_common "Example"
# @ref tui_common "Example 1"
# \n @ref swig_MakeCommon "Example 2"
def MakeCommon(self, s1, s2):
# Example: see GEOM_TestOthers.py
return self.MakeBoolean(s1, s2, 1)
## Shortcut to MakeBoolean(s1, s2, 2)
#
# @ref tui_cut "Example"
# @ref tui_cut "Example 1"
# \n @ref swig_MakeCommon "Example 2"
def MakeCut(self, s1, s2):
# Example: see GEOM_TestOthers.py
return self.MakeBoolean(s1, s2, 2)
## Shortcut to MakeBoolean(s1, s2, 3)
#
# @ref tui_fuse "Example"
# @ref tui_fuse "Example 1"
# \n @ref swig_MakeCommon "Example 2"
def MakeFuse(self, s1, s2):
# Example: see GEOM_TestOthers.py
return self.MakeBoolean(s1, s2, 3)
## Shortcut to MakeBoolean(s1, s2, 4)
#
# @ref tui_section "Example"
# @ref tui_section "Example 1"
# \n @ref swig_MakeCommon "Example 2"
def MakeSection(self, s1, s2):
# Example: see GEOM_TestOthers.py
return self.MakeBoolean(s1, s2, 4)
@ -1849,7 +1864,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
#
# @return New GEOM_Object, containing the result shapes.
#
# @ref tui_todo "Example"
# @ref swig_todo "Example"
def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
ListKeepInside=[], ListRemoveInside=[],
Limit=ShapeType["SHAPE"], RemoveWebs=0,
@ -1863,7 +1878,8 @@ class geompyDC(GEOM._objref_GEOM_Gen):
## Shortcut to MakePartition()
#
# @ref tui_partition "Example"
# @ref tui_partition "Example 1"
# \n @ref swig_Partition "Example 2"
def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
KeepNonlimitShapes=0):
@ -1899,7 +1915,8 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @param thePoint2 End point of translation vector.
# @return New GEOM_Object, containing the translated object.
#
# @ref tui_translation "Example"
# @ref tui_translation "Example 1"
# \n @ref swig_MakeTranslationTwoPoints "Example 2"
def MakeTranslationTwoPoints(self,theObject, thePoint1, thePoint2):
# Example: see GEOM_TestAll.py
anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
@ -2133,6 +2150,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
return anObj
## The same, as MultiRotate1D(), but axis is given by direction and point
# @ref swig_MakeMultiRotation "Example"
def MakeMultiRotation1D(self,aShape,aDir,aPoint,aNbTimes):
# Example: see GEOM_TestOthers.py
aVec = self.MakeLine(aPoint,aDir)
@ -2140,6 +2158,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
return anObj
## The same, as MultiRotate2D(), but axis is given by direction and point
# @ref swig_MakeMultiRotation "Example"
def MakeMultiRotation2D(self,aShape,aDir,aPoint,anAngle,nbtimes1,aStep,nbtimes2):
# Example: see GEOM_TestOthers.py
aVec = self.MakeLine(aPoint,aDir)
@ -2157,7 +2176,8 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @param theR Fillet radius.
# @return New GEOM_Object, containing the result shape.
#
# @ref tui_fillet "Example"
# @ref tui_fillet "Example 1"
# \n @ref swig_MakeFilletAll "Example 2"
def MakeFilletAll(self,theShape, theR):
# Example: see GEOM_TestOthers.py
anObj = self.LocalOp.MakeFilletAll(theShape, theR)
@ -2200,7 +2220,8 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @param theD Chamfer size along each face.
# @return New GEOM_Object, containing the result shape.
#
# @ref tui_chamfer "Example"
# @ref tui_chamfer "Example 1"
# \n @ref swig_MakeChamferAll "Example 2"
def MakeChamferAll(self,theShape, theD):
# Example: see GEOM_TestOthers.py
anObj = self.LocalOp.MakeChamferAll(theShape, theD)
@ -2223,7 +2244,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
RaiseIfFailed("MakeChamferEdge", self.LocalOp)
return anObj
## The Same that MakeChamferEdge but with params theD is chamfer lenght and
## The Same that MakeChamferEdge but with params theD is chamfer length and
# theAngle is Angle of chamfer (angle in radians)
def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2):
anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
@ -2250,6 +2271,8 @@ class geompyDC(GEOM._objref_GEOM_Gen):
## The Same that MakeChamferFaces but with params theD is chamfer lenght and
# theAngle is Angle of chamfer (angle in radians)
#
# @ref swig_FilletChamfer "Example"
def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces):
anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
@ -2262,7 +2285,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @param theEdges Sequence of edges of \a theShape.
# @return New GEOM_Object, containing the result shape.
#
# @ref tui_todo "Example"
# @ref swig_FilletChamfer "Example"
def MakeChamferEdges(self, theShape, theD1, theD2, theEdges):
anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
RaiseIfFailed("MakeChamferEdges", self.LocalOp)
@ -2270,14 +2293,14 @@ class geompyDC(GEOM._objref_GEOM_Gen):
## The Same that MakeChamferEdges but with params theD is chamfer lenght and
# theAngle is Angle of chamfer (angle in radians)
#
# @ref tui_todo "Example"
def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges):
anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
return anObj
## Shortcut to MakeChamferEdge() and MakeChamferFaces()
#
# @ref swig_MakeChamfer "Example"
def MakeChamfer(self,aShape,d1,d2,aShapeType,ListShape):
# Example: see GEOM_TestOthers.py
anObj = None
@ -2382,7 +2405,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @param theShape1,theShape2 Shapes to find minimal distance between.
# @return Value of the minimal distance between the given shapes.
#
# @ref tui_todo "Example"
# @ref swig_all_measure "Example"
def MinDistanceComponents(self, theShape1, theShape2):
# Example: see GEOM_TestMeasures.py
aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
@ -2407,7 +2430,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
## @{
## Measure curvature of a curve at a point, set by parameter.
# @ref tui_todo "Example"
# @ref swig_todo "Example"
def CurveCurvatureByParam(self, theCurve, theParam):
# Example: see GEOM_TestMeasures.py
aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
@ -2415,7 +2438,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
return aCurv
## @details
# @ref tui_todo "Example"
# @ref swig_todo "Example"
def CurveCurvatureByPoint(self, theCurve, thePoint):
aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
@ -2428,7 +2451,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
## @{
## @details
## @ref tui_todo "Example"
## @ref swig_todo "Example"
def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
# Example: see GEOM_TestMeasures.py
aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
@ -2436,21 +2459,21 @@ class geompyDC(GEOM._objref_GEOM_Gen):
return aSurf
## @details
## @ref tui_todo "Example"
## @ref swig_todo "Example"
def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
return aSurf
## @details
## @ref tui_todo "Example"
## @ref swig_todo "Example"
def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
return aSurf
## @details
## @ref tui_todo "Example"
## @ref swig_todo "Example"
def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
@ -2499,7 +2522,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @param theOptionalPoint Point to compute the normale at.
# @return New GEOM_Object, containing the created vector.
#
# @ref tui_todo "Example"
# @ref swig_todo "Example"
def GetNormal(self, theFace, theOptionalPoint = None):
# Example: see GEOM_TestMeasures.py
anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
@ -2538,7 +2561,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
# Xx,Xy,Xz: Coordinates of shape's LCS X direction.
#
# @ref tui_todo "Example"
# @ref swig_todo "Example"
def GetPosition(self,theShape):
# Example: see GEOM_TestMeasures.py
aTuple = self.MeasuOp.GetPosition(theShape)
@ -2593,7 +2616,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
#
# - geompy.kind.VERTEX x y z
#
# @ref tui_todo "Example"
# @ref swig_todo "Example"
def KindOfShape(self,theShape):
# Example: see GEOM_TestMeasures.py
aRoughTuple = self.MeasuOp.KindOfShape(theShape)
@ -2627,7 +2650,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# Available formats can be obtained with InsertOp.ImportTranslators() method.
# @return New GEOM_Object, containing the imported shape.
#
# @ref tui_todo "Example"
# @ref swig_Import_Export "Example"
def Import(self,theFileName, theFormatName):
# Example: see GEOM_TestOthers.py
anObj = self.InsertOp.Import(theFileName, theFormatName)
@ -2636,21 +2659,21 @@ class geompyDC(GEOM._objref_GEOM_Gen):
## Shortcut to Import() for BREP format
#
# @ref tui_todo "Example"
# @ref swig_Import_Export "Example"
def ImportBREP(self,theFileName):
# Example: see GEOM_TestOthers.py
return self.Import(theFileName, "BREP")
## Shortcut to Import() for IGES format
#
# @ref tui_todo "Example"
# @ref swig_Import_Export "Example"
def ImportIGES(self,theFileName):
# Example: see GEOM_TestOthers.py
return self.Import(theFileName, "IGES")
## Shortcut to Import() for STEP format
#
# @ref tui_todo "Example"
# @ref swig_Import_Export "Example"
def ImportSTEP(self,theFileName):
# Example: see GEOM_TestOthers.py
return self.Import(theFileName, "STEP")
@ -2661,7 +2684,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @param theFormatName Specify format for the shape storage.
# Available formats can be obtained with InsertOp.ImportTranslators() method.
#
# @ref tui_todo "Example"
# @ref swig_Import_Export "Example"
def Export(self,theObject, theFileName, theFormatName):
# Example: see GEOM_TestOthers.py
self.InsertOp.Export(theObject, theFileName, theFormatName)
@ -2672,21 +2695,21 @@ class geompyDC(GEOM._objref_GEOM_Gen):
## Shortcut to Export() for BREP format
#
# @ref tui_todo "Example"
# @ref swig_Import_Export "Example"
def ExportBREP(self,theObject, theFileName):
# Example: see GEOM_TestOthers.py
return self.Export(theObject, theFileName, "BREP")
## Shortcut to Export() for IGES format
#
# @ref tui_todo "Example"
# @ref swig_Import_Export "Example"
def ExportIGES(self,theObject, theFileName):
# Example: see GEOM_TestOthers.py
return self.Export(theObject, theFileName, "IGES")
## Shortcut to Export() for STEP format
#
# @ref tui_todo "Example"
# @ref swig_Import_Export "Example"
def ExportSTEP(self,theObject, theFileName):
# Example: see GEOM_TestOthers.py
return self.Export(theObject, theFileName, "STEP")
@ -2726,7 +2749,8 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @param V1,V2,V3,V4 Corner vertices for the face.
# @return New GEOM_Object, containing the created face.
#
# @ref tui_building_by_blocks_page "Example"
# @ref tui_building_by_blocks_page "Example 1"
# \n @ref swig_MakeQuad4Vertices "Example 2"
def MakeQuad4Vertices(self,V1, V2, V3, V4):
# Example: see GEOM_Spanner.py
anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
@ -2738,7 +2762,8 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
# @return New GEOM_Object, containing the created solid.
#
# @ref tui_building_by_blocks_page "Example"
# @ref tui_building_by_blocks_page "Example 1"
# \n @ref swig_MakeHexa "Example 2"
def MakeHexa(self,F1, F2, F3, F4, F5, F6):
# Example: see GEOM_Spanner.py
anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
@ -2750,7 +2775,8 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @param F1,F2 Two opposite faces for the hexahedral solid.
# @return New GEOM_Object, containing the created solid.
#
# @ref tui_building_by_blocks_page "Example"
# @ref tui_building_by_blocks_page "Example 1"
# \n @ref swig_MakeHexa2Faces "Example 2"
def MakeHexa2Faces(self,F1, F2):
# Example: see GEOM_Spanner.py
anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
@ -2770,7 +2796,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# vertex and point with the given coordinates.
# @return New GEOM_Object, containing the found vertex.
#
# @ref tui_todo "Example"
# @ref swig_GetPoint "Example"
def GetPoint(self,theShape, theX, theY, theZ, theEpsilon):
# Example: see GEOM_TestOthers.py
anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
@ -2782,7 +2808,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
# @return New GEOM_Object, containing the found edge.
#
# @ref tui_todo "Example"
# @ref swig_todo "Example"
def GetEdge(self,theShape, thePoint1, thePoint2):
# Example: see GEOM_Spanner.py
anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
@ -2794,7 +2820,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @param thePoint Point, close to the desired edge.
# @return New GEOM_Object, containing the found edge.
#
# @ref tui_todo "Example"
# @ref swig_GetEdgeNearPoint "Example"
def GetEdgeNearPoint(self,theShape, thePoint):
# Example: see GEOM_TestOthers.py
anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
@ -2806,7 +2832,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
# @return New GEOM_Object, containing the found face.
#
# @ref tui_todo "Example"
# @ref swig_todo "Example"
def GetFaceByPoints(self,theShape, thePoint1, thePoint2, thePoint3, thePoint4):
# Example: see GEOM_Spanner.py
anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
@ -2818,7 +2844,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
# @return New GEOM_Object, containing the found face.
#
# @ref tui_todo "Example"
# @ref swig_todo "Example"
def GetFaceByEdges(self,theShape, theEdge1, theEdge2):
# Example: see GEOM_Spanner.py
anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
@ -2830,7 +2856,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @param theFace Face of \a theBlock, opposite to the desired face.
# @return New GEOM_Object, containing the found face.
#
# @ref tui_todo "Example"
# @ref swig_GetOppositeFace "Example"
def GetOppositeFace(self,theBlock, theFace):
# Example: see GEOM_Spanner.py
anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
@ -2842,7 +2868,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @param thePoint Point, close to the desired face.
# @return New GEOM_Object, containing the found face.
#
# @ref tui_todo "Example"
# @ref swig_GetFaceNearPoint "Example"
def GetFaceNearPoint(self,theShape, thePoint):
# Example: see GEOM_Spanner.py
anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
@ -2854,7 +2880,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @param theVector Vector, close to the normale of the desired face.
# @return New GEOM_Object, containing the found face.
#
# @ref tui_todo "Example"
# @ref swig_todo "Example"
def GetFaceByNormale(self, theBlock, theVector):
# Example: see GEOM_Spanner.py
anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
@ -2878,7 +2904,8 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @return TRUE, if the given shape is a compound of blocks.
# If theCompound is not valid, prints all discovered errors.
#
# @ref tui_measurement_tools_page "Example"
# @ref tui_measurement_tools_page "Example 1"
# \n @ref swig_CheckCompoundOfBlocks "Example 2"
def CheckCompoundOfBlocks(self,theCompound):
# Example: see GEOM_Spanner.py
(IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
@ -2894,7 +2921,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @param theShape The compound or single solid to remove irregular edges from.
# @return Improved shape.
#
# @ref tui_todo "Example"
# @ref swig_RemoveExtraEdges "Example"
def RemoveExtraEdges(self,theShape):
# Example: see GEOM_TestOthers.py
anObj = self.BlocksOp.RemoveExtraEdges(theShape)
@ -2907,7 +2934,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @param theShape The compound to check and improve.
# @return Improved compound.
#
# @ref tui_todo "Example"
# @ref swig_CheckAndImprove "Example"
def CheckAndImprove(self,theShape):
# Example: see GEOM_TestOthers.py
anObj = self.BlocksOp.CheckAndImprove(theShape)
@ -2927,7 +2954,8 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# \note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
# @return List of GEOM_Objects, containing the retrieved blocks.
#
# @ref tui_explode_on_blocks "Example"
# @ref tui_explode_on_blocks "Example 1"
# \n @ref swig_MakeBlockExplode "Example 2"
def MakeBlockExplode(self,theCompound, theMinNbFaces, theMaxNbFaces):
# Example: see GEOM_TestOthers.py
aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
@ -2940,7 +2968,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# boundary between some blocks, we return block with nearest center.
# @return New GEOM_Object, containing the found block.
#
# @ref tui_todo "Example"
# @ref swig_todo "Example"
def GetBlockNearPoint(self,theCompound, thePoint):
# Example: see GEOM_Spanner.py
anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
@ -2952,7 +2980,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
# @return New GEOM_Object, containing the found block.
#
# @ref tui_todo "Example"
# @ref swig_GetBlockByParts "Example"
def GetBlockByParts(self,theCompound, theParts):
# Example: see GEOM_TestOthers.py
anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
@ -2964,7 +2992,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
# @return List of GEOM_Objects, containing the found blocks.
#
# @ref tui_todo "Example"
# @ref swig_todo "Example"
def GetBlocksByParts(self,theCompound, theParts):
# Example: see GEOM_Spanner.py
aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
@ -3010,7 +3038,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @param theShape Shape to build propagation groups on.
# @return List of GEOM_Objects, each of them is a propagation group.
#
# @ref tui_propagate "Example"
# @ref swig_Propagate "Example"
def Propagate(self,theShape):
# Example: see GEOM_TestOthers.py
listChains = self.BlocksOp.Propagate(theShape)
@ -3028,7 +3056,8 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @param theShapeType defines a shape type of the group
# @return a newly created GEOM group
#
# @ref tui_working_with_groups_page "Example"
# @ref tui_working_with_groups_page "Example 1"
# \n @ref swig_CreateGroup "Example 2"
def CreateGroup(self,theMainShape, theShapeType):
# Example: see GEOM_TestOthers.py
anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
@ -3073,7 +3102,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
## Works like the above method, but argument
# theSubShapes here is a list of sub-shapes indices
#
# @ref tui_todo "Example"
# @ref swig_UnionIDs "Example"
def UnionIDs(self,theGroup, theSubShapes):
# Example: see GEOM_TestOthers.py
self.GroupOp.UnionIDs(theGroup, theSubShapes)
@ -3094,7 +3123,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
## Works like the above method, but argument
# theSubShapes here is a list of sub-shapes indices
#
# @ref tui_todo "Example"
# @ref swig_DifferenceIDs "Example"
def DifferenceIDs(self,theGroup, theSubShapes):
# Example: see GEOM_TestOthers.py
self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
@ -3104,7 +3133,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
## Returns a list of sub objects ID stored in the group
# @param theGroup is a GEOM group for which a list of IDs is requested
#
# @ref tui_todo "Example"
# @ref swig_GetObjectIDs "Example"
def GetObjectIDs(self,theGroup):
# Example: see GEOM_TestOthers.py
ListIDs = self.GroupOp.GetObjects(theGroup)
@ -3114,7 +3143,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
## Returns a type of sub objects stored in the group
# @param theGroup is a GEOM group which type is returned.
#
# @ref tui_todo "Example"
# @ref swig_GetType "Example"
def GetType(self,theGroup):
# Example: see GEOM_TestOthers.py
aType = self.GroupOp.GetType(theGroup)
@ -3125,7 +3154,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @param theGroup is a GEOM group for which a main shape object is requested
# @return a GEOM object which is a main shape for theGroup
#
# @ref tui_todo "Example"
# @ref swig_GetMainShape "Example"
def GetMainShape(self,theGroup):
# Example: see GEOM_TestOthers.py
anObj = self.GroupOp.GetMainShape(theGroup)
@ -3135,7 +3164,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
## Create group of edges of theShape, whose length is in range [min_length, max_length].
# If include_min/max == 0, edges with length == min/max_length will not be included in result.
#
# @ref tui_todo "Example"
# @ref swig_todo "Example"
def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1):
edges = self.SubShapeAll(theShape, ShapeType["EDGE"])
edges_in_range = []
@ -3162,7 +3191,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
## Create group of edges of selected shape, whose length is in range [min_length, max_length].
# If include_min/max == 0, edges with length == min/max_length will not be included in result.
#
# @ref tui_todo "Example"
# @ref swig_todo "Example"
def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
nb_selected = sg.SelectedCount()
if nb_selected < 1:
@ -3195,7 +3224,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
## Create a copy of the given object
# @ingroup l1_geompy_auxiliary
#
# @ref tui_todo "Example"
# @ref swig_all_advanced "Example"
def MakeCopy(self,theOriginal):
# Example: see GEOM_TestAll.py
anObj = self.InsertOp.MakeCopy(theOriginal)