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 with given radius.
510 # Center of the circle will be in the origin of global
511 # coordinate system and normal vector will be codirected with Z axis
512 # @param theR Circle radius.
513 # @return New GEOM_Object, containing the created circle.
514 def MakeCircleR(self, theR):
515 anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
516 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
519 ## Create a circle, passing through three given points
520 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
521 # @return New GEOM_Object, containing the created circle.
523 # @ref tui_creation_circle "Example"
524 def MakeCircleThreePnt(self,thePnt1, thePnt2, thePnt3):
525 # Example: see GEOM_TestAll.py
526 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
527 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
530 ## Create a circle, with given point1 as center,
531 # passing through the point2 as radius and laying in the plane,
532 # defined by all three given points.
533 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
534 # @return New GEOM_Object, containing the created circle.
536 # @ref swig_MakeCircle "Example"
537 def MakeCircleCenter2Pnt(self,thePnt1, thePnt2, thePnt3):
538 # Example: see GEOM_example6.py
539 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
540 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
543 ## Create an ellipse with given center, normal vector and radiuses.
544 # @param thePnt Ellipse center.
545 # @param theVec Vector, normal to the plane of the ellipse.
546 # @param theRMajor Major ellipse radius.
547 # @param theRMinor Minor ellipse radius.
548 # @return New GEOM_Object, containing the created ellipse.
550 # @ref tui_creation_ellipse "Example"
551 def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor):
552 # Example: see GEOM_TestAll.py
553 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
554 RaiseIfFailed("MakeEllipse", self.CurvesOp)
557 ## Create an ellipse with given radiuses.
558 # Center of the ellipse will be in the origin of global
559 # coordinate system and normal vector will be codirected with Z axis
560 # @param theRMajor Major ellipse radius.
561 # @param theRMinor Minor ellipse radius.
562 # @return New GEOM_Object, containing the created ellipse.
563 def MakeEllipseRR(self, theRMajor, theRMinor):
564 anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
565 RaiseIfFailed("MakeEllipse", self.CurvesOp)
568 ## Create a polyline on the set of points.
569 # @param thePoints Sequence of points for the polyline.
570 # @return New GEOM_Object, containing the created polyline.
572 # @ref tui_creation_curve "Example"
573 def MakePolyline(self,thePoints):
574 # Example: see GEOM_TestAll.py
575 anObj = self.CurvesOp.MakePolyline(thePoints)
576 RaiseIfFailed("MakePolyline", self.CurvesOp)
579 ## Create bezier curve on the set of points.
580 # @param thePoints Sequence of points for the bezier curve.
581 # @return New GEOM_Object, containing the created bezier curve.
583 # @ref tui_creation_curve "Example"
584 def MakeBezier(self,thePoints):
585 # Example: see GEOM_TestAll.py
586 anObj = self.CurvesOp.MakeSplineBezier(thePoints)
587 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
590 ## Create B-Spline curve on the set of points.
591 # @param thePoints Sequence of points for the B-Spline curve.
592 # @return New GEOM_Object, containing the created B-Spline curve.
594 # @ref tui_creation_curve "Example"
595 def MakeInterpol(self,thePoints):
596 # Example: see GEOM_TestAll.py
597 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints)
598 RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
604 ## @addtogroup l3_sketcher
607 ## Create a sketcher (wire or face), following the textual description,
608 # passed through <VAR>theCommand</VAR> argument. \n
609 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
610 # Format of the description string have to be the following:
612 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
615 # - x1, y1 are coordinates of the first sketcher point (zero by default),
617 # - "R angle" : Set the direction by angle
618 # - "D dx dy" : Set the direction by DX & DY
621 # - "TT x y" : Create segment by point at X & Y
622 # - "T dx dy" : Create segment by point with DX & DY
623 # - "L length" : Create segment by direction & Length
624 # - "IX x" : Create segment by direction & Intersect. X
625 # - "IY y" : Create segment by direction & Intersect. Y
628 # - "C radius length" : Create arc by direction, radius and length(in degree)
631 # - "WW" : Close Wire (to finish)
632 # - "WF" : Close Wire and build face (to finish)
634 # @param theCommand String, defining the sketcher in local
635 # coordinates of the working plane.
636 # @param theWorkingPlane Nine double values, defining origin,
637 # OZ and OX directions of the working plane.
638 # @return New GEOM_Object, containing the created wire.
640 # @ref tui_sketcher_page "Example"
641 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0]):
642 # Example: see GEOM_TestAll.py
643 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
644 RaiseIfFailed("MakeSketcher", self.CurvesOp)
647 ## Create a sketcher (wire or face), following the textual description,
648 # passed through <VAR>theCommand</VAR> argument. \n
649 # For format of the description string see the previous method.\n
650 # @param theCommand String, defining the sketcher in local
651 # coordinates of the working plane.
652 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
653 # @return New GEOM_Object, containing the created wire.
655 # @ref tui_sketcher_page "Example"
656 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane):
657 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
658 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
664 ## @addtogroup l3_3d_primitives
667 ## Create a box by coordinates of two opposite vertices.
669 # @ref tui_creation_box "Example"
670 def MakeBox(self,x1,y1,z1,x2,y2,z2):
671 # Example: see GEOM_TestAll.py
672 pnt1 = self.MakeVertex(x1,y1,z1)
673 pnt2 = self.MakeVertex(x2,y2,z2)
674 return self.MakeBoxTwoPnt(pnt1,pnt2)
676 ## Create a box with specified dimensions along the coordinate axes
677 # and with edges, parallel to the coordinate axes.
678 # Center of the box will be at point (DX/2, DY/2, DZ/2).
679 # @param theDX Length of Box edges, parallel to OX axis.
680 # @param theDY Length of Box edges, parallel to OY axis.
681 # @param theDZ Length of Box edges, parallel to OZ axis.
682 # @return New GEOM_Object, containing the created box.
684 # @ref tui_creation_box "Example"
685 def MakeBoxDXDYDZ(self,theDX, theDY, theDZ):
686 # Example: see GEOM_TestAll.py
687 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
688 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
691 ## Create a box with two specified opposite vertices,
692 # and with edges, parallel to the coordinate axes
693 # @param thePnt1 First of two opposite vertices.
694 # @param thePnt2 Second of two opposite vertices.
695 # @return New GEOM_Object, containing the created box.
697 # @ref tui_creation_box "Example"
698 def MakeBoxTwoPnt(self,thePnt1, thePnt2):
699 # Example: see GEOM_TestAll.py
700 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
701 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
704 ## Create a face with specified dimensions along OX-OY coordinate axes,
705 # with edges, parallel to this coordinate axes.
706 # @param theH height of Face.
707 # @param theW width of Face.
708 # @param theOrientation orientation belong axis OXY OYZ OZX
709 # @return New GEOM_Object, containing the created face.
711 # @ref tui_creation_face "Example"
712 def MakeFaceHW(self,theH, theW, theOrientation):
713 # Example: see GEOM_TestAll.py
714 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
715 RaiseIfFailed("MakeFaceHW", self.PrimOp)
718 ## Create a face from another plane and two sizes,
719 # vertical size and horisontal size.
720 # @param theObj Normale vector to the creating face or
722 # @param theH Height (vertical size).
723 # @param theW Width (horisontal size).
724 # @return New GEOM_Object, containing the created face.
726 # @ref tui_creation_face "Example"
727 def MakeFaceObjHW(self, theObj, theH, theW):
728 # Example: see GEOM_TestAll.py
729 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
730 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
733 ## Create a disk with given center, normal vector and radius.
734 # @param thePnt Disk center.
735 # @param theVec Vector, normal to the plane of the disk.
736 # @param theR Disk radius.
737 # @return New GEOM_Object, containing the created disk.
739 # @ref tui_creation_disk "Example"
740 def MakeDiskPntVecR(self,thePnt, theVec, theR):
741 # Example: see GEOM_TestAll.py
742 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
743 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
746 ## Create a disk, passing through three given points
747 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
748 # @return New GEOM_Object, containing the created disk.
750 # @ref tui_creation_disk "Example"
751 def MakeDiskThreePnt(self,thePnt1, thePnt2, thePnt3):
752 # Example: see GEOM_TestAll.py
753 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
754 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
757 ## Create a disk with specified dimensions along OX-OY coordinate axes.
758 # @param theR Radius of Face.
759 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
760 # @return New GEOM_Object, containing the created disk.
762 # @ref tui_creation_face "Example"
763 def MakeDiskR(self,theR, theOrientation):
764 # Example: see GEOM_TestAll.py
765 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
766 RaiseIfFailed("MakeDiskR", self.PrimOp)
769 ## Create a cylinder with given base point, axis, radius and height.
770 # @param thePnt Central point of cylinder base.
771 # @param theAxis Cylinder axis.
772 # @param theR Cylinder radius.
773 # @param theH Cylinder height.
774 # @return New GEOM_Object, containing the created cylinder.
776 # @ref tui_creation_cylinder "Example"
777 def MakeCylinder(self,thePnt, theAxis, theR, theH):
778 # Example: see GEOM_TestAll.py
779 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
780 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
783 ## Create a cylinder with given radius and height at
784 # the origin of coordinate system. Axis of the cylinder
785 # will be collinear to the OZ axis of the coordinate system.
786 # @param theR Cylinder radius.
787 # @param theH Cylinder height.
788 # @return New GEOM_Object, containing the created cylinder.
790 # @ref tui_creation_cylinder "Example"
791 def MakeCylinderRH(self,theR, theH):
792 # Example: see GEOM_TestAll.py
793 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
794 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
797 ## Create a sphere with given center and radius.
798 # @param thePnt Sphere center.
799 # @param theR Sphere radius.
800 # @return New GEOM_Object, containing the created sphere.
802 # @ref tui_creation_sphere "Example"
803 def MakeSpherePntR(self, thePnt, theR):
804 # Example: see GEOM_TestAll.py
805 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
806 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
809 ## Create a sphere with given center and radius.
810 # @param x,y,z Coordinates of sphere center.
811 # @param theR Sphere radius.
812 # @return New GEOM_Object, containing the created sphere.
814 # @ref tui_creation_sphere "Example"
815 def MakeSphere(self, x, y, z, theR):
816 # Example: see GEOM_TestAll.py
817 point = self.MakeVertex(x, y, z)
818 anObj = self.MakeSpherePntR(point, theR)
821 ## Create a sphere with given radius at the origin of coordinate system.
822 # @param theR Sphere radius.
823 # @return New GEOM_Object, containing the created sphere.
825 # @ref tui_creation_sphere "Example"
826 def MakeSphereR(self, theR):
827 # Example: see GEOM_TestAll.py
828 anObj = self.PrimOp.MakeSphereR(theR)
829 RaiseIfFailed("MakeSphereR", self.PrimOp)
832 ## Create a cone with given base point, axis, height and radiuses.
833 # @param thePnt Central point of the first cone base.
834 # @param theAxis Cone axis.
835 # @param theR1 Radius of the first cone base.
836 # @param theR2 Radius of the second cone base.
837 # \note If both radiuses are non-zero, the cone will be truncated.
838 # \note If the radiuses are equal, a cylinder will be created instead.
839 # @param theH Cone height.
840 # @return New GEOM_Object, containing the created cone.
842 # @ref tui_creation_cone "Example"
843 def MakeCone(self,thePnt, theAxis, theR1, theR2, theH):
844 # Example: see GEOM_TestAll.py
845 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
846 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
849 ## Create a cone with given height and radiuses at
850 # the origin of coordinate system. Axis of the cone will
851 # be collinear to the OZ axis of the coordinate system.
852 # @param theR1 Radius of the first cone base.
853 # @param theR2 Radius of the second cone base.
854 # \note If both radiuses are non-zero, the cone will be truncated.
855 # \note If the radiuses are equal, a cylinder will be created instead.
856 # @param theH Cone height.
857 # @return New GEOM_Object, containing the created cone.
859 # @ref tui_creation_cone "Example"
860 def MakeConeR1R2H(self,theR1, theR2, theH):
861 # Example: see GEOM_TestAll.py
862 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
863 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
866 ## Create a torus with given center, normal vector and radiuses.
867 # @param thePnt Torus central point.
868 # @param theVec Torus axis of symmetry.
869 # @param theRMajor Torus major radius.
870 # @param theRMinor Torus minor radius.
871 # @return New GEOM_Object, containing the created torus.
873 # @ref tui_creation_torus "Example"
874 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor):
875 # Example: see GEOM_TestAll.py
876 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
877 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
880 ## Create a torus with given radiuses at the origin of coordinate system.
881 # @param theRMajor Torus major radius.
882 # @param theRMinor Torus minor radius.
883 # @return New GEOM_Object, containing the created torus.
885 # @ref tui_creation_torus "Example"
886 def MakeTorusRR(self, theRMajor, theRMinor):
887 # Example: see GEOM_TestAll.py
888 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
889 RaiseIfFailed("MakeTorusRR", self.PrimOp)
892 # end of l3_3d_primitives
895 ## @addtogroup l3_complex
898 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
899 # @param theBase Base shape to be extruded.
900 # @param thePoint1 First end of extrusion vector.
901 # @param thePoint2 Second end of extrusion vector.
902 # @return New GEOM_Object, containing the created prism.
904 # @ref tui_creation_prism "Example"
905 def MakePrism(self, theBase, thePoint1, thePoint2):
906 # Example: see GEOM_TestAll.py
907 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
908 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
911 ## Create a shape by extrusion of the base shape along the vector,
912 # i.e. all the space, transfixed by the base shape during its translation
913 # along the vector on the given distance.
914 # @param theBase Base shape to be extruded.
915 # @param theVec Direction of extrusion.
916 # @param theH Prism dimension along theVec.
917 # @return New GEOM_Object, containing the created prism.
919 # @ref tui_creation_prism "Example"
920 def MakePrismVecH(self, theBase, theVec, theH):
921 # Example: see GEOM_TestAll.py
922 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
923 RaiseIfFailed("MakePrismVecH", self.PrimOp)
926 ## Create a shape by extrusion of the base shape along the vector,
927 # i.e. all the space, transfixed by the base shape during its translation
928 # along the vector on the given distance in 2 Ways (forward/backward) .
929 # @param theBase Base shape to be extruded.
930 # @param theVec Direction of extrusion.
931 # @param theH Prism dimension along theVec in forward direction.
932 # @return New GEOM_Object, containing the created prism.
934 # @ref tui_creation_prism "Example"
935 def MakePrismVecH2Ways(self, theBase, theVec, theH):
936 # Example: see GEOM_TestAll.py
937 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
938 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
941 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
942 # @param theBase Base shape to be extruded.
943 # @param theDX, theDY, theDZ Directions of extrusion.
944 # @return New GEOM_Object, containing the created prism.
946 # @ref tui_creation_prism "Example"
947 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ):
948 # Example: see GEOM_TestAll.py
949 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
950 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
953 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
954 # i.e. all the space, transfixed by the base shape during its translation
955 # along the vector on the given distance in 2 Ways (forward/backward) .
956 # @param theBase Base shape to be extruded.
957 # @param theDX, theDY, theDZ Directions of extrusion.
958 # @return New GEOM_Object, containing the created prism.
960 # @ref tui_creation_prism "Example"
961 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ):
962 # Example: see GEOM_TestAll.py
963 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
964 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
967 ## Create a shape by revolution of the base shape around the axis
968 # on the given angle, i.e. all the space, transfixed by the base
969 # shape during its rotation around the axis on the given angle.
970 # @param theBase Base shape to be rotated.
971 # @param theAxis Rotation axis.
972 # @param theAngle Rotation angle in radians.
973 # @return New GEOM_Object, containing the created revolution.
975 # @ref tui_creation_revolution "Example"
976 def MakeRevolution(self, theBase, theAxis, theAngle):
977 # Example: see GEOM_TestAll.py
978 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
979 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
982 ## The Same Revolution but in both ways forward&backward.
983 def MakeRevolution2Ways(self, theBase, theAxis, theAngle):
984 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
985 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
988 ## Create a filling from the given compound of contours.
989 # @param theShape the compound of contours
990 # @param theMinDeg a minimal degree of BSpline surface to create
991 # @param theMaxDeg a maximal degree of BSpline surface to create
992 # @param theTol2D a 2d tolerance to be reached
993 # @param theTol3D a 3d tolerance to be reached
994 # @param theNbIter a number of iteration of approximation algorithm
995 # @param isApprox if True, BSpline curves are generated in the process
996 # of surface construction. By default it is False, that means
997 # the surface is created using Besier curves. The usage of
998 # Approximation makes the algorithm work slower, but allows
999 # building the surface for rather complex cases
1000 # @return New GEOM_Object, containing the created filling surface.
1002 # @ref tui_creation_filling "Example"
1003 def MakeFilling(self, theShape, theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter, isApprox=0):
1004 # Example: see GEOM_TestAll.py
1005 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
1006 theTol2D, theTol3D, theNbIter, isApprox)
1007 RaiseIfFailed("MakeFilling", self.PrimOp)
1010 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
1011 # @param theSeqSections - set of specified sections.
1012 # @param theModeSolid - mode defining building solid or shell
1013 # @param thePreci - precision 3D used for smoothing by default 1.e-6
1014 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
1015 # @return New GEOM_Object, containing the created shell or solid.
1017 # @ref swig_todo "Example"
1018 def MakeThruSections(self,theSeqSections,theModeSolid,thePreci,theRuled):
1019 # Example: see GEOM_TestAll.py
1020 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
1021 RaiseIfFailed("MakeThruSections", self.PrimOp)
1024 ## Create a shape by extrusion of the base shape along
1025 # the path shape. The path shape can be a wire or an edge.
1026 # @param theBase Base shape to be extruded.
1027 # @param thePath Path shape to extrude the base shape along it.
1028 # @return New GEOM_Object, containing the created pipe.
1030 # @ref tui_creation_pipe "Example"
1031 def MakePipe(self,theBase, thePath):
1032 # Example: see GEOM_TestAll.py
1033 anObj = self.PrimOp.MakePipe(theBase, thePath)
1034 RaiseIfFailed("MakePipe", self.PrimOp)
1037 ## Create a shape by extrusion of the profile shape along
1038 # the path shape. The path shape can be a wire or an edge.
1039 # the several profiles can be specified in the several locations of path.
1040 # @param theSeqBases - list of Bases shape to be extruded.
1041 # @param theLocations - list of locations on the path corresponding
1042 # specified list of the Bases shapes. Number of locations
1043 # should be equal to number of bases or list of locations can be empty.
1044 # @param thePath - Path shape to extrude the base shape along it.
1045 # @param theWithContact - the mode defining that the section is translated to be in
1046 # contact with the spine.
1047 # @param theWithCorrection - defining that the section is rotated to be
1048 # orthogonal to the spine tangent in the correspondent point
1049 # @return New GEOM_Object, containing the created pipe.
1051 # @ref tui_creation_pipe_with_diff_sec "Example"
1052 def MakePipeWithDifferentSections(self, theSeqBases,
1053 theLocations, thePath,
1054 theWithContact, theWithCorrection):
1055 anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
1056 theLocations, thePath,
1057 theWithContact, theWithCorrection)
1058 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
1061 ## Create a shape by extrusion of the profile shape along
1062 # the path shape. The path shape can be a wire or a edge.
1063 # the several profiles can be specified in the several locations of path.
1064 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
1065 # shell or face. If number of faces in neighbour sections
1066 # aren't coincided result solid between such sections will
1067 # be created using external boundaries of this shells.
1068 # @param theSeqSubBases - list of corresponding subshapes of section shapes.
1069 # This list is used for searching correspondences between
1070 # faces in the sections. Size of this list must be equal
1071 # to size of list of base shapes.
1072 # @param theLocations - list of locations on the path corresponding
1073 # specified list of the Bases shapes. Number of locations
1074 # should be equal to number of bases. First and last
1075 # locations must be coincided with first and last vertexes
1076 # of path correspondingly.
1077 # @param thePath - Path shape to extrude the base shape along it.
1078 # @param theWithContact - the mode defining that the section is translated to be in
1079 # contact with the spine.
1080 # @param theWithCorrection - defining that the section is rotated to be
1081 # orthogonal to the spine tangent in the correspondent point
1082 # @return New GEOM_Object, containing the created solids.
1084 # @ref tui_creation_pipe_with_shell_sec "Example"
1085 def MakePipeWithShellSections(self,theSeqBases, theSeqSubBases,
1086 theLocations, thePath,
1087 theWithContact, theWithCorrection):
1088 anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
1089 theLocations, thePath,
1090 theWithContact, theWithCorrection)
1091 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
1094 ## Create a shape by extrusion of the profile shape along
1095 # the path shape. This function is used only for debug pipe
1096 # functionality - it is a version of previous function
1097 # (MakePipeWithShellSections(...)) which give a possibility to
1098 # recieve information about creating pipe between each pair of
1099 # sections step by step.
1100 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
1101 theLocations, thePath,
1102 theWithContact, theWithCorrection):
1104 nbsect = len(theSeqBases)
1105 nbsubsect = len(theSeqSubBases)
1106 #print "nbsect = ",nbsect
1107 for i in range(1,nbsect):
1109 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
1110 tmpLocations = [ theLocations[i-1], theLocations[i] ]
1112 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
1113 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
1114 tmpLocations, thePath,
1115 theWithContact, theWithCorrection)
1116 if self.PrimOp.IsDone() == 0:
1117 print "Problems with pipe creation between ",i," and ",i+1," sections"
1118 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
1121 print "Pipe between ",i," and ",i+1," sections is OK"
1126 resc = self.MakeCompound(res)
1127 #resc = self.MakeSewing(res, 0.001)
1128 #print "resc: ",resc
1131 ## Create solids between given sections
1132 # @param theSeqBases - list of sections (shell or face).
1133 # @param theLocations - list of corresponding vertexes
1134 # @return New GEOM_Object, containing the created solids.
1136 # @ref tui_creation_pipe_without_path "Example"
1137 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations):
1138 anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
1139 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
1142 ## Create a shape by extrusion of the base shape along
1143 # the path shape with constant bi-normal direction along the given vector.
1144 # The path shape can be a wire or an edge.
1145 # @param theBase Base shape to be extruded.
1146 # @param thePath Path shape to extrude the base shape along it.
1147 # @param theVec Vector defines a constant binormal direction to keep the
1148 # same angle beetween the direction and the sections
1149 # along the sweep surface.
1150 # @return New GEOM_Object, containing the created pipe.
1152 # @ref tui_creation_pipe "Example"
1153 def MakePipeBiNormalAlongVector(self,theBase, thePath, theVec):
1154 # Example: see GEOM_TestAll.py
1155 anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
1156 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
1162 ## @addtogroup l3_advanced
1165 ## Create a linear edge with specified ends.
1166 # @param thePnt1 Point for the first end of edge.
1167 # @param thePnt2 Point for the second end of edge.
1168 # @return New GEOM_Object, containing the created edge.
1170 # @ref tui_creation_edge "Example"
1171 def MakeEdge(self,thePnt1, thePnt2):
1172 # Example: see GEOM_TestAll.py
1173 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
1174 RaiseIfFailed("MakeEdge", self.ShapesOp)
1177 ## Create a wire from the set of edges and wires.
1178 # @param theEdgesAndWires List of edges and/or wires.
1179 # @return New GEOM_Object, containing the created wire.
1181 # @ref tui_creation_wire "Example"
1182 def MakeWire(self,theEdgesAndWires):
1183 # Example: see GEOM_TestAll.py
1184 anObj = self.ShapesOp.MakeWire(theEdgesAndWires)
1185 RaiseIfFailed("MakeWire", self.ShapesOp)
1188 ## Create a face on the given wire.
1189 # @param theWire closed Wire or Edge to build the face on.
1190 # @param isPlanarWanted If TRUE, only planar face will be built.
1191 # If impossible, NULL object will be returned.
1192 # @return New GEOM_Object, containing the created face.
1194 # @ref tui_creation_face "Example"
1195 def MakeFace(self,theWire, isPlanarWanted):
1196 # Example: see GEOM_TestAll.py
1197 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
1198 RaiseIfFailed("MakeFace", self.ShapesOp)
1201 ## Create a face on the given wires set.
1202 # @param theWires List of closed wires or edges to build the face on.
1203 # @param isPlanarWanted If TRUE, only planar face will be built.
1204 # If impossible, NULL object will be returned.
1205 # @return New GEOM_Object, containing the created face.
1207 # @ref tui_creation_face "Example"
1208 def MakeFaceWires(self,theWires, isPlanarWanted):
1209 # Example: see GEOM_TestAll.py
1210 anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
1211 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
1214 ## Shortcut to MakeFaceWires()
1216 # @ref tui_creation_face "Example 1"
1217 # \n @ref swig_MakeFaces "Example 2"
1218 def MakeFaces(self,theWires, isPlanarWanted):
1219 # Example: see GEOM_TestOthers.py
1220 anObj = self.MakeFaceWires(theWires, isPlanarWanted)
1223 ## Create a shell from the set of faces and shells.
1224 # @param theFacesAndShells List of faces and/or shells.
1225 # @return New GEOM_Object, containing the created shell.
1227 # @ref tui_creation_shell "Example"
1228 def MakeShell(self,theFacesAndShells):
1229 # Example: see GEOM_TestAll.py
1230 anObj = self.ShapesOp.MakeShell(theFacesAndShells)
1231 RaiseIfFailed("MakeShell", self.ShapesOp)
1234 ## Create a solid, bounded by the given shells.
1235 # @param theShells Sequence of bounding shells.
1236 # @return New GEOM_Object, containing the created solid.
1238 # @ref tui_creation_solid "Example"
1239 def MakeSolid(self,theShells):
1240 # Example: see GEOM_TestAll.py
1241 anObj = self.ShapesOp.MakeSolidShells(theShells)
1242 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
1245 ## Create a compound of the given shapes.
1246 # @param theShapes List of shapes to put in compound.
1247 # @return New GEOM_Object, containing the created compound.
1249 # @ref tui_creation_compound "Example"
1250 def MakeCompound(self,theShapes):
1251 # Example: see GEOM_TestAll.py
1252 anObj = self.ShapesOp.MakeCompound(theShapes)
1253 RaiseIfFailed("MakeCompound", self.ShapesOp)
1256 # end of l3_advanced
1259 ## @addtogroup l2_measure
1262 ## Gives quantity of faces in the given shape.
1263 # @param theShape Shape to count faces of.
1264 # @return Quantity of faces.
1266 # @ref swig_NumberOfFaces "Example"
1267 def NumberOfFaces(self,theShape):
1268 # Example: see GEOM_TestOthers.py
1269 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
1270 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
1273 ## Gives quantity of edges in the given shape.
1274 # @param theShape Shape to count edges of.
1275 # @return Quantity of edges.
1277 # @ref swig_NumberOfEdges "Example"
1278 def NumberOfEdges(self,theShape):
1279 # Example: see GEOM_TestOthers.py
1280 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
1281 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
1287 ## @addtogroup l3_healing
1290 ## Reverses an orientation the given shape.
1291 # @param theShape Shape to be reversed.
1292 # @return The reversed copy of theShape.
1294 # @ref swig_ChangeOrientation "Example"
1295 def ChangeOrientation(self,theShape):
1296 # Example: see GEOM_TestAll.py
1297 anObj = self.ShapesOp.ChangeOrientation(theShape)
1298 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
1301 ## Shortcut to ChangeOrientation()
1303 # @ref swig_OrientationChange "Example"
1304 def OrientationChange(self,theShape):
1305 # Example: see GEOM_TestOthers.py
1306 anObj = self.ChangeOrientation(theShape)
1312 ## @addtogroup l4_obtain
1315 ## Retrieve all free faces from the given shape.
1316 # Free face is a face, which is not shared between two shells of the shape.
1317 # @param theShape Shape to find free faces in.
1318 # @return List of IDs of all free faces, contained in theShape.
1320 # @ref tui_measurement_tools_page "Example"
1321 def GetFreeFacesIDs(self,theShape):
1322 # Example: see GEOM_TestOthers.py
1323 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
1324 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
1327 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
1328 # @param theShape1 Shape to find sub-shapes in.
1329 # @param theShape2 Shape to find shared sub-shapes with.
1330 # @param theShapeType Type of sub-shapes to be retrieved.
1331 # @return List of sub-shapes of theShape1, shared with theShape2.
1333 # @ref swig_GetSharedShapes "Example"
1334 def GetSharedShapes(self,theShape1, theShape2, theShapeType):
1335 # Example: see GEOM_TestOthers.py
1336 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
1337 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
1340 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
1341 # situated relatively the specified plane by the certain way,
1342 # defined through <VAR>theState</VAR> parameter.
1343 # @param theShape Shape to find sub-shapes of.
1344 # @param theShapeType Type of sub-shapes to be retrieved.
1345 # @param theAx1 Vector (or line, or linear edge), specifying normal
1346 # direction and location of the plane to find shapes on.
1347 # @param theState The state of the subshapes to find. It can be one of
1348 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1349 # @return List of all found sub-shapes.
1351 # @ref swig_GetShapesOnPlane "Example"
1352 def GetShapesOnPlane(self,theShape, theShapeType, theAx1, theState):
1353 # Example: see GEOM_TestOthers.py
1354 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
1355 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
1358 ## Works like the above method, but returns list of sub-shapes indices
1360 # @ref swig_GetShapesOnPlaneIDs "Example"
1361 def GetShapesOnPlaneIDs(self,theShape, theShapeType, theAx1, theState):
1362 # Example: see GEOM_TestOthers.py
1363 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
1364 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
1367 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
1368 # situated relatively the specified plane by the certain way,
1369 # defined through <VAR>theState</VAR> parameter.
1370 # @param theShape Shape to find sub-shapes of.
1371 # @param theShapeType Type of sub-shapes to be retrieved.
1372 # @param theAx1 Vector (or line, or linear edge), specifying normal
1373 # direction of the plane to find shapes on.
1374 # @param thePnt Point specifying location of the plane to find shapes on.
1375 # @param theState The state of the subshapes to find. It can be one of
1376 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1377 # @return List of all found sub-shapes.
1379 # @ref swig_GetShapesOnPlaneWithLocation "Example"
1380 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState):
1381 # Example: see GEOM_TestOthers.py
1382 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
1383 theAx1, thePnt, theState)
1384 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
1387 ## Works like the above method, but returns list of sub-shapes indices
1389 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
1390 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
1391 # Example: see GEOM_TestOthers.py
1392 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
1393 theAx1, thePnt, theState)
1394 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
1397 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1398 # the specified cylinder by the certain way, defined through \a theState parameter.
1399 # @param theShape Shape to find sub-shapes of.
1400 # @param theShapeType Type of sub-shapes to be retrieved.
1401 # @param theAxis Vector (or line, or linear edge), specifying
1402 # axis of the cylinder to find shapes on.
1403 # @param theRadius Radius of the cylinder to find shapes on.
1404 # @param theState The state of the subshapes to find. It can be one of
1405 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1406 # @return List of all found sub-shapes.
1408 # @ref swig_GetShapesOnCylinder "Example"
1409 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState):
1410 # Example: see GEOM_TestOthers.py
1411 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
1412 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
1415 ## Works like the above method, but returns list of sub-shapes indices
1417 # @ref swig_GetShapesOnCylinderIDs "Example"
1418 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
1419 # Example: see GEOM_TestOthers.py
1420 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
1421 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
1424 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1425 # the specified sphere by the certain way, defined through \a theState parameter.
1426 # @param theShape Shape to find sub-shapes of.
1427 # @param theShapeType Type of sub-shapes to be retrieved.
1428 # @param theCenter Point, specifying center of the sphere to find shapes on.
1429 # @param theRadius Radius of the sphere to find shapes on.
1430 # @param theState The state of the subshapes to find. It can be one of
1431 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1432 # @return List of all found sub-shapes.
1434 # @ref swig_GetShapesOnSphere "Example"
1435 def GetShapesOnSphere(self,theShape, theShapeType, theCenter, theRadius, theState):
1436 # Example: see GEOM_TestOthers.py
1437 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
1438 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
1441 ## Works like the above method, but returns list of sub-shapes indices
1443 # @ref swig_GetShapesOnSphereIDs "Example"
1444 def GetShapesOnSphereIDs(self,theShape, theShapeType, theCenter, theRadius, theState):
1445 # Example: see GEOM_TestOthers.py
1446 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
1447 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
1450 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1451 # the specified quadrangle by the certain way, defined through \a theState parameter.
1452 # @param theShape Shape to find sub-shapes of.
1453 # @param theShapeType Type of sub-shapes to be retrieved.
1454 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
1455 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
1456 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
1457 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
1458 # @param theState The state of the subshapes to find. It can be one of
1459 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1460 # @return List of all found sub-shapes.
1462 # @ref swig_GetShapesOnQuadrangle "Example"
1463 def GetShapesOnQuadrangle(self, theShape, theShapeType,
1464 theTopLeftPoint, theTopRigthPoint,
1465 theBottomLeftPoint, theBottomRigthPoint, theState):
1466 # Example: see GEOM_TestOthers.py
1467 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
1468 theTopLeftPoint, theTopRigthPoint,
1469 theBottomLeftPoint, theBottomRigthPoint, theState)
1470 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
1473 ## Works like the above method, but returns list of sub-shapes indices
1475 # @ref swig_GetShapesOnQuadrangleIDs "Example"
1476 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
1477 theTopLeftPoint, theTopRigthPoint,
1478 theBottomLeftPoint, theBottomRigthPoint, theState):
1479 # Example: see GEOM_TestOthers.py
1480 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
1481 theTopLeftPoint, theTopRigthPoint,
1482 theBottomLeftPoint, theBottomRigthPoint, theState)
1483 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
1486 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1487 # the specified \a theBox by the certain way, defined through \a theState parameter.
1488 # @param theBox Shape for relative comparing.
1489 # @param theShape Shape to find sub-shapes of.
1490 # @param theShapeType Type of sub-shapes to be retrieved.
1491 # @param theState The state of the subshapes to find. It can be one of
1492 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1493 # @return List of all found sub-shapes.
1495 # @ref swig_GetShapesOnBox "Example"
1496 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState):
1497 # Example: see GEOM_TestOthers.py
1498 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
1499 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
1502 ## Works like the above method, but returns list of sub-shapes indices
1504 # @ref swig_GetShapesOnBoxIDs "Example"
1505 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
1506 # Example: see GEOM_TestOthers.py
1507 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
1508 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
1511 ## Find in \a theShape all sub-shapes of type \a theShapeType,
1512 # situated relatively the specified \a theCheckShape by the
1513 # certain way, defined through \a theState parameter.
1514 # @param theCheckShape Shape for relative comparing.
1515 # @param theShape Shape to find sub-shapes of.
1516 # @param theShapeType Type of sub-shapes to be retrieved.
1517 # @param theState The state of the subshapes to find. It can be one of
1518 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1519 # @return List of all found sub-shapes.
1521 # @ref swig_GetShapesOnShape "Example"
1522 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState):
1523 # Example: see GEOM_TestOthers.py
1524 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
1525 theShapeType, theState)
1526 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
1529 ## Works like the above method, but returns result as compound
1531 # @ref swig_GetShapesOnShapeAsCompound "Example"
1532 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState):
1533 # Example: see GEOM_TestOthers.py
1534 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
1535 theShapeType, theState)
1536 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
1539 ## Works like the above method, but returns list of sub-shapes indices
1541 # @ref swig_GetShapesOnShapeIDs "Example"
1542 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
1543 # Example: see GEOM_TestOthers.py
1544 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
1545 theShapeType, theState)
1546 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
1549 ## Get sub-shape(s) of theShapeWhere, which are
1550 # coincident with \a theShapeWhat or could be a part of it.
1551 # @param theShapeWhere Shape to find sub-shapes of.
1552 # @param theShapeWhat Shape, specifying what to find.
1553 # @return Group of all found sub-shapes or a single found sub-shape.
1555 # @ref swig_GetInPlace "Example"
1556 def GetInPlace(self,theShapeWhere, theShapeWhat):
1557 # Example: see GEOM_TestOthers.py
1558 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
1559 RaiseIfFailed("GetInPlace", self.ShapesOp)
1562 ## Get sub-shape(s) of \a theShapeWhere, which are
1563 # coincident with \a theShapeWhat or could be a part of it.
1565 # Implementation of this method is based on a saved history of an operation,
1566 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
1567 # arguments (an argument shape or a sub-shape of an argument shape).
1568 # The operation could be the Partition or one of boolean operations,
1569 # performed on simple shapes (not on compounds).
1571 # @param theShapeWhere Shape to find sub-shapes of.
1572 # @param theShapeWhat Shape, specifying what to find (must be in the
1573 # building history of the ShapeWhere).
1574 # @return Group of all found sub-shapes or a single found sub-shape.
1576 # @ref swig_GetInPlace "Example"
1577 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat):
1578 # Example: see GEOM_TestOthers.py
1579 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
1580 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
1583 ## Get sub-shape of theShapeWhere, which is
1584 # equal to \a theShapeWhat.
1585 # @param theShapeWhere Shape to find sub-shape of.
1586 # @param theShapeWhat Shape, specifying what to find.
1587 # @return New GEOM_Object for found sub-shape.
1589 # @ref swig_GetSame "Example"
1590 def GetSame(self,theShapeWhere, theShapeWhat):
1591 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
1592 RaiseIfFailed("GetSame", self.ShapesOp)
1598 ## @addtogroup l4_access
1601 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
1602 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
1604 # @ref swig_all_decompose "Example"
1605 def GetSubShape(self, aShape, ListOfID):
1606 # Example: see GEOM_TestAll.py
1607 anObj = self.AddSubShape(aShape,ListOfID)
1610 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
1612 # @ref swig_all_decompose "Example"
1613 def GetSubShapeID(self, aShape, aSubShape):
1614 # Example: see GEOM_TestAll.py
1615 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
1616 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
1622 ## @addtogroup l4_decompose
1625 ## Explode a shape on subshapes of a given type.
1626 # @param aShape Shape to be exploded.
1627 # @param aType Type of sub-shapes to be retrieved.
1628 # @return List of sub-shapes of type theShapeType, contained in theShape.
1630 # @ref swig_all_decompose "Example"
1631 def SubShapeAll(self, aShape, aType):
1632 # Example: see GEOM_TestAll.py
1633 ListObj = self.ShapesOp.MakeExplode(aShape,aType,0)
1634 RaiseIfFailed("MakeExplode", self.ShapesOp)
1637 ## Explode a shape on subshapes of a given type.
1638 # @param aShape Shape to be exploded.
1639 # @param aType Type of sub-shapes to be retrieved.
1640 # @return List of IDs of sub-shapes.
1642 # @ref swig_all_decompose "Example"
1643 def SubShapeAllIDs(self, aShape, aType):
1644 ListObj = self.ShapesOp.SubShapeAllIDs(aShape,aType,0)
1645 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
1648 ## Explode a shape on subshapes of a given type.
1649 # Sub-shapes will be sorted by coordinates of their gravity centers.
1650 # @param aShape Shape to be exploded.
1651 # @param aType Type of sub-shapes to be retrieved.
1652 # @return List of sub-shapes of type theShapeType, contained in theShape.
1654 # @ref swig_SubShapeAllSorted "Example"
1655 def SubShapeAllSorted(self, aShape, aType):
1656 # Example: see GEOM_TestAll.py
1657 ListObj = self.ShapesOp.MakeExplode(aShape,aType,1)
1658 RaiseIfFailed("MakeExplode", self.ShapesOp)
1661 ## Explode a shape on subshapes of a given type.
1662 # Sub-shapes will be sorted by coordinates of their gravity centers.
1663 # @param aShape Shape to be exploded.
1664 # @param aType Type of sub-shapes to be retrieved.
1665 # @return List of IDs of sub-shapes.
1667 # @ref swig_all_decompose "Example"
1668 def SubShapeAllSortedIDs(self, aShape, aType):
1669 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape,aType,1)
1670 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
1673 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
1674 # selected by they indices in list of all sub-shapes of type <VAR>aType</VAR>.
1675 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
1677 # @ref swig_all_decompose "Example"
1678 def SubShape(self, aShape, aType, ListOfInd):
1679 # Example: see GEOM_TestAll.py
1681 AllShapeList = self.SubShapeAll(aShape, aType)
1682 for ind in ListOfInd:
1683 ListOfIDs.append(self.GetSubShapeID(aShape, AllShapeList[ind - 1]))
1684 anObj = self.GetSubShape(aShape, ListOfIDs)
1687 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
1688 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
1689 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
1691 # @ref swig_all_decompose "Example"
1692 def SubShapeSorted(self,aShape, aType, ListOfInd):
1693 # Example: see GEOM_TestAll.py
1695 AllShapeList = self.SubShapeAllSorted(aShape, aType)
1696 for ind in ListOfInd:
1697 ListOfIDs.append(self.GetSubShapeID(aShape, AllShapeList[ind - 1]))
1698 anObj = self.GetSubShape(aShape, ListOfIDs)
1701 # end of l4_decompose
1704 ## @addtogroup l3_healing
1707 ## Apply a sequence of Shape Healing operators to the given object.
1708 # @param theShape Shape to be processed.
1709 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
1710 # @param theParameters List of names of parameters
1711 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
1712 # @param theValues List of values of parameters, in the same order
1713 # as parameters are listed in <VAR>theParameters</VAR> list.
1714 # @return New GEOM_Object, containing processed shape.
1716 # @ref tui_shape_processing "Example"
1717 def ProcessShape(self,theShape, theOperators, theParameters, theValues):
1718 # Example: see GEOM_TestHealing.py
1719 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
1720 RaiseIfFailed("ProcessShape", self.HealOp)
1723 ## Remove faces from the given object (shape).
1724 # @param theObject Shape to be processed.
1725 # @param theFaces Indices of faces to be removed, if EMPTY then the method
1726 # removes ALL faces of the given object.
1727 # @return New GEOM_Object, containing processed shape.
1729 # @ref tui_suppress_faces "Example"
1730 def SuppressFaces(self,theObject, theFaces):
1731 # Example: see GEOM_TestHealing.py
1732 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
1733 RaiseIfFailed("SuppressFaces", self.HealOp)
1736 ## Sewing of some shapes into single shape.
1738 # @ref tui_sewing "Example"
1739 def MakeSewing(self, ListShape, theTolerance):
1740 # Example: see GEOM_TestHealing.py
1741 comp = self.MakeCompound(ListShape)
1742 anObj = self.Sew(comp, theTolerance)
1745 ## Sewing of the given object.
1746 # @param theObject Shape to be processed.
1747 # @param theTolerance Required tolerance value.
1748 # @return New GEOM_Object, containing processed shape.
1749 def Sew(self, theObject, theTolerance):
1750 # Example: see MakeSewing() above
1751 anObj = self.HealOp.Sew(theObject, theTolerance)
1752 RaiseIfFailed("Sew", self.HealOp)
1755 ## Remove internal wires and edges from the given object (face).
1756 # @param theObject Shape to be processed.
1757 # @param theWires Indices of wires to be removed, if EMPTY then the method
1758 # removes ALL internal wires of the given object.
1759 # @return New GEOM_Object, containing processed shape.
1761 # @ref tui_suppress_internal_wires "Example"
1762 def SuppressInternalWires(self,theObject, theWires):
1763 # Example: see GEOM_TestHealing.py
1764 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
1765 RaiseIfFailed("RemoveIntWires", self.HealOp)
1768 ## Remove internal closed contours (holes) from the given object.
1769 # @param theObject Shape to be processed.
1770 # @param theWires Indices of wires to be removed, if EMPTY then the method
1771 # removes ALL internal holes of the given object
1772 # @return New GEOM_Object, containing processed shape.
1774 # @ref tui_suppress_holes "Example"
1775 def SuppressHoles(self,theObject, theWires):
1776 # Example: see GEOM_TestHealing.py
1777 anObj = self.HealOp.FillHoles(theObject, theWires)
1778 RaiseIfFailed("FillHoles", self.HealOp)
1781 ## Close an open wire.
1782 # @param theObject Shape to be processed.
1783 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
1784 # if -1, then <VAR>theObject</VAR> itself is a wire.
1785 # @param isCommonVertex If TRUE : closure by creation of a common vertex,
1786 # If FALS : closure by creation of an edge between ends.
1787 # @return New GEOM_Object, containing processed shape.
1789 # @ref tui_close_contour "Example"
1790 def CloseContour(self,theObject, theWires, isCommonVertex):
1791 # Example: see GEOM_TestHealing.py
1792 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
1793 RaiseIfFailed("CloseContour", self.HealOp)
1796 ## Addition of a point to a given edge object.
1797 # @param theObject Shape to be processed.
1798 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
1799 # if -1, then theObject itself is the edge.
1800 # @param theValue Value of parameter on edge or length parameter,
1801 # depending on \a isByParameter.
1802 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1],
1803 # if FALSE : \a theValue is treated as a length parameter [0..1]
1804 # @return New GEOM_Object, containing processed shape.
1806 # @ref tui_add_point_on_edge "Example"
1807 def DivideEdge(self,theObject, theEdgeIndex, theValue, isByParameter):
1808 # Example: see GEOM_TestHealing.py
1809 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
1810 RaiseIfFailed("DivideEdge", self.HealOp)
1813 ## Change orientation of the given object. Updates given shape.
1814 # @param theObject Shape to be processed.
1816 # @ref swig_todo "Example"
1817 def ChangeOrientationShell(self,theObject):
1818 theObject = self.HealOp.ChangeOrientation(theObject)
1819 RaiseIfFailed("ChangeOrientation", self.HealOp)
1822 ## Change orientation of the given object.
1823 # @param theObject Shape to be processed.
1824 # @return New GEOM_Object, containing processed shape.
1826 # @ref swig_todo "Example"
1827 def ChangeOrientationShellCopy(self,theObject):
1828 anObj = self.HealOp.ChangeOrientationCopy(theObject)
1829 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
1832 ## Get a list of wires (wrapped in GEOM_Object-s),
1833 # that constitute a free boundary of the given shape.
1834 # @param theObject Shape to get free boundary of.
1835 # @return [status, theClosedWires, theOpenWires]
1836 # status: FALSE, if an error(s) occured during the method execution.
1837 # theClosedWires: Closed wires on the free boundary of the given shape.
1838 # theOpenWires: Open wires on the free boundary of the given shape.
1840 # @ref tui_measurement_tools_page "Example"
1841 def GetFreeBoundary(self,theObject):
1842 # Example: see GEOM_TestHealing.py
1843 anObj = self.HealOp.GetFreeBoundary(theObject)
1844 RaiseIfFailed("GetFreeBoundary", self.HealOp)
1847 ## Replace coincident faces in theShape by one face.
1848 # @param theShape Initial shape.
1849 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
1850 # @param doKeepNonSolids If FALSE, only solids will present in the result,
1851 # otherwise all initial shapes.
1852 # @return New GEOM_Object, containing a copy of theShape without coincident faces.
1854 # @ref tui_glue_faces "Example"
1855 def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True):
1856 # Example: see GEOM_Spanner.py
1857 anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
1859 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
1862 ## Find coincident faces in theShape for possible gluing.
1863 # @param theShape Initial shape.
1864 # @param theTolerance Maximum distance between faces,
1865 # which can be considered as coincident.
1868 # @ref swig_todo "Example"
1869 def GetGlueFaces(self, theShape, theTolerance):
1870 # Example: see GEOM_Spanner.py
1871 anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
1872 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
1875 ## Replace coincident faces in theShape by one face
1876 # in compliance with given list of faces
1877 # @param theShape Initial shape.
1878 # @param theTolerance Maximum distance between faces,
1879 # which can be considered as coincident.
1880 # @param theFaces List of faces for gluing.
1881 # @param doKeepNonSolids If FALSE, only solids will present in the result,
1882 # otherwise all initial shapes.
1883 # @return New GEOM_Object, containing a copy of theShape
1884 # without some faces.
1886 # @ref swig_todo "Example"
1887 def MakeGlueFacesByList(self, theShape, theTolerance, theFaces, doKeepNonSolids=True):
1888 # Example: see GEOM_Spanner.py
1889 anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces, doKeepNonSolids)
1891 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
1897 ## @addtogroup l3_boolean Boolean Operations
1900 # -----------------------------------------------------------------------------
1901 # Boolean (Common, Cut, Fuse, Section)
1902 # -----------------------------------------------------------------------------
1904 ## Perform one of boolean operations on two given shapes.
1905 # @param theShape1 First argument for boolean operation.
1906 # @param theShape2 Second argument for boolean operation.
1907 # @param theOperation Indicates the operation to be done:
1908 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
1909 # @return New GEOM_Object, containing the result shape.
1911 # @ref tui_fuse "Example"
1912 def MakeBoolean(self,theShape1, theShape2, theOperation):
1913 # Example: see GEOM_TestAll.py
1914 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation)
1915 RaiseIfFailed("MakeBoolean", self.BoolOp)
1918 ## Shortcut to MakeBoolean(s1, s2, 1)
1920 # @ref tui_common "Example 1"
1921 # \n @ref swig_MakeCommon "Example 2"
1922 def MakeCommon(self, s1, s2):
1923 # Example: see GEOM_TestOthers.py
1924 return self.MakeBoolean(s1, s2, 1)
1926 ## Shortcut to MakeBoolean(s1, s2, 2)
1928 # @ref tui_cut "Example 1"
1929 # \n @ref swig_MakeCommon "Example 2"
1930 def MakeCut(self, s1, s2):
1931 # Example: see GEOM_TestOthers.py
1932 return self.MakeBoolean(s1, s2, 2)
1934 ## Shortcut to MakeBoolean(s1, s2, 3)
1936 # @ref tui_fuse "Example 1"
1937 # \n @ref swig_MakeCommon "Example 2"
1938 def MakeFuse(self, s1, s2):
1939 # Example: see GEOM_TestOthers.py
1940 return self.MakeBoolean(s1, s2, 3)
1942 ## Shortcut to MakeBoolean(s1, s2, 4)
1944 # @ref tui_section "Example 1"
1945 # \n @ref swig_MakeCommon "Example 2"
1946 def MakeSection(self, s1, s2):
1947 # Example: see GEOM_TestOthers.py
1948 return self.MakeBoolean(s1, s2, 4)
1953 ## @addtogroup l3_basic_op
1956 ## Perform partition operation.
1957 # @param ListShapes Shapes to be intersected.
1958 # @param ListTools Shapes to intersect theShapes.
1959 # !!!NOTE: Each compound from ListShapes and ListTools will be exploded
1960 # in order to avoid possible intersection between shapes from
1962 # @param Limit Type of resulting shapes (corresponding to TopAbs_ShapeEnum).
1963 # @param KeepNonlimitShapes: if this parameter == 0 - only shapes with
1964 # type <= Limit are kept in the result,
1965 # else - shapes with type > Limit are kept
1966 # also (if they exist)
1968 # After implementation new version of PartitionAlgo (October 2006)
1969 # other parameters are ignored by current functionality. They are kept
1970 # in this function only for support old versions.
1971 # Ignored parameters:
1972 # @param ListKeepInside Shapes, outside which the results will be deleted.
1973 # Each shape from theKeepInside must belong to theShapes also.
1974 # @param ListRemoveInside Shapes, inside which the results will be deleted.
1975 # Each shape from theRemoveInside must belong to theShapes also.
1976 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
1977 # @param ListMaterials Material indices for each shape. Make sence,
1978 # only if theRemoveWebs is TRUE.
1980 # @return New GEOM_Object, containing the result shapes.
1982 # @ref tui_partition "Example"
1983 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
1984 Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
1985 KeepNonlimitShapes=0):
1986 # Example: see GEOM_TestAll.py
1987 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
1988 ListKeepInside, ListRemoveInside,
1989 Limit, RemoveWebs, ListMaterials,
1990 KeepNonlimitShapes);
1991 RaiseIfFailed("MakePartition", self.BoolOp)
1994 ## Perform partition operation.
1995 # This method may be useful if it is needed to make a partition for
1996 # compound contains nonintersected shapes. Performance will be better
1997 # since intersection between shapes from compound is not performed.
1999 # Description of all parameters as in previous method MakePartition()
2001 # !!!NOTE: Passed compounds (via ListShapes or via ListTools)
2002 # have to consist of nonintersecting shapes.
2004 # @return New GEOM_Object, containing the result shapes.
2006 # @ref swig_todo "Example"
2007 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
2008 ListKeepInside=[], ListRemoveInside=[],
2009 Limit=ShapeType["SHAPE"], RemoveWebs=0,
2010 ListMaterials=[], KeepNonlimitShapes=0):
2011 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
2012 ListKeepInside, ListRemoveInside,
2013 Limit, RemoveWebs, ListMaterials,
2014 KeepNonlimitShapes);
2015 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
2018 ## Shortcut to MakePartition()
2020 # @ref tui_partition "Example 1"
2021 # \n @ref swig_Partition "Example 2"
2022 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
2023 Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
2024 KeepNonlimitShapes=0):
2025 # Example: see GEOM_TestOthers.py
2026 anObj = self.MakePartition(ListShapes, ListTools,
2027 ListKeepInside, ListRemoveInside,
2028 Limit, RemoveWebs, ListMaterials,
2029 KeepNonlimitShapes);
2032 ## Perform partition of the Shape with the Plane
2033 # @param theShape Shape to be intersected.
2034 # @param thePlane Tool shape, to intersect theShape.
2035 # @return New GEOM_Object, containing the result shape.
2037 # @ref tui_partition "Example"
2038 def MakeHalfPartition(self,theShape, thePlane):
2039 # Example: see GEOM_TestAll.py
2040 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
2041 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
2044 # end of l3_basic_op
2047 ## @addtogroup l3_transform
2050 ## Translate the given object along the vector, specified
2051 # by its end points, creating its copy before the translation.
2052 # @param theObject The object to be translated.
2053 # @param thePoint1 Start point of translation vector.
2054 # @param thePoint2 End point of translation vector.
2055 # @return New GEOM_Object, containing the translated object.
2057 # @ref tui_translation "Example 1"
2058 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
2059 def MakeTranslationTwoPoints(self,theObject, thePoint1, thePoint2):
2060 # Example: see GEOM_TestAll.py
2061 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
2062 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
2065 ## Translate the given object along the vector, specified
2066 # by its components, creating its copy before the translation.
2067 # @param theObject The object to be translated.
2068 # @param theDX,theDY,theDZ Components of translation vector.
2069 # @return New GEOM_Object, containing the translated object.
2071 # @ref tui_translation "Example"
2072 def MakeTranslation(self,theObject, theDX, theDY, theDZ):
2073 # Example: see GEOM_TestAll.py
2074 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
2075 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
2078 ## Translate the given object along the given vector,
2079 # creating its copy before the translation.
2080 # @param theObject The object to be translated.
2081 # @param theVector The translation vector.
2082 # @return New GEOM_Object, containing the translated object.
2084 # @ref tui_translation "Example"
2085 def MakeTranslationVector(self,theObject, theVector):
2086 # Example: see GEOM_TestAll.py
2087 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
2088 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
2091 ## Translate the given object along the given vector on given distance,
2092 # creating its copy before the translation.
2093 # @param theObject The object to be translated.
2094 # @param theVector The translation vector.
2095 # @param theDistance The translation distance.
2096 # @return New GEOM_Object, containing the translated object.
2098 # @ref tui_translation "Example"
2099 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance):
2100 # Example: see GEOM_TestAll.py
2101 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
2102 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
2105 ## Rotate the given object around the given axis
2106 # on the given angle, creating its copy before the rotatation.
2107 # @param theObject The object to be rotated.
2108 # @param theAxis Rotation axis.
2109 # @param theAngle Rotation angle in radians.
2110 # @return New GEOM_Object, containing the rotated object.
2112 # @ref tui_rotation "Example"
2113 def MakeRotation(self,theObject, theAxis, theAngle):
2114 # Example: see GEOM_TestAll.py
2115 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
2116 RaiseIfFailed("RotateCopy", self.TrsfOp)
2119 ## Rotate given object around vector perpendicular to plane
2120 # containing three points, creating its copy before the rotatation.
2121 # @param theObject The object to be rotated.
2122 # @param theCentPoint central point - the axis is the vector perpendicular to the plane
2123 # containing the three points.
2124 # @param thePoint1,thePoint2 - in a perpendicular plane of the axis.
2125 # @return New GEOM_Object, containing the rotated object.
2127 # @ref tui_rotation "Example"
2128 def MakeRotationThreePoints(self,theObject, theCentPoint, thePoint1, thePoint2):
2129 # Example: see GEOM_TestAll.py
2130 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
2131 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
2134 ## Scale the given object by the factor, creating its copy before the scaling.
2135 # @param theObject The object to be scaled.
2136 # @param thePoint Center point for scaling.
2137 # Passing None for it means scaling relatively the origin of global CS.
2138 # @param theFactor Scaling factor value.
2139 # @return New GEOM_Object, containing the scaled shape.
2141 # @ref tui_scale "Example"
2142 def MakeScaleTransform(self, theObject, thePoint, theFactor):
2143 # Example: see GEOM_TestAll.py
2144 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
2145 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
2148 ## Scale the given object by different factors along coordinate axes,
2149 # creating its copy before the scaling.
2150 # @param theObject The object to be scaled.
2151 # @param thePoint Center point for scaling.
2152 # Passing None for it means scaling relatively the origin of global CS.
2153 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
2154 # @return New GEOM_Object, containing the scaled shape.
2156 # @ref swig_scale "Example"
2157 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ):
2158 # Example: see GEOM_TestAll.py
2159 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
2160 theFactorX, theFactorY, theFactorZ)
2161 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
2164 ## Create an object, symmetrical
2165 # to the given one relatively the given plane.
2166 # @param theObject The object to be mirrored.
2167 # @param thePlane Plane of symmetry.
2168 # @return New GEOM_Object, containing the mirrored shape.
2170 # @ref tui_mirror "Example"
2171 def MakeMirrorByPlane(self,theObject, thePlane):
2172 # Example: see GEOM_TestAll.py
2173 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
2174 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
2177 ## Create an object, symmetrical
2178 # to the given one relatively the given axis.
2179 # @param theObject The object to be mirrored.
2180 # @param theAxis Axis of symmetry.
2181 # @return New GEOM_Object, containing the mirrored shape.
2183 # @ref tui_mirror "Example"
2184 def MakeMirrorByAxis(self,theObject, theAxis):
2185 # Example: see GEOM_TestAll.py
2186 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
2187 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
2190 ## Create an object, symmetrical
2191 # to the given one relatively the given point.
2192 # @param theObject The object to be mirrored.
2193 # @param thePoint Point of symmetry.
2194 # @return New GEOM_Object, containing the mirrored shape.
2196 # @ref tui_mirror "Example"
2197 def MakeMirrorByPoint(self,theObject, thePoint):
2198 # Example: see GEOM_TestAll.py
2199 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
2200 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
2203 ## Modify the Location of the given object by LCS,
2204 # creating its copy before the setting.
2205 # @param theObject The object to be displaced.
2206 # @param theStartLCS Coordinate system to perform displacement from it.
2207 # If \a theStartLCS is NULL, displacement
2208 # will be performed from global CS.
2209 # If \a theObject itself is used as \a theStartLCS,
2210 # its location will be changed to \a theEndLCS.
2211 # @param theEndLCS Coordinate system to perform displacement to it.
2212 # @return New GEOM_Object, containing the displaced shape.
2214 # @ref tui_modify_location "Example"
2215 def MakePosition(self,theObject, theStartLCS, theEndLCS):
2216 # Example: see GEOM_TestAll.py
2217 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
2218 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
2221 ## Create new object as offset of the given one.
2222 # @param theObject The base object for the offset.
2223 # @param theOffset Offset value.
2224 # @return New GEOM_Object, containing the offset object.
2226 # @ref tui_offset "Example"
2227 def MakeOffset(self,theObject, theOffset):
2228 # Example: see GEOM_TestAll.py
2229 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
2230 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
2233 # -----------------------------------------------------------------------------
2235 # -----------------------------------------------------------------------------
2237 ## Translate the given object along the given vector a given number times
2238 # @param theObject The object to be translated.
2239 # @param theVector Direction of the translation.
2240 # @param theStep Distance to translate on.
2241 # @param theNbTimes Quantity of translations to be done.
2242 # @return New GEOM_Object, containing compound of all
2243 # the shapes, obtained after each translation.
2245 # @ref tui_multi_translation "Example"
2246 def MakeMultiTranslation1D(self,theObject, theVector, theStep, theNbTimes):
2247 # Example: see GEOM_TestAll.py
2248 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
2249 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
2252 ## Conseqently apply two specified translations to theObject specified number of times.
2253 # @param theObject The object to be translated.
2254 # @param theVector1 Direction of the first translation.
2255 # @param theStep1 Step of the first translation.
2256 # @param theNbTimes1 Quantity of translations to be done along theVector1.
2257 # @param theVector2 Direction of the second translation.
2258 # @param theStep2 Step of the second translation.
2259 # @param theNbTimes2 Quantity of translations to be done along theVector2.
2260 # @return New GEOM_Object, containing compound of all
2261 # the shapes, obtained after each translation.
2263 # @ref tui_multi_translation "Example"
2264 def MakeMultiTranslation2D(self,theObject, theVector1, theStep1, theNbTimes1,
2265 theVector2, theStep2, theNbTimes2):
2266 # Example: see GEOM_TestAll.py
2267 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
2268 theVector2, theStep2, theNbTimes2)
2269 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
2272 ## Rotate the given object around the given axis a given number times.
2273 # Rotation angle will be 2*PI/theNbTimes.
2274 # @param theObject The object to be rotated.
2275 # @param theAxis The rotation axis.
2276 # @param theNbTimes Quantity of rotations to be done.
2277 # @return New GEOM_Object, containing compound of all the
2278 # shapes, obtained after each rotation.
2280 # @ref tui_multi_rotation "Example"
2281 def MultiRotate1D(self,theObject, theAxis, theNbTimes):
2282 # Example: see GEOM_TestAll.py
2283 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
2284 RaiseIfFailed("MultiRotate1D", self.TrsfOp)
2287 ## Rotate the given object around the
2288 # given axis on the given angle a given number
2289 # times and multi-translate each rotation result.
2290 # Translation direction passes through center of gravity
2291 # of rotated shape and its projection on the rotation axis.
2292 # @param theObject The object to be rotated.
2293 # @param theAxis Rotation axis.
2294 # @param theAngle Rotation angle in graduces.
2295 # @param theNbTimes1 Quantity of rotations to be done.
2296 # @param theStep Translation distance.
2297 # @param theNbTimes2 Quantity of translations to be done.
2298 # @return New GEOM_Object, containing compound of all the
2299 # shapes, obtained after each transformation.
2301 # @ref tui_multi_rotation "Example"
2302 def MultiRotate2D(self,theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2):
2303 # Example: see GEOM_TestAll.py
2304 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
2305 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
2308 ## The same, as MultiRotate1D(), but axis is given by direction and point
2309 # @ref swig_MakeMultiRotation "Example"
2310 def MakeMultiRotation1D(self,aShape,aDir,aPoint,aNbTimes):
2311 # Example: see GEOM_TestOthers.py
2312 aVec = self.MakeLine(aPoint,aDir)
2313 anObj = self.MultiRotate1D(aShape,aVec,aNbTimes)
2316 ## The same, as MultiRotate2D(), but axis is given by direction and point
2317 # @ref swig_MakeMultiRotation "Example"
2318 def MakeMultiRotation2D(self,aShape,aDir,aPoint,anAngle,nbtimes1,aStep,nbtimes2):
2319 # Example: see GEOM_TestOthers.py
2320 aVec = self.MakeLine(aPoint,aDir)
2321 anObj = self.MultiRotate2D(aShape,aVec,anAngle,nbtimes1,aStep,nbtimes2)
2324 # end of l3_transform
2327 ## @addtogroup l3_local
2330 ## Perform a fillet on all edges of the given shape.
2331 # @param theShape Shape, to perform fillet on.
2332 # @param theR Fillet radius.
2333 # @return New GEOM_Object, containing the result shape.
2335 # @ref tui_fillet "Example 1"
2336 # \n @ref swig_MakeFilletAll "Example 2"
2337 def MakeFilletAll(self,theShape, theR):
2338 # Example: see GEOM_TestOthers.py
2339 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
2340 RaiseIfFailed("MakeFilletAll", self.LocalOp)
2343 ## Perform a fillet on the specified edges/faces of the given shape
2344 # @param theShape Shape, to perform fillet on.
2345 # @param theR Fillet radius.
2346 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR>.
2347 # @param theListShapes Global indices of edges/faces to perform fillet on.
2348 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2349 # @return New GEOM_Object, containing the result shape.
2351 # @ref tui_fillet "Example"
2352 def MakeFillet(self,theShape, theR, theShapeType, theListShapes):
2353 # Example: see GEOM_TestAll.py
2355 if theShapeType == ShapeType["EDGE"]:
2356 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
2357 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
2359 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
2360 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
2363 ## The same that MakeFillet but with two Fillet Radius R1 and R2
2364 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes):
2366 if theShapeType == ShapeType["EDGE"]:
2367 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
2368 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
2370 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
2371 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
2374 ## Perform a symmetric chamfer on all edges of the given shape.
2375 # @param theShape Shape, to perform chamfer on.
2376 # @param theD Chamfer size along each face.
2377 # @return New GEOM_Object, containing the result shape.
2379 # @ref tui_chamfer "Example 1"
2380 # \n @ref swig_MakeChamferAll "Example 2"
2381 def MakeChamferAll(self,theShape, theD):
2382 # Example: see GEOM_TestOthers.py
2383 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
2384 RaiseIfFailed("MakeChamferAll", self.LocalOp)
2387 ## Perform a chamfer on edges, common to the specified faces,
2388 # with distance D1 on the Face1
2389 # @param theShape Shape, to perform chamfer on.
2390 # @param theD1 Chamfer size along \a theFace1.
2391 # @param theD2 Chamfer size along \a theFace2.
2392 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
2393 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2394 # @return New GEOM_Object, containing the result shape.
2396 # @ref tui_chamfer "Example"
2397 def MakeChamferEdge(self,theShape, theD1, theD2, theFace1, theFace2):
2398 # Example: see GEOM_TestAll.py
2399 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
2400 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
2403 ## The Same that MakeChamferEdge but with params theD is chamfer length and
2404 # theAngle is Angle of chamfer (angle in radians)
2405 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2):
2406 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
2407 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
2410 ## Perform a chamfer on all edges of the specified faces,
2411 # with distance D1 on the first specified face (if several for one edge)
2412 # @param theShape Shape, to perform chamfer on.
2413 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
2414 # connected to the edge, are in \a theFaces, \a theD1
2415 # will be get along face, which is nearer to \a theFaces beginning.
2416 # @param theD2 Chamfer size along another of two faces, connected to the edge.
2417 # @param theFaces Sequence of global indices of faces of \a theShape.
2418 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2419 # @return New GEOM_Object, containing the result shape.
2421 # @ref tui_chamfer "Example"
2422 def MakeChamferFaces(self,theShape, theD1, theD2, theFaces):
2423 # Example: see GEOM_TestAll.py
2424 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
2425 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
2428 ## The Same that MakeChamferFaces but with params theD is chamfer lenght and
2429 # theAngle is Angle of chamfer (angle in radians)
2431 # @ref swig_FilletChamfer "Example"
2432 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces):
2433 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
2434 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
2437 ## Perform a chamfer on edges,
2438 # with distance D1 on the first specified face (if several for one edge)
2439 # @param theShape Shape, to perform chamfer on.
2440 # @param theD1,theD2 Chamfer size
2441 # @param theEdges Sequence of edges of \a theShape.
2442 # @return New GEOM_Object, containing the result shape.
2444 # @ref swig_FilletChamfer "Example"
2445 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges):
2446 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
2447 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
2450 ## The Same that MakeChamferEdges but with params theD is chamfer lenght and
2451 # theAngle is Angle of chamfer (angle in radians)
2452 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges):
2453 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
2454 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
2457 ## Shortcut to MakeChamferEdge() and MakeChamferFaces()
2459 # @ref swig_MakeChamfer "Example"
2460 def MakeChamfer(self,aShape,d1,d2,aShapeType,ListShape):
2461 # Example: see GEOM_TestOthers.py
2463 if aShapeType == ShapeType["EDGE"]:
2464 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1])
2466 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape)
2472 ## @addtogroup l3_basic_op
2475 ## Perform an Archimde operation on the given shape with given parameters.
2476 # The object presenting the resulting face is returned.
2477 # @param theShape Shape to be put in water.
2478 # @param theWeight Weight og the shape.
2479 # @param theWaterDensity Density of the water.
2480 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
2481 # @return New GEOM_Object, containing a section of \a theShape
2482 # by a plane, corresponding to water level.
2484 # @ref tui_archimede "Example"
2485 def Archimede(self,theShape, theWeight, theWaterDensity, theMeshDeflection):
2486 # Example: see GEOM_TestAll.py
2487 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
2488 RaiseIfFailed("MakeArchimede", self.LocalOp)
2491 # end of l3_basic_op
2494 ## @addtogroup l2_measure
2497 ## Get point coordinates
2500 # @ref tui_measurement_tools_page "Example"
2501 def PointCoordinates(self,Point):
2502 # Example: see GEOM_TestMeasures.py
2503 aTuple = self.MeasuOp.PointCoordinates(Point)
2504 RaiseIfFailed("PointCoordinates", self.MeasuOp)
2507 ## Get summarized length of all wires,
2508 # area of surface and volume of the given shape.
2509 # @param theShape Shape to define properties of.
2510 # @return [theLength, theSurfArea, theVolume]
2511 # theLength: Summarized length of all wires of the given shape.
2512 # theSurfArea: Area of surface of the given shape.
2513 # theVolume: Volume of the given shape.
2515 # @ref tui_measurement_tools_page "Example"
2516 def BasicProperties(self,theShape):
2517 # Example: see GEOM_TestMeasures.py
2518 aTuple = self.MeasuOp.GetBasicProperties(theShape)
2519 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
2522 ## Get parameters of bounding box of the given shape
2523 # @param theShape Shape to obtain bounding box of.
2524 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
2525 # Xmin,Xmax: Limits of shape along OX axis.
2526 # Ymin,Ymax: Limits of shape along OY axis.
2527 # Zmin,Zmax: Limits of shape along OZ axis.
2529 # @ref tui_measurement_tools_page "Example"
2530 def BoundingBox(self,theShape):
2531 # Example: see GEOM_TestMeasures.py
2532 aTuple = self.MeasuOp.GetBoundingBox(theShape)
2533 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
2536 ## Get inertia matrix and moments of inertia of theShape.
2537 # @param theShape Shape to calculate inertia of.
2538 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
2539 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
2540 # Ix,Iy,Iz: Moments of inertia of the given shape.
2542 # @ref tui_measurement_tools_page "Example"
2543 def Inertia(self,theShape):
2544 # Example: see GEOM_TestMeasures.py
2545 aTuple = self.MeasuOp.GetInertia(theShape)
2546 RaiseIfFailed("GetInertia", self.MeasuOp)
2549 ## Get minimal distance between the given shapes.
2550 # @param theShape1,theShape2 Shapes to find minimal distance between.
2551 # @return Value of the minimal distance between the given shapes.
2553 # @ref tui_measurement_tools_page "Example"
2554 def MinDistance(self, theShape1, theShape2):
2555 # Example: see GEOM_TestMeasures.py
2556 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
2557 RaiseIfFailed("GetMinDistance", self.MeasuOp)
2560 ## Get minimal distance between the given shapes.
2561 # @param theShape1,theShape2 Shapes to find minimal distance between.
2562 # @return Value of the minimal distance between the given shapes.
2564 # @ref swig_all_measure "Example"
2565 def MinDistanceComponents(self, theShape1, theShape2):
2566 # Example: see GEOM_TestMeasures.py
2567 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
2568 RaiseIfFailed("GetMinDistance", self.MeasuOp)
2569 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
2572 ## Get angle between the given shapes in degrees.
2573 # @param theShape1,theShape2 Lines or linear edges to find angle between.
2574 # @return Value of the angle between the given shapes in degrees.
2576 # @ref tui_measurement_tools_page "Example"
2577 def GetAngle(self, theShape1, theShape2):
2578 # Example: see GEOM_TestMeasures.py
2579 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
2580 RaiseIfFailed("GetAngle", self.MeasuOp)
2582 ## Get angle between the given shapes in radians.
2583 # @param theShape1,theShape2 Lines or linear edges to find angle between.
2584 # @return Value of the angle between the given shapes in radians.
2586 # @ref tui_measurement_tools_page "Example"
2587 def GetAngleRadians(self, theShape1, theShape2):
2588 # Example: see GEOM_TestMeasures.py
2589 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
2590 RaiseIfFailed("GetAngle", self.MeasuOp)
2593 ## @name Curve Curvature Measurement
2594 # Methods for receiving radius of curvature of curves
2595 # in the given point
2598 ## Measure curvature of a curve at a point, set by parameter.
2599 # @ref swig_todo "Example"
2600 def CurveCurvatureByParam(self, theCurve, theParam):
2601 # Example: see GEOM_TestMeasures.py
2602 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
2603 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
2607 # @ref swig_todo "Example"
2608 def CurveCurvatureByPoint(self, theCurve, thePoint):
2609 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
2610 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
2614 ## @name Surface Curvature Measurement
2615 # Methods for receiving max and min radius of curvature of surfaces
2616 # in the given point
2620 ## @ref swig_todo "Example"
2621 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
2622 # Example: see GEOM_TestMeasures.py
2623 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
2624 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
2628 ## @ref swig_todo "Example"
2629 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
2630 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
2631 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
2635 ## @ref swig_todo "Example"
2636 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
2637 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
2638 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
2642 ## @ref swig_todo "Example"
2643 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
2644 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
2645 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
2649 ## Get min and max tolerances of sub-shapes of theShape
2650 # @param theShape Shape, to get tolerances of.
2651 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
2652 # FaceMin,FaceMax: Min and max tolerances of the faces.
2653 # EdgeMin,EdgeMax: Min and max tolerances of the edges.
2654 # VertMin,VertMax: Min and max tolerances of the vertices.
2656 # @ref tui_measurement_tools_page "Example"
2657 def Tolerance(self,theShape):
2658 # Example: see GEOM_TestMeasures.py
2659 aTuple = self.MeasuOp.GetTolerance(theShape)
2660 RaiseIfFailed("GetTolerance", self.MeasuOp)
2663 ## Obtain description of the given shape (number of sub-shapes of each type)
2664 # @param theShape Shape to be described.
2665 # @return Description of the given shape.
2667 # @ref tui_measurement_tools_page "Example"
2668 def WhatIs(self,theShape):
2669 # Example: see GEOM_TestMeasures.py
2670 aDescr = self.MeasuOp.WhatIs(theShape)
2671 RaiseIfFailed("WhatIs", self.MeasuOp)
2674 ## Get a point, situated at the centre of mass of theShape.
2675 # @param theShape Shape to define centre of mass of.
2676 # @return New GEOM_Object, containing the created point.
2678 # @ref tui_measurement_tools_page "Example"
2679 def MakeCDG(self,theShape):
2680 # Example: see GEOM_TestMeasures.py
2681 anObj = self.MeasuOp.GetCentreOfMass(theShape)
2682 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
2685 ## Get a normale to the given face. If the point is not given,
2686 # the normale is calculated at the center of mass.
2687 # @param theFace Face to define normale of.
2688 # @param theOptionalPoint Point to compute the normale at.
2689 # @return New GEOM_Object, containing the created vector.
2691 # @ref swig_todo "Example"
2692 def GetNormal(self, theFace, theOptionalPoint = None):
2693 # Example: see GEOM_TestMeasures.py
2694 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
2695 RaiseIfFailed("GetNormal", self.MeasuOp)
2698 ## Check a topology of the given shape.
2699 # @param theShape Shape to check validity of.
2700 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked,
2701 # if TRUE, the shape's geometry will be checked also.
2702 # @return TRUE, if the shape "seems to be valid".
2703 # If theShape is invalid, prints a description of problem.
2705 # @ref tui_measurement_tools_page "Example"
2706 def CheckShape(self,theShape, theIsCheckGeom = 0):
2707 # Example: see GEOM_TestMeasures.py
2709 (IsValid, Status) = self.MeasuOp.CheckShapeWithGeometry(theShape)
2710 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
2712 (IsValid, Status) = self.MeasuOp.CheckShape(theShape)
2713 RaiseIfFailed("CheckShape", self.MeasuOp)
2718 ## Get position (LCS) of theShape.
2720 # Origin of the LCS is situated at the shape's center of mass.
2721 # Axes of the LCS are obtained from shape's location or,
2722 # if the shape is a planar face, from position of its plane.
2724 # @param theShape Shape to calculate position of.
2725 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
2726 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
2727 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
2728 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
2730 # @ref swig_todo "Example"
2731 def GetPosition(self,theShape):
2732 # Example: see GEOM_TestMeasures.py
2733 aTuple = self.MeasuOp.GetPosition(theShape)
2734 RaiseIfFailed("GetPosition", self.MeasuOp)
2737 ## Get kind of theShape.
2739 # @param theShape Shape to get a kind of.
2740 # @return Returns a kind of shape in terms of <VAR>GEOM_IKindOfShape.shape_kind</VAR> enumeration
2741 # and a list of parameters, describing the shape.
2742 # @note Concrete meaning of each value, returned via \a theIntegers
2743 # or \a theDoubles list depends on the kind of the shape.
2744 # The full list of possible outputs is:
2746 # - geompy.kind.COMPOUND nb_solids nb_faces nb_edges nb_vertices
2747 # - geompy.kind.COMPSOLID nb_solids nb_faces nb_edges nb_vertices
2749 # - geompy.kind.SHELL geompy.info.CLOSED nb_faces nb_edges nb_vertices
2750 # - geompy.kind.SHELL geompy.info.UNCLOSED nb_faces nb_edges nb_vertices
2752 # - geompy.kind.WIRE geompy.info.CLOSED nb_edges nb_vertices
2753 # - geompy.kind.WIRE geompy.info.UNCLOSED nb_edges nb_vertices
2755 # - geompy.kind.SPHERE xc yc zc R
2756 # - geompy.kind.CYLINDER xb yb zb dx dy dz R H
2757 # - geompy.kind.BOX xc yc zc ax ay az
2758 # - geompy.kind.ROTATED_BOX xc yc zc zx zy zz xx xy xz ax ay az
2759 # - geompy.kind.TORUS xc yc zc dx dy dz R_1 R_2
2760 # - geompy.kind.CONE xb yb zb dx dy dz R_1 R_2 H
2761 # - geompy.kind.POLYHEDRON nb_faces nb_edges nb_vertices
2762 # - geompy.kind.SOLID nb_faces nb_edges nb_vertices
2764 # - geompy.kind.SPHERE2D xc yc zc R
2765 # - geompy.kind.CYLINDER2D xb yb zb dx dy dz R H
2766 # - geompy.kind.TORUS2D xc yc zc dx dy dz R_1 R_2
2767 # - geompy.kind.CONE2D xc yc zc dx dy dz R_1 R_2 H
2768 # - geompy.kind.DISK_CIRCLE xc yc zc dx dy dz R
2769 # - geompy.kind.DISK_ELLIPSE xc yc zc dx dy dz R_1 R_2
2770 # - geompy.kind.POLYGON xo yo zo dx dy dz nb_edges nb_vertices
2771 # - geompy.kind.PLANE xo yo zo dx dy dz
2772 # - geompy.kind.PLANAR xo yo zo dx dy dz nb_edges nb_vertices
2773 # - geompy.kind.FACE nb_edges nb_vertices
2775 # - geompy.kind.CIRCLE xc yc zc dx dy dz R
2776 # - geompy.kind.ARC_CIRCLE xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2
2777 # - geompy.kind.ELLIPSE xc yc zc dx dy dz R_1 R_2
2778 # - geompy.kind.ARC_ELLIPSE xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2
2779 # - geompy.kind.LINE xo yo zo dx dy dz
2780 # - geompy.kind.SEGMENT x1 y1 z1 x2 y2 z2
2781 # - geompy.kind.EDGE nb_vertices
2783 # - geompy.kind.VERTEX x y z
2785 # @ref swig_todo "Example"
2786 def KindOfShape(self,theShape):
2787 # Example: see GEOM_TestMeasures.py
2788 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
2789 RaiseIfFailed("KindOfShape", self.MeasuOp)
2791 aKind = aRoughTuple[0]
2792 anInts = aRoughTuple[1]
2793 aDbls = aRoughTuple[2]
2795 # Now there is no exception from this rule:
2796 aKindTuple = [aKind] + aDbls + anInts
2798 # If they are we will regroup parameters for such kind of shape.
2800 #if aKind == kind.SOME_KIND:
2801 # # SOME_KIND int int double int double double
2802 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
2809 ## @addtogroup l2_import_export
2812 ## Import a shape from the BREP or IGES or STEP file
2813 # (depends on given format) with given name.
2814 # @param theFileName The file, containing the shape.
2815 # @param theFormatName Specify format for the file reading.
2816 # Available formats can be obtained with InsertOp.ImportTranslators() method.
2817 # @return New GEOM_Object, containing the imported shape.
2819 # @ref swig_Import_Export "Example"
2820 def Import(self,theFileName, theFormatName):
2821 # Example: see GEOM_TestOthers.py
2822 anObj = self.InsertOp.Import(theFileName, theFormatName)
2823 RaiseIfFailed("Import", self.InsertOp)
2826 ## Shortcut to Import() for BREP format
2828 # @ref swig_Import_Export "Example"
2829 def ImportBREP(self,theFileName):
2830 # Example: see GEOM_TestOthers.py
2831 return self.Import(theFileName, "BREP")
2833 ## Shortcut to Import() for IGES format
2835 # @ref swig_Import_Export "Example"
2836 def ImportIGES(self,theFileName):
2837 # Example: see GEOM_TestOthers.py
2838 return self.Import(theFileName, "IGES")
2840 ## Shortcut to Import() for STEP format
2842 # @ref swig_Import_Export "Example"
2843 def ImportSTEP(self,theFileName):
2844 # Example: see GEOM_TestOthers.py
2845 return self.Import(theFileName, "STEP")
2847 ## Export the given shape into a file with given name.
2848 # @param theObject Shape to be stored in the file.
2849 # @param theFileName Name of the file to store the given shape in.
2850 # @param theFormatName Specify format for the shape storage.
2851 # Available formats can be obtained with InsertOp.ImportTranslators() method.
2853 # @ref swig_Import_Export "Example"
2854 def Export(self,theObject, theFileName, theFormatName):
2855 # Example: see GEOM_TestOthers.py
2856 self.InsertOp.Export(theObject, theFileName, theFormatName)
2857 if self.InsertOp.IsDone() == 0:
2858 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
2862 ## Shortcut to Export() for BREP format
2864 # @ref swig_Import_Export "Example"
2865 def ExportBREP(self,theObject, theFileName):
2866 # Example: see GEOM_TestOthers.py
2867 return self.Export(theObject, theFileName, "BREP")
2869 ## Shortcut to Export() for IGES format
2871 # @ref swig_Import_Export "Example"
2872 def ExportIGES(self,theObject, theFileName):
2873 # Example: see GEOM_TestOthers.py
2874 return self.Export(theObject, theFileName, "IGES")
2876 ## Shortcut to Export() for STEP format
2878 # @ref swig_Import_Export "Example"
2879 def ExportSTEP(self,theObject, theFileName):
2880 # Example: see GEOM_TestOthers.py
2881 return self.Export(theObject, theFileName, "STEP")
2883 # end of l2_import_export
2886 ## @addtogroup l3_blocks
2889 ## Create a quadrangle face from four edges. Order of Edges is not
2890 # important. It is not necessary that edges share the same vertex.
2891 # @param E1,E2,E3,E4 Edges for the face bound.
2892 # @return New GEOM_Object, containing the created face.
2894 # @ref tui_building_by_blocks_page "Example"
2895 def MakeQuad(self,E1, E2, E3, E4):
2896 # Example: see GEOM_Spanner.py
2897 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
2898 RaiseIfFailed("MakeQuad", self.BlocksOp)
2901 ## Create a quadrangle face on two edges.
2902 # The missing edges will be built by creating the shortest ones.
2903 # @param E1,E2 Two opposite edges for the face.
2904 # @return New GEOM_Object, containing the created face.
2906 # @ref tui_building_by_blocks_page "Example"
2907 def MakeQuad2Edges(self,E1, E2):
2908 # Example: see GEOM_Spanner.py
2909 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
2910 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
2913 ## Create a quadrangle face with specified corners.
2914 # The missing edges will be built by creating the shortest ones.
2915 # @param V1,V2,V3,V4 Corner vertices for the face.
2916 # @return New GEOM_Object, containing the created face.
2918 # @ref tui_building_by_blocks_page "Example 1"
2919 # \n @ref swig_MakeQuad4Vertices "Example 2"
2920 def MakeQuad4Vertices(self,V1, V2, V3, V4):
2921 # Example: see GEOM_Spanner.py
2922 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
2923 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
2926 ## Create a hexahedral solid, bounded by the six given faces. Order of
2927 # faces is not important. It is not necessary that Faces share the same edge.
2928 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
2929 # @return New GEOM_Object, containing the created solid.
2931 # @ref tui_building_by_blocks_page "Example 1"
2932 # \n @ref swig_MakeHexa "Example 2"
2933 def MakeHexa(self,F1, F2, F3, F4, F5, F6):
2934 # Example: see GEOM_Spanner.py
2935 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
2936 RaiseIfFailed("MakeHexa", self.BlocksOp)
2939 ## Create a hexahedral solid between two given faces.
2940 # The missing faces will be built by creating the smallest ones.
2941 # @param F1,F2 Two opposite faces for the hexahedral solid.
2942 # @return New GEOM_Object, containing the created solid.
2944 # @ref tui_building_by_blocks_page "Example 1"
2945 # \n @ref swig_MakeHexa2Faces "Example 2"
2946 def MakeHexa2Faces(self,F1, F2):
2947 # Example: see GEOM_Spanner.py
2948 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
2949 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
2955 ## @addtogroup l3_blocks_op
2958 ## Get a vertex, found in the given shape by its coordinates.
2959 # @param theShape Block or a compound of blocks.
2960 # @param theX,theY,theZ Coordinates of the sought vertex.
2961 # @param theEpsilon Maximum allowed distance between the resulting
2962 # vertex and point with the given coordinates.
2963 # @return New GEOM_Object, containing the found vertex.
2965 # @ref swig_GetPoint "Example"
2966 def GetPoint(self,theShape, theX, theY, theZ, theEpsilon):
2967 # Example: see GEOM_TestOthers.py
2968 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
2969 RaiseIfFailed("GetPoint", self.BlocksOp)
2972 ## Get an edge, found in the given shape by two given vertices.
2973 # @param theShape Block or a compound of blocks.
2974 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
2975 # @return New GEOM_Object, containing the found edge.
2977 # @ref swig_todo "Example"
2978 def GetEdge(self,theShape, thePoint1, thePoint2):
2979 # Example: see GEOM_Spanner.py
2980 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
2981 RaiseIfFailed("GetEdge", self.BlocksOp)
2984 ## Find an edge of the given shape, which has minimal distance to the given point.
2985 # @param theShape Block or a compound of blocks.
2986 # @param thePoint Point, close to the desired edge.
2987 # @return New GEOM_Object, containing the found edge.
2989 # @ref swig_GetEdgeNearPoint "Example"
2990 def GetEdgeNearPoint(self,theShape, thePoint):
2991 # Example: see GEOM_TestOthers.py
2992 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
2993 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
2996 ## Returns a face, found in the given shape by four given corner vertices.
2997 # @param theShape Block or a compound of blocks.
2998 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
2999 # @return New GEOM_Object, containing the found face.
3001 # @ref swig_todo "Example"
3002 def GetFaceByPoints(self,theShape, thePoint1, thePoint2, thePoint3, thePoint4):
3003 # Example: see GEOM_Spanner.py
3004 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
3005 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
3008 ## Get a face of block, found in the given shape by two given edges.
3009 # @param theShape Block or a compound of blocks.
3010 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
3011 # @return New GEOM_Object, containing the found face.
3013 # @ref swig_todo "Example"
3014 def GetFaceByEdges(self,theShape, theEdge1, theEdge2):
3015 # Example: see GEOM_Spanner.py
3016 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
3017 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
3020 ## Find a face, opposite to the given one in the given block.
3021 # @param theBlock Must be a hexahedral solid.
3022 # @param theFace Face of \a theBlock, opposite to the desired face.
3023 # @return New GEOM_Object, containing the found face.
3025 # @ref swig_GetOppositeFace "Example"
3026 def GetOppositeFace(self,theBlock, theFace):
3027 # Example: see GEOM_Spanner.py
3028 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
3029 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
3032 ## Find a face of the given shape, which has minimal distance to the given point.
3033 # @param theShape Block or a compound of blocks.
3034 # @param thePoint Point, close to the desired face.
3035 # @return New GEOM_Object, containing the found face.
3037 # @ref swig_GetFaceNearPoint "Example"
3038 def GetFaceNearPoint(self,theShape, thePoint):
3039 # Example: see GEOM_Spanner.py
3040 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
3041 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
3044 ## Find a face of block, whose outside normale has minimal angle with the given vector.
3045 # @param theBlock Block or a compound of blocks.
3046 # @param theVector Vector, close to the normale of the desired face.
3047 # @return New GEOM_Object, containing the found face.
3049 # @ref swig_todo "Example"
3050 def GetFaceByNormale(self, theBlock, theVector):
3051 # Example: see GEOM_Spanner.py
3052 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
3053 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
3056 # end of l3_blocks_op
3059 ## @addtogroup l4_blocks_measure
3062 ## Check, if the compound of blocks is given.
3063 # To be considered as a compound of blocks, the
3064 # given shape must satisfy the following conditions:
3065 # - Each element of the compound should be a Block (6 faces and 12 edges).
3066 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
3067 # - The compound should be connexe.
3068 # - The glue between two quadrangle faces should be applied.
3069 # @param theCompound The compound to check.
3070 # @return TRUE, if the given shape is a compound of blocks.
3071 # If theCompound is not valid, prints all discovered errors.
3073 # @ref tui_measurement_tools_page "Example 1"
3074 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
3075 def CheckCompoundOfBlocks(self,theCompound):
3076 # Example: see GEOM_Spanner.py
3077 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
3078 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
3080 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
3084 ## Remove all seam and degenerated edges from \a theShape.
3085 # Unite faces and edges, sharing one surface. It means that
3086 # this faces must have references to one C++ surface object (handle).
3087 # @param theShape The compound or single solid to remove irregular edges from.
3088 # @return Improved shape.
3090 # @ref swig_RemoveExtraEdges "Example"
3091 def RemoveExtraEdges(self,theShape):
3092 # Example: see GEOM_TestOthers.py
3093 anObj = self.BlocksOp.RemoveExtraEdges(theShape)
3094 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
3097 ## Check, if the given shape is a blocks compound.
3098 # Fix all detected errors.
3099 # \note Single block can be also fixed by this method.
3100 # @param theShape The compound to check and improve.
3101 # @return Improved compound.
3103 # @ref swig_CheckAndImprove "Example"
3104 def CheckAndImprove(self,theShape):
3105 # Example: see GEOM_TestOthers.py
3106 anObj = self.BlocksOp.CheckAndImprove(theShape)
3107 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
3110 # end of l4_blocks_measure
3113 ## @addtogroup l3_blocks_op
3116 ## Get all the blocks, contained in the given compound.
3117 # @param theCompound The compound to explode.
3118 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
3119 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
3120 # \note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
3121 # @return List of GEOM_Objects, containing the retrieved blocks.
3123 # @ref tui_explode_on_blocks "Example 1"
3124 # \n @ref swig_MakeBlockExplode "Example 2"
3125 def MakeBlockExplode(self,theCompound, theMinNbFaces, theMaxNbFaces):
3126 # Example: see GEOM_TestOthers.py
3127 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
3128 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
3131 ## Find block, containing the given point inside its volume or on boundary.
3132 # @param theCompound Compound, to find block in.
3133 # @param thePoint Point, close to the desired block. If the point lays on
3134 # boundary between some blocks, we return block with nearest center.
3135 # @return New GEOM_Object, containing the found block.
3137 # @ref swig_todo "Example"
3138 def GetBlockNearPoint(self,theCompound, thePoint):
3139 # Example: see GEOM_Spanner.py
3140 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
3141 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
3144 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
3145 # @param theCompound Compound, to find block in.
3146 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
3147 # @return New GEOM_Object, containing the found block.
3149 # @ref swig_GetBlockByParts "Example"
3150 def GetBlockByParts(self,theCompound, theParts):
3151 # Example: see GEOM_TestOthers.py
3152 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
3153 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
3156 ## Return all blocks, containing all the elements, passed as the parts.
3157 # @param theCompound Compound, to find blocks in.
3158 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
3159 # @return List of GEOM_Objects, containing the found blocks.
3161 # @ref swig_todo "Example"
3162 def GetBlocksByParts(self,theCompound, theParts):
3163 # Example: see GEOM_Spanner.py
3164 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
3165 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
3168 ## Multi-transformate block and glue the result.
3169 # Transformation is defined so, as to superpose direction faces.
3170 # @param Block Hexahedral solid to be multi-transformed.
3171 # @param DirFace1 ID of First direction face.
3172 # @param DirFace2 ID of Second direction face.
3173 # @param NbTimes Quantity of transformations to be done.
3174 # \note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
3175 # @return New GEOM_Object, containing the result shape.
3177 # @ref tui_multi_transformation "Example"
3178 def MakeMultiTransformation1D(self,Block, DirFace1, DirFace2, NbTimes):
3179 # Example: see GEOM_Spanner.py
3180 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
3181 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
3184 ## Multi-transformate block and glue the result.
3185 # @param Block Hexahedral solid to be multi-transformed.
3186 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
3187 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
3188 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
3189 # @return New GEOM_Object, containing the result shape.
3191 # @ref tui_multi_transformation "Example"
3192 def MakeMultiTransformation2D(self,Block, DirFace1U, DirFace2U, NbTimesU,
3193 DirFace1V, DirFace2V, NbTimesV):
3194 # Example: see GEOM_Spanner.py
3195 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
3196 DirFace1V, DirFace2V, NbTimesV)
3197 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
3200 ## Build all possible propagation groups.
3201 # Propagation group is a set of all edges, opposite to one (main)
3202 # edge of this group directly or through other opposite edges.
3203 # Notion of Opposite Edge make sence only on quadrangle face.
3204 # @param theShape Shape to build propagation groups on.
3205 # @return List of GEOM_Objects, each of them is a propagation group.
3207 # @ref swig_Propagate "Example"
3208 def Propagate(self,theShape):
3209 # Example: see GEOM_TestOthers.py
3210 listChains = self.BlocksOp.Propagate(theShape)
3211 RaiseIfFailed("Propagate", self.BlocksOp)
3214 # end of l3_blocks_op
3217 ## @addtogroup l3_groups
3220 ## Creates a new group which will store sub shapes of theMainShape
3221 # @param theMainShape is a GEOM object on which the group is selected
3222 # @param theShapeType defines a shape type of the group
3223 # @return a newly created GEOM group
3225 # @ref tui_working_with_groups_page "Example 1"
3226 # \n @ref swig_CreateGroup "Example 2"
3227 def CreateGroup(self,theMainShape, theShapeType):
3228 # Example: see GEOM_TestOthers.py
3229 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
3230 RaiseIfFailed("CreateGroup", self.GroupOp)
3233 ## Adds a sub object with ID theSubShapeId to the group
3234 # @param theGroup is a GEOM group to which the new sub shape is added
3235 # @param theSubShapeID is a sub shape ID in the main object.
3236 # \note Use method GetSubShapeID() to get an unique ID of the sub shape
3238 # @ref tui_working_with_groups_page "Example"
3239 def AddObject(self,theGroup, theSubShapeID):
3240 # Example: see GEOM_TestOthers.py
3241 self.GroupOp.AddObject(theGroup, theSubShapeID)
3242 RaiseIfFailed("AddObject", self.GroupOp)
3245 ## Removes a sub object with ID \a theSubShapeId from the group
3246 # @param theGroup is a GEOM group from which the new sub shape is removed
3247 # @param theSubShapeID is a sub shape ID in the main object.
3248 # \note Use method GetSubShapeID() to get an unique ID of the sub shape
3250 # @ref tui_working_with_groups_page "Example"
3251 def RemoveObject(self,theGroup, theSubShapeID):
3252 # Example: see GEOM_TestOthers.py
3253 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
3254 RaiseIfFailed("RemoveObject", self.GroupOp)
3257 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
3258 # @param theGroup is a GEOM group to which the new sub shapes are added.
3259 # @param theSubShapes is a list of sub shapes to be added.
3261 # @ref tui_working_with_groups_page "Example"
3262 def UnionList (self,theGroup, theSubShapes):
3263 # Example: see GEOM_TestOthers.py
3264 self.GroupOp.UnionList(theGroup, theSubShapes)
3265 RaiseIfFailed("UnionList", self.GroupOp)
3268 ## Works like the above method, but argument
3269 # theSubShapes here is a list of sub-shapes indices
3271 # @ref swig_UnionIDs "Example"
3272 def UnionIDs(self,theGroup, theSubShapes):
3273 # Example: see GEOM_TestOthers.py
3274 self.GroupOp.UnionIDs(theGroup, theSubShapes)
3275 RaiseIfFailed("UnionIDs", self.GroupOp)
3278 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
3279 # @param theGroup is a GEOM group from which the sub-shapes are removed.
3280 # @param theSubShapes is a list of sub-shapes to be removed.
3282 # @ref tui_working_with_groups_page "Example"
3283 def DifferenceList (self,theGroup, theSubShapes):
3284 # Example: see GEOM_TestOthers.py
3285 self.GroupOp.DifferenceList(theGroup, theSubShapes)
3286 RaiseIfFailed("DifferenceList", self.GroupOp)
3289 ## Works like the above method, but argument
3290 # theSubShapes here is a list of sub-shapes indices
3292 # @ref swig_DifferenceIDs "Example"
3293 def DifferenceIDs(self,theGroup, theSubShapes):
3294 # Example: see GEOM_TestOthers.py
3295 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
3296 RaiseIfFailed("DifferenceIDs", self.GroupOp)
3299 ## Returns a list of sub objects ID stored in the group
3300 # @param theGroup is a GEOM group for which a list of IDs is requested
3302 # @ref swig_GetObjectIDs "Example"
3303 def GetObjectIDs(self,theGroup):
3304 # Example: see GEOM_TestOthers.py
3305 ListIDs = self.GroupOp.GetObjects(theGroup)
3306 RaiseIfFailed("GetObjects", self.GroupOp)
3309 ## Returns a type of sub objects stored in the group
3310 # @param theGroup is a GEOM group which type is returned.
3312 # @ref swig_GetType "Example"
3313 def GetType(self,theGroup):
3314 # Example: see GEOM_TestOthers.py
3315 aType = self.GroupOp.GetType(theGroup)
3316 RaiseIfFailed("GetType", self.GroupOp)
3319 ## Returns a main shape associated with the group
3320 # @param theGroup is a GEOM group for which a main shape object is requested
3321 # @return a GEOM object which is a main shape for theGroup
3323 # @ref swig_GetMainShape "Example"
3324 def GetMainShape(self,theGroup):
3325 # Example: see GEOM_TestOthers.py
3326 anObj = self.GroupOp.GetMainShape(theGroup)
3327 RaiseIfFailed("GetMainShape", self.GroupOp)
3330 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
3331 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
3333 # @ref swig_todo "Example"
3334 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1):
3335 edges = self.SubShapeAll(theShape, ShapeType["EDGE"])
3338 Props = self.BasicProperties(edge)
3339 if min_length <= Props[0] and Props[0] <= max_length:
3340 if (not include_min) and (min_length == Props[0]):
3343 if (not include_max) and (Props[0] == max_length):
3346 edges_in_range.append(edge)
3348 if len(edges_in_range) <= 0:
3349 print "No edges found by given criteria"
3352 group_edges = self.CreateGroup(theShape, ShapeType["EDGE"])
3353 self.UnionList(group_edges, edges_in_range)
3357 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
3358 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
3360 # @ref swig_todo "Example"
3361 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
3362 nb_selected = sg.SelectedCount()
3364 print "Select a shape before calling this function, please."
3367 print "Only one shape must be selected"
3370 id_shape = sg.getSelected(0)
3371 shape = IDToObject( id_shape )
3373 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
3377 if include_min: left_str = " <= "
3378 if include_max: right_str = " <= "
3380 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
3381 + left_str + "length" + right_str + `max_length`)
3383 sg.updateObjBrowser(1)
3390 ## Create a copy of the given object
3391 # @ingroup l1_geompy_auxiliary
3393 # @ref swig_all_advanced "Example"
3394 def MakeCopy(self,theOriginal):
3395 # Example: see GEOM_TestAll.py
3396 anObj = self.InsertOp.MakeCopy(theOriginal)
3397 RaiseIfFailed("MakeCopy", self.InsertOp)
3400 ## Add Path to load python scripts from
3401 # @ingroup l1_geompy_auxiliary
3402 def addPath(self,Path):
3403 if (sys.path.count(Path) < 1):
3404 sys.path.append(Path)
3407 #Register the new proxy for GEOM_Gen
3408 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geompyDC)