1 # GEOM GEOM_SWIG : binding of C++ omplementaion with Python
3 # Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 # This library is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU Lesser General Public
8 # License as published by the Free Software Foundation; either
9 # version 2.1 of the License.
11 # This library is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # Lesser General Public License for more details.
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with this library; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
25 # Author : Paul RASCLE, EDF
34 ## @defgroup l1_geompy_auxiliary Auxiliary data structures and methods
36 ## @defgroup l1_geompy_purpose All package methods, grouped by their purpose
38 ## @defgroup l2_import_export Importing/exporting geometrical objects
39 ## @defgroup l2_creating Creating geometrical objects
41 ## @defgroup l3_basic_go Creating Basic Geometric Objects
43 ## @defgroup l4_curves Creating Curves
46 ## @defgroup l3_3d_primitives Creating 3D Primitives
47 ## @defgroup l3_complex Creating Complex Objects
48 ## @defgroup l3_groups Working with groups
49 ## @defgroup l3_blocks Building by blocks
51 ## @defgroup l4_blocks_measure Check and Improve
54 ## @defgroup l3_sketcher Sketcher
55 ## @defgroup l3_advanced Creating Advanced Geometrical Objects
57 ## @defgroup l4_decompose Decompose objects
58 ## @defgroup l4_access Access to sub-shapes by their unique IDs inside the main shape
59 ## @defgroup l4_obtain Access to subshapes by a criteria
64 ## @defgroup l2_transforming Transforming geometrical objects
66 ## @defgroup l3_basic_op Basic Operations
67 ## @defgroup l3_boolean Boolean Operations
68 ## @defgroup l3_transform Transformation Operations
69 ## @defgroup l3_local Local Operations (Fillet and Chamfer)
70 ## @defgroup l3_blocks_op Blocks Operations
71 ## @defgroup l3_healing Repairing Operations
72 ## @defgroup l3_restore_ss Restore presentation parameters and a tree of subshapes
75 ## @defgroup l2_measure Using measurement tools
86 ## Enumeration ShapeType as a dictionary
87 # @ingroup l1_geompy_auxiliary
88 ShapeType = {"COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8}
90 ## Raise an Error, containing the Method_name, if Operation is Failed
91 ## @ingroup l1_geompy_auxiliary
92 def RaiseIfFailed (Method_name, Operation):
93 if Operation.IsDone() == 0 and Operation.GetErrorCode() != "NOT_FOUND_ANY":
94 raise RuntimeError, Method_name + " : " + Operation.GetErrorCode()
96 ## Kinds of shape enumeration
97 # @ingroup l1_geompy_auxiliary
98 kind = GEOM.GEOM_IKindOfShape
100 ## Information about closed/unclosed state of shell or wire
101 # @ingroup l1_geompy_auxiliary
108 class geompyDC(GEOM._objref_GEOM_Gen):
110 ## @addtogroup l1_geompy_auxiliary
113 GEOM._objref_GEOM_Gen.__init__(self)
114 self.myBuilder = None
132 def init_geom(self,theStudy):
133 self.myStudy = theStudy
134 self.myStudyId = self.myStudy._get_StudyId()
135 self.myBuilder = self.myStudy.NewBuilder()
136 self.father = self.myStudy.FindComponent("GEOM")
137 if self.father is None:
138 self.father = self.myBuilder.NewComponent("GEOM")
139 A1 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributeName")
140 FName = A1._narrow(SALOMEDS.AttributeName)
141 FName.SetValue("Geometry")
142 A2 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributePixMap")
143 aPixmap = A2._narrow(SALOMEDS.AttributePixMap)
144 aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry")
145 self.myBuilder.DefineComponentInstance(self.father,self)
147 self.BasicOp = self.GetIBasicOperations (self.myStudyId)
148 self.CurvesOp = self.GetICurvesOperations (self.myStudyId)
149 self.PrimOp = self.GetI3DPrimOperations (self.myStudyId)
150 self.ShapesOp = self.GetIShapesOperations (self.myStudyId)
151 self.HealOp = self.GetIHealingOperations (self.myStudyId)
152 self.InsertOp = self.GetIInsertOperations (self.myStudyId)
153 self.BoolOp = self.GetIBooleanOperations (self.myStudyId)
154 self.TrsfOp = self.GetITransformOperations(self.myStudyId)
155 self.LocalOp = self.GetILocalOperations (self.myStudyId)
156 self.MeasuOp = self.GetIMeasureOperations (self.myStudyId)
157 self.BlocksOp = self.GetIBlocksOperations (self.myStudyId)
158 self.GroupOp = self.GetIGroupOperations (self.myStudyId)
161 ## Get name for sub-shape aSubObj of shape aMainObj
163 # @ref swig_SubShapeAllSorted "Example"
164 def SubShapeName(self,aSubObj, aMainObj):
165 # Example: see GEOM_TestAll.py
167 #aSubId = orb.object_to_string(aSubObj)
168 #aMainId = orb.object_to_string(aMainObj)
169 #index = gg.getIndexTopology(aSubId, aMainId)
170 #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
171 index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
172 name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
175 ## Publish in study aShape with name aName
177 # \param aShape the shape to be published
178 # \param aName the name for the shape
179 # \param doRestoreSubShapes if True, finds and publishes also
180 # sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
181 # and published sub-shapes of arguments
182 # \param theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes for
183 # these arguments description
184 # \return study entry of the published shape in form of string
186 # @ref swig_MakeQuad4Vertices "Example"
187 def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
188 theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
189 # Example: see GEOM_TestAll.py
191 aSObject = self.AddInStudy(self.myStudy, aShape, aName, None)
192 if doRestoreSubShapes:
193 self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs,
194 theFindMethod, theInheritFirstArg)
196 print "addToStudy() failed"
198 return aShape.GetStudyEntry()
200 ## Publish in study aShape with name aName as sub-object of previously published aFather
202 # @ref swig_SubShapeAllSorted "Example"
203 def addToStudyInFather(self, aFather, aShape, aName):
204 # Example: see GEOM_TestAll.py
206 aSObject = self.AddInStudy(myStudy, aShape, aName, aFather)
208 print "addToStudyInFather() failed"
210 return aShape.GetStudyEntry()
212 # end of l1_geompy_auxiliary
215 ## @addtogroup l3_restore_ss
218 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
219 # To be used from python scripts out of geompy.addToStudy (non-default usage)
220 # \param theObject published GEOM object, arguments of which will be published
221 # \param theArgs list of GEOM_Object, operation arguments to be published.
222 # If this list is empty, all operation arguments will be published
223 # \param theFindMethod method to search subshapes, corresponding to arguments and
224 # their subshapes. Value from enumeration GEOM::find_shape_method.
225 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
226 # Do not publish subshapes in place of arguments, but only
227 # in place of subshapes of the first argument,
228 # because the whole shape corresponds to the first argument.
229 # Mainly to be used after transformations, but it also can be
230 # usefull after partition with one object shape, and some other
231 # operations, where only the first argument has to be considered.
232 # If theObject has only one argument shape, this flag is automatically
233 # considered as True, not regarding really passed value.
234 # \return True in case of success, False otherwise.
236 # @ref tui_restore_prs_params "Example"
237 def RestoreSubShapes (self, theObject, theArgs=[],
238 theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
239 # Example: see GEOM_TestAll.py
240 return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
241 theFindMethod, theInheritFirstArg)
243 # end of l3_restore_ss
246 ## @addtogroup l3_basic_go
249 ## Create point by three coordinates.
250 # @param theX The X coordinate of the point.
251 # @param theY The Y coordinate of the point.
252 # @param theZ The Z coordinate of the point.
253 # @return New GEOM_Object, containing the created point.
255 # @ref tui_creation_point "Example"
256 def MakeVertex(self,theX, theY, theZ):
257 # Example: see GEOM_TestAll.py
258 anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
259 RaiseIfFailed("MakePointXYZ", self.BasicOp)
262 ## Create a point, distant from the referenced point
263 # on the given distances along the coordinate axes.
264 # @param theReference The referenced point.
265 # @param theX Displacement from the referenced point along OX axis.
266 # @param theY Displacement from the referenced point along OY axis.
267 # @param theZ Displacement from the referenced point along OZ axis.
268 # @return New GEOM_Object, containing the created point.
270 # @ref tui_creation_point "Example"
271 def MakeVertexWithRef(self,theReference, theX, theY, theZ):
272 # Example: see GEOM_TestAll.py
273 anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
274 RaiseIfFailed("MakePointWithReference", self.BasicOp)
277 ## Create a point, corresponding to the given parameter on the given curve.
278 # @param theRefCurve The referenced curve.
279 # @param theParameter Value of parameter on the referenced curve.
280 # @return New GEOM_Object, containing the created point.
282 # @ref tui_creation_point "Example"
283 def MakeVertexOnCurve(self,theRefCurve, theParameter):
284 # Example: see GEOM_TestAll.py
285 anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter)
286 RaiseIfFailed("MakePointOnCurve", self.BasicOp)
289 ## Create a point, corresponding to the given parameters on the
291 # @param theRefSurf The referenced surface.
292 # @param theUParameter Value of U-parameter on the referenced surface.
293 # @param theVParameter Value of V-parameter on the referenced surface.
294 # @return New GEOM_Object, containing the created point.
296 # @ref swig_MakeVertexOnSurface "Example"
297 def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter):
298 # Example: see GEOM_TestAll.py
299 anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
300 RaiseIfFailed("MakePointOnSurface", self.BasicOp)
303 ## Create a point on intersection of two lines.
304 # @param theRefLine1, theRefLine2 The referenced lines.
305 # @return New GEOM_Object, containing the created point.
307 # @ref swig_MakeVertexOnLinesIntersection "Example"
308 def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2):
309 # Example: see GEOM_TestAll.py
310 anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
311 RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
314 ## Create a tangent, corresponding to the given parameter on the given curve.
315 # @param theRefCurve The referenced curve.
316 # @param theParameter Value of parameter on the referenced curve.
317 # @return New GEOM_Object, containing the created tangent.
319 # @ref swig_MakeTangentOnCurve "Example"
320 def MakeTangentOnCurve(self, theRefCurve, theParameter):
321 anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
322 RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
325 ## Create a vector with the given components.
326 # @param theDX X component of the vector.
327 # @param theDY Y component of the vector.
328 # @param theDZ Z component of the vector.
329 # @return New GEOM_Object, containing the created vector.
331 # @ref tui_creation_vector "Example"
332 def MakeVectorDXDYDZ(self,theDX, theDY, theDZ):
333 # Example: see GEOM_TestAll.py
334 anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
335 RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
338 ## Create a vector between two points.
339 # @param thePnt1 Start point for the vector.
340 # @param thePnt2 End point for the vector.
341 # @return New GEOM_Object, containing the created vector.
343 # @ref tui_creation_vector "Example"
344 def MakeVector(self,thePnt1, thePnt2):
345 # Example: see GEOM_TestAll.py
346 anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
347 RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
350 ## Create a line, passing through the given point
351 # and parrallel to the given direction
352 # @param thePnt Point. The resulting line will pass through it.
353 # @param theDir Direction. The resulting line will be parallel to it.
354 # @return New GEOM_Object, containing the created line.
356 # @ref tui_creation_line "Example"
357 def MakeLine(self,thePnt, theDir):
358 # Example: see GEOM_TestAll.py
359 anObj = self.BasicOp.MakeLine(thePnt, theDir)
360 RaiseIfFailed("MakeLine", self.BasicOp)
363 ## Create a line, passing through the given points
364 # @param thePnt1 First of two points, defining the line.
365 # @param thePnt2 Second of two points, defining the line.
366 # @return New GEOM_Object, containing the created line.
368 # @ref tui_creation_line "Example"
369 def MakeLineTwoPnt(self,thePnt1, thePnt2):
370 # Example: see GEOM_TestAll.py
371 anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
372 RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
375 ## Create a line on two faces intersection.
376 # @param theFace1 First of two faces, defining the line.
377 # @param theFace2 Second of two faces, defining the line.
378 # @return New GEOM_Object, containing the created line.
380 # @ref swig_MakeLineTwoFaces "Example"
381 def MakeLineTwoFaces(self, theFace1, theFace2):
382 # Example: see GEOM_TestAll.py
383 anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
384 RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
387 ## Create a plane, passing through the given point
388 # and normal to the given vector.
389 # @param thePnt Point, the plane has to pass through.
390 # @param theVec Vector, defining the plane normal direction.
391 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
392 # @return New GEOM_Object, containing the created plane.
394 # @ref tui_creation_plane "Example"
395 def MakePlane(self,thePnt, theVec, theTrimSize):
396 # Example: see GEOM_TestAll.py
397 anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
398 RaiseIfFailed("MakePlanePntVec", self.BasicOp)
401 ## Create a plane, passing through the three given points
402 # @param thePnt1 First of three points, defining the plane.
403 # @param thePnt2 Second of three points, defining the plane.
404 # @param thePnt3 Fird of three points, defining the plane.
405 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
406 # @return New GEOM_Object, containing the created plane.
408 # @ref tui_creation_plane "Example"
409 def MakePlaneThreePnt(self,thePnt1, thePnt2, thePnt3, theTrimSize):
410 # Example: see GEOM_TestAll.py
411 anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
412 RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
415 ## Create a plane, similar to the existing one, but with another size of representing face.
416 # @param theFace Referenced plane or LCS(Marker).
417 # @param theTrimSize New half size of a side of quadrangle face, representing the plane.
418 # @return New GEOM_Object, containing the created plane.
420 # @ref tui_creation_plane "Example"
421 def MakePlaneFace(self,theFace, theTrimSize):
422 # Example: see GEOM_TestAll.py
423 anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
424 RaiseIfFailed("MakePlaneFace", self.BasicOp)
427 ## Create a local coordinate system.
428 # @param OX,OY,OZ Three coordinates of coordinate system origin.
429 # @param XDX,XDY,XDZ Three components of OX direction
430 # @param YDX,YDY,YDZ Three components of OY direction
431 # @return New GEOM_Object, containing the created coordinate system.
433 # @ref swig_MakeMarker "Example"
434 def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ):
435 # Example: see GEOM_TestAll.py
436 anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
437 RaiseIfFailed("MakeMarker", self.BasicOp)
440 ## Create a local coordinate system.
441 # @param theOrigin Point of coordinate system origin.
442 # @param theXVec Vector of X direction
443 # @param theYVec Vector of Y direction
444 # @return New GEOM_Object, containing the created coordinate system.
446 # @ref swig_MakeMarker "Example"
447 def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec):
448 O = self.PointCoordinates( theOrigin )
450 for vec in [ theXVec, theYVec ]:
451 v1, v2 = self.SubShapeAll( vec, ShapeType["VERTEX"] )
452 p1 = self.PointCoordinates( v1 )
453 p2 = self.PointCoordinates( v2 )
454 for i in range( 0, 3 ):
455 OXOY.append( p2[i] - p1[i] )
457 anObj = self.BasicOp.MakeMarker( O[0], O[1], O[2],
458 OXOY[0], OXOY[1], OXOY[2],
459 OXOY[3], OXOY[4], OXOY[5], )
460 RaiseIfFailed("MakeMarker", self.BasicOp)
466 ## @addtogroup l4_curves
469 ## Create an arc of circle, passing through three given points.
470 # @param thePnt1 Start point of the arc.
471 # @param thePnt2 Middle point of the arc.
472 # @param thePnt3 End point of the arc.
473 # @return New GEOM_Object, containing the created arc.
475 # @ref swig_MakeArc "Example"
476 def MakeArc(self,thePnt1, thePnt2, thePnt3):
477 # Example: see GEOM_TestAll.py
478 anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
479 RaiseIfFailed("MakeArc", self.CurvesOp)
482 ## Create an arc of circle from a center and 2 points.
483 # @param thePnt1 Center of the arc
484 # @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
485 # @param thePnt3 End point of the arc (Gives also a direction)
486 # @param theSense Orientation of the arc
487 # @return New GEOM_Object, containing the created arc.
489 # @ref swig_MakeArc "Example"
490 def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False):
491 # Example: see GEOM_TestAll.py
492 anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
493 RaiseIfFailed("MakeArcCenter", self.CurvesOp)
496 ## Create a circle with given center, normal vector and radius.
497 # @param thePnt Circle center.
498 # @param theVec Vector, normal to the plane of the circle.
499 # @param theR Circle radius.
500 # @return New GEOM_Object, containing the created circle.
502 # @ref tui_creation_circle "Example"
503 def MakeCircle(self,thePnt, theVec, theR):
504 # Example: see GEOM_TestAll.py
505 anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
506 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
509 ## Create a circle, passing through three given points
510 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
511 # @return New GEOM_Object, containing the created circle.
513 # @ref tui_creation_circle "Example"
514 def MakeCircleThreePnt(self,thePnt1, thePnt2, thePnt3):
515 # Example: see GEOM_TestAll.py
516 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
517 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
520 ## Create a circle, with given point1 as center,
521 # passing through the point2 as radius and laying in the plane,
522 # defined by all three given points.
523 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
524 # @return New GEOM_Object, containing the created circle.
526 # @ref swig_MakeCircle "Example"
527 def MakeCircleCenter2Pnt(self,thePnt1, thePnt2, thePnt3):
528 # Example: see GEOM_example6.py
529 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
530 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
533 ## Create an ellipse with given center, normal vector and radiuses.
534 # @param thePnt Ellipse center.
535 # @param theVec Vector, normal to the plane of the ellipse.
536 # @param theRMajor Major ellipse radius.
537 # @param theRMinor Minor ellipse radius.
538 # @return New GEOM_Object, containing the created ellipse.
540 # @ref tui_creation_ellipse "Example"
541 def MakeEllipse(self,thePnt, theVec, theRMajor, theRMinor):
542 # Example: see GEOM_TestAll.py
543 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
544 RaiseIfFailed("MakeEllipse", self.CurvesOp)
547 ## Create a polyline on the set of points.
548 # @param thePoints Sequence of points for the polyline.
549 # @return New GEOM_Object, containing the created polyline.
551 # @ref tui_creation_curve "Example"
552 def MakePolyline(self,thePoints):
553 # Example: see GEOM_TestAll.py
554 anObj = self.CurvesOp.MakePolyline(thePoints)
555 RaiseIfFailed("MakePolyline", self.CurvesOp)
558 ## Create bezier curve on the set of points.
559 # @param thePoints Sequence of points for the bezier curve.
560 # @return New GEOM_Object, containing the created bezier curve.
562 # @ref tui_creation_curve "Example"
563 def MakeBezier(self,thePoints):
564 # Example: see GEOM_TestAll.py
565 anObj = self.CurvesOp.MakeSplineBezier(thePoints)
566 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
569 ## Create B-Spline curve on the set of points.
570 # @param thePoints Sequence of points for the B-Spline curve.
571 # @return New GEOM_Object, containing the created B-Spline curve.
573 # @ref tui_creation_curve "Example"
574 def MakeInterpol(self,thePoints):
575 # Example: see GEOM_TestAll.py
576 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints)
577 RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
583 ## @addtogroup l3_sketcher
586 ## Create a sketcher (wire or face), following the textual description,
587 # passed through <VAR>theCommand</VAR> argument. \n
588 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
589 # Format of the description string have to be the following:
591 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
594 # - x1, y1 are coordinates of the first sketcher point (zero by default),
596 # - "R angle" : Set the direction by angle
597 # - "D dx dy" : Set the direction by DX & DY
600 # - "TT x y" : Create segment by point at X & Y
601 # - "T dx dy" : Create segment by point with DX & DY
602 # - "L length" : Create segment by direction & Length
603 # - "IX x" : Create segment by direction & Intersect. X
604 # - "IY y" : Create segment by direction & Intersect. Y
607 # - "C radius length" : Create arc by direction, radius and length(in degree)
610 # - "WW" : Close Wire (to finish)
611 # - "WF" : Close Wire and build face (to finish)
613 # @param theCommand String, defining the sketcher in local
614 # coordinates of the working plane.
615 # @param theWorkingPlane Nine double values, defining origin,
616 # OZ and OX directions of the working plane.
617 # @return New GEOM_Object, containing the created wire.
619 # @ref tui_sketcher_page "Example"
620 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0]):
621 # Example: see GEOM_TestAll.py
622 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
623 RaiseIfFailed("MakeSketcher", self.CurvesOp)
626 ## Create a sketcher (wire or face), following the textual description,
627 # passed through <VAR>theCommand</VAR> argument. \n
628 # For format of the description string see the previous method.\n
629 # @param theCommand String, defining the sketcher in local
630 # coordinates of the working plane.
631 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
632 # @return New GEOM_Object, containing the created wire.
634 # @ref tui_sketcher_page "Example"
635 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane):
636 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
637 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
643 ## @addtogroup l3_3d_primitives
646 ## Create a box by coordinates of two opposite vertices.
648 # @ref tui_creation_box "Example"
649 def MakeBox(self,x1,y1,z1,x2,y2,z2):
650 # Example: see GEOM_TestAll.py
651 pnt1 = self.MakeVertex(x1,y1,z1)
652 pnt2 = self.MakeVertex(x2,y2,z2)
653 return self.MakeBoxTwoPnt(pnt1,pnt2)
655 ## Create a box with specified dimensions along the coordinate axes
656 # and with edges, parallel to the coordinate axes.
657 # Center of the box will be at point (DX/2, DY/2, DZ/2).
658 # @param theDX Length of Box edges, parallel to OX axis.
659 # @param theDY Length of Box edges, parallel to OY axis.
660 # @param theDZ Length of Box edges, parallel to OZ axis.
661 # @return New GEOM_Object, containing the created box.
663 # @ref tui_creation_box "Example"
664 def MakeBoxDXDYDZ(self,theDX, theDY, theDZ):
665 # Example: see GEOM_TestAll.py
666 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
667 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
670 ## Create a box with two specified opposite vertices,
671 # and with edges, parallel to the coordinate axes
672 # @param thePnt1 First of two opposite vertices.
673 # @param thePnt2 Second of two opposite vertices.
674 # @return New GEOM_Object, containing the created box.
676 # @ref tui_creation_box "Example"
677 def MakeBoxTwoPnt(self,thePnt1, thePnt2):
678 # Example: see GEOM_TestAll.py
679 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
680 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
683 ## Create a face with specified dimensions along OX-OY coordinate axes,
684 # with edges, parallel to this coordinate axes.
685 # @param theH height of Face.
686 # @param theW width of Face.
687 # @param theOrientation orientation belong axis OXY OYZ OZX
688 # @return New GEOM_Object, containing the created face.
690 # @ref tui_creation_face "Example"
691 def MakeFaceHW(self,theH, theW, theOrientation):
692 # Example: see GEOM_TestAll.py
693 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
694 RaiseIfFailed("MakeFaceHW", self.PrimOp)
697 ## Create a face from another plane and two sizes,
698 # vertical size and horisontal size.
699 # @param theObj Normale vector to the creating face or
701 # @param theH Height (vertical size).
702 # @param theW Width (horisontal size).
703 # @return New GEOM_Object, containing the created face.
705 # @ref tui_creation_face "Example"
706 def MakeFaceObjHW(self, theObj, theH, theW):
707 # Example: see GEOM_TestAll.py
708 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
709 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
712 ## Create a disk with given center, normal vector and radius.
713 # @param thePnt Disk center.
714 # @param theVec Vector, normal to the plane of the disk.
715 # @param theR Disk radius.
716 # @return New GEOM_Object, containing the created disk.
718 # @ref tui_creation_disk "Example"
719 def MakeDiskPntVecR(self,thePnt, theVec, theR):
720 # Example: see GEOM_TestAll.py
721 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
722 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
725 ## Create a disk, passing through three given points
726 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
727 # @return New GEOM_Object, containing the created disk.
729 # @ref tui_creation_disk "Example"
730 def MakeDiskThreePnt(self,thePnt1, thePnt2, thePnt3):
731 # Example: see GEOM_TestAll.py
732 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
733 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
736 ## Create a disk with specified dimensions along OX-OY coordinate axes.
737 # @param theR Radius of Face.
738 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
739 # @return New GEOM_Object, containing the created disk.
741 # @ref tui_creation_face "Example"
742 def MakeDiskR(self,theR, theOrientation):
743 # Example: see GEOM_TestAll.py
744 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
745 RaiseIfFailed("MakeDiskR", self.PrimOp)
748 ## Create a cylinder with given base point, axis, radius and height.
749 # @param thePnt Central point of cylinder base.
750 # @param theAxis Cylinder axis.
751 # @param theR Cylinder radius.
752 # @param theH Cylinder height.
753 # @return New GEOM_Object, containing the created cylinder.
755 # @ref tui_creation_cylinder "Example"
756 def MakeCylinder(self,thePnt, theAxis, theR, theH):
757 # Example: see GEOM_TestAll.py
758 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
759 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
762 ## Create a cylinder with given radius and height at
763 # the origin of coordinate system. Axis of the cylinder
764 # will be collinear to the OZ axis of the coordinate system.
765 # @param theR Cylinder radius.
766 # @param theH Cylinder height.
767 # @return New GEOM_Object, containing the created cylinder.
769 # @ref tui_creation_cylinder "Example"
770 def MakeCylinderRH(self,theR, theH):
771 # Example: see GEOM_TestAll.py
772 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
773 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
776 ## Create a sphere with given center and radius.
777 # @param thePnt Sphere center.
778 # @param theR Sphere radius.
779 # @return New GEOM_Object, containing the created sphere.
781 # @ref tui_creation_sphere "Example"
782 def MakeSpherePntR(self, thePnt, theR):
783 # Example: see GEOM_TestAll.py
784 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
785 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
788 ## Create a sphere with given center and radius.
789 # @param x,y,z Coordinates of sphere center.
790 # @param theR Sphere radius.
791 # @return New GEOM_Object, containing the created sphere.
793 # @ref tui_creation_sphere "Example"
794 def MakeSphere(self, x, y, z, theR):
795 # Example: see GEOM_TestAll.py
796 point = self.MakeVertex(x, y, z)
797 anObj = self.MakeSpherePntR(point, theR)
800 ## Create a sphere with given radius at the origin of coordinate system.
801 # @param theR Sphere radius.
802 # @return New GEOM_Object, containing the created sphere.
804 # @ref tui_creation_sphere "Example"
805 def MakeSphereR(self, theR):
806 # Example: see GEOM_TestAll.py
807 anObj = self.PrimOp.MakeSphereR(theR)
808 RaiseIfFailed("MakeSphereR", self.PrimOp)
811 ## Create a cone with given base point, axis, height and radiuses.
812 # @param thePnt Central point of the first cone base.
813 # @param theAxis Cone axis.
814 # @param theR1 Radius of the first cone base.
815 # @param theR2 Radius of the second cone base.
816 # \note If both radiuses are non-zero, the cone will be truncated.
817 # \note If the radiuses are equal, a cylinder will be created instead.
818 # @param theH Cone height.
819 # @return New GEOM_Object, containing the created cone.
821 # @ref tui_creation_cone "Example"
822 def MakeCone(self,thePnt, theAxis, theR1, theR2, theH):
823 # Example: see GEOM_TestAll.py
824 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
825 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
828 ## Create a cone with given height and radiuses at
829 # the origin of coordinate system. Axis of the cone will
830 # be collinear to the OZ axis of the coordinate system.
831 # @param theR1 Radius of the first cone base.
832 # @param theR2 Radius of the second cone base.
833 # \note If both radiuses are non-zero, the cone will be truncated.
834 # \note If the radiuses are equal, a cylinder will be created instead.
835 # @param theH Cone height.
836 # @return New GEOM_Object, containing the created cone.
838 # @ref tui_creation_cone "Example"
839 def MakeConeR1R2H(self,theR1, theR2, theH):
840 # Example: see GEOM_TestAll.py
841 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
842 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
845 ## Create a torus with given center, normal vector and radiuses.
846 # @param thePnt Torus central point.
847 # @param theVec Torus axis of symmetry.
848 # @param theRMajor Torus major radius.
849 # @param theRMinor Torus minor radius.
850 # @return New GEOM_Object, containing the created torus.
852 # @ref tui_creation_torus "Example"
853 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor):
854 # Example: see GEOM_TestAll.py
855 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
856 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
859 ## Create a torus with given radiuses at the origin of coordinate system.
860 # @param theRMajor Torus major radius.
861 # @param theRMinor Torus minor radius.
862 # @return New GEOM_Object, containing the created torus.
864 # @ref tui_creation_torus "Example"
865 def MakeTorusRR(self, theRMajor, theRMinor):
866 # Example: see GEOM_TestAll.py
867 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
868 RaiseIfFailed("MakeTorusRR", self.PrimOp)
871 # end of l3_3d_primitives
874 ## @addtogroup l3_complex
877 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
878 # @param theBase Base shape to be extruded.
879 # @param thePoint1 First end of extrusion vector.
880 # @param thePoint2 Second end of extrusion vector.
881 # @return New GEOM_Object, containing the created prism.
883 # @ref tui_creation_prism "Example"
884 def MakePrism(self, theBase, thePoint1, thePoint2):
885 # Example: see GEOM_TestAll.py
886 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
887 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
890 ## Create a shape by extrusion of the base shape along the vector,
891 # i.e. all the space, transfixed by the base shape during its translation
892 # along the vector on the given distance.
893 # @param theBase Base shape to be extruded.
894 # @param theVec Direction of extrusion.
895 # @param theH Prism dimension along theVec.
896 # @return New GEOM_Object, containing the created prism.
898 # @ref tui_creation_prism "Example"
899 def MakePrismVecH(self, theBase, theVec, theH):
900 # Example: see GEOM_TestAll.py
901 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
902 RaiseIfFailed("MakePrismVecH", self.PrimOp)
905 ## Create a shape by extrusion of the base shape along the vector,
906 # i.e. all the space, transfixed by the base shape during its translation
907 # along the vector on the given distance in 2 Ways (forward/backward) .
908 # @param theBase Base shape to be extruded.
909 # @param theVec Direction of extrusion.
910 # @param theH Prism dimension along theVec in forward direction.
911 # @return New GEOM_Object, containing the created prism.
913 # @ref tui_creation_prism "Example"
914 def MakePrismVecH2Ways(self, theBase, theVec, theH):
915 # Example: see GEOM_TestAll.py
916 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
917 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
920 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
921 # @param theBase Base shape to be extruded.
922 # @param theDX, theDY, theDZ Directions of extrusion.
923 # @return New GEOM_Object, containing the created prism.
925 # @ref tui_creation_prism "Example"
926 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ):
927 # Example: see GEOM_TestAll.py
928 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
929 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
932 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
933 # i.e. all the space, transfixed by the base shape during its translation
934 # along the vector on the given distance in 2 Ways (forward/backward) .
935 # @param theBase Base shape to be extruded.
936 # @param theDX, theDY, theDZ Directions of extrusion.
937 # @return New GEOM_Object, containing the created prism.
939 # @ref tui_creation_prism "Example"
940 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ):
941 # Example: see GEOM_TestAll.py
942 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
943 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
946 ## Create a shape by revolution of the base shape around the axis
947 # on the given angle, i.e. all the space, transfixed by the base
948 # shape during its rotation around the axis on the given angle.
949 # @param theBase Base shape to be rotated.
950 # @param theAxis Rotation axis.
951 # @param theAngle Rotation angle in radians.
952 # @return New GEOM_Object, containing the created revolution.
954 # @ref tui_creation_revolution "Example"
955 def MakeRevolution(self, theBase, theAxis, theAngle):
956 # Example: see GEOM_TestAll.py
957 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
958 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
961 ## The Same Revolution but in both ways forward&backward.
962 def MakeRevolution2Ways(self, theBase, theAxis, theAngle):
963 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
964 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
967 ## Create a filling from the given compound of contours.
968 # @param theShape the compound of contours
969 # @param theMinDeg a minimal degree of BSpline surface to create
970 # @param theMaxDeg a maximal degree of BSpline surface to create
971 # @param theTol2D a 2d tolerance to be reached
972 # @param theTol3D a 3d tolerance to be reached
973 # @param theNbIter a number of iteration of approximation algorithm
974 # @param isApprox if True, BSpline curves are generated in the process
975 # of surface construction. By default it is False, that means
976 # the surface is created using Besier curves. The usage of
977 # Approximation makes the algorithm work slower, but allows
978 # building the surface for rather complex cases
979 # @return New GEOM_Object, containing the created filling surface.
981 # @ref tui_creation_filling "Example"
982 def MakeFilling(self, theShape, theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter, isApprox=0):
983 # Example: see GEOM_TestAll.py
984 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
985 theTol2D, theTol3D, theNbIter, isApprox)
986 RaiseIfFailed("MakeFilling", self.PrimOp)
989 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
990 # @param theSeqSections - set of specified sections.
991 # @param theModeSolid - mode defining building solid or shell
992 # @param thePreci - precision 3D used for smoothing by default 1.e-6
993 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
994 # @return New GEOM_Object, containing the created shell or solid.
996 # @ref swig_todo "Example"
997 def MakeThruSections(self,theSeqSections,theModeSolid,thePreci,theRuled):
998 # Example: see GEOM_TestAll.py
999 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
1000 RaiseIfFailed("MakeThruSections", self.PrimOp)
1003 ## Create a shape by extrusion of the base shape along
1004 # the path shape. The path shape can be a wire or an edge.
1005 # @param theBase Base shape to be extruded.
1006 # @param thePath Path shape to extrude the base shape along it.
1007 # @return New GEOM_Object, containing the created pipe.
1009 # @ref tui_creation_pipe "Example"
1010 def MakePipe(self,theBase, thePath):
1011 # Example: see GEOM_TestAll.py
1012 anObj = self.PrimOp.MakePipe(theBase, thePath)
1013 RaiseIfFailed("MakePipe", self.PrimOp)
1016 ## Create a shape by extrusion of the profile shape along
1017 # the path shape. The path shape can be a wire or an edge.
1018 # the several profiles can be specified in the several locations of path.
1019 # @param theSeqBases - list of Bases shape to be extruded.
1020 # @param theLocations - list of locations on the path corresponding
1021 # specified list of the Bases shapes. Number of locations
1022 # should be equal to number of bases or list of locations can be empty.
1023 # @param thePath - Path shape to extrude the base shape along it.
1024 # @param theWithContact - the mode defining that the section is translated to be in
1025 # contact with the spine.
1026 # @param theWithCorrection - defining that the section is rotated to be
1027 # orthogonal to the spine tangent in the correspondent point
1028 # @return New GEOM_Object, containing the created pipe.
1030 # @ref tui_creation_pipe_with_diff_sec "Example"
1031 def MakePipeWithDifferentSections(self, theSeqBases,
1032 theLocations, thePath,
1033 theWithContact, theWithCorrection):
1034 anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
1035 theLocations, thePath,
1036 theWithContact, theWithCorrection)
1037 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
1040 ## Create a shape by extrusion of the profile shape along
1041 # the path shape. The path shape can be a wire or a edge.
1042 # the several profiles can be specified in the several locations of path.
1043 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
1044 # shell or face. If number of faces in neighbour sections
1045 # aren't coincided result solid between such sections will
1046 # be created using external boundaries of this shells.
1047 # @param theSeqSubBases - list of corresponding subshapes of section shapes.
1048 # This list is used for searching correspondences between
1049 # faces in the sections. Size of this list must be equal
1050 # to size of list of base shapes.
1051 # @param theLocations - list of locations on the path corresponding
1052 # specified list of the Bases shapes. Number of locations
1053 # should be equal to number of bases. First and last
1054 # locations must be coincided with first and last vertexes
1055 # of path correspondingly.
1056 # @param thePath - Path shape to extrude the base shape along it.
1057 # @param theWithContact - the mode defining that the section is translated to be in
1058 # contact with the spine.
1059 # @param theWithCorrection - defining that the section is rotated to be
1060 # orthogonal to the spine tangent in the correspondent point
1061 # @return New GEOM_Object, containing the created solids.
1063 # @ref tui_creation_pipe_with_shell_sec "Example"
1064 def MakePipeWithShellSections(self,theSeqBases, theSeqSubBases,
1065 theLocations, thePath,
1066 theWithContact, theWithCorrection):
1067 anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
1068 theLocations, thePath,
1069 theWithContact, theWithCorrection)
1070 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
1073 ## Create a shape by extrusion of the profile shape along
1074 # the path shape. This function is used only for debug pipe
1075 # functionality - it is a version of previous function
1076 # (MakePipeWithShellSections(...)) which give a possibility to
1077 # recieve information about creating pipe between each pair of
1078 # sections step by step.
1079 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
1080 theLocations, thePath,
1081 theWithContact, theWithCorrection):
1083 nbsect = len(theSeqBases)
1084 nbsubsect = len(theSeqSubBases)
1085 #print "nbsect = ",nbsect
1086 for i in range(1,nbsect):
1088 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
1089 tmpLocations = [ theLocations[i-1], theLocations[i] ]
1091 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
1092 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
1093 tmpLocations, thePath,
1094 theWithContact, theWithCorrection)
1095 if self.PrimOp.IsDone() == 0:
1096 print "Problems with pipe creation between ",i," and ",i+1," sections"
1097 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
1100 print "Pipe between ",i," and ",i+1," sections is OK"
1105 resc = self.MakeCompound(res)
1106 #resc = self.MakeSewing(res, 0.001)
1107 #print "resc: ",resc
1110 ## Create solids between given sections
1111 # @param theSeqBases - list of sections (shell or face).
1112 # @param theLocations - list of corresponding vertexes
1113 # @return New GEOM_Object, containing the created solids.
1115 # @ref tui_creation_pipe_without_path "Example"
1116 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations):
1117 anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
1118 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
1124 ## @addtogroup l3_advanced
1127 ## Create a linear edge with specified ends.
1128 # @param thePnt1 Point for the first end of edge.
1129 # @param thePnt2 Point for the second end of edge.
1130 # @return New GEOM_Object, containing the created edge.
1132 # @ref tui_creation_edge "Example"
1133 def MakeEdge(self,thePnt1, thePnt2):
1134 # Example: see GEOM_TestAll.py
1135 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
1136 RaiseIfFailed("MakeEdge", self.ShapesOp)
1139 ## Create a wire from the set of edges and wires.
1140 # @param theEdgesAndWires List of edges and/or wires.
1141 # @return New GEOM_Object, containing the created wire.
1143 # @ref tui_creation_wire "Example"
1144 def MakeWire(self,theEdgesAndWires):
1145 # Example: see GEOM_TestAll.py
1146 anObj = self.ShapesOp.MakeWire(theEdgesAndWires)
1147 RaiseIfFailed("MakeWire", self.ShapesOp)
1150 ## Create a face on the given wire.
1151 # @param theWire closed Wire or Edge to build the face on.
1152 # @param isPlanarWanted If TRUE, only planar face will be built.
1153 # If impossible, NULL object will be returned.
1154 # @return New GEOM_Object, containing the created face.
1156 # @ref tui_creation_face "Example"
1157 def MakeFace(self,theWire, isPlanarWanted):
1158 # Example: see GEOM_TestAll.py
1159 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
1160 RaiseIfFailed("MakeFace", self.ShapesOp)
1163 ## Create a face on the given wires set.
1164 # @param theWires List of closed wires or edges to build the face on.
1165 # @param isPlanarWanted If TRUE, only planar face will be built.
1166 # If impossible, NULL object will be returned.
1167 # @return New GEOM_Object, containing the created face.
1169 # @ref tui_creation_face "Example"
1170 def MakeFaceWires(self,theWires, isPlanarWanted):
1171 # Example: see GEOM_TestAll.py
1172 anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
1173 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
1176 ## Shortcut to MakeFaceWires()
1178 # @ref tui_creation_face "Example 1"
1179 # \n @ref swig_MakeFaces "Example 2"
1180 def MakeFaces(self,theWires, isPlanarWanted):
1181 # Example: see GEOM_TestOthers.py
1182 anObj = self.MakeFaceWires(theWires, isPlanarWanted)
1185 ## Create a shell from the set of faces and shells.
1186 # @param theFacesAndShells List of faces and/or shells.
1187 # @return New GEOM_Object, containing the created shell.
1189 # @ref tui_creation_shell "Example"
1190 def MakeShell(self,theFacesAndShells):
1191 # Example: see GEOM_TestAll.py
1192 anObj = self.ShapesOp.MakeShell(theFacesAndShells)
1193 RaiseIfFailed("MakeShell", self.ShapesOp)
1196 ## Create a solid, bounded by the given shells.
1197 # @param theShells Sequence of bounding shells.
1198 # @return New GEOM_Object, containing the created solid.
1200 # @ref tui_creation_solid "Example"
1201 def MakeSolid(self,theShells):
1202 # Example: see GEOM_TestAll.py
1203 anObj = self.ShapesOp.MakeSolidShells(theShells)
1204 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
1207 ## Create a compound of the given shapes.
1208 # @param theShapes List of shapes to put in compound.
1209 # @return New GEOM_Object, containing the created compound.
1211 # @ref tui_creation_compound "Example"
1212 def MakeCompound(self,theShapes):
1213 # Example: see GEOM_TestAll.py
1214 anObj = self.ShapesOp.MakeCompound(theShapes)
1215 RaiseIfFailed("MakeCompound", self.ShapesOp)
1218 # end of l3_advanced
1221 ## @addtogroup l2_measure
1224 ## Gives quantity of faces in the given shape.
1225 # @param theShape Shape to count faces of.
1226 # @return Quantity of faces.
1228 # @ref swig_NumberOfFaces "Example"
1229 def NumberOfFaces(self,theShape):
1230 # Example: see GEOM_TestOthers.py
1231 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
1232 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
1235 ## Gives quantity of edges in the given shape.
1236 # @param theShape Shape to count edges of.
1237 # @return Quantity of edges.
1239 # @ref swig_NumberOfEdges "Example"
1240 def NumberOfEdges(self,theShape):
1241 # Example: see GEOM_TestOthers.py
1242 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
1243 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
1249 ## @addtogroup l3_healing
1252 ## Reverses an orientation the given shape.
1253 # @param theShape Shape to be reversed.
1254 # @return The reversed copy of theShape.
1256 # @ref swig_ChangeOrientation "Example"
1257 def ChangeOrientation(self,theShape):
1258 # Example: see GEOM_TestAll.py
1259 anObj = self.ShapesOp.ChangeOrientation(theShape)
1260 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
1263 ## Shortcut to ChangeOrientation()
1265 # @ref swig_OrientationChange "Example"
1266 def OrientationChange(self,theShape):
1267 # Example: see GEOM_TestOthers.py
1268 anObj = self.ChangeOrientation(theShape)
1274 ## @addtogroup l4_obtain
1277 ## Retrieve all free faces from the given shape.
1278 # Free face is a face, which is not shared between two shells of the shape.
1279 # @param theShape Shape to find free faces in.
1280 # @return List of IDs of all free faces, contained in theShape.
1282 # @ref tui_measurement_tools_page "Example"
1283 def GetFreeFacesIDs(self,theShape):
1284 # Example: see GEOM_TestOthers.py
1285 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
1286 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
1289 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
1290 # @param theShape1 Shape to find sub-shapes in.
1291 # @param theShape2 Shape to find shared sub-shapes with.
1292 # @param theShapeType Type of sub-shapes to be retrieved.
1293 # @return List of sub-shapes of theShape1, shared with theShape2.
1295 # @ref swig_GetSharedShapes "Example"
1296 def GetSharedShapes(self,theShape1, theShape2, theShapeType):
1297 # Example: see GEOM_TestOthers.py
1298 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
1299 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
1302 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
1303 # situated relatively the specified plane by the certain way,
1304 # defined through <VAR>theState</VAR> parameter.
1305 # @param theShape Shape to find sub-shapes of.
1306 # @param theShapeType Type of sub-shapes to be retrieved.
1307 # @param theAx1 Vector (or line, or linear edge), specifying normal
1308 # direction and location of the plane to find shapes on.
1309 # @param theState The state of the subshapes to find. It can be one of
1310 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1311 # @return List of all found sub-shapes.
1313 # @ref swig_GetShapesOnPlane "Example"
1314 def GetShapesOnPlane(self,theShape, theShapeType, theAx1, theState):
1315 # Example: see GEOM_TestOthers.py
1316 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
1317 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
1320 ## Works like the above method, but returns list of sub-shapes indices
1322 # @ref swig_GetShapesOnPlaneIDs "Example"
1323 def GetShapesOnPlaneIDs(self,theShape, theShapeType, theAx1, theState):
1324 # Example: see GEOM_TestOthers.py
1325 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
1326 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
1329 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
1330 # situated relatively the specified plane by the certain way,
1331 # defined through <VAR>theState</VAR> parameter.
1332 # @param theShape Shape to find sub-shapes of.
1333 # @param theShapeType Type of sub-shapes to be retrieved.
1334 # @param theAx1 Vector (or line, or linear edge), specifying normal
1335 # direction of the plane to find shapes on.
1336 # @param thePnt Point specifying location of the plane to find shapes on.
1337 # @param theState The state of the subshapes to find. It can be one of
1338 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1339 # @return List of all found sub-shapes.
1341 # @ref swig_GetShapesOnPlaneWithLocation "Example"
1342 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState):
1343 # Example: see GEOM_TestOthers.py
1344 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
1345 theAx1, thePnt, theState)
1346 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
1349 ## Works like the above method, but returns list of sub-shapes indices
1351 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
1352 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
1353 # Example: see GEOM_TestOthers.py
1354 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
1355 theAx1, thePnt, theState)
1356 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
1359 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1360 # the specified cylinder by the certain way, defined through \a theState parameter.
1361 # @param theShape Shape to find sub-shapes of.
1362 # @param theShapeType Type of sub-shapes to be retrieved.
1363 # @param theAxis Vector (or line, or linear edge), specifying
1364 # axis of the cylinder to find shapes on.
1365 # @param theRadius Radius of the cylinder to find shapes on.
1366 # @param theState The state of the subshapes to find. It can be one of
1367 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1368 # @return List of all found sub-shapes.
1370 # @ref swig_GetShapesOnCylinder "Example"
1371 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState):
1372 # Example: see GEOM_TestOthers.py
1373 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
1374 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
1377 ## Works like the above method, but returns list of sub-shapes indices
1379 # @ref swig_GetShapesOnCylinderIDs "Example"
1380 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
1381 # Example: see GEOM_TestOthers.py
1382 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
1383 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
1386 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1387 # the specified sphere by the certain way, defined through \a theState parameter.
1388 # @param theShape Shape to find sub-shapes of.
1389 # @param theShapeType Type of sub-shapes to be retrieved.
1390 # @param theCenter Point, specifying center of the sphere to find shapes on.
1391 # @param theRadius Radius of the sphere to find shapes on.
1392 # @param theState The state of the subshapes to find. It can be one of
1393 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1394 # @return List of all found sub-shapes.
1396 # @ref swig_GetShapesOnSphere "Example"
1397 def GetShapesOnSphere(self,theShape, theShapeType, theCenter, theRadius, theState):
1398 # Example: see GEOM_TestOthers.py
1399 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
1400 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
1403 ## Works like the above method, but returns list of sub-shapes indices
1405 # @ref swig_GetShapesOnSphereIDs "Example"
1406 def GetShapesOnSphereIDs(self,theShape, theShapeType, theCenter, theRadius, theState):
1407 # Example: see GEOM_TestOthers.py
1408 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
1409 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
1412 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1413 # the specified quadrangle by the certain way, defined through \a theState parameter.
1414 # @param theShape Shape to find sub-shapes of.
1415 # @param theShapeType Type of sub-shapes to be retrieved.
1416 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
1417 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
1418 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
1419 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
1420 # @param theState The state of the subshapes to find. It can be one of
1421 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1422 # @return List of all found sub-shapes.
1424 # @ref swig_GetShapesOnQuadrangle "Example"
1425 def GetShapesOnQuadrangle(self, theShape, theShapeType,
1426 theTopLeftPoint, theTopRigthPoint,
1427 theBottomLeftPoint, theBottomRigthPoint, theState):
1428 # Example: see GEOM_TestOthers.py
1429 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
1430 theTopLeftPoint, theTopRigthPoint,
1431 theBottomLeftPoint, theBottomRigthPoint, theState)
1432 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
1435 ## Works like the above method, but returns list of sub-shapes indices
1437 # @ref swig_GetShapesOnQuadrangleIDs "Example"
1438 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
1439 theTopLeftPoint, theTopRigthPoint,
1440 theBottomLeftPoint, theBottomRigthPoint, theState):
1441 # Example: see GEOM_TestOthers.py
1442 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
1443 theTopLeftPoint, theTopRigthPoint,
1444 theBottomLeftPoint, theBottomRigthPoint, theState)
1445 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
1448 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1449 # the specified \a theBox by the certain way, defined through \a theState parameter.
1450 # @param theBox Shape for relative comparing.
1451 # @param theShape Shape to find sub-shapes of.
1452 # @param theShapeType Type of sub-shapes to be retrieved.
1453 # @param theState The state of the subshapes to find. It can be one of
1454 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1455 # @return List of all found sub-shapes.
1457 # @ref swig_GetShapesOnBox "Example"
1458 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState):
1459 # Example: see GEOM_TestOthers.py
1460 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
1461 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
1464 ## Works like the above method, but returns list of sub-shapes indices
1466 # @ref swig_GetShapesOnBoxIDs "Example"
1467 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
1468 # Example: see GEOM_TestOthers.py
1469 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
1470 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
1473 ## Find in \a theShape all sub-shapes of type \a theShapeType,
1474 # situated relatively the specified \a theCheckShape by the
1475 # certain way, defined through \a theState parameter.
1476 # @param theCheckShape Shape for relative comparing.
1477 # @param theShape Shape to find sub-shapes of.
1478 # @param theShapeType Type of sub-shapes to be retrieved.
1479 # @param theState The state of the subshapes to find. It can be one of
1480 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1481 # @return List of all found sub-shapes.
1483 # @ref swig_GetShapesOnShape "Example"
1484 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState):
1485 # Example: see GEOM_TestOthers.py
1486 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
1487 theShapeType, theState)
1488 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
1491 ## Works like the above method, but returns result as compound
1493 # @ref swig_GetShapesOnShapeAsCompound "Example"
1494 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState):
1495 # Example: see GEOM_TestOthers.py
1496 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
1497 theShapeType, theState)
1498 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
1501 ## Works like the above method, but returns list of sub-shapes indices
1503 # @ref swig_GetShapesOnShapeIDs "Example"
1504 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
1505 # Example: see GEOM_TestOthers.py
1506 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
1507 theShapeType, theState)
1508 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
1511 ## Get sub-shape(s) of theShapeWhere, which are
1512 # coincident with \a theShapeWhat or could be a part of it.
1513 # @param theShapeWhere Shape to find sub-shapes of.
1514 # @param theShapeWhat Shape, specifying what to find.
1515 # @return Group of all found sub-shapes or a single found sub-shape.
1517 # @ref swig_GetInPlace "Example"
1518 def GetInPlace(self,theShapeWhere, theShapeWhat):
1519 # Example: see GEOM_TestOthers.py
1520 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
1521 RaiseIfFailed("GetInPlace", self.ShapesOp)
1524 ## Get sub-shape(s) of \a theShapeWhere, which are
1525 # coincident with \a theShapeWhat or could be a part of it.
1527 # Implementation of this method is based on a saved history of an operation,
1528 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
1529 # arguments (an argument shape or a sub-shape of an argument shape).
1530 # The operation could be the Partition or one of boolean operations,
1531 # performed on simple shapes (not on compounds).
1533 # @param theShapeWhere Shape to find sub-shapes of.
1534 # @param theShapeWhat Shape, specifying what to find (must be in the
1535 # building history of the ShapeWhere).
1536 # @return Group of all found sub-shapes or a single found sub-shape.
1538 # @ref swig_GetInPlace "Example"
1539 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat):
1540 # Example: see GEOM_TestOthers.py
1541 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
1542 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
1545 ## Get sub-shape of theShapeWhere, which is
1546 # equal to \a theShapeWhat.
1547 # @param theShapeWhere Shape to find sub-shape of.
1548 # @param theShapeWhat Shape, specifying what to find.
1549 # @return New GEOM_Object for found sub-shape.
1551 # @ref swig_GetSame "Example"
1552 def GetSame(self,theShapeWhere, theShapeWhat):
1553 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
1554 RaiseIfFailed("GetSame", self.ShapesOp)
1560 ## @addtogroup l4_access
1563 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
1564 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
1566 # @ref swig_all_decompose "Example"
1567 def GetSubShape(self, aShape, ListOfID):
1568 # Example: see GEOM_TestAll.py
1569 anObj = self.AddSubShape(aShape,ListOfID)
1572 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
1574 # @ref swig_all_decompose "Example"
1575 def GetSubShapeID(self, aShape, aSubShape):
1576 # Example: see GEOM_TestAll.py
1577 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
1578 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
1584 ## @addtogroup l4_decompose
1587 ## Explode a shape on subshapes of a given type.
1588 # @param aShape Shape to be exploded.
1589 # @param aType Type of sub-shapes to be retrieved.
1590 # @return List of sub-shapes of type theShapeType, contained in theShape.
1592 # @ref swig_all_decompose "Example"
1593 def SubShapeAll(self, aShape, aType):
1594 # Example: see GEOM_TestAll.py
1595 ListObj = self.ShapesOp.MakeExplode(aShape,aType,0)
1596 RaiseIfFailed("MakeExplode", self.ShapesOp)
1599 ## Explode a shape on subshapes of a given type.
1600 # @param aShape Shape to be exploded.
1601 # @param aType Type of sub-shapes to be retrieved.
1602 # @return List of IDs of sub-shapes.
1604 # @ref swig_all_decompose "Example"
1605 def SubShapeAllIDs(self, aShape, aType):
1606 ListObj = self.ShapesOp.SubShapeAllIDs(aShape,aType,0)
1607 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
1610 ## Explode a shape on subshapes of a given type.
1611 # Sub-shapes will be sorted by coordinates of their gravity centers.
1612 # @param aShape Shape to be exploded.
1613 # @param aType Type of sub-shapes to be retrieved.
1614 # @return List of sub-shapes of type theShapeType, contained in theShape.
1616 # @ref swig_SubShapeAllSorted "Example"
1617 def SubShapeAllSorted(self, aShape, aType):
1618 # Example: see GEOM_TestAll.py
1619 ListObj = self.ShapesOp.MakeExplode(aShape,aType,1)
1620 RaiseIfFailed("MakeExplode", self.ShapesOp)
1623 ## Explode a shape on subshapes of a given type.
1624 # Sub-shapes will be sorted by coordinates of their gravity centers.
1625 # @param aShape Shape to be exploded.
1626 # @param aType Type of sub-shapes to be retrieved.
1627 # @return List of IDs of sub-shapes.
1629 # @ref swig_all_decompose "Example"
1630 def SubShapeAllSortedIDs(self, aShape, aType):
1631 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape,aType,1)
1632 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
1635 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
1636 # selected by they indices in list of all sub-shapes of type <VAR>aType</VAR>.
1637 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
1639 # @ref swig_all_decompose "Example"
1640 def SubShape(self, aShape, aType, ListOfInd):
1641 # Example: see GEOM_TestAll.py
1643 AllShapeList = self.SubShapeAll(aShape, aType)
1644 for ind in ListOfInd:
1645 ListOfIDs.append(self.GetSubShapeID(aShape, AllShapeList[ind - 1]))
1646 anObj = self.GetSubShape(aShape, ListOfIDs)
1649 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
1650 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
1651 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
1653 # @ref swig_all_decompose "Example"
1654 def SubShapeSorted(self,aShape, aType, ListOfInd):
1655 # Example: see GEOM_TestAll.py
1657 AllShapeList = self.SubShapeAllSorted(aShape, aType)
1658 for ind in ListOfInd:
1659 ListOfIDs.append(self.GetSubShapeID(aShape, AllShapeList[ind - 1]))
1660 anObj = self.GetSubShape(aShape, ListOfIDs)
1663 # end of l4_decompose
1666 ## @addtogroup l3_healing
1669 ## Apply a sequence of Shape Healing operators to the given object.
1670 # @param theShape Shape to be processed.
1671 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
1672 # @param theParameters List of names of parameters
1673 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
1674 # @param theValues List of values of parameters, in the same order
1675 # as parameters are listed in <VAR>theParameters</VAR> list.
1676 # @return New GEOM_Object, containing processed shape.
1678 # @ref tui_shape_processing "Example"
1679 def ProcessShape(self,theShape, theOperators, theParameters, theValues):
1680 # Example: see GEOM_TestHealing.py
1681 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
1682 RaiseIfFailed("ProcessShape", self.HealOp)
1685 ## Remove faces from the given object (shape).
1686 # @param theObject Shape to be processed.
1687 # @param theFaces Indices of faces to be removed, if EMPTY then the method
1688 # removes ALL faces of the given object.
1689 # @return New GEOM_Object, containing processed shape.
1691 # @ref tui_suppress_faces "Example"
1692 def SuppressFaces(self,theObject, theFaces):
1693 # Example: see GEOM_TestHealing.py
1694 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
1695 RaiseIfFailed("SuppressFaces", self.HealOp)
1698 ## Sewing of some shapes into single shape.
1700 # @ref tui_sewing "Example"
1701 def MakeSewing(self, ListShape, theTolerance):
1702 # Example: see GEOM_TestHealing.py
1703 comp = self.MakeCompound(ListShape)
1704 anObj = self.Sew(comp, theTolerance)
1707 ## Sewing of the given object.
1708 # @param theObject Shape to be processed.
1709 # @param theTolerance Required tolerance value.
1710 # @return New GEOM_Object, containing processed shape.
1711 def Sew(self, theObject, theTolerance):
1712 # Example: see MakeSewing() above
1713 anObj = self.HealOp.Sew(theObject, theTolerance)
1714 RaiseIfFailed("Sew", self.HealOp)
1717 ## Remove internal wires and edges from the given object (face).
1718 # @param theObject Shape to be processed.
1719 # @param theWires Indices of wires to be removed, if EMPTY then the method
1720 # removes ALL internal wires of the given object.
1721 # @return New GEOM_Object, containing processed shape.
1723 # @ref tui_suppress_internal_wires "Example"
1724 def SuppressInternalWires(self,theObject, theWires):
1725 # Example: see GEOM_TestHealing.py
1726 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
1727 RaiseIfFailed("RemoveIntWires", self.HealOp)
1730 ## Remove internal closed contours (holes) from the given object.
1731 # @param theObject Shape to be processed.
1732 # @param theWires Indices of wires to be removed, if EMPTY then the method
1733 # removes ALL internal holes of the given object
1734 # @return New GEOM_Object, containing processed shape.
1736 # @ref tui_suppress_holes "Example"
1737 def SuppressHoles(self,theObject, theWires):
1738 # Example: see GEOM_TestHealing.py
1739 anObj = self.HealOp.FillHoles(theObject, theWires)
1740 RaiseIfFailed("FillHoles", self.HealOp)
1743 ## Close an open wire.
1744 # @param theObject Shape to be processed.
1745 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
1746 # if -1, then <VAR>theObject</VAR> itself is a wire.
1747 # @param isCommonVertex If TRUE : closure by creation of a common vertex,
1748 # If FALS : closure by creation of an edge between ends.
1749 # @return New GEOM_Object, containing processed shape.
1751 # @ref tui_close_contour "Example"
1752 def CloseContour(self,theObject, theWires, isCommonVertex):
1753 # Example: see GEOM_TestHealing.py
1754 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
1755 RaiseIfFailed("CloseContour", self.HealOp)
1758 ## Addition of a point to a given edge object.
1759 # @param theObject Shape to be processed.
1760 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
1761 # if -1, then theObject itself is the edge.
1762 # @param theValue Value of parameter on edge or length parameter,
1763 # depending on \a isByParameter.
1764 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1],
1765 # if FALSE : \a theValue is treated as a length parameter [0..1]
1766 # @return New GEOM_Object, containing processed shape.
1768 # @ref tui_add_point_on_edge "Example"
1769 def DivideEdge(self,theObject, theEdgeIndex, theValue, isByParameter):
1770 # Example: see GEOM_TestHealing.py
1771 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
1772 RaiseIfFailed("DivideEdge", self.HealOp)
1775 ## Change orientation of the given object. Updates given shape.
1776 # @param theObject Shape to be processed.
1778 # @ref swig_todo "Example"
1779 def ChangeOrientationShell(self,theObject):
1780 theObject = self.HealOp.ChangeOrientation(theObject)
1781 RaiseIfFailed("ChangeOrientation", self.HealOp)
1784 ## Change orientation of the given object.
1785 # @param theObject Shape to be processed.
1786 # @return New GEOM_Object, containing processed shape.
1788 # @ref swig_todo "Example"
1789 def ChangeOrientationShellCopy(self,theObject):
1790 anObj = self.HealOp.ChangeOrientationCopy(theObject)
1791 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
1794 ## Get a list of wires (wrapped in GEOM_Object-s),
1795 # that constitute a free boundary of the given shape.
1796 # @param theObject Shape to get free boundary of.
1797 # @return [status, theClosedWires, theOpenWires]
1798 # status: FALSE, if an error(s) occured during the method execution.
1799 # theClosedWires: Closed wires on the free boundary of the given shape.
1800 # theOpenWires: Open wires on the free boundary of the given shape.
1802 # @ref tui_measurement_tools_page "Example"
1803 def GetFreeBoundary(self,theObject):
1804 # Example: see GEOM_TestHealing.py
1805 anObj = self.HealOp.GetFreeBoundary(theObject)
1806 RaiseIfFailed("GetFreeBoundary", self.HealOp)
1809 ## Replace coincident faces in theShape by one face.
1810 # @param theShape Initial shape.
1811 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
1812 # @param doKeepNonSolids If FALSE, only solids will present in the result,
1813 # otherwise all initial shapes.
1814 # @return New GEOM_Object, containing a copy of theShape without coincident faces.
1816 # @ref tui_glue_faces "Example"
1817 def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True):
1818 # Example: see GEOM_Spanner.py
1819 anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
1821 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
1824 ## Find coincident faces in theShape for possible gluing.
1825 # @param theShape Initial shape.
1826 # @param theTolerance Maximum distance between faces,
1827 # which can be considered as coincident.
1830 # @ref swig_todo "Example"
1831 def GetGlueFaces(self, theShape, theTolerance):
1832 # Example: see GEOM_Spanner.py
1833 anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
1834 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
1837 ## Replace coincident faces in theShape by one face
1838 # in compliance with given list of faces
1839 # @param theShape Initial shape.
1840 # @param theTolerance Maximum distance between faces,
1841 # which can be considered as coincident.
1842 # @param theFaces List of faces for gluing.
1843 # @param doKeepNonSolids If FALSE, only solids will present in the result,
1844 # otherwise all initial shapes.
1845 # @return New GEOM_Object, containing a copy of theShape
1846 # without some faces.
1848 # @ref swig_todo "Example"
1849 def MakeGlueFacesByList(self, theShape, theTolerance, theFaces, doKeepNonSolids=True):
1850 # Example: see GEOM_Spanner.py
1851 anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces, doKeepNonSolids)
1853 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
1859 ## @addtogroup l3_boolean Boolean Operations
1862 # -----------------------------------------------------------------------------
1863 # Boolean (Common, Cut, Fuse, Section)
1864 # -----------------------------------------------------------------------------
1866 ## Perform one of boolean operations on two given shapes.
1867 # @param theShape1 First argument for boolean operation.
1868 # @param theShape2 Second argument for boolean operation.
1869 # @param theOperation Indicates the operation to be done:
1870 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
1871 # @return New GEOM_Object, containing the result shape.
1873 # @ref tui_fuse "Example"
1874 def MakeBoolean(self,theShape1, theShape2, theOperation):
1875 # Example: see GEOM_TestAll.py
1876 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation)
1877 RaiseIfFailed("MakeBoolean", self.BoolOp)
1880 ## Shortcut to MakeBoolean(s1, s2, 1)
1882 # @ref tui_common "Example 1"
1883 # \n @ref swig_MakeCommon "Example 2"
1884 def MakeCommon(self, s1, s2):
1885 # Example: see GEOM_TestOthers.py
1886 return self.MakeBoolean(s1, s2, 1)
1888 ## Shortcut to MakeBoolean(s1, s2, 2)
1890 # @ref tui_cut "Example 1"
1891 # \n @ref swig_MakeCommon "Example 2"
1892 def MakeCut(self, s1, s2):
1893 # Example: see GEOM_TestOthers.py
1894 return self.MakeBoolean(s1, s2, 2)
1896 ## Shortcut to MakeBoolean(s1, s2, 3)
1898 # @ref tui_fuse "Example 1"
1899 # \n @ref swig_MakeCommon "Example 2"
1900 def MakeFuse(self, s1, s2):
1901 # Example: see GEOM_TestOthers.py
1902 return self.MakeBoolean(s1, s2, 3)
1904 ## Shortcut to MakeBoolean(s1, s2, 4)
1906 # @ref tui_section "Example 1"
1907 # \n @ref swig_MakeCommon "Example 2"
1908 def MakeSection(self, s1, s2):
1909 # Example: see GEOM_TestOthers.py
1910 return self.MakeBoolean(s1, s2, 4)
1915 ## @addtogroup l3_basic_op
1918 ## Perform partition operation.
1919 # @param ListShapes Shapes to be intersected.
1920 # @param ListTools Shapes to intersect theShapes.
1921 # !!!NOTE: Each compound from ListShapes and ListTools will be exploded
1922 # in order to avoid possible intersection between shapes from
1924 # @param Limit Type of resulting shapes (corresponding to TopAbs_ShapeEnum).
1925 # @param KeepNonlimitShapes: if this parameter == 0 - only shapes with
1926 # type <= Limit are kept in the result,
1927 # else - shapes with type > Limit are kept
1928 # also (if they exist)
1930 # After implementation new version of PartitionAlgo (October 2006)
1931 # other parameters are ignored by current functionality. They are kept
1932 # in this function only for support old versions.
1933 # Ignored parameters:
1934 # @param ListKeepInside Shapes, outside which the results will be deleted.
1935 # Each shape from theKeepInside must belong to theShapes also.
1936 # @param ListRemoveInside Shapes, inside which the results will be deleted.
1937 # Each shape from theRemoveInside must belong to theShapes also.
1938 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
1939 # @param ListMaterials Material indices for each shape. Make sence,
1940 # only if theRemoveWebs is TRUE.
1942 # @return New GEOM_Object, containing the result shapes.
1944 # @ref tui_partition "Example"
1945 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
1946 Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
1947 KeepNonlimitShapes=0):
1948 # Example: see GEOM_TestAll.py
1949 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
1950 ListKeepInside, ListRemoveInside,
1951 Limit, RemoveWebs, ListMaterials,
1952 KeepNonlimitShapes);
1953 RaiseIfFailed("MakePartition", self.BoolOp)
1956 ## Perform partition operation.
1957 # This method may be useful if it is needed to make a partition for
1958 # compound contains nonintersected shapes. Performance will be better
1959 # since intersection between shapes from compound is not performed.
1961 # Description of all parameters as in previous method MakePartition()
1963 # !!!NOTE: Passed compounds (via ListShapes or via ListTools)
1964 # have to consist of nonintersecting shapes.
1966 # @return New GEOM_Object, containing the result shapes.
1968 # @ref swig_todo "Example"
1969 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
1970 ListKeepInside=[], ListRemoveInside=[],
1971 Limit=ShapeType["SHAPE"], RemoveWebs=0,
1972 ListMaterials=[], KeepNonlimitShapes=0):
1973 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
1974 ListKeepInside, ListRemoveInside,
1975 Limit, RemoveWebs, ListMaterials,
1976 KeepNonlimitShapes);
1977 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
1980 ## Shortcut to MakePartition()
1982 # @ref tui_partition "Example 1"
1983 # \n @ref swig_Partition "Example 2"
1984 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
1985 Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
1986 KeepNonlimitShapes=0):
1987 # Example: see GEOM_TestOthers.py
1988 anObj = self.MakePartition(ListShapes, ListTools,
1989 ListKeepInside, ListRemoveInside,
1990 Limit, RemoveWebs, ListMaterials,
1991 KeepNonlimitShapes);
1994 ## Perform partition of the Shape with the Plane
1995 # @param theShape Shape to be intersected.
1996 # @param thePlane Tool shape, to intersect theShape.
1997 # @return New GEOM_Object, containing the result shape.
1999 # @ref tui_partition "Example"
2000 def MakeHalfPartition(self,theShape, thePlane):
2001 # Example: see GEOM_TestAll.py
2002 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
2003 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
2006 # end of l3_basic_op
2009 ## @addtogroup l3_transform
2012 ## Translate the given object along the vector, specified
2013 # by its end points, creating its copy before the translation.
2014 # @param theObject The object to be translated.
2015 # @param thePoint1 Start point of translation vector.
2016 # @param thePoint2 End point of translation vector.
2017 # @return New GEOM_Object, containing the translated object.
2019 # @ref tui_translation "Example 1"
2020 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
2021 def MakeTranslationTwoPoints(self,theObject, thePoint1, thePoint2):
2022 # Example: see GEOM_TestAll.py
2023 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
2024 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
2027 ## Translate the given object along the vector, specified
2028 # by its components, creating its copy before the translation.
2029 # @param theObject The object to be translated.
2030 # @param theDX,theDY,theDZ Components of translation vector.
2031 # @return New GEOM_Object, containing the translated object.
2033 # @ref tui_translation "Example"
2034 def MakeTranslation(self,theObject, theDX, theDY, theDZ):
2035 # Example: see GEOM_TestAll.py
2036 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
2037 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
2040 ## Translate the given object along the given vector,
2041 # creating its copy before the translation.
2042 # @param theObject The object to be translated.
2043 # @param theVector The translation vector.
2044 # @return New GEOM_Object, containing the translated object.
2046 # @ref tui_translation "Example"
2047 def MakeTranslationVector(self,theObject, theVector):
2048 # Example: see GEOM_TestAll.py
2049 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
2050 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
2053 ## Translate the given object along the given vector on given distance,
2054 # creating its copy before the translation.
2055 # @param theObject The object to be translated.
2056 # @param theVector The translation vector.
2057 # @param theDistance The translation distance.
2058 # @return New GEOM_Object, containing the translated object.
2060 # @ref tui_translation "Example"
2061 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance):
2062 # Example: see GEOM_TestAll.py
2063 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
2064 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
2067 ## Rotate the given object around the given axis
2068 # on the given angle, creating its copy before the rotatation.
2069 # @param theObject The object to be rotated.
2070 # @param theAxis Rotation axis.
2071 # @param theAngle Rotation angle in radians.
2072 # @return New GEOM_Object, containing the rotated object.
2074 # @ref tui_rotation "Example"
2075 def MakeRotation(self,theObject, theAxis, theAngle):
2076 # Example: see GEOM_TestAll.py
2077 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
2078 RaiseIfFailed("RotateCopy", self.TrsfOp)
2081 ## Rotate given object around vector perpendicular to plane
2082 # containing three points, creating its copy before the rotatation.
2083 # @param theObject The object to be rotated.
2084 # @param theCentPoint central point - the axis is the vector perpendicular to the plane
2085 # containing the three points.
2086 # @param thePoint1,thePoint2 - in a perpendicular plane of the axis.
2087 # @return New GEOM_Object, containing the rotated object.
2089 # @ref tui_rotation "Example"
2090 def MakeRotationThreePoints(self,theObject, theCentPoint, thePoint1, thePoint2):
2091 # Example: see GEOM_TestAll.py
2092 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
2093 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
2096 ## Scale the given object by the factor, creating its copy before the scaling.
2097 # @param theObject The object to be scaled.
2098 # @param thePoint Center point for scaling.
2099 # Passing None for it means scaling relatively the origin of global CS.
2100 # @param theFactor Scaling factor value.
2101 # @return New GEOM_Object, containing the scaled shape.
2103 # @ref tui_scale "Example"
2104 def MakeScaleTransform(self, theObject, thePoint, theFactor):
2105 # Example: see GEOM_TestAll.py
2106 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
2107 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
2110 ## Scale the given object by different factors along coordinate axes,
2111 # creating its copy before the scaling.
2112 # @param theObject The object to be scaled.
2113 # @param thePoint Center point for scaling.
2114 # Passing None for it means scaling relatively the origin of global CS.
2115 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
2116 # @return New GEOM_Object, containing the scaled shape.
2118 # @ref swig_scale "Example"
2119 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ):
2120 # Example: see GEOM_TestAll.py
2121 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
2122 theFactorX, theFactorY, theFactorZ)
2123 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
2126 ## Create an object, symmetrical
2127 # to the given one relatively the given plane.
2128 # @param theObject The object to be mirrored.
2129 # @param thePlane Plane of symmetry.
2130 # @return New GEOM_Object, containing the mirrored shape.
2132 # @ref tui_mirror "Example"
2133 def MakeMirrorByPlane(self,theObject, thePlane):
2134 # Example: see GEOM_TestAll.py
2135 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
2136 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
2139 ## Create an object, symmetrical
2140 # to the given one relatively the given axis.
2141 # @param theObject The object to be mirrored.
2142 # @param theAxis Axis of symmetry.
2143 # @return New GEOM_Object, containing the mirrored shape.
2145 # @ref tui_mirror "Example"
2146 def MakeMirrorByAxis(self,theObject, theAxis):
2147 # Example: see GEOM_TestAll.py
2148 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
2149 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
2152 ## Create an object, symmetrical
2153 # to the given one relatively the given point.
2154 # @param theObject The object to be mirrored.
2155 # @param thePoint Point of symmetry.
2156 # @return New GEOM_Object, containing the mirrored shape.
2158 # @ref tui_mirror "Example"
2159 def MakeMirrorByPoint(self,theObject, thePoint):
2160 # Example: see GEOM_TestAll.py
2161 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
2162 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
2165 ## Modify the Location of the given object by LCS,
2166 # creating its copy before the setting.
2167 # @param theObject The object to be displaced.
2168 # @param theStartLCS Coordinate system to perform displacement from it.
2169 # If \a theStartLCS is NULL, displacement
2170 # will be performed from global CS.
2171 # If \a theObject itself is used as \a theStartLCS,
2172 # its location will be changed to \a theEndLCS.
2173 # @param theEndLCS Coordinate system to perform displacement to it.
2174 # @return New GEOM_Object, containing the displaced shape.
2176 # @ref tui_modify_location "Example"
2177 def MakePosition(self,theObject, theStartLCS, theEndLCS):
2178 # Example: see GEOM_TestAll.py
2179 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
2180 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
2183 ## Create new object as offset of the given one.
2184 # @param theObject The base object for the offset.
2185 # @param theOffset Offset value.
2186 # @return New GEOM_Object, containing the offset object.
2188 # @ref tui_offset "Example"
2189 def MakeOffset(self,theObject, theOffset):
2190 # Example: see GEOM_TestAll.py
2191 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
2192 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
2195 # -----------------------------------------------------------------------------
2197 # -----------------------------------------------------------------------------
2199 ## Translate the given object along the given vector a given number times
2200 # @param theObject The object to be translated.
2201 # @param theVector Direction of the translation.
2202 # @param theStep Distance to translate on.
2203 # @param theNbTimes Quantity of translations to be done.
2204 # @return New GEOM_Object, containing compound of all
2205 # the shapes, obtained after each translation.
2207 # @ref tui_multi_translation "Example"
2208 def MakeMultiTranslation1D(self,theObject, theVector, theStep, theNbTimes):
2209 # Example: see GEOM_TestAll.py
2210 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
2211 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
2214 ## Conseqently apply two specified translations to theObject specified number of times.
2215 # @param theObject The object to be translated.
2216 # @param theVector1 Direction of the first translation.
2217 # @param theStep1 Step of the first translation.
2218 # @param theNbTimes1 Quantity of translations to be done along theVector1.
2219 # @param theVector2 Direction of the second translation.
2220 # @param theStep2 Step of the second translation.
2221 # @param theNbTimes2 Quantity of translations to be done along theVector2.
2222 # @return New GEOM_Object, containing compound of all
2223 # the shapes, obtained after each translation.
2225 # @ref tui_multi_translation "Example"
2226 def MakeMultiTranslation2D(self,theObject, theVector1, theStep1, theNbTimes1,
2227 theVector2, theStep2, theNbTimes2):
2228 # Example: see GEOM_TestAll.py
2229 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
2230 theVector2, theStep2, theNbTimes2)
2231 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
2234 ## Rotate the given object around the given axis a given number times.
2235 # Rotation angle will be 2*PI/theNbTimes.
2236 # @param theObject The object to be rotated.
2237 # @param theAxis The rotation axis.
2238 # @param theNbTimes Quantity of rotations to be done.
2239 # @return New GEOM_Object, containing compound of all the
2240 # shapes, obtained after each rotation.
2242 # @ref tui_multi_rotation "Example"
2243 def MultiRotate1D(self,theObject, theAxis, theNbTimes):
2244 # Example: see GEOM_TestAll.py
2245 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
2246 RaiseIfFailed("MultiRotate1D", self.TrsfOp)
2249 ## Rotate the given object around the
2250 # given axis on the given angle a given number
2251 # times and multi-translate each rotation result.
2252 # Translation direction passes through center of gravity
2253 # of rotated shape and its projection on the rotation axis.
2254 # @param theObject The object to be rotated.
2255 # @param theAxis Rotation axis.
2256 # @param theAngle Rotation angle in graduces.
2257 # @param theNbTimes1 Quantity of rotations to be done.
2258 # @param theStep Translation distance.
2259 # @param theNbTimes2 Quantity of translations to be done.
2260 # @return New GEOM_Object, containing compound of all the
2261 # shapes, obtained after each transformation.
2263 # @ref tui_multi_rotation "Example"
2264 def MultiRotate2D(self,theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2):
2265 # Example: see GEOM_TestAll.py
2266 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
2267 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
2270 ## The same, as MultiRotate1D(), but axis is given by direction and point
2271 # @ref swig_MakeMultiRotation "Example"
2272 def MakeMultiRotation1D(self,aShape,aDir,aPoint,aNbTimes):
2273 # Example: see GEOM_TestOthers.py
2274 aVec = self.MakeLine(aPoint,aDir)
2275 anObj = self.MultiRotate1D(aShape,aVec,aNbTimes)
2278 ## The same, as MultiRotate2D(), but axis is given by direction and point
2279 # @ref swig_MakeMultiRotation "Example"
2280 def MakeMultiRotation2D(self,aShape,aDir,aPoint,anAngle,nbtimes1,aStep,nbtimes2):
2281 # Example: see GEOM_TestOthers.py
2282 aVec = self.MakeLine(aPoint,aDir)
2283 anObj = self.MultiRotate2D(aShape,aVec,anAngle,nbtimes1,aStep,nbtimes2)
2286 # end of l3_transform
2289 ## @addtogroup l3_local
2292 ## Perform a fillet on all edges of the given shape.
2293 # @param theShape Shape, to perform fillet on.
2294 # @param theR Fillet radius.
2295 # @return New GEOM_Object, containing the result shape.
2297 # @ref tui_fillet "Example 1"
2298 # \n @ref swig_MakeFilletAll "Example 2"
2299 def MakeFilletAll(self,theShape, theR):
2300 # Example: see GEOM_TestOthers.py
2301 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
2302 RaiseIfFailed("MakeFilletAll", self.LocalOp)
2305 ## Perform a fillet on the specified edges/faces of the given shape
2306 # @param theShape Shape, to perform fillet on.
2307 # @param theR Fillet radius.
2308 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR>.
2309 # @param theListShapes Global indices of edges/faces to perform fillet on.
2310 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2311 # @return New GEOM_Object, containing the result shape.
2313 # @ref tui_fillet "Example"
2314 def MakeFillet(self,theShape, theR, theShapeType, theListShapes):
2315 # Example: see GEOM_TestAll.py
2317 if theShapeType == ShapeType["EDGE"]:
2318 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
2319 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
2321 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
2322 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
2325 ## The same that MakeFillet but with two Fillet Radius R1 and R2
2326 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes):
2328 if theShapeType == ShapeType["EDGE"]:
2329 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
2330 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
2332 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
2333 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
2336 ## Perform a symmetric chamfer on all edges of the given shape.
2337 # @param theShape Shape, to perform chamfer on.
2338 # @param theD Chamfer size along each face.
2339 # @return New GEOM_Object, containing the result shape.
2341 # @ref tui_chamfer "Example 1"
2342 # \n @ref swig_MakeChamferAll "Example 2"
2343 def MakeChamferAll(self,theShape, theD):
2344 # Example: see GEOM_TestOthers.py
2345 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
2346 RaiseIfFailed("MakeChamferAll", self.LocalOp)
2349 ## Perform a chamfer on edges, common to the specified faces,
2350 # with distance D1 on the Face1
2351 # @param theShape Shape, to perform chamfer on.
2352 # @param theD1 Chamfer size along \a theFace1.
2353 # @param theD2 Chamfer size along \a theFace2.
2354 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
2355 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2356 # @return New GEOM_Object, containing the result shape.
2358 # @ref tui_chamfer "Example"
2359 def MakeChamferEdge(self,theShape, theD1, theD2, theFace1, theFace2):
2360 # Example: see GEOM_TestAll.py
2361 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
2362 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
2365 ## The Same that MakeChamferEdge but with params theD is chamfer length and
2366 # theAngle is Angle of chamfer (angle in radians)
2367 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2):
2368 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
2369 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
2372 ## Perform a chamfer on all edges of the specified faces,
2373 # with distance D1 on the first specified face (if several for one edge)
2374 # @param theShape Shape, to perform chamfer on.
2375 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
2376 # connected to the edge, are in \a theFaces, \a theD1
2377 # will be get along face, which is nearer to \a theFaces beginning.
2378 # @param theD2 Chamfer size along another of two faces, connected to the edge.
2379 # @param theFaces Sequence of global indices of faces of \a theShape.
2380 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2381 # @return New GEOM_Object, containing the result shape.
2383 # @ref tui_chamfer "Example"
2384 def MakeChamferFaces(self,theShape, theD1, theD2, theFaces):
2385 # Example: see GEOM_TestAll.py
2386 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
2387 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
2390 ## The Same that MakeChamferFaces but with params theD is chamfer lenght and
2391 # theAngle is Angle of chamfer (angle in radians)
2393 # @ref swig_FilletChamfer "Example"
2394 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces):
2395 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
2396 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
2399 ## Perform a chamfer on edges,
2400 # with distance D1 on the first specified face (if several for one edge)
2401 # @param theShape Shape, to perform chamfer on.
2402 # @param theD1,theD2 Chamfer size
2403 # @param theEdges Sequence of edges of \a theShape.
2404 # @return New GEOM_Object, containing the result shape.
2406 # @ref swig_FilletChamfer "Example"
2407 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges):
2408 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
2409 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
2412 ## The Same that MakeChamferEdges but with params theD is chamfer lenght and
2413 # theAngle is Angle of chamfer (angle in radians)
2414 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges):
2415 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
2416 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
2419 ## Shortcut to MakeChamferEdge() and MakeChamferFaces()
2421 # @ref swig_MakeChamfer "Example"
2422 def MakeChamfer(self,aShape,d1,d2,aShapeType,ListShape):
2423 # Example: see GEOM_TestOthers.py
2425 if aShapeType == ShapeType["EDGE"]:
2426 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1])
2428 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape)
2434 ## @addtogroup l3_basic_op
2437 ## Perform an Archimde operation on the given shape with given parameters.
2438 # The object presenting the resulting face is returned.
2439 # @param theShape Shape to be put in water.
2440 # @param theWeight Weight og the shape.
2441 # @param theWaterDensity Density of the water.
2442 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
2443 # @return New GEOM_Object, containing a section of \a theShape
2444 # by a plane, corresponding to water level.
2446 # @ref tui_archimede "Example"
2447 def Archimede(self,theShape, theWeight, theWaterDensity, theMeshDeflection):
2448 # Example: see GEOM_TestAll.py
2449 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
2450 RaiseIfFailed("MakeArchimede", self.LocalOp)
2453 # end of l3_basic_op
2456 ## @addtogroup l2_measure
2459 ## Get point coordinates
2462 # @ref tui_measurement_tools_page "Example"
2463 def PointCoordinates(self,Point):
2464 # Example: see GEOM_TestMeasures.py
2465 aTuple = self.MeasuOp.PointCoordinates(Point)
2466 RaiseIfFailed("PointCoordinates", self.MeasuOp)
2469 ## Get summarized length of all wires,
2470 # area of surface and volume of the given shape.
2471 # @param theShape Shape to define properties of.
2472 # @return [theLength, theSurfArea, theVolume]
2473 # theLength: Summarized length of all wires of the given shape.
2474 # theSurfArea: Area of surface of the given shape.
2475 # theVolume: Volume of the given shape.
2477 # @ref tui_measurement_tools_page "Example"
2478 def BasicProperties(self,theShape):
2479 # Example: see GEOM_TestMeasures.py
2480 aTuple = self.MeasuOp.GetBasicProperties(theShape)
2481 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
2484 ## Get parameters of bounding box of the given shape
2485 # @param theShape Shape to obtain bounding box of.
2486 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
2487 # Xmin,Xmax: Limits of shape along OX axis.
2488 # Ymin,Ymax: Limits of shape along OY axis.
2489 # Zmin,Zmax: Limits of shape along OZ axis.
2491 # @ref tui_measurement_tools_page "Example"
2492 def BoundingBox(self,theShape):
2493 # Example: see GEOM_TestMeasures.py
2494 aTuple = self.MeasuOp.GetBoundingBox(theShape)
2495 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
2498 ## Get inertia matrix and moments of inertia of theShape.
2499 # @param theShape Shape to calculate inertia of.
2500 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
2501 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
2502 # Ix,Iy,Iz: Moments of inertia of the given shape.
2504 # @ref tui_measurement_tools_page "Example"
2505 def Inertia(self,theShape):
2506 # Example: see GEOM_TestMeasures.py
2507 aTuple = self.MeasuOp.GetInertia(theShape)
2508 RaiseIfFailed("GetInertia", self.MeasuOp)
2511 ## Get minimal distance between the given shapes.
2512 # @param theShape1,theShape2 Shapes to find minimal distance between.
2513 # @return Value of the minimal distance between the given shapes.
2515 # @ref tui_measurement_tools_page "Example"
2516 def MinDistance(self, theShape1, theShape2):
2517 # Example: see GEOM_TestMeasures.py
2518 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
2519 RaiseIfFailed("GetMinDistance", self.MeasuOp)
2522 ## Get minimal distance between the given shapes.
2523 # @param theShape1,theShape2 Shapes to find minimal distance between.
2524 # @return Value of the minimal distance between the given shapes.
2526 # @ref swig_all_measure "Example"
2527 def MinDistanceComponents(self, theShape1, theShape2):
2528 # Example: see GEOM_TestMeasures.py
2529 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
2530 RaiseIfFailed("GetMinDistance", self.MeasuOp)
2531 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
2534 ## Get angle between the given shapes in degrees.
2535 # @param theShape1,theShape2 Lines or linear edges to find angle between.
2536 # @return Value of the angle between the given shapes in degrees.
2538 # @ref tui_measurement_tools_page "Example"
2539 def GetAngle(self, theShape1, theShape2):
2540 # Example: see GEOM_TestMeasures.py
2541 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
2542 RaiseIfFailed("GetAngle", self.MeasuOp)
2544 ## Get angle between the given shapes in radians.
2545 # @param theShape1,theShape2 Lines or linear edges to find angle between.
2546 # @return Value of the angle between the given shapes in radians.
2548 # @ref tui_measurement_tools_page "Example"
2549 def GetAngleRadians(self, theShape1, theShape2):
2550 # Example: see GEOM_TestMeasures.py
2551 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
2552 RaiseIfFailed("GetAngle", self.MeasuOp)
2555 ## @name Curve Curvature Measurement
2556 # Methods for receiving radius of curvature of curves
2557 # in the given point
2560 ## Measure curvature of a curve at a point, set by parameter.
2561 # @ref swig_todo "Example"
2562 def CurveCurvatureByParam(self, theCurve, theParam):
2563 # Example: see GEOM_TestMeasures.py
2564 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
2565 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
2569 # @ref swig_todo "Example"
2570 def CurveCurvatureByPoint(self, theCurve, thePoint):
2571 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
2572 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
2576 ## @name Surface Curvature Measurement
2577 # Methods for receiving max and min radius of curvature of surfaces
2578 # in the given point
2582 ## @ref swig_todo "Example"
2583 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
2584 # Example: see GEOM_TestMeasures.py
2585 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
2586 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
2590 ## @ref swig_todo "Example"
2591 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
2592 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
2593 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
2597 ## @ref swig_todo "Example"
2598 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
2599 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
2600 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
2604 ## @ref swig_todo "Example"
2605 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
2606 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
2607 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
2611 ## Get min and max tolerances of sub-shapes of theShape
2612 # @param theShape Shape, to get tolerances of.
2613 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
2614 # FaceMin,FaceMax: Min and max tolerances of the faces.
2615 # EdgeMin,EdgeMax: Min and max tolerances of the edges.
2616 # VertMin,VertMax: Min and max tolerances of the vertices.
2618 # @ref tui_measurement_tools_page "Example"
2619 def Tolerance(self,theShape):
2620 # Example: see GEOM_TestMeasures.py
2621 aTuple = self.MeasuOp.GetTolerance(theShape)
2622 RaiseIfFailed("GetTolerance", self.MeasuOp)
2625 ## Obtain description of the given shape (number of sub-shapes of each type)
2626 # @param theShape Shape to be described.
2627 # @return Description of the given shape.
2629 # @ref tui_measurement_tools_page "Example"
2630 def WhatIs(self,theShape):
2631 # Example: see GEOM_TestMeasures.py
2632 aDescr = self.MeasuOp.WhatIs(theShape)
2633 RaiseIfFailed("WhatIs", self.MeasuOp)
2636 ## Get a point, situated at the centre of mass of theShape.
2637 # @param theShape Shape to define centre of mass of.
2638 # @return New GEOM_Object, containing the created point.
2640 # @ref tui_measurement_tools_page "Example"
2641 def MakeCDG(self,theShape):
2642 # Example: see GEOM_TestMeasures.py
2643 anObj = self.MeasuOp.GetCentreOfMass(theShape)
2644 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
2647 ## Get a normale to the given face. If the point is not given,
2648 # the normale is calculated at the center of mass.
2649 # @param theFace Face to define normale of.
2650 # @param theOptionalPoint Point to compute the normale at.
2651 # @return New GEOM_Object, containing the created vector.
2653 # @ref swig_todo "Example"
2654 def GetNormal(self, theFace, theOptionalPoint = None):
2655 # Example: see GEOM_TestMeasures.py
2656 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
2657 RaiseIfFailed("GetNormal", self.MeasuOp)
2660 ## Check a topology of the given shape.
2661 # @param theShape Shape to check validity of.
2662 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked,
2663 # if TRUE, the shape's geometry will be checked also.
2664 # @return TRUE, if the shape "seems to be valid".
2665 # If theShape is invalid, prints a description of problem.
2667 # @ref tui_measurement_tools_page "Example"
2668 def CheckShape(self,theShape, theIsCheckGeom = 0):
2669 # Example: see GEOM_TestMeasures.py
2671 (IsValid, Status) = self.MeasuOp.CheckShapeWithGeometry(theShape)
2672 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
2674 (IsValid, Status) = self.MeasuOp.CheckShape(theShape)
2675 RaiseIfFailed("CheckShape", self.MeasuOp)
2680 ## Get position (LCS) of theShape.
2682 # Origin of the LCS is situated at the shape's center of mass.
2683 # Axes of the LCS are obtained from shape's location or,
2684 # if the shape is a planar face, from position of its plane.
2686 # @param theShape Shape to calculate position of.
2687 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
2688 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
2689 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
2690 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
2692 # @ref swig_todo "Example"
2693 def GetPosition(self,theShape):
2694 # Example: see GEOM_TestMeasures.py
2695 aTuple = self.MeasuOp.GetPosition(theShape)
2696 RaiseIfFailed("GetPosition", self.MeasuOp)
2699 ## Get kind of theShape.
2701 # @param theShape Shape to get a kind of.
2702 # @return Returns a kind of shape in terms of <VAR>GEOM_IKindOfShape.shape_kind</VAR> enumeration
2703 # and a list of parameters, describing the shape.
2704 # @note Concrete meaning of each value, returned via \a theIntegers
2705 # or \a theDoubles list depends on the kind of the shape.
2706 # The full list of possible outputs is:
2708 # - geompy.kind.COMPOUND nb_solids nb_faces nb_edges nb_vertices
2709 # - geompy.kind.COMPSOLID nb_solids nb_faces nb_edges nb_vertices
2711 # - geompy.kind.SHELL geompy.info.CLOSED nb_faces nb_edges nb_vertices
2712 # - geompy.kind.SHELL geompy.info.UNCLOSED nb_faces nb_edges nb_vertices
2714 # - geompy.kind.WIRE geompy.info.CLOSED nb_edges nb_vertices
2715 # - geompy.kind.WIRE geompy.info.UNCLOSED nb_edges nb_vertices
2717 # - geompy.kind.SPHERE xc yc zc R
2718 # - geompy.kind.CYLINDER xb yb zb dx dy dz R H
2719 # - geompy.kind.BOX xc yc zc ax ay az
2720 # - geompy.kind.ROTATED_BOX xc yc zc zx zy zz xx xy xz ax ay az
2721 # - geompy.kind.TORUS xc yc zc dx dy dz R_1 R_2
2722 # - geompy.kind.CONE xb yb zb dx dy dz R_1 R_2 H
2723 # - geompy.kind.POLYHEDRON nb_faces nb_edges nb_vertices
2724 # - geompy.kind.SOLID nb_faces nb_edges nb_vertices
2726 # - geompy.kind.SPHERE2D xc yc zc R
2727 # - geompy.kind.CYLINDER2D xb yb zb dx dy dz R H
2728 # - geompy.kind.TORUS2D xc yc zc dx dy dz R_1 R_2
2729 # - geompy.kind.CONE2D xc yc zc dx dy dz R_1 R_2 H
2730 # - geompy.kind.DISK_CIRCLE xc yc zc dx dy dz R
2731 # - geompy.kind.DISK_ELLIPSE xc yc zc dx dy dz R_1 R_2
2732 # - geompy.kind.POLYGON xo yo zo dx dy dz nb_edges nb_vertices
2733 # - geompy.kind.PLANE xo yo zo dx dy dz
2734 # - geompy.kind.PLANAR xo yo zo dx dy dz nb_edges nb_vertices
2735 # - geompy.kind.FACE nb_edges nb_vertices
2737 # - geompy.kind.CIRCLE xc yc zc dx dy dz R
2738 # - geompy.kind.ARC_CIRCLE xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2
2739 # - geompy.kind.ELLIPSE xc yc zc dx dy dz R_1 R_2
2740 # - geompy.kind.ARC_ELLIPSE xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2
2741 # - geompy.kind.LINE xo yo zo dx dy dz
2742 # - geompy.kind.SEGMENT x1 y1 z1 x2 y2 z2
2743 # - geompy.kind.EDGE nb_vertices
2745 # - geompy.kind.VERTEX x y z
2747 # @ref swig_todo "Example"
2748 def KindOfShape(self,theShape):
2749 # Example: see GEOM_TestMeasures.py
2750 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
2751 RaiseIfFailed("KindOfShape", self.MeasuOp)
2753 aKind = aRoughTuple[0]
2754 anInts = aRoughTuple[1]
2755 aDbls = aRoughTuple[2]
2757 # Now there is no exception from this rule:
2758 aKindTuple = [aKind] + aDbls + anInts
2760 # If they are we will regroup parameters for such kind of shape.
2762 #if aKind == kind.SOME_KIND:
2763 # # SOME_KIND int int double int double double
2764 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
2771 ## @addtogroup l2_import_export
2774 ## Import a shape from the BREP or IGES or STEP file
2775 # (depends on given format) with given name.
2776 # @param theFileName The file, containing the shape.
2777 # @param theFormatName Specify format for the file reading.
2778 # Available formats can be obtained with InsertOp.ImportTranslators() method.
2779 # @return New GEOM_Object, containing the imported shape.
2781 # @ref swig_Import_Export "Example"
2782 def Import(self,theFileName, theFormatName):
2783 # Example: see GEOM_TestOthers.py
2784 anObj = self.InsertOp.Import(theFileName, theFormatName)
2785 RaiseIfFailed("Import", self.InsertOp)
2788 ## Shortcut to Import() for BREP format
2790 # @ref swig_Import_Export "Example"
2791 def ImportBREP(self,theFileName):
2792 # Example: see GEOM_TestOthers.py
2793 return self.Import(theFileName, "BREP")
2795 ## Shortcut to Import() for IGES format
2797 # @ref swig_Import_Export "Example"
2798 def ImportIGES(self,theFileName):
2799 # Example: see GEOM_TestOthers.py
2800 return self.Import(theFileName, "IGES")
2802 ## Shortcut to Import() for STEP format
2804 # @ref swig_Import_Export "Example"
2805 def ImportSTEP(self,theFileName):
2806 # Example: see GEOM_TestOthers.py
2807 return self.Import(theFileName, "STEP")
2809 ## Export the given shape into a file with given name.
2810 # @param theObject Shape to be stored in the file.
2811 # @param theFileName Name of the file to store the given shape in.
2812 # @param theFormatName Specify format for the shape storage.
2813 # Available formats can be obtained with InsertOp.ImportTranslators() method.
2815 # @ref swig_Import_Export "Example"
2816 def Export(self,theObject, theFileName, theFormatName):
2817 # Example: see GEOM_TestOthers.py
2818 self.InsertOp.Export(theObject, theFileName, theFormatName)
2819 if self.InsertOp.IsDone() == 0:
2820 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
2824 ## Shortcut to Export() for BREP format
2826 # @ref swig_Import_Export "Example"
2827 def ExportBREP(self,theObject, theFileName):
2828 # Example: see GEOM_TestOthers.py
2829 return self.Export(theObject, theFileName, "BREP")
2831 ## Shortcut to Export() for IGES format
2833 # @ref swig_Import_Export "Example"
2834 def ExportIGES(self,theObject, theFileName):
2835 # Example: see GEOM_TestOthers.py
2836 return self.Export(theObject, theFileName, "IGES")
2838 ## Shortcut to Export() for STEP format
2840 # @ref swig_Import_Export "Example"
2841 def ExportSTEP(self,theObject, theFileName):
2842 # Example: see GEOM_TestOthers.py
2843 return self.Export(theObject, theFileName, "STEP")
2845 # end of l2_import_export
2848 ## @addtogroup l3_blocks
2851 ## Create a quadrangle face from four edges. Order of Edges is not
2852 # important. It is not necessary that edges share the same vertex.
2853 # @param E1,E2,E3,E4 Edges for the face bound.
2854 # @return New GEOM_Object, containing the created face.
2856 # @ref tui_building_by_blocks_page "Example"
2857 def MakeQuad(self,E1, E2, E3, E4):
2858 # Example: see GEOM_Spanner.py
2859 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
2860 RaiseIfFailed("MakeQuad", self.BlocksOp)
2863 ## Create a quadrangle face on two edges.
2864 # The missing edges will be built by creating the shortest ones.
2865 # @param E1,E2 Two opposite edges for the face.
2866 # @return New GEOM_Object, containing the created face.
2868 # @ref tui_building_by_blocks_page "Example"
2869 def MakeQuad2Edges(self,E1, E2):
2870 # Example: see GEOM_Spanner.py
2871 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
2872 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
2875 ## Create a quadrangle face with specified corners.
2876 # The missing edges will be built by creating the shortest ones.
2877 # @param V1,V2,V3,V4 Corner vertices for the face.
2878 # @return New GEOM_Object, containing the created face.
2880 # @ref tui_building_by_blocks_page "Example 1"
2881 # \n @ref swig_MakeQuad4Vertices "Example 2"
2882 def MakeQuad4Vertices(self,V1, V2, V3, V4):
2883 # Example: see GEOM_Spanner.py
2884 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
2885 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
2888 ## Create a hexahedral solid, bounded by the six given faces. Order of
2889 # faces is not important. It is not necessary that Faces share the same edge.
2890 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
2891 # @return New GEOM_Object, containing the created solid.
2893 # @ref tui_building_by_blocks_page "Example 1"
2894 # \n @ref swig_MakeHexa "Example 2"
2895 def MakeHexa(self,F1, F2, F3, F4, F5, F6):
2896 # Example: see GEOM_Spanner.py
2897 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
2898 RaiseIfFailed("MakeHexa", self.BlocksOp)
2901 ## Create a hexahedral solid between two given faces.
2902 # The missing faces will be built by creating the smallest ones.
2903 # @param F1,F2 Two opposite faces for the hexahedral solid.
2904 # @return New GEOM_Object, containing the created solid.
2906 # @ref tui_building_by_blocks_page "Example 1"
2907 # \n @ref swig_MakeHexa2Faces "Example 2"
2908 def MakeHexa2Faces(self,F1, F2):
2909 # Example: see GEOM_Spanner.py
2910 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
2911 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
2917 ## @addtogroup l3_blocks_op
2920 ## Get a vertex, found in the given shape by its coordinates.
2921 # @param theShape Block or a compound of blocks.
2922 # @param theX,theY,theZ Coordinates of the sought vertex.
2923 # @param theEpsilon Maximum allowed distance between the resulting
2924 # vertex and point with the given coordinates.
2925 # @return New GEOM_Object, containing the found vertex.
2927 # @ref swig_GetPoint "Example"
2928 def GetPoint(self,theShape, theX, theY, theZ, theEpsilon):
2929 # Example: see GEOM_TestOthers.py
2930 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
2931 RaiseIfFailed("GetPoint", self.BlocksOp)
2934 ## Get an edge, found in the given shape by two given vertices.
2935 # @param theShape Block or a compound of blocks.
2936 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
2937 # @return New GEOM_Object, containing the found edge.
2939 # @ref swig_todo "Example"
2940 def GetEdge(self,theShape, thePoint1, thePoint2):
2941 # Example: see GEOM_Spanner.py
2942 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
2943 RaiseIfFailed("GetEdge", self.BlocksOp)
2946 ## Find an edge of the given shape, which has minimal distance to the given point.
2947 # @param theShape Block or a compound of blocks.
2948 # @param thePoint Point, close to the desired edge.
2949 # @return New GEOM_Object, containing the found edge.
2951 # @ref swig_GetEdgeNearPoint "Example"
2952 def GetEdgeNearPoint(self,theShape, thePoint):
2953 # Example: see GEOM_TestOthers.py
2954 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
2955 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
2958 ## Returns a face, found in the given shape by four given corner vertices.
2959 # @param theShape Block or a compound of blocks.
2960 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
2961 # @return New GEOM_Object, containing the found face.
2963 # @ref swig_todo "Example"
2964 def GetFaceByPoints(self,theShape, thePoint1, thePoint2, thePoint3, thePoint4):
2965 # Example: see GEOM_Spanner.py
2966 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
2967 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
2970 ## Get a face of block, found in the given shape by two given edges.
2971 # @param theShape Block or a compound of blocks.
2972 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
2973 # @return New GEOM_Object, containing the found face.
2975 # @ref swig_todo "Example"
2976 def GetFaceByEdges(self,theShape, theEdge1, theEdge2):
2977 # Example: see GEOM_Spanner.py
2978 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
2979 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
2982 ## Find a face, opposite to the given one in the given block.
2983 # @param theBlock Must be a hexahedral solid.
2984 # @param theFace Face of \a theBlock, opposite to the desired face.
2985 # @return New GEOM_Object, containing the found face.
2987 # @ref swig_GetOppositeFace "Example"
2988 def GetOppositeFace(self,theBlock, theFace):
2989 # Example: see GEOM_Spanner.py
2990 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
2991 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
2994 ## Find a face of the given shape, which has minimal distance to the given point.
2995 # @param theShape Block or a compound of blocks.
2996 # @param thePoint Point, close to the desired face.
2997 # @return New GEOM_Object, containing the found face.
2999 # @ref swig_GetFaceNearPoint "Example"
3000 def GetFaceNearPoint(self,theShape, thePoint):
3001 # Example: see GEOM_Spanner.py
3002 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
3003 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
3006 ## Find a face of block, whose outside normale has minimal angle with the given vector.
3007 # @param theBlock Block or a compound of blocks.
3008 # @param theVector Vector, close to the normale of the desired face.
3009 # @return New GEOM_Object, containing the found face.
3011 # @ref swig_todo "Example"
3012 def GetFaceByNormale(self, theBlock, theVector):
3013 # Example: see GEOM_Spanner.py
3014 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
3015 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
3018 # end of l3_blocks_op
3021 ## @addtogroup l4_blocks_measure
3024 ## Check, if the compound of blocks is given.
3025 # To be considered as a compound of blocks, the
3026 # given shape must satisfy the following conditions:
3027 # - Each element of the compound should be a Block (6 faces and 12 edges).
3028 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
3029 # - The compound should be connexe.
3030 # - The glue between two quadrangle faces should be applied.
3031 # @param theCompound The compound to check.
3032 # @return TRUE, if the given shape is a compound of blocks.
3033 # If theCompound is not valid, prints all discovered errors.
3035 # @ref tui_measurement_tools_page "Example 1"
3036 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
3037 def CheckCompoundOfBlocks(self,theCompound):
3038 # Example: see GEOM_Spanner.py
3039 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
3040 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
3042 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
3046 ## Remove all seam and degenerated edges from \a theShape.
3047 # Unite faces and edges, sharing one surface. It means that
3048 # this faces must have references to one C++ surface object (handle).
3049 # @param theShape The compound or single solid to remove irregular edges from.
3050 # @return Improved shape.
3052 # @ref swig_RemoveExtraEdges "Example"
3053 def RemoveExtraEdges(self,theShape):
3054 # Example: see GEOM_TestOthers.py
3055 anObj = self.BlocksOp.RemoveExtraEdges(theShape)
3056 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
3059 ## Check, if the given shape is a blocks compound.
3060 # Fix all detected errors.
3061 # \note Single block can be also fixed by this method.
3062 # @param theShape The compound to check and improve.
3063 # @return Improved compound.
3065 # @ref swig_CheckAndImprove "Example"
3066 def CheckAndImprove(self,theShape):
3067 # Example: see GEOM_TestOthers.py
3068 anObj = self.BlocksOp.CheckAndImprove(theShape)
3069 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
3072 # end of l4_blocks_measure
3075 ## @addtogroup l3_blocks_op
3078 ## Get all the blocks, contained in the given compound.
3079 # @param theCompound The compound to explode.
3080 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
3081 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
3082 # \note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
3083 # @return List of GEOM_Objects, containing the retrieved blocks.
3085 # @ref tui_explode_on_blocks "Example 1"
3086 # \n @ref swig_MakeBlockExplode "Example 2"
3087 def MakeBlockExplode(self,theCompound, theMinNbFaces, theMaxNbFaces):
3088 # Example: see GEOM_TestOthers.py
3089 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
3090 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
3093 ## Find block, containing the given point inside its volume or on boundary.
3094 # @param theCompound Compound, to find block in.
3095 # @param thePoint Point, close to the desired block. If the point lays on
3096 # boundary between some blocks, we return block with nearest center.
3097 # @return New GEOM_Object, containing the found block.
3099 # @ref swig_todo "Example"
3100 def GetBlockNearPoint(self,theCompound, thePoint):
3101 # Example: see GEOM_Spanner.py
3102 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
3103 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
3106 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
3107 # @param theCompound Compound, to find block in.
3108 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
3109 # @return New GEOM_Object, containing the found block.
3111 # @ref swig_GetBlockByParts "Example"
3112 def GetBlockByParts(self,theCompound, theParts):
3113 # Example: see GEOM_TestOthers.py
3114 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
3115 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
3118 ## Return all blocks, containing all the elements, passed as the parts.
3119 # @param theCompound Compound, to find blocks in.
3120 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
3121 # @return List of GEOM_Objects, containing the found blocks.
3123 # @ref swig_todo "Example"
3124 def GetBlocksByParts(self,theCompound, theParts):
3125 # Example: see GEOM_Spanner.py
3126 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
3127 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
3130 ## Multi-transformate block and glue the result.
3131 # Transformation is defined so, as to superpose direction faces.
3132 # @param Block Hexahedral solid to be multi-transformed.
3133 # @param DirFace1 ID of First direction face.
3134 # @param DirFace2 ID of Second direction face.
3135 # @param NbTimes Quantity of transformations to be done.
3136 # \note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
3137 # @return New GEOM_Object, containing the result shape.
3139 # @ref tui_multi_transformation "Example"
3140 def MakeMultiTransformation1D(self,Block, DirFace1, DirFace2, NbTimes):
3141 # Example: see GEOM_Spanner.py
3142 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
3143 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
3146 ## Multi-transformate block and glue the result.
3147 # @param Block Hexahedral solid to be multi-transformed.
3148 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
3149 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
3150 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
3151 # @return New GEOM_Object, containing the result shape.
3153 # @ref tui_multi_transformation "Example"
3154 def MakeMultiTransformation2D(self,Block, DirFace1U, DirFace2U, NbTimesU,
3155 DirFace1V, DirFace2V, NbTimesV):
3156 # Example: see GEOM_Spanner.py
3157 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
3158 DirFace1V, DirFace2V, NbTimesV)
3159 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
3162 ## Build all possible propagation groups.
3163 # Propagation group is a set of all edges, opposite to one (main)
3164 # edge of this group directly or through other opposite edges.
3165 # Notion of Opposite Edge make sence only on quadrangle face.
3166 # @param theShape Shape to build propagation groups on.
3167 # @return List of GEOM_Objects, each of them is a propagation group.
3169 # @ref swig_Propagate "Example"
3170 def Propagate(self,theShape):
3171 # Example: see GEOM_TestOthers.py
3172 listChains = self.BlocksOp.Propagate(theShape)
3173 RaiseIfFailed("Propagate", self.BlocksOp)
3176 # end of l3_blocks_op
3179 ## @addtogroup l3_groups
3182 ## Creates a new group which will store sub shapes of theMainShape
3183 # @param theMainShape is a GEOM object on which the group is selected
3184 # @param theShapeType defines a shape type of the group
3185 # @return a newly created GEOM group
3187 # @ref tui_working_with_groups_page "Example 1"
3188 # \n @ref swig_CreateGroup "Example 2"
3189 def CreateGroup(self,theMainShape, theShapeType):
3190 # Example: see GEOM_TestOthers.py
3191 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
3192 RaiseIfFailed("CreateGroup", self.GroupOp)
3195 ## Adds a sub object with ID theSubShapeId to the group
3196 # @param theGroup is a GEOM group to which the new sub shape is added
3197 # @param theSubShapeID is a sub shape ID in the main object.
3198 # \note Use method GetSubShapeID() to get an unique ID of the sub shape
3200 # @ref tui_working_with_groups_page "Example"
3201 def AddObject(self,theGroup, theSubShapeID):
3202 # Example: see GEOM_TestOthers.py
3203 self.GroupOp.AddObject(theGroup, theSubShapeID)
3204 RaiseIfFailed("AddObject", self.GroupOp)
3207 ## Removes a sub object with ID \a theSubShapeId from the group
3208 # @param theGroup is a GEOM group from which the new sub shape is removed
3209 # @param theSubShapeID is a sub shape ID in the main object.
3210 # \note Use method GetSubShapeID() to get an unique ID of the sub shape
3212 # @ref tui_working_with_groups_page "Example"
3213 def RemoveObject(self,theGroup, theSubShapeID):
3214 # Example: see GEOM_TestOthers.py
3215 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
3216 RaiseIfFailed("RemoveObject", self.GroupOp)
3219 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
3220 # @param theGroup is a GEOM group to which the new sub shapes are added.
3221 # @param theSubShapes is a list of sub shapes to be added.
3223 # @ref tui_working_with_groups_page "Example"
3224 def UnionList (self,theGroup, theSubShapes):
3225 # Example: see GEOM_TestOthers.py
3226 self.GroupOp.UnionList(theGroup, theSubShapes)
3227 RaiseIfFailed("UnionList", self.GroupOp)
3230 ## Works like the above method, but argument
3231 # theSubShapes here is a list of sub-shapes indices
3233 # @ref swig_UnionIDs "Example"
3234 def UnionIDs(self,theGroup, theSubShapes):
3235 # Example: see GEOM_TestOthers.py
3236 self.GroupOp.UnionIDs(theGroup, theSubShapes)
3237 RaiseIfFailed("UnionIDs", self.GroupOp)
3240 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
3241 # @param theGroup is a GEOM group from which the sub-shapes are removed.
3242 # @param theSubShapes is a list of sub-shapes to be removed.
3244 # @ref tui_working_with_groups_page "Example"
3245 def DifferenceList (self,theGroup, theSubShapes):
3246 # Example: see GEOM_TestOthers.py
3247 self.GroupOp.DifferenceList(theGroup, theSubShapes)
3248 RaiseIfFailed("DifferenceList", self.GroupOp)
3251 ## Works like the above method, but argument
3252 # theSubShapes here is a list of sub-shapes indices
3254 # @ref swig_DifferenceIDs "Example"
3255 def DifferenceIDs(self,theGroup, theSubShapes):
3256 # Example: see GEOM_TestOthers.py
3257 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
3258 RaiseIfFailed("DifferenceIDs", self.GroupOp)
3261 ## Returns a list of sub objects ID stored in the group
3262 # @param theGroup is a GEOM group for which a list of IDs is requested
3264 # @ref swig_GetObjectIDs "Example"
3265 def GetObjectIDs(self,theGroup):
3266 # Example: see GEOM_TestOthers.py
3267 ListIDs = self.GroupOp.GetObjects(theGroup)
3268 RaiseIfFailed("GetObjects", self.GroupOp)
3271 ## Returns a type of sub objects stored in the group
3272 # @param theGroup is a GEOM group which type is returned.
3274 # @ref swig_GetType "Example"
3275 def GetType(self,theGroup):
3276 # Example: see GEOM_TestOthers.py
3277 aType = self.GroupOp.GetType(theGroup)
3278 RaiseIfFailed("GetType", self.GroupOp)
3281 ## Returns a main shape associated with the group
3282 # @param theGroup is a GEOM group for which a main shape object is requested
3283 # @return a GEOM object which is a main shape for theGroup
3285 # @ref swig_GetMainShape "Example"
3286 def GetMainShape(self,theGroup):
3287 # Example: see GEOM_TestOthers.py
3288 anObj = self.GroupOp.GetMainShape(theGroup)
3289 RaiseIfFailed("GetMainShape", self.GroupOp)
3292 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
3293 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
3295 # @ref swig_todo "Example"
3296 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1):
3297 edges = self.SubShapeAll(theShape, ShapeType["EDGE"])
3300 Props = self.BasicProperties(edge)
3301 if min_length <= Props[0] and Props[0] <= max_length:
3302 if (not include_min) and (min_length == Props[0]):
3305 if (not include_max) and (Props[0] == max_length):
3308 edges_in_range.append(edge)
3310 if len(edges_in_range) <= 0:
3311 print "No edges found by given criteria"
3314 group_edges = self.CreateGroup(theShape, ShapeType["EDGE"])
3315 self.UnionList(group_edges, edges_in_range)
3319 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
3320 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
3322 # @ref swig_todo "Example"
3323 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
3324 nb_selected = sg.SelectedCount()
3326 print "Select a shape before calling this function, please."
3329 print "Only one shape must be selected"
3332 id_shape = sg.getSelected(0)
3333 shape = IDToObject( id_shape )
3335 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
3339 if include_min: left_str = " <= "
3340 if include_max: right_str = " <= "
3342 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
3343 + left_str + "length" + right_str + `max_length`)
3345 sg.updateObjBrowser(1)
3352 ## Create a copy of the given object
3353 # @ingroup l1_geompy_auxiliary
3355 # @ref swig_all_advanced "Example"
3356 def MakeCopy(self,theOriginal):
3357 # Example: see GEOM_TestAll.py
3358 anObj = self.InsertOp.MakeCopy(theOriginal)
3359 RaiseIfFailed("MakeCopy", self.InsertOp)
3362 ## Add Path to load python scripts from
3363 # @ingroup l1_geompy_auxiliary
3364 def addPath(self,Path):
3365 if (sys.path.count(Path) < 1):
3366 sys.path.append(Path)
3369 #Register the new proxy for GEOM_Gen
3370 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geompyDC)