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)
1145 ## @addtogroup l3_advanced
1148 ## Create a linear edge with specified ends.
1149 # @param thePnt1 Point for the first end of edge.
1150 # @param thePnt2 Point for the second end of edge.
1151 # @return New GEOM_Object, containing the created edge.
1153 # @ref tui_creation_edge "Example"
1154 def MakeEdge(self,thePnt1, thePnt2):
1155 # Example: see GEOM_TestAll.py
1156 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
1157 RaiseIfFailed("MakeEdge", self.ShapesOp)
1160 ## Create a wire from the set of edges and wires.
1161 # @param theEdgesAndWires List of edges and/or wires.
1162 # @return New GEOM_Object, containing the created wire.
1164 # @ref tui_creation_wire "Example"
1165 def MakeWire(self,theEdgesAndWires):
1166 # Example: see GEOM_TestAll.py
1167 anObj = self.ShapesOp.MakeWire(theEdgesAndWires)
1168 RaiseIfFailed("MakeWire", self.ShapesOp)
1171 ## Create a face on the given wire.
1172 # @param theWire closed Wire or Edge to build the face on.
1173 # @param isPlanarWanted If TRUE, only planar face will be built.
1174 # If impossible, NULL object will be returned.
1175 # @return New GEOM_Object, containing the created face.
1177 # @ref tui_creation_face "Example"
1178 def MakeFace(self,theWire, isPlanarWanted):
1179 # Example: see GEOM_TestAll.py
1180 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
1181 RaiseIfFailed("MakeFace", self.ShapesOp)
1184 ## Create a face on the given wires set.
1185 # @param theWires List of closed wires or edges to build the face on.
1186 # @param isPlanarWanted If TRUE, only planar face will be built.
1187 # If impossible, NULL object will be returned.
1188 # @return New GEOM_Object, containing the created face.
1190 # @ref tui_creation_face "Example"
1191 def MakeFaceWires(self,theWires, isPlanarWanted):
1192 # Example: see GEOM_TestAll.py
1193 anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
1194 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
1197 ## Shortcut to MakeFaceWires()
1199 # @ref tui_creation_face "Example 1"
1200 # \n @ref swig_MakeFaces "Example 2"
1201 def MakeFaces(self,theWires, isPlanarWanted):
1202 # Example: see GEOM_TestOthers.py
1203 anObj = self.MakeFaceWires(theWires, isPlanarWanted)
1206 ## Create a shell from the set of faces and shells.
1207 # @param theFacesAndShells List of faces and/or shells.
1208 # @return New GEOM_Object, containing the created shell.
1210 # @ref tui_creation_shell "Example"
1211 def MakeShell(self,theFacesAndShells):
1212 # Example: see GEOM_TestAll.py
1213 anObj = self.ShapesOp.MakeShell(theFacesAndShells)
1214 RaiseIfFailed("MakeShell", self.ShapesOp)
1217 ## Create a solid, bounded by the given shells.
1218 # @param theShells Sequence of bounding shells.
1219 # @return New GEOM_Object, containing the created solid.
1221 # @ref tui_creation_solid "Example"
1222 def MakeSolid(self,theShells):
1223 # Example: see GEOM_TestAll.py
1224 anObj = self.ShapesOp.MakeSolidShells(theShells)
1225 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
1228 ## Create a compound of the given shapes.
1229 # @param theShapes List of shapes to put in compound.
1230 # @return New GEOM_Object, containing the created compound.
1232 # @ref tui_creation_compound "Example"
1233 def MakeCompound(self,theShapes):
1234 # Example: see GEOM_TestAll.py
1235 anObj = self.ShapesOp.MakeCompound(theShapes)
1236 RaiseIfFailed("MakeCompound", self.ShapesOp)
1239 # end of l3_advanced
1242 ## @addtogroup l2_measure
1245 ## Gives quantity of faces in the given shape.
1246 # @param theShape Shape to count faces of.
1247 # @return Quantity of faces.
1249 # @ref swig_NumberOfFaces "Example"
1250 def NumberOfFaces(self,theShape):
1251 # Example: see GEOM_TestOthers.py
1252 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
1253 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
1256 ## Gives quantity of edges in the given shape.
1257 # @param theShape Shape to count edges of.
1258 # @return Quantity of edges.
1260 # @ref swig_NumberOfEdges "Example"
1261 def NumberOfEdges(self,theShape):
1262 # Example: see GEOM_TestOthers.py
1263 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
1264 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
1270 ## @addtogroup l3_healing
1273 ## Reverses an orientation the given shape.
1274 # @param theShape Shape to be reversed.
1275 # @return The reversed copy of theShape.
1277 # @ref swig_ChangeOrientation "Example"
1278 def ChangeOrientation(self,theShape):
1279 # Example: see GEOM_TestAll.py
1280 anObj = self.ShapesOp.ChangeOrientation(theShape)
1281 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
1284 ## Shortcut to ChangeOrientation()
1286 # @ref swig_OrientationChange "Example"
1287 def OrientationChange(self,theShape):
1288 # Example: see GEOM_TestOthers.py
1289 anObj = self.ChangeOrientation(theShape)
1295 ## @addtogroup l4_obtain
1298 ## Retrieve all free faces from the given shape.
1299 # Free face is a face, which is not shared between two shells of the shape.
1300 # @param theShape Shape to find free faces in.
1301 # @return List of IDs of all free faces, contained in theShape.
1303 # @ref tui_measurement_tools_page "Example"
1304 def GetFreeFacesIDs(self,theShape):
1305 # Example: see GEOM_TestOthers.py
1306 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
1307 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
1310 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
1311 # @param theShape1 Shape to find sub-shapes in.
1312 # @param theShape2 Shape to find shared sub-shapes with.
1313 # @param theShapeType Type of sub-shapes to be retrieved.
1314 # @return List of sub-shapes of theShape1, shared with theShape2.
1316 # @ref swig_GetSharedShapes "Example"
1317 def GetSharedShapes(self,theShape1, theShape2, theShapeType):
1318 # Example: see GEOM_TestOthers.py
1319 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
1320 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
1323 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
1324 # situated relatively the specified plane by the certain way,
1325 # defined through <VAR>theState</VAR> parameter.
1326 # @param theShape Shape to find sub-shapes of.
1327 # @param theShapeType Type of sub-shapes to be retrieved.
1328 # @param theAx1 Vector (or line, or linear edge), specifying normal
1329 # direction and location of the plane to find shapes on.
1330 # @param theState The state of the subshapes to find. It can be one of
1331 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1332 # @return List of all found sub-shapes.
1334 # @ref swig_GetShapesOnPlane "Example"
1335 def GetShapesOnPlane(self,theShape, theShapeType, theAx1, theState):
1336 # Example: see GEOM_TestOthers.py
1337 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
1338 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
1341 ## Works like the above method, but returns list of sub-shapes indices
1343 # @ref swig_GetShapesOnPlaneIDs "Example"
1344 def GetShapesOnPlaneIDs(self,theShape, theShapeType, theAx1, theState):
1345 # Example: see GEOM_TestOthers.py
1346 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
1347 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
1350 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
1351 # situated relatively the specified plane by the certain way,
1352 # defined through <VAR>theState</VAR> parameter.
1353 # @param theShape Shape to find sub-shapes of.
1354 # @param theShapeType Type of sub-shapes to be retrieved.
1355 # @param theAx1 Vector (or line, or linear edge), specifying normal
1356 # direction of the plane to find shapes on.
1357 # @param thePnt Point specifying location of the plane to find shapes on.
1358 # @param theState The state of the subshapes to find. It can be one of
1359 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1360 # @return List of all found sub-shapes.
1362 # @ref swig_GetShapesOnPlaneWithLocation "Example"
1363 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState):
1364 # Example: see GEOM_TestOthers.py
1365 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
1366 theAx1, thePnt, theState)
1367 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
1370 ## Works like the above method, but returns list of sub-shapes indices
1372 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
1373 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
1374 # Example: see GEOM_TestOthers.py
1375 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
1376 theAx1, thePnt, theState)
1377 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
1380 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1381 # the specified cylinder by the certain way, defined through \a theState parameter.
1382 # @param theShape Shape to find sub-shapes of.
1383 # @param theShapeType Type of sub-shapes to be retrieved.
1384 # @param theAxis Vector (or line, or linear edge), specifying
1385 # axis of the cylinder to find shapes on.
1386 # @param theRadius Radius of the cylinder to find shapes on.
1387 # @param theState The state of the subshapes to find. It can be one of
1388 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1389 # @return List of all found sub-shapes.
1391 # @ref swig_GetShapesOnCylinder "Example"
1392 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState):
1393 # Example: see GEOM_TestOthers.py
1394 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
1395 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
1398 ## Works like the above method, but returns list of sub-shapes indices
1400 # @ref swig_GetShapesOnCylinderIDs "Example"
1401 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
1402 # Example: see GEOM_TestOthers.py
1403 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
1404 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
1407 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1408 # the specified sphere by the certain way, defined through \a theState parameter.
1409 # @param theShape Shape to find sub-shapes of.
1410 # @param theShapeType Type of sub-shapes to be retrieved.
1411 # @param theCenter Point, specifying center of the sphere to find shapes on.
1412 # @param theRadius Radius of the sphere to find shapes on.
1413 # @param theState The state of the subshapes to find. It can be one of
1414 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1415 # @return List of all found sub-shapes.
1417 # @ref swig_GetShapesOnSphere "Example"
1418 def GetShapesOnSphere(self,theShape, theShapeType, theCenter, theRadius, theState):
1419 # Example: see GEOM_TestOthers.py
1420 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
1421 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
1424 ## Works like the above method, but returns list of sub-shapes indices
1426 # @ref swig_GetShapesOnSphereIDs "Example"
1427 def GetShapesOnSphereIDs(self,theShape, theShapeType, theCenter, theRadius, theState):
1428 # Example: see GEOM_TestOthers.py
1429 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
1430 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
1433 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1434 # the specified quadrangle by the certain way, defined through \a theState parameter.
1435 # @param theShape Shape to find sub-shapes of.
1436 # @param theShapeType Type of sub-shapes to be retrieved.
1437 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
1438 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
1439 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
1440 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
1441 # @param theState The state of the subshapes to find. It can be one of
1442 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1443 # @return List of all found sub-shapes.
1445 # @ref swig_GetShapesOnQuadrangle "Example"
1446 def GetShapesOnQuadrangle(self, theShape, theShapeType,
1447 theTopLeftPoint, theTopRigthPoint,
1448 theBottomLeftPoint, theBottomRigthPoint, theState):
1449 # Example: see GEOM_TestOthers.py
1450 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
1451 theTopLeftPoint, theTopRigthPoint,
1452 theBottomLeftPoint, theBottomRigthPoint, theState)
1453 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
1456 ## Works like the above method, but returns list of sub-shapes indices
1458 # @ref swig_GetShapesOnQuadrangleIDs "Example"
1459 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
1460 theTopLeftPoint, theTopRigthPoint,
1461 theBottomLeftPoint, theBottomRigthPoint, theState):
1462 # Example: see GEOM_TestOthers.py
1463 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
1464 theTopLeftPoint, theTopRigthPoint,
1465 theBottomLeftPoint, theBottomRigthPoint, theState)
1466 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
1469 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1470 # the specified \a theBox by the certain way, defined through \a theState parameter.
1471 # @param theBox Shape for relative comparing.
1472 # @param theShape Shape to find sub-shapes of.
1473 # @param theShapeType Type of sub-shapes to be retrieved.
1474 # @param theState The state of the subshapes to find. It can be one of
1475 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1476 # @return List of all found sub-shapes.
1478 # @ref swig_GetShapesOnBox "Example"
1479 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState):
1480 # Example: see GEOM_TestOthers.py
1481 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
1482 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
1485 ## Works like the above method, but returns list of sub-shapes indices
1487 # @ref swig_GetShapesOnBoxIDs "Example"
1488 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
1489 # Example: see GEOM_TestOthers.py
1490 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
1491 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
1494 ## Find in \a theShape all sub-shapes of type \a theShapeType,
1495 # situated relatively the specified \a theCheckShape by the
1496 # certain way, defined through \a theState parameter.
1497 # @param theCheckShape Shape for relative comparing.
1498 # @param theShape Shape to find sub-shapes of.
1499 # @param theShapeType Type of sub-shapes to be retrieved.
1500 # @param theState The state of the subshapes to find. It can be one of
1501 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1502 # @return List of all found sub-shapes.
1504 # @ref swig_GetShapesOnShape "Example"
1505 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState):
1506 # Example: see GEOM_TestOthers.py
1507 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
1508 theShapeType, theState)
1509 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
1512 ## Works like the above method, but returns result as compound
1514 # @ref swig_GetShapesOnShapeAsCompound "Example"
1515 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState):
1516 # Example: see GEOM_TestOthers.py
1517 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
1518 theShapeType, theState)
1519 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
1522 ## Works like the above method, but returns list of sub-shapes indices
1524 # @ref swig_GetShapesOnShapeIDs "Example"
1525 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
1526 # Example: see GEOM_TestOthers.py
1527 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
1528 theShapeType, theState)
1529 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
1532 ## Get sub-shape(s) of theShapeWhere, which are
1533 # coincident with \a theShapeWhat or could be a part of it.
1534 # @param theShapeWhere Shape to find sub-shapes of.
1535 # @param theShapeWhat Shape, specifying what to find.
1536 # @return Group of all found sub-shapes or a single found sub-shape.
1538 # @ref swig_GetInPlace "Example"
1539 def GetInPlace(self,theShapeWhere, theShapeWhat):
1540 # Example: see GEOM_TestOthers.py
1541 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
1542 RaiseIfFailed("GetInPlace", self.ShapesOp)
1545 ## Get sub-shape(s) of \a theShapeWhere, which are
1546 # coincident with \a theShapeWhat or could be a part of it.
1548 # Implementation of this method is based on a saved history of an operation,
1549 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
1550 # arguments (an argument shape or a sub-shape of an argument shape).
1551 # The operation could be the Partition or one of boolean operations,
1552 # performed on simple shapes (not on compounds).
1554 # @param theShapeWhere Shape to find sub-shapes of.
1555 # @param theShapeWhat Shape, specifying what to find (must be in the
1556 # building history of the ShapeWhere).
1557 # @return Group of all found sub-shapes or a single found sub-shape.
1559 # @ref swig_GetInPlace "Example"
1560 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat):
1561 # Example: see GEOM_TestOthers.py
1562 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
1563 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
1566 ## Get sub-shape of theShapeWhere, which is
1567 # equal to \a theShapeWhat.
1568 # @param theShapeWhere Shape to find sub-shape of.
1569 # @param theShapeWhat Shape, specifying what to find.
1570 # @return New GEOM_Object for found sub-shape.
1572 # @ref swig_GetSame "Example"
1573 def GetSame(self,theShapeWhere, theShapeWhat):
1574 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
1575 RaiseIfFailed("GetSame", self.ShapesOp)
1581 ## @addtogroup l4_access
1584 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
1585 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
1587 # @ref swig_all_decompose "Example"
1588 def GetSubShape(self, aShape, ListOfID):
1589 # Example: see GEOM_TestAll.py
1590 anObj = self.AddSubShape(aShape,ListOfID)
1593 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
1595 # @ref swig_all_decompose "Example"
1596 def GetSubShapeID(self, aShape, aSubShape):
1597 # Example: see GEOM_TestAll.py
1598 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
1599 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
1605 ## @addtogroup l4_decompose
1608 ## Explode a shape on subshapes of a given type.
1609 # @param aShape Shape to be exploded.
1610 # @param aType Type of sub-shapes to be retrieved.
1611 # @return List of sub-shapes of type theShapeType, contained in theShape.
1613 # @ref swig_all_decompose "Example"
1614 def SubShapeAll(self, aShape, aType):
1615 # Example: see GEOM_TestAll.py
1616 ListObj = self.ShapesOp.MakeExplode(aShape,aType,0)
1617 RaiseIfFailed("MakeExplode", self.ShapesOp)
1620 ## Explode a shape on subshapes of a given type.
1621 # @param aShape Shape to be exploded.
1622 # @param aType Type of sub-shapes to be retrieved.
1623 # @return List of IDs of sub-shapes.
1625 # @ref swig_all_decompose "Example"
1626 def SubShapeAllIDs(self, aShape, aType):
1627 ListObj = self.ShapesOp.SubShapeAllIDs(aShape,aType,0)
1628 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
1631 ## Explode a shape on subshapes of a given type.
1632 # Sub-shapes will be sorted by coordinates of their gravity centers.
1633 # @param aShape Shape to be exploded.
1634 # @param aType Type of sub-shapes to be retrieved.
1635 # @return List of sub-shapes of type theShapeType, contained in theShape.
1637 # @ref swig_SubShapeAllSorted "Example"
1638 def SubShapeAllSorted(self, aShape, aType):
1639 # Example: see GEOM_TestAll.py
1640 ListObj = self.ShapesOp.MakeExplode(aShape,aType,1)
1641 RaiseIfFailed("MakeExplode", self.ShapesOp)
1644 ## Explode a shape on subshapes of a given type.
1645 # Sub-shapes will be sorted by coordinates of their gravity centers.
1646 # @param aShape Shape to be exploded.
1647 # @param aType Type of sub-shapes to be retrieved.
1648 # @return List of IDs of sub-shapes.
1650 # @ref swig_all_decompose "Example"
1651 def SubShapeAllSortedIDs(self, aShape, aType):
1652 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape,aType,1)
1653 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
1656 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
1657 # selected by they indices in list of all sub-shapes of type <VAR>aType</VAR>.
1658 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
1660 # @ref swig_all_decompose "Example"
1661 def SubShape(self, aShape, aType, ListOfInd):
1662 # Example: see GEOM_TestAll.py
1664 AllShapeList = self.SubShapeAll(aShape, aType)
1665 for ind in ListOfInd:
1666 ListOfIDs.append(self.GetSubShapeID(aShape, AllShapeList[ind - 1]))
1667 anObj = self.GetSubShape(aShape, ListOfIDs)
1670 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
1671 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
1672 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
1674 # @ref swig_all_decompose "Example"
1675 def SubShapeSorted(self,aShape, aType, ListOfInd):
1676 # Example: see GEOM_TestAll.py
1678 AllShapeList = self.SubShapeAllSorted(aShape, aType)
1679 for ind in ListOfInd:
1680 ListOfIDs.append(self.GetSubShapeID(aShape, AllShapeList[ind - 1]))
1681 anObj = self.GetSubShape(aShape, ListOfIDs)
1684 # end of l4_decompose
1687 ## @addtogroup l3_healing
1690 ## Apply a sequence of Shape Healing operators to the given object.
1691 # @param theShape Shape to be processed.
1692 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
1693 # @param theParameters List of names of parameters
1694 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
1695 # @param theValues List of values of parameters, in the same order
1696 # as parameters are listed in <VAR>theParameters</VAR> list.
1697 # @return New GEOM_Object, containing processed shape.
1699 # @ref tui_shape_processing "Example"
1700 def ProcessShape(self,theShape, theOperators, theParameters, theValues):
1701 # Example: see GEOM_TestHealing.py
1702 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
1703 RaiseIfFailed("ProcessShape", self.HealOp)
1706 ## Remove faces from the given object (shape).
1707 # @param theObject Shape to be processed.
1708 # @param theFaces Indices of faces to be removed, if EMPTY then the method
1709 # removes ALL faces of the given object.
1710 # @return New GEOM_Object, containing processed shape.
1712 # @ref tui_suppress_faces "Example"
1713 def SuppressFaces(self,theObject, theFaces):
1714 # Example: see GEOM_TestHealing.py
1715 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
1716 RaiseIfFailed("SuppressFaces", self.HealOp)
1719 ## Sewing of some shapes into single shape.
1721 # @ref tui_sewing "Example"
1722 def MakeSewing(self, ListShape, theTolerance):
1723 # Example: see GEOM_TestHealing.py
1724 comp = self.MakeCompound(ListShape)
1725 anObj = self.Sew(comp, theTolerance)
1728 ## Sewing of the given object.
1729 # @param theObject Shape to be processed.
1730 # @param theTolerance Required tolerance value.
1731 # @return New GEOM_Object, containing processed shape.
1732 def Sew(self, theObject, theTolerance):
1733 # Example: see MakeSewing() above
1734 anObj = self.HealOp.Sew(theObject, theTolerance)
1735 RaiseIfFailed("Sew", self.HealOp)
1738 ## Remove internal wires and edges from the given object (face).
1739 # @param theObject Shape to be processed.
1740 # @param theWires Indices of wires to be removed, if EMPTY then the method
1741 # removes ALL internal wires of the given object.
1742 # @return New GEOM_Object, containing processed shape.
1744 # @ref tui_suppress_internal_wires "Example"
1745 def SuppressInternalWires(self,theObject, theWires):
1746 # Example: see GEOM_TestHealing.py
1747 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
1748 RaiseIfFailed("RemoveIntWires", self.HealOp)
1751 ## Remove internal closed contours (holes) from the given object.
1752 # @param theObject Shape to be processed.
1753 # @param theWires Indices of wires to be removed, if EMPTY then the method
1754 # removes ALL internal holes of the given object
1755 # @return New GEOM_Object, containing processed shape.
1757 # @ref tui_suppress_holes "Example"
1758 def SuppressHoles(self,theObject, theWires):
1759 # Example: see GEOM_TestHealing.py
1760 anObj = self.HealOp.FillHoles(theObject, theWires)
1761 RaiseIfFailed("FillHoles", self.HealOp)
1764 ## Close an open wire.
1765 # @param theObject Shape to be processed.
1766 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
1767 # if -1, then <VAR>theObject</VAR> itself is a wire.
1768 # @param isCommonVertex If TRUE : closure by creation of a common vertex,
1769 # If FALS : closure by creation of an edge between ends.
1770 # @return New GEOM_Object, containing processed shape.
1772 # @ref tui_close_contour "Example"
1773 def CloseContour(self,theObject, theWires, isCommonVertex):
1774 # Example: see GEOM_TestHealing.py
1775 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
1776 RaiseIfFailed("CloseContour", self.HealOp)
1779 ## Addition of a point to a given edge object.
1780 # @param theObject Shape to be processed.
1781 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
1782 # if -1, then theObject itself is the edge.
1783 # @param theValue Value of parameter on edge or length parameter,
1784 # depending on \a isByParameter.
1785 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1],
1786 # if FALSE : \a theValue is treated as a length parameter [0..1]
1787 # @return New GEOM_Object, containing processed shape.
1789 # @ref tui_add_point_on_edge "Example"
1790 def DivideEdge(self,theObject, theEdgeIndex, theValue, isByParameter):
1791 # Example: see GEOM_TestHealing.py
1792 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
1793 RaiseIfFailed("DivideEdge", self.HealOp)
1796 ## Change orientation of the given object. Updates given shape.
1797 # @param theObject Shape to be processed.
1799 # @ref swig_todo "Example"
1800 def ChangeOrientationShell(self,theObject):
1801 theObject = self.HealOp.ChangeOrientation(theObject)
1802 RaiseIfFailed("ChangeOrientation", self.HealOp)
1805 ## Change orientation of the given object.
1806 # @param theObject Shape to be processed.
1807 # @return New GEOM_Object, containing processed shape.
1809 # @ref swig_todo "Example"
1810 def ChangeOrientationShellCopy(self,theObject):
1811 anObj = self.HealOp.ChangeOrientationCopy(theObject)
1812 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
1815 ## Get a list of wires (wrapped in GEOM_Object-s),
1816 # that constitute a free boundary of the given shape.
1817 # @param theObject Shape to get free boundary of.
1818 # @return [status, theClosedWires, theOpenWires]
1819 # status: FALSE, if an error(s) occured during the method execution.
1820 # theClosedWires: Closed wires on the free boundary of the given shape.
1821 # theOpenWires: Open wires on the free boundary of the given shape.
1823 # @ref tui_measurement_tools_page "Example"
1824 def GetFreeBoundary(self,theObject):
1825 # Example: see GEOM_TestHealing.py
1826 anObj = self.HealOp.GetFreeBoundary(theObject)
1827 RaiseIfFailed("GetFreeBoundary", self.HealOp)
1830 ## Replace coincident faces in theShape by one face.
1831 # @param theShape Initial shape.
1832 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
1833 # @param doKeepNonSolids If FALSE, only solids will present in the result,
1834 # otherwise all initial shapes.
1835 # @return New GEOM_Object, containing a copy of theShape without coincident faces.
1837 # @ref tui_glue_faces "Example"
1838 def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True):
1839 # Example: see GEOM_Spanner.py
1840 anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
1842 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
1845 ## Find coincident faces in theShape for possible gluing.
1846 # @param theShape Initial shape.
1847 # @param theTolerance Maximum distance between faces,
1848 # which can be considered as coincident.
1851 # @ref swig_todo "Example"
1852 def GetGlueFaces(self, theShape, theTolerance):
1853 # Example: see GEOM_Spanner.py
1854 anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
1855 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
1858 ## Replace coincident faces in theShape by one face
1859 # in compliance with given list of faces
1860 # @param theShape Initial shape.
1861 # @param theTolerance Maximum distance between faces,
1862 # which can be considered as coincident.
1863 # @param theFaces List of faces for gluing.
1864 # @param doKeepNonSolids If FALSE, only solids will present in the result,
1865 # otherwise all initial shapes.
1866 # @return New GEOM_Object, containing a copy of theShape
1867 # without some faces.
1869 # @ref swig_todo "Example"
1870 def MakeGlueFacesByList(self, theShape, theTolerance, theFaces, doKeepNonSolids=True):
1871 # Example: see GEOM_Spanner.py
1872 anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces, doKeepNonSolids)
1874 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
1880 ## @addtogroup l3_boolean Boolean Operations
1883 # -----------------------------------------------------------------------------
1884 # Boolean (Common, Cut, Fuse, Section)
1885 # -----------------------------------------------------------------------------
1887 ## Perform one of boolean operations on two given shapes.
1888 # @param theShape1 First argument for boolean operation.
1889 # @param theShape2 Second argument for boolean operation.
1890 # @param theOperation Indicates the operation to be done:
1891 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
1892 # @return New GEOM_Object, containing the result shape.
1894 # @ref tui_fuse "Example"
1895 def MakeBoolean(self,theShape1, theShape2, theOperation):
1896 # Example: see GEOM_TestAll.py
1897 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation)
1898 RaiseIfFailed("MakeBoolean", self.BoolOp)
1901 ## Shortcut to MakeBoolean(s1, s2, 1)
1903 # @ref tui_common "Example 1"
1904 # \n @ref swig_MakeCommon "Example 2"
1905 def MakeCommon(self, s1, s2):
1906 # Example: see GEOM_TestOthers.py
1907 return self.MakeBoolean(s1, s2, 1)
1909 ## Shortcut to MakeBoolean(s1, s2, 2)
1911 # @ref tui_cut "Example 1"
1912 # \n @ref swig_MakeCommon "Example 2"
1913 def MakeCut(self, s1, s2):
1914 # Example: see GEOM_TestOthers.py
1915 return self.MakeBoolean(s1, s2, 2)
1917 ## Shortcut to MakeBoolean(s1, s2, 3)
1919 # @ref tui_fuse "Example 1"
1920 # \n @ref swig_MakeCommon "Example 2"
1921 def MakeFuse(self, s1, s2):
1922 # Example: see GEOM_TestOthers.py
1923 return self.MakeBoolean(s1, s2, 3)
1925 ## Shortcut to MakeBoolean(s1, s2, 4)
1927 # @ref tui_section "Example 1"
1928 # \n @ref swig_MakeCommon "Example 2"
1929 def MakeSection(self, s1, s2):
1930 # Example: see GEOM_TestOthers.py
1931 return self.MakeBoolean(s1, s2, 4)
1936 ## @addtogroup l3_basic_op
1939 ## Perform partition operation.
1940 # @param ListShapes Shapes to be intersected.
1941 # @param ListTools Shapes to intersect theShapes.
1942 # !!!NOTE: Each compound from ListShapes and ListTools will be exploded
1943 # in order to avoid possible intersection between shapes from
1945 # @param Limit Type of resulting shapes (corresponding to TopAbs_ShapeEnum).
1946 # @param KeepNonlimitShapes: if this parameter == 0 - only shapes with
1947 # type <= Limit are kept in the result,
1948 # else - shapes with type > Limit are kept
1949 # also (if they exist)
1951 # After implementation new version of PartitionAlgo (October 2006)
1952 # other parameters are ignored by current functionality. They are kept
1953 # in this function only for support old versions.
1954 # Ignored parameters:
1955 # @param ListKeepInside Shapes, outside which the results will be deleted.
1956 # Each shape from theKeepInside must belong to theShapes also.
1957 # @param ListRemoveInside Shapes, inside which the results will be deleted.
1958 # Each shape from theRemoveInside must belong to theShapes also.
1959 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
1960 # @param ListMaterials Material indices for each shape. Make sence,
1961 # only if theRemoveWebs is TRUE.
1963 # @return New GEOM_Object, containing the result shapes.
1965 # @ref tui_partition "Example"
1966 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
1967 Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
1968 KeepNonlimitShapes=0):
1969 # Example: see GEOM_TestAll.py
1970 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
1971 ListKeepInside, ListRemoveInside,
1972 Limit, RemoveWebs, ListMaterials,
1973 KeepNonlimitShapes);
1974 RaiseIfFailed("MakePartition", self.BoolOp)
1977 ## Perform partition operation.
1978 # This method may be useful if it is needed to make a partition for
1979 # compound contains nonintersected shapes. Performance will be better
1980 # since intersection between shapes from compound is not performed.
1982 # Description of all parameters as in previous method MakePartition()
1984 # !!!NOTE: Passed compounds (via ListShapes or via ListTools)
1985 # have to consist of nonintersecting shapes.
1987 # @return New GEOM_Object, containing the result shapes.
1989 # @ref swig_todo "Example"
1990 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
1991 ListKeepInside=[], ListRemoveInside=[],
1992 Limit=ShapeType["SHAPE"], RemoveWebs=0,
1993 ListMaterials=[], KeepNonlimitShapes=0):
1994 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
1995 ListKeepInside, ListRemoveInside,
1996 Limit, RemoveWebs, ListMaterials,
1997 KeepNonlimitShapes);
1998 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
2001 ## Shortcut to MakePartition()
2003 # @ref tui_partition "Example 1"
2004 # \n @ref swig_Partition "Example 2"
2005 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
2006 Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
2007 KeepNonlimitShapes=0):
2008 # Example: see GEOM_TestOthers.py
2009 anObj = self.MakePartition(ListShapes, ListTools,
2010 ListKeepInside, ListRemoveInside,
2011 Limit, RemoveWebs, ListMaterials,
2012 KeepNonlimitShapes);
2015 ## Perform partition of the Shape with the Plane
2016 # @param theShape Shape to be intersected.
2017 # @param thePlane Tool shape, to intersect theShape.
2018 # @return New GEOM_Object, containing the result shape.
2020 # @ref tui_partition "Example"
2021 def MakeHalfPartition(self,theShape, thePlane):
2022 # Example: see GEOM_TestAll.py
2023 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
2024 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
2027 # end of l3_basic_op
2030 ## @addtogroup l3_transform
2033 ## Translate the given object along the vector, specified
2034 # by its end points, creating its copy before the translation.
2035 # @param theObject The object to be translated.
2036 # @param thePoint1 Start point of translation vector.
2037 # @param thePoint2 End point of translation vector.
2038 # @return New GEOM_Object, containing the translated object.
2040 # @ref tui_translation "Example 1"
2041 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
2042 def MakeTranslationTwoPoints(self,theObject, thePoint1, thePoint2):
2043 # Example: see GEOM_TestAll.py
2044 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
2045 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
2048 ## Translate the given object along the vector, specified
2049 # by its components, creating its copy before the translation.
2050 # @param theObject The object to be translated.
2051 # @param theDX,theDY,theDZ Components of translation vector.
2052 # @return New GEOM_Object, containing the translated object.
2054 # @ref tui_translation "Example"
2055 def MakeTranslation(self,theObject, theDX, theDY, theDZ):
2056 # Example: see GEOM_TestAll.py
2057 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
2058 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
2061 ## Translate the given object along the given vector,
2062 # creating its copy before the translation.
2063 # @param theObject The object to be translated.
2064 # @param theVector The translation vector.
2065 # @return New GEOM_Object, containing the translated object.
2067 # @ref tui_translation "Example"
2068 def MakeTranslationVector(self,theObject, theVector):
2069 # Example: see GEOM_TestAll.py
2070 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
2071 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
2074 ## Translate the given object along the given vector on given distance,
2075 # creating its copy before the translation.
2076 # @param theObject The object to be translated.
2077 # @param theVector The translation vector.
2078 # @param theDistance The translation distance.
2079 # @return New GEOM_Object, containing the translated object.
2081 # @ref tui_translation "Example"
2082 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance):
2083 # Example: see GEOM_TestAll.py
2084 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
2085 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
2088 ## Rotate the given object around the given axis
2089 # on the given angle, creating its copy before the rotatation.
2090 # @param theObject The object to be rotated.
2091 # @param theAxis Rotation axis.
2092 # @param theAngle Rotation angle in radians.
2093 # @return New GEOM_Object, containing the rotated object.
2095 # @ref tui_rotation "Example"
2096 def MakeRotation(self,theObject, theAxis, theAngle):
2097 # Example: see GEOM_TestAll.py
2098 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
2099 RaiseIfFailed("RotateCopy", self.TrsfOp)
2102 ## Rotate given object around vector perpendicular to plane
2103 # containing three points, creating its copy before the rotatation.
2104 # @param theObject The object to be rotated.
2105 # @param theCentPoint central point - the axis is the vector perpendicular to the plane
2106 # containing the three points.
2107 # @param thePoint1,thePoint2 - in a perpendicular plane of the axis.
2108 # @return New GEOM_Object, containing the rotated object.
2110 # @ref tui_rotation "Example"
2111 def MakeRotationThreePoints(self,theObject, theCentPoint, thePoint1, thePoint2):
2112 # Example: see GEOM_TestAll.py
2113 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
2114 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
2117 ## Scale the given object by the factor, creating its copy before the scaling.
2118 # @param theObject The object to be scaled.
2119 # @param thePoint Center point for scaling.
2120 # Passing None for it means scaling relatively the origin of global CS.
2121 # @param theFactor Scaling factor value.
2122 # @return New GEOM_Object, containing the scaled shape.
2124 # @ref tui_scale "Example"
2125 def MakeScaleTransform(self, theObject, thePoint, theFactor):
2126 # Example: see GEOM_TestAll.py
2127 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
2128 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
2131 ## Scale the given object by different factors along coordinate axes,
2132 # creating its copy before the scaling.
2133 # @param theObject The object to be scaled.
2134 # @param thePoint Center point for scaling.
2135 # Passing None for it means scaling relatively the origin of global CS.
2136 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
2137 # @return New GEOM_Object, containing the scaled shape.
2139 # @ref swig_scale "Example"
2140 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ):
2141 # Example: see GEOM_TestAll.py
2142 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
2143 theFactorX, theFactorY, theFactorZ)
2144 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
2147 ## Create an object, symmetrical
2148 # to the given one relatively the given plane.
2149 # @param theObject The object to be mirrored.
2150 # @param thePlane Plane of symmetry.
2151 # @return New GEOM_Object, containing the mirrored shape.
2153 # @ref tui_mirror "Example"
2154 def MakeMirrorByPlane(self,theObject, thePlane):
2155 # Example: see GEOM_TestAll.py
2156 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
2157 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
2160 ## Create an object, symmetrical
2161 # to the given one relatively the given axis.
2162 # @param theObject The object to be mirrored.
2163 # @param theAxis Axis of symmetry.
2164 # @return New GEOM_Object, containing the mirrored shape.
2166 # @ref tui_mirror "Example"
2167 def MakeMirrorByAxis(self,theObject, theAxis):
2168 # Example: see GEOM_TestAll.py
2169 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
2170 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
2173 ## Create an object, symmetrical
2174 # to the given one relatively the given point.
2175 # @param theObject The object to be mirrored.
2176 # @param thePoint Point of symmetry.
2177 # @return New GEOM_Object, containing the mirrored shape.
2179 # @ref tui_mirror "Example"
2180 def MakeMirrorByPoint(self,theObject, thePoint):
2181 # Example: see GEOM_TestAll.py
2182 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
2183 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
2186 ## Modify the Location of the given object by LCS,
2187 # creating its copy before the setting.
2188 # @param theObject The object to be displaced.
2189 # @param theStartLCS Coordinate system to perform displacement from it.
2190 # If \a theStartLCS is NULL, displacement
2191 # will be performed from global CS.
2192 # If \a theObject itself is used as \a theStartLCS,
2193 # its location will be changed to \a theEndLCS.
2194 # @param theEndLCS Coordinate system to perform displacement to it.
2195 # @return New GEOM_Object, containing the displaced shape.
2197 # @ref tui_modify_location "Example"
2198 def MakePosition(self,theObject, theStartLCS, theEndLCS):
2199 # Example: see GEOM_TestAll.py
2200 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
2201 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
2204 ## Create new object as offset of the given one.
2205 # @param theObject The base object for the offset.
2206 # @param theOffset Offset value.
2207 # @return New GEOM_Object, containing the offset object.
2209 # @ref tui_offset "Example"
2210 def MakeOffset(self,theObject, theOffset):
2211 # Example: see GEOM_TestAll.py
2212 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
2213 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
2216 # -----------------------------------------------------------------------------
2218 # -----------------------------------------------------------------------------
2220 ## Translate the given object along the given vector a given number times
2221 # @param theObject The object to be translated.
2222 # @param theVector Direction of the translation.
2223 # @param theStep Distance to translate on.
2224 # @param theNbTimes Quantity of translations to be done.
2225 # @return New GEOM_Object, containing compound of all
2226 # the shapes, obtained after each translation.
2228 # @ref tui_multi_translation "Example"
2229 def MakeMultiTranslation1D(self,theObject, theVector, theStep, theNbTimes):
2230 # Example: see GEOM_TestAll.py
2231 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
2232 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
2235 ## Conseqently apply two specified translations to theObject specified number of times.
2236 # @param theObject The object to be translated.
2237 # @param theVector1 Direction of the first translation.
2238 # @param theStep1 Step of the first translation.
2239 # @param theNbTimes1 Quantity of translations to be done along theVector1.
2240 # @param theVector2 Direction of the second translation.
2241 # @param theStep2 Step of the second translation.
2242 # @param theNbTimes2 Quantity of translations to be done along theVector2.
2243 # @return New GEOM_Object, containing compound of all
2244 # the shapes, obtained after each translation.
2246 # @ref tui_multi_translation "Example"
2247 def MakeMultiTranslation2D(self,theObject, theVector1, theStep1, theNbTimes1,
2248 theVector2, theStep2, theNbTimes2):
2249 # Example: see GEOM_TestAll.py
2250 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
2251 theVector2, theStep2, theNbTimes2)
2252 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
2255 ## Rotate the given object around the given axis a given number times.
2256 # Rotation angle will be 2*PI/theNbTimes.
2257 # @param theObject The object to be rotated.
2258 # @param theAxis The rotation axis.
2259 # @param theNbTimes Quantity of rotations to be done.
2260 # @return New GEOM_Object, containing compound of all the
2261 # shapes, obtained after each rotation.
2263 # @ref tui_multi_rotation "Example"
2264 def MultiRotate1D(self,theObject, theAxis, theNbTimes):
2265 # Example: see GEOM_TestAll.py
2266 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
2267 RaiseIfFailed("MultiRotate1D", self.TrsfOp)
2270 ## Rotate the given object around the
2271 # given axis on the given angle a given number
2272 # times and multi-translate each rotation result.
2273 # Translation direction passes through center of gravity
2274 # of rotated shape and its projection on the rotation axis.
2275 # @param theObject The object to be rotated.
2276 # @param theAxis Rotation axis.
2277 # @param theAngle Rotation angle in graduces.
2278 # @param theNbTimes1 Quantity of rotations to be done.
2279 # @param theStep Translation distance.
2280 # @param theNbTimes2 Quantity of translations to be done.
2281 # @return New GEOM_Object, containing compound of all the
2282 # shapes, obtained after each transformation.
2284 # @ref tui_multi_rotation "Example"
2285 def MultiRotate2D(self,theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2):
2286 # Example: see GEOM_TestAll.py
2287 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
2288 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
2291 ## The same, as MultiRotate1D(), but axis is given by direction and point
2292 # @ref swig_MakeMultiRotation "Example"
2293 def MakeMultiRotation1D(self,aShape,aDir,aPoint,aNbTimes):
2294 # Example: see GEOM_TestOthers.py
2295 aVec = self.MakeLine(aPoint,aDir)
2296 anObj = self.MultiRotate1D(aShape,aVec,aNbTimes)
2299 ## The same, as MultiRotate2D(), but axis is given by direction and point
2300 # @ref swig_MakeMultiRotation "Example"
2301 def MakeMultiRotation2D(self,aShape,aDir,aPoint,anAngle,nbtimes1,aStep,nbtimes2):
2302 # Example: see GEOM_TestOthers.py
2303 aVec = self.MakeLine(aPoint,aDir)
2304 anObj = self.MultiRotate2D(aShape,aVec,anAngle,nbtimes1,aStep,nbtimes2)
2307 # end of l3_transform
2310 ## @addtogroup l3_local
2313 ## Perform a fillet on all edges of the given shape.
2314 # @param theShape Shape, to perform fillet on.
2315 # @param theR Fillet radius.
2316 # @return New GEOM_Object, containing the result shape.
2318 # @ref tui_fillet "Example 1"
2319 # \n @ref swig_MakeFilletAll "Example 2"
2320 def MakeFilletAll(self,theShape, theR):
2321 # Example: see GEOM_TestOthers.py
2322 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
2323 RaiseIfFailed("MakeFilletAll", self.LocalOp)
2326 ## Perform a fillet on the specified edges/faces of the given shape
2327 # @param theShape Shape, to perform fillet on.
2328 # @param theR Fillet radius.
2329 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR>.
2330 # @param theListShapes Global indices of edges/faces to perform fillet on.
2331 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2332 # @return New GEOM_Object, containing the result shape.
2334 # @ref tui_fillet "Example"
2335 def MakeFillet(self,theShape, theR, theShapeType, theListShapes):
2336 # Example: see GEOM_TestAll.py
2338 if theShapeType == ShapeType["EDGE"]:
2339 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
2340 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
2342 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
2343 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
2346 ## The same that MakeFillet but with two Fillet Radius R1 and R2
2347 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes):
2349 if theShapeType == ShapeType["EDGE"]:
2350 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
2351 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
2353 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
2354 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
2357 ## Perform a symmetric chamfer on all edges of the given shape.
2358 # @param theShape Shape, to perform chamfer on.
2359 # @param theD Chamfer size along each face.
2360 # @return New GEOM_Object, containing the result shape.
2362 # @ref tui_chamfer "Example 1"
2363 # \n @ref swig_MakeChamferAll "Example 2"
2364 def MakeChamferAll(self,theShape, theD):
2365 # Example: see GEOM_TestOthers.py
2366 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
2367 RaiseIfFailed("MakeChamferAll", self.LocalOp)
2370 ## Perform a chamfer on edges, common to the specified faces,
2371 # with distance D1 on the Face1
2372 # @param theShape Shape, to perform chamfer on.
2373 # @param theD1 Chamfer size along \a theFace1.
2374 # @param theD2 Chamfer size along \a theFace2.
2375 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
2376 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2377 # @return New GEOM_Object, containing the result shape.
2379 # @ref tui_chamfer "Example"
2380 def MakeChamferEdge(self,theShape, theD1, theD2, theFace1, theFace2):
2381 # Example: see GEOM_TestAll.py
2382 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
2383 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
2386 ## The Same that MakeChamferEdge but with params theD is chamfer length and
2387 # theAngle is Angle of chamfer (angle in radians)
2388 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2):
2389 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
2390 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
2393 ## Perform a chamfer on all edges of the specified faces,
2394 # with distance D1 on the first specified face (if several for one edge)
2395 # @param theShape Shape, to perform chamfer on.
2396 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
2397 # connected to the edge, are in \a theFaces, \a theD1
2398 # will be get along face, which is nearer to \a theFaces beginning.
2399 # @param theD2 Chamfer size along another of two faces, connected to the edge.
2400 # @param theFaces Sequence of global indices of faces of \a theShape.
2401 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2402 # @return New GEOM_Object, containing the result shape.
2404 # @ref tui_chamfer "Example"
2405 def MakeChamferFaces(self,theShape, theD1, theD2, theFaces):
2406 # Example: see GEOM_TestAll.py
2407 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
2408 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
2411 ## The Same that MakeChamferFaces but with params theD is chamfer lenght and
2412 # theAngle is Angle of chamfer (angle in radians)
2414 # @ref swig_FilletChamfer "Example"
2415 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces):
2416 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
2417 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
2420 ## Perform a chamfer on edges,
2421 # with distance D1 on the first specified face (if several for one edge)
2422 # @param theShape Shape, to perform chamfer on.
2423 # @param theD1,theD2 Chamfer size
2424 # @param theEdges Sequence of edges of \a theShape.
2425 # @return New GEOM_Object, containing the result shape.
2427 # @ref swig_FilletChamfer "Example"
2428 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges):
2429 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
2430 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
2433 ## The Same that MakeChamferEdges but with params theD is chamfer lenght and
2434 # theAngle is Angle of chamfer (angle in radians)
2435 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges):
2436 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
2437 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
2440 ## Shortcut to MakeChamferEdge() and MakeChamferFaces()
2442 # @ref swig_MakeChamfer "Example"
2443 def MakeChamfer(self,aShape,d1,d2,aShapeType,ListShape):
2444 # Example: see GEOM_TestOthers.py
2446 if aShapeType == ShapeType["EDGE"]:
2447 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1])
2449 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape)
2455 ## @addtogroup l3_basic_op
2458 ## Perform an Archimde operation on the given shape with given parameters.
2459 # The object presenting the resulting face is returned.
2460 # @param theShape Shape to be put in water.
2461 # @param theWeight Weight og the shape.
2462 # @param theWaterDensity Density of the water.
2463 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
2464 # @return New GEOM_Object, containing a section of \a theShape
2465 # by a plane, corresponding to water level.
2467 # @ref tui_archimede "Example"
2468 def Archimede(self,theShape, theWeight, theWaterDensity, theMeshDeflection):
2469 # Example: see GEOM_TestAll.py
2470 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
2471 RaiseIfFailed("MakeArchimede", self.LocalOp)
2474 # end of l3_basic_op
2477 ## @addtogroup l2_measure
2480 ## Get point coordinates
2483 # @ref tui_measurement_tools_page "Example"
2484 def PointCoordinates(self,Point):
2485 # Example: see GEOM_TestMeasures.py
2486 aTuple = self.MeasuOp.PointCoordinates(Point)
2487 RaiseIfFailed("PointCoordinates", self.MeasuOp)
2490 ## Get summarized length of all wires,
2491 # area of surface and volume of the given shape.
2492 # @param theShape Shape to define properties of.
2493 # @return [theLength, theSurfArea, theVolume]
2494 # theLength: Summarized length of all wires of the given shape.
2495 # theSurfArea: Area of surface of the given shape.
2496 # theVolume: Volume of the given shape.
2498 # @ref tui_measurement_tools_page "Example"
2499 def BasicProperties(self,theShape):
2500 # Example: see GEOM_TestMeasures.py
2501 aTuple = self.MeasuOp.GetBasicProperties(theShape)
2502 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
2505 ## Get parameters of bounding box of the given shape
2506 # @param theShape Shape to obtain bounding box of.
2507 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
2508 # Xmin,Xmax: Limits of shape along OX axis.
2509 # Ymin,Ymax: Limits of shape along OY axis.
2510 # Zmin,Zmax: Limits of shape along OZ axis.
2512 # @ref tui_measurement_tools_page "Example"
2513 def BoundingBox(self,theShape):
2514 # Example: see GEOM_TestMeasures.py
2515 aTuple = self.MeasuOp.GetBoundingBox(theShape)
2516 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
2519 ## Get inertia matrix and moments of inertia of theShape.
2520 # @param theShape Shape to calculate inertia of.
2521 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
2522 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
2523 # Ix,Iy,Iz: Moments of inertia of the given shape.
2525 # @ref tui_measurement_tools_page "Example"
2526 def Inertia(self,theShape):
2527 # Example: see GEOM_TestMeasures.py
2528 aTuple = self.MeasuOp.GetInertia(theShape)
2529 RaiseIfFailed("GetInertia", self.MeasuOp)
2532 ## Get minimal distance between the given shapes.
2533 # @param theShape1,theShape2 Shapes to find minimal distance between.
2534 # @return Value of the minimal distance between the given shapes.
2536 # @ref tui_measurement_tools_page "Example"
2537 def MinDistance(self, theShape1, theShape2):
2538 # Example: see GEOM_TestMeasures.py
2539 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
2540 RaiseIfFailed("GetMinDistance", self.MeasuOp)
2543 ## Get minimal distance between the given shapes.
2544 # @param theShape1,theShape2 Shapes to find minimal distance between.
2545 # @return Value of the minimal distance between the given shapes.
2547 # @ref swig_all_measure "Example"
2548 def MinDistanceComponents(self, theShape1, theShape2):
2549 # Example: see GEOM_TestMeasures.py
2550 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
2551 RaiseIfFailed("GetMinDistance", self.MeasuOp)
2552 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
2555 ## Get angle between the given shapes in degrees.
2556 # @param theShape1,theShape2 Lines or linear edges to find angle between.
2557 # @return Value of the angle between the given shapes in degrees.
2559 # @ref tui_measurement_tools_page "Example"
2560 def GetAngle(self, theShape1, theShape2):
2561 # Example: see GEOM_TestMeasures.py
2562 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
2563 RaiseIfFailed("GetAngle", self.MeasuOp)
2565 ## Get angle between the given shapes in radians.
2566 # @param theShape1,theShape2 Lines or linear edges to find angle between.
2567 # @return Value of the angle between the given shapes in radians.
2569 # @ref tui_measurement_tools_page "Example"
2570 def GetAngleRadians(self, theShape1, theShape2):
2571 # Example: see GEOM_TestMeasures.py
2572 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
2573 RaiseIfFailed("GetAngle", self.MeasuOp)
2576 ## @name Curve Curvature Measurement
2577 # Methods for receiving radius of curvature of curves
2578 # in the given point
2581 ## Measure curvature of a curve at a point, set by parameter.
2582 # @ref swig_todo "Example"
2583 def CurveCurvatureByParam(self, theCurve, theParam):
2584 # Example: see GEOM_TestMeasures.py
2585 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
2586 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
2590 # @ref swig_todo "Example"
2591 def CurveCurvatureByPoint(self, theCurve, thePoint):
2592 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
2593 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
2597 ## @name Surface Curvature Measurement
2598 # Methods for receiving max and min radius of curvature of surfaces
2599 # in the given point
2603 ## @ref swig_todo "Example"
2604 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
2605 # Example: see GEOM_TestMeasures.py
2606 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
2607 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
2611 ## @ref swig_todo "Example"
2612 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
2613 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
2614 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
2618 ## @ref swig_todo "Example"
2619 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
2620 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
2621 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
2625 ## @ref swig_todo "Example"
2626 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
2627 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
2628 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
2632 ## Get min and max tolerances of sub-shapes of theShape
2633 # @param theShape Shape, to get tolerances of.
2634 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
2635 # FaceMin,FaceMax: Min and max tolerances of the faces.
2636 # EdgeMin,EdgeMax: Min and max tolerances of the edges.
2637 # VertMin,VertMax: Min and max tolerances of the vertices.
2639 # @ref tui_measurement_tools_page "Example"
2640 def Tolerance(self,theShape):
2641 # Example: see GEOM_TestMeasures.py
2642 aTuple = self.MeasuOp.GetTolerance(theShape)
2643 RaiseIfFailed("GetTolerance", self.MeasuOp)
2646 ## Obtain description of the given shape (number of sub-shapes of each type)
2647 # @param theShape Shape to be described.
2648 # @return Description of the given shape.
2650 # @ref tui_measurement_tools_page "Example"
2651 def WhatIs(self,theShape):
2652 # Example: see GEOM_TestMeasures.py
2653 aDescr = self.MeasuOp.WhatIs(theShape)
2654 RaiseIfFailed("WhatIs", self.MeasuOp)
2657 ## Get a point, situated at the centre of mass of theShape.
2658 # @param theShape Shape to define centre of mass of.
2659 # @return New GEOM_Object, containing the created point.
2661 # @ref tui_measurement_tools_page "Example"
2662 def MakeCDG(self,theShape):
2663 # Example: see GEOM_TestMeasures.py
2664 anObj = self.MeasuOp.GetCentreOfMass(theShape)
2665 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
2668 ## Get a normale to the given face. If the point is not given,
2669 # the normale is calculated at the center of mass.
2670 # @param theFace Face to define normale of.
2671 # @param theOptionalPoint Point to compute the normale at.
2672 # @return New GEOM_Object, containing the created vector.
2674 # @ref swig_todo "Example"
2675 def GetNormal(self, theFace, theOptionalPoint = None):
2676 # Example: see GEOM_TestMeasures.py
2677 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
2678 RaiseIfFailed("GetNormal", self.MeasuOp)
2681 ## Check a topology of the given shape.
2682 # @param theShape Shape to check validity of.
2683 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked,
2684 # if TRUE, the shape's geometry will be checked also.
2685 # @return TRUE, if the shape "seems to be valid".
2686 # If theShape is invalid, prints a description of problem.
2688 # @ref tui_measurement_tools_page "Example"
2689 def CheckShape(self,theShape, theIsCheckGeom = 0):
2690 # Example: see GEOM_TestMeasures.py
2692 (IsValid, Status) = self.MeasuOp.CheckShapeWithGeometry(theShape)
2693 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
2695 (IsValid, Status) = self.MeasuOp.CheckShape(theShape)
2696 RaiseIfFailed("CheckShape", self.MeasuOp)
2701 ## Get position (LCS) of theShape.
2703 # Origin of the LCS is situated at the shape's center of mass.
2704 # Axes of the LCS are obtained from shape's location or,
2705 # if the shape is a planar face, from position of its plane.
2707 # @param theShape Shape to calculate position of.
2708 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
2709 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
2710 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
2711 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
2713 # @ref swig_todo "Example"
2714 def GetPosition(self,theShape):
2715 # Example: see GEOM_TestMeasures.py
2716 aTuple = self.MeasuOp.GetPosition(theShape)
2717 RaiseIfFailed("GetPosition", self.MeasuOp)
2720 ## Get kind of theShape.
2722 # @param theShape Shape to get a kind of.
2723 # @return Returns a kind of shape in terms of <VAR>GEOM_IKindOfShape.shape_kind</VAR> enumeration
2724 # and a list of parameters, describing the shape.
2725 # @note Concrete meaning of each value, returned via \a theIntegers
2726 # or \a theDoubles list depends on the kind of the shape.
2727 # The full list of possible outputs is:
2729 # - geompy.kind.COMPOUND nb_solids nb_faces nb_edges nb_vertices
2730 # - geompy.kind.COMPSOLID nb_solids nb_faces nb_edges nb_vertices
2732 # - geompy.kind.SHELL geompy.info.CLOSED nb_faces nb_edges nb_vertices
2733 # - geompy.kind.SHELL geompy.info.UNCLOSED nb_faces nb_edges nb_vertices
2735 # - geompy.kind.WIRE geompy.info.CLOSED nb_edges nb_vertices
2736 # - geompy.kind.WIRE geompy.info.UNCLOSED nb_edges nb_vertices
2738 # - geompy.kind.SPHERE xc yc zc R
2739 # - geompy.kind.CYLINDER xb yb zb dx dy dz R H
2740 # - geompy.kind.BOX xc yc zc ax ay az
2741 # - geompy.kind.ROTATED_BOX xc yc zc zx zy zz xx xy xz ax ay az
2742 # - geompy.kind.TORUS xc yc zc dx dy dz R_1 R_2
2743 # - geompy.kind.CONE xb yb zb dx dy dz R_1 R_2 H
2744 # - geompy.kind.POLYHEDRON nb_faces nb_edges nb_vertices
2745 # - geompy.kind.SOLID nb_faces nb_edges nb_vertices
2747 # - geompy.kind.SPHERE2D xc yc zc R
2748 # - geompy.kind.CYLINDER2D xb yb zb dx dy dz R H
2749 # - geompy.kind.TORUS2D xc yc zc dx dy dz R_1 R_2
2750 # - geompy.kind.CONE2D xc yc zc dx dy dz R_1 R_2 H
2751 # - geompy.kind.DISK_CIRCLE xc yc zc dx dy dz R
2752 # - geompy.kind.DISK_ELLIPSE xc yc zc dx dy dz R_1 R_2
2753 # - geompy.kind.POLYGON xo yo zo dx dy dz nb_edges nb_vertices
2754 # - geompy.kind.PLANE xo yo zo dx dy dz
2755 # - geompy.kind.PLANAR xo yo zo dx dy dz nb_edges nb_vertices
2756 # - geompy.kind.FACE nb_edges nb_vertices
2758 # - geompy.kind.CIRCLE xc yc zc dx dy dz R
2759 # - geompy.kind.ARC_CIRCLE xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2
2760 # - geompy.kind.ELLIPSE xc yc zc dx dy dz R_1 R_2
2761 # - geompy.kind.ARC_ELLIPSE xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2
2762 # - geompy.kind.LINE xo yo zo dx dy dz
2763 # - geompy.kind.SEGMENT x1 y1 z1 x2 y2 z2
2764 # - geompy.kind.EDGE nb_vertices
2766 # - geompy.kind.VERTEX x y z
2768 # @ref swig_todo "Example"
2769 def KindOfShape(self,theShape):
2770 # Example: see GEOM_TestMeasures.py
2771 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
2772 RaiseIfFailed("KindOfShape", self.MeasuOp)
2774 aKind = aRoughTuple[0]
2775 anInts = aRoughTuple[1]
2776 aDbls = aRoughTuple[2]
2778 # Now there is no exception from this rule:
2779 aKindTuple = [aKind] + aDbls + anInts
2781 # If they are we will regroup parameters for such kind of shape.
2783 #if aKind == kind.SOME_KIND:
2784 # # SOME_KIND int int double int double double
2785 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
2792 ## @addtogroup l2_import_export
2795 ## Import a shape from the BREP or IGES or STEP file
2796 # (depends on given format) with given name.
2797 # @param theFileName The file, containing the shape.
2798 # @param theFormatName Specify format for the file reading.
2799 # Available formats can be obtained with InsertOp.ImportTranslators() method.
2800 # @return New GEOM_Object, containing the imported shape.
2802 # @ref swig_Import_Export "Example"
2803 def Import(self,theFileName, theFormatName):
2804 # Example: see GEOM_TestOthers.py
2805 anObj = self.InsertOp.Import(theFileName, theFormatName)
2806 RaiseIfFailed("Import", self.InsertOp)
2809 ## Shortcut to Import() for BREP format
2811 # @ref swig_Import_Export "Example"
2812 def ImportBREP(self,theFileName):
2813 # Example: see GEOM_TestOthers.py
2814 return self.Import(theFileName, "BREP")
2816 ## Shortcut to Import() for IGES format
2818 # @ref swig_Import_Export "Example"
2819 def ImportIGES(self,theFileName):
2820 # Example: see GEOM_TestOthers.py
2821 return self.Import(theFileName, "IGES")
2823 ## Shortcut to Import() for STEP format
2825 # @ref swig_Import_Export "Example"
2826 def ImportSTEP(self,theFileName):
2827 # Example: see GEOM_TestOthers.py
2828 return self.Import(theFileName, "STEP")
2830 ## Export the given shape into a file with given name.
2831 # @param theObject Shape to be stored in the file.
2832 # @param theFileName Name of the file to store the given shape in.
2833 # @param theFormatName Specify format for the shape storage.
2834 # Available formats can be obtained with InsertOp.ImportTranslators() method.
2836 # @ref swig_Import_Export "Example"
2837 def Export(self,theObject, theFileName, theFormatName):
2838 # Example: see GEOM_TestOthers.py
2839 self.InsertOp.Export(theObject, theFileName, theFormatName)
2840 if self.InsertOp.IsDone() == 0:
2841 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
2845 ## Shortcut to Export() for BREP format
2847 # @ref swig_Import_Export "Example"
2848 def ExportBREP(self,theObject, theFileName):
2849 # Example: see GEOM_TestOthers.py
2850 return self.Export(theObject, theFileName, "BREP")
2852 ## Shortcut to Export() for IGES format
2854 # @ref swig_Import_Export "Example"
2855 def ExportIGES(self,theObject, theFileName):
2856 # Example: see GEOM_TestOthers.py
2857 return self.Export(theObject, theFileName, "IGES")
2859 ## Shortcut to Export() for STEP format
2861 # @ref swig_Import_Export "Example"
2862 def ExportSTEP(self,theObject, theFileName):
2863 # Example: see GEOM_TestOthers.py
2864 return self.Export(theObject, theFileName, "STEP")
2866 # end of l2_import_export
2869 ## @addtogroup l3_blocks
2872 ## Create a quadrangle face from four edges. Order of Edges is not
2873 # important. It is not necessary that edges share the same vertex.
2874 # @param E1,E2,E3,E4 Edges for the face bound.
2875 # @return New GEOM_Object, containing the created face.
2877 # @ref tui_building_by_blocks_page "Example"
2878 def MakeQuad(self,E1, E2, E3, E4):
2879 # Example: see GEOM_Spanner.py
2880 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
2881 RaiseIfFailed("MakeQuad", self.BlocksOp)
2884 ## Create a quadrangle face on two edges.
2885 # The missing edges will be built by creating the shortest ones.
2886 # @param E1,E2 Two opposite edges for the face.
2887 # @return New GEOM_Object, containing the created face.
2889 # @ref tui_building_by_blocks_page "Example"
2890 def MakeQuad2Edges(self,E1, E2):
2891 # Example: see GEOM_Spanner.py
2892 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
2893 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
2896 ## Create a quadrangle face with specified corners.
2897 # The missing edges will be built by creating the shortest ones.
2898 # @param V1,V2,V3,V4 Corner vertices for the face.
2899 # @return New GEOM_Object, containing the created face.
2901 # @ref tui_building_by_blocks_page "Example 1"
2902 # \n @ref swig_MakeQuad4Vertices "Example 2"
2903 def MakeQuad4Vertices(self,V1, V2, V3, V4):
2904 # Example: see GEOM_Spanner.py
2905 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
2906 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
2909 ## Create a hexahedral solid, bounded by the six given faces. Order of
2910 # faces is not important. It is not necessary that Faces share the same edge.
2911 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
2912 # @return New GEOM_Object, containing the created solid.
2914 # @ref tui_building_by_blocks_page "Example 1"
2915 # \n @ref swig_MakeHexa "Example 2"
2916 def MakeHexa(self,F1, F2, F3, F4, F5, F6):
2917 # Example: see GEOM_Spanner.py
2918 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
2919 RaiseIfFailed("MakeHexa", self.BlocksOp)
2922 ## Create a hexahedral solid between two given faces.
2923 # The missing faces will be built by creating the smallest ones.
2924 # @param F1,F2 Two opposite faces for the hexahedral solid.
2925 # @return New GEOM_Object, containing the created solid.
2927 # @ref tui_building_by_blocks_page "Example 1"
2928 # \n @ref swig_MakeHexa2Faces "Example 2"
2929 def MakeHexa2Faces(self,F1, F2):
2930 # Example: see GEOM_Spanner.py
2931 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
2932 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
2938 ## @addtogroup l3_blocks_op
2941 ## Get a vertex, found in the given shape by its coordinates.
2942 # @param theShape Block or a compound of blocks.
2943 # @param theX,theY,theZ Coordinates of the sought vertex.
2944 # @param theEpsilon Maximum allowed distance between the resulting
2945 # vertex and point with the given coordinates.
2946 # @return New GEOM_Object, containing the found vertex.
2948 # @ref swig_GetPoint "Example"
2949 def GetPoint(self,theShape, theX, theY, theZ, theEpsilon):
2950 # Example: see GEOM_TestOthers.py
2951 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
2952 RaiseIfFailed("GetPoint", self.BlocksOp)
2955 ## Get an edge, found in the given shape by two given vertices.
2956 # @param theShape Block or a compound of blocks.
2957 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
2958 # @return New GEOM_Object, containing the found edge.
2960 # @ref swig_todo "Example"
2961 def GetEdge(self,theShape, thePoint1, thePoint2):
2962 # Example: see GEOM_Spanner.py
2963 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
2964 RaiseIfFailed("GetEdge", self.BlocksOp)
2967 ## Find an edge of the given shape, which has minimal distance to the given point.
2968 # @param theShape Block or a compound of blocks.
2969 # @param thePoint Point, close to the desired edge.
2970 # @return New GEOM_Object, containing the found edge.
2972 # @ref swig_GetEdgeNearPoint "Example"
2973 def GetEdgeNearPoint(self,theShape, thePoint):
2974 # Example: see GEOM_TestOthers.py
2975 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
2976 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
2979 ## Returns a face, found in the given shape by four given corner vertices.
2980 # @param theShape Block or a compound of blocks.
2981 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
2982 # @return New GEOM_Object, containing the found face.
2984 # @ref swig_todo "Example"
2985 def GetFaceByPoints(self,theShape, thePoint1, thePoint2, thePoint3, thePoint4):
2986 # Example: see GEOM_Spanner.py
2987 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
2988 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
2991 ## Get a face of block, found in the given shape by two given edges.
2992 # @param theShape Block or a compound of blocks.
2993 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
2994 # @return New GEOM_Object, containing the found face.
2996 # @ref swig_todo "Example"
2997 def GetFaceByEdges(self,theShape, theEdge1, theEdge2):
2998 # Example: see GEOM_Spanner.py
2999 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
3000 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
3003 ## Find a face, opposite to the given one in the given block.
3004 # @param theBlock Must be a hexahedral solid.
3005 # @param theFace Face of \a theBlock, opposite to the desired face.
3006 # @return New GEOM_Object, containing the found face.
3008 # @ref swig_GetOppositeFace "Example"
3009 def GetOppositeFace(self,theBlock, theFace):
3010 # Example: see GEOM_Spanner.py
3011 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
3012 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
3015 ## Find a face of the given shape, which has minimal distance to the given point.
3016 # @param theShape Block or a compound of blocks.
3017 # @param thePoint Point, close to the desired face.
3018 # @return New GEOM_Object, containing the found face.
3020 # @ref swig_GetFaceNearPoint "Example"
3021 def GetFaceNearPoint(self,theShape, thePoint):
3022 # Example: see GEOM_Spanner.py
3023 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
3024 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
3027 ## Find a face of block, whose outside normale has minimal angle with the given vector.
3028 # @param theBlock Block or a compound of blocks.
3029 # @param theVector Vector, close to the normale of the desired face.
3030 # @return New GEOM_Object, containing the found face.
3032 # @ref swig_todo "Example"
3033 def GetFaceByNormale(self, theBlock, theVector):
3034 # Example: see GEOM_Spanner.py
3035 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
3036 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
3039 # end of l3_blocks_op
3042 ## @addtogroup l4_blocks_measure
3045 ## Check, if the compound of blocks is given.
3046 # To be considered as a compound of blocks, the
3047 # given shape must satisfy the following conditions:
3048 # - Each element of the compound should be a Block (6 faces and 12 edges).
3049 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
3050 # - The compound should be connexe.
3051 # - The glue between two quadrangle faces should be applied.
3052 # @param theCompound The compound to check.
3053 # @return TRUE, if the given shape is a compound of blocks.
3054 # If theCompound is not valid, prints all discovered errors.
3056 # @ref tui_measurement_tools_page "Example 1"
3057 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
3058 def CheckCompoundOfBlocks(self,theCompound):
3059 # Example: see GEOM_Spanner.py
3060 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
3061 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
3063 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
3067 ## Remove all seam and degenerated edges from \a theShape.
3068 # Unite faces and edges, sharing one surface. It means that
3069 # this faces must have references to one C++ surface object (handle).
3070 # @param theShape The compound or single solid to remove irregular edges from.
3071 # @return Improved shape.
3073 # @ref swig_RemoveExtraEdges "Example"
3074 def RemoveExtraEdges(self,theShape):
3075 # Example: see GEOM_TestOthers.py
3076 anObj = self.BlocksOp.RemoveExtraEdges(theShape)
3077 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
3080 ## Check, if the given shape is a blocks compound.
3081 # Fix all detected errors.
3082 # \note Single block can be also fixed by this method.
3083 # @param theShape The compound to check and improve.
3084 # @return Improved compound.
3086 # @ref swig_CheckAndImprove "Example"
3087 def CheckAndImprove(self,theShape):
3088 # Example: see GEOM_TestOthers.py
3089 anObj = self.BlocksOp.CheckAndImprove(theShape)
3090 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
3093 # end of l4_blocks_measure
3096 ## @addtogroup l3_blocks_op
3099 ## Get all the blocks, contained in the given compound.
3100 # @param theCompound The compound to explode.
3101 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
3102 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
3103 # \note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
3104 # @return List of GEOM_Objects, containing the retrieved blocks.
3106 # @ref tui_explode_on_blocks "Example 1"
3107 # \n @ref swig_MakeBlockExplode "Example 2"
3108 def MakeBlockExplode(self,theCompound, theMinNbFaces, theMaxNbFaces):
3109 # Example: see GEOM_TestOthers.py
3110 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
3111 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
3114 ## Find block, containing the given point inside its volume or on boundary.
3115 # @param theCompound Compound, to find block in.
3116 # @param thePoint Point, close to the desired block. If the point lays on
3117 # boundary between some blocks, we return block with nearest center.
3118 # @return New GEOM_Object, containing the found block.
3120 # @ref swig_todo "Example"
3121 def GetBlockNearPoint(self,theCompound, thePoint):
3122 # Example: see GEOM_Spanner.py
3123 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
3124 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
3127 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
3128 # @param theCompound Compound, to find block in.
3129 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
3130 # @return New GEOM_Object, containing the found block.
3132 # @ref swig_GetBlockByParts "Example"
3133 def GetBlockByParts(self,theCompound, theParts):
3134 # Example: see GEOM_TestOthers.py
3135 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
3136 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
3139 ## Return all blocks, containing all the elements, passed as the parts.
3140 # @param theCompound Compound, to find blocks in.
3141 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
3142 # @return List of GEOM_Objects, containing the found blocks.
3144 # @ref swig_todo "Example"
3145 def GetBlocksByParts(self,theCompound, theParts):
3146 # Example: see GEOM_Spanner.py
3147 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
3148 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
3151 ## Multi-transformate block and glue the result.
3152 # Transformation is defined so, as to superpose direction faces.
3153 # @param Block Hexahedral solid to be multi-transformed.
3154 # @param DirFace1 ID of First direction face.
3155 # @param DirFace2 ID of Second direction face.
3156 # @param NbTimes Quantity of transformations to be done.
3157 # \note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
3158 # @return New GEOM_Object, containing the result shape.
3160 # @ref tui_multi_transformation "Example"
3161 def MakeMultiTransformation1D(self,Block, DirFace1, DirFace2, NbTimes):
3162 # Example: see GEOM_Spanner.py
3163 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
3164 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
3167 ## Multi-transformate block and glue the result.
3168 # @param Block Hexahedral solid to be multi-transformed.
3169 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
3170 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
3171 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
3172 # @return New GEOM_Object, containing the result shape.
3174 # @ref tui_multi_transformation "Example"
3175 def MakeMultiTransformation2D(self,Block, DirFace1U, DirFace2U, NbTimesU,
3176 DirFace1V, DirFace2V, NbTimesV):
3177 # Example: see GEOM_Spanner.py
3178 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
3179 DirFace1V, DirFace2V, NbTimesV)
3180 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
3183 ## Build all possible propagation groups.
3184 # Propagation group is a set of all edges, opposite to one (main)
3185 # edge of this group directly or through other opposite edges.
3186 # Notion of Opposite Edge make sence only on quadrangle face.
3187 # @param theShape Shape to build propagation groups on.
3188 # @return List of GEOM_Objects, each of them is a propagation group.
3190 # @ref swig_Propagate "Example"
3191 def Propagate(self,theShape):
3192 # Example: see GEOM_TestOthers.py
3193 listChains = self.BlocksOp.Propagate(theShape)
3194 RaiseIfFailed("Propagate", self.BlocksOp)
3197 # end of l3_blocks_op
3200 ## @addtogroup l3_groups
3203 ## Creates a new group which will store sub shapes of theMainShape
3204 # @param theMainShape is a GEOM object on which the group is selected
3205 # @param theShapeType defines a shape type of the group
3206 # @return a newly created GEOM group
3208 # @ref tui_working_with_groups_page "Example 1"
3209 # \n @ref swig_CreateGroup "Example 2"
3210 def CreateGroup(self,theMainShape, theShapeType):
3211 # Example: see GEOM_TestOthers.py
3212 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
3213 RaiseIfFailed("CreateGroup", self.GroupOp)
3216 ## Adds a sub object with ID theSubShapeId to the group
3217 # @param theGroup is a GEOM group to which the new sub shape is added
3218 # @param theSubShapeID is a sub shape ID in the main object.
3219 # \note Use method GetSubShapeID() to get an unique ID of the sub shape
3221 # @ref tui_working_with_groups_page "Example"
3222 def AddObject(self,theGroup, theSubShapeID):
3223 # Example: see GEOM_TestOthers.py
3224 self.GroupOp.AddObject(theGroup, theSubShapeID)
3225 RaiseIfFailed("AddObject", self.GroupOp)
3228 ## Removes a sub object with ID \a theSubShapeId from the group
3229 # @param theGroup is a GEOM group from which the new sub shape is removed
3230 # @param theSubShapeID is a sub shape ID in the main object.
3231 # \note Use method GetSubShapeID() to get an unique ID of the sub shape
3233 # @ref tui_working_with_groups_page "Example"
3234 def RemoveObject(self,theGroup, theSubShapeID):
3235 # Example: see GEOM_TestOthers.py
3236 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
3237 RaiseIfFailed("RemoveObject", self.GroupOp)
3240 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
3241 # @param theGroup is a GEOM group to which the new sub shapes are added.
3242 # @param theSubShapes is a list of sub shapes to be added.
3244 # @ref tui_working_with_groups_page "Example"
3245 def UnionList (self,theGroup, theSubShapes):
3246 # Example: see GEOM_TestOthers.py
3247 self.GroupOp.UnionList(theGroup, theSubShapes)
3248 RaiseIfFailed("UnionList", self.GroupOp)
3251 ## Works like the above method, but argument
3252 # theSubShapes here is a list of sub-shapes indices
3254 # @ref swig_UnionIDs "Example"
3255 def UnionIDs(self,theGroup, theSubShapes):
3256 # Example: see GEOM_TestOthers.py
3257 self.GroupOp.UnionIDs(theGroup, theSubShapes)
3258 RaiseIfFailed("UnionIDs", self.GroupOp)
3261 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
3262 # @param theGroup is a GEOM group from which the sub-shapes are removed.
3263 # @param theSubShapes is a list of sub-shapes to be removed.
3265 # @ref tui_working_with_groups_page "Example"
3266 def DifferenceList (self,theGroup, theSubShapes):
3267 # Example: see GEOM_TestOthers.py
3268 self.GroupOp.DifferenceList(theGroup, theSubShapes)
3269 RaiseIfFailed("DifferenceList", self.GroupOp)
3272 ## Works like the above method, but argument
3273 # theSubShapes here is a list of sub-shapes indices
3275 # @ref swig_DifferenceIDs "Example"
3276 def DifferenceIDs(self,theGroup, theSubShapes):
3277 # Example: see GEOM_TestOthers.py
3278 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
3279 RaiseIfFailed("DifferenceIDs", self.GroupOp)
3282 ## Returns a list of sub objects ID stored in the group
3283 # @param theGroup is a GEOM group for which a list of IDs is requested
3285 # @ref swig_GetObjectIDs "Example"
3286 def GetObjectIDs(self,theGroup):
3287 # Example: see GEOM_TestOthers.py
3288 ListIDs = self.GroupOp.GetObjects(theGroup)
3289 RaiseIfFailed("GetObjects", self.GroupOp)
3292 ## Returns a type of sub objects stored in the group
3293 # @param theGroup is a GEOM group which type is returned.
3295 # @ref swig_GetType "Example"
3296 def GetType(self,theGroup):
3297 # Example: see GEOM_TestOthers.py
3298 aType = self.GroupOp.GetType(theGroup)
3299 RaiseIfFailed("GetType", self.GroupOp)
3302 ## Returns a main shape associated with the group
3303 # @param theGroup is a GEOM group for which a main shape object is requested
3304 # @return a GEOM object which is a main shape for theGroup
3306 # @ref swig_GetMainShape "Example"
3307 def GetMainShape(self,theGroup):
3308 # Example: see GEOM_TestOthers.py
3309 anObj = self.GroupOp.GetMainShape(theGroup)
3310 RaiseIfFailed("GetMainShape", self.GroupOp)
3313 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
3314 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
3316 # @ref swig_todo "Example"
3317 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1):
3318 edges = self.SubShapeAll(theShape, ShapeType["EDGE"])
3321 Props = self.BasicProperties(edge)
3322 if min_length <= Props[0] and Props[0] <= max_length:
3323 if (not include_min) and (min_length == Props[0]):
3326 if (not include_max) and (Props[0] == max_length):
3329 edges_in_range.append(edge)
3331 if len(edges_in_range) <= 0:
3332 print "No edges found by given criteria"
3335 group_edges = self.CreateGroup(theShape, ShapeType["EDGE"])
3336 self.UnionList(group_edges, edges_in_range)
3340 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
3341 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
3343 # @ref swig_todo "Example"
3344 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
3345 nb_selected = sg.SelectedCount()
3347 print "Select a shape before calling this function, please."
3350 print "Only one shape must be selected"
3353 id_shape = sg.getSelected(0)
3354 shape = IDToObject( id_shape )
3356 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
3360 if include_min: left_str = " <= "
3361 if include_max: right_str = " <= "
3363 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
3364 + left_str + "length" + right_str + `max_length`)
3366 sg.updateObjBrowser(1)
3373 ## Create a copy of the given object
3374 # @ingroup l1_geompy_auxiliary
3376 # @ref swig_all_advanced "Example"
3377 def MakeCopy(self,theOriginal):
3378 # Example: see GEOM_TestAll.py
3379 anObj = self.InsertOp.MakeCopy(theOriginal)
3380 RaiseIfFailed("MakeCopy", self.InsertOp)
3383 ## Add Path to load python scripts from
3384 # @ingroup l1_geompy_auxiliary
3385 def addPath(self,Path):
3386 if (sys.path.count(Path) < 1):
3387 sys.path.append(Path)
3390 #Register the new proxy for GEOM_Gen
3391 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geompyDC)