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):
111 GEOM._objref_GEOM_Gen.__init__(self)
112 self.myBuilder = None
130 ## @addtogroup l1_geompy_auxiliary
132 def init_geom(self,theStudy):
133 self.myStudy = theStudy
134 self.myStudyId = self.myStudy._get_StudyId()
135 self.myBuilder = self.myStudy.NewBuilder()
136 self.father = self.myStudy.FindComponent("GEOM")
137 if self.father is None:
138 self.father = self.myBuilder.NewComponent("GEOM")
139 A1 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributeName")
140 FName = A1._narrow(SALOMEDS.AttributeName)
141 FName.SetValue("Geometry")
142 A2 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributePixMap")
143 aPixmap = A2._narrow(SALOMEDS.AttributePixMap)
144 aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry")
145 self.myBuilder.DefineComponentInstance(self.father,self)
147 self.BasicOp = self.GetIBasicOperations (self.myStudyId)
148 self.CurvesOp = self.GetICurvesOperations (self.myStudyId)
149 self.PrimOp = self.GetI3DPrimOperations (self.myStudyId)
150 self.ShapesOp = self.GetIShapesOperations (self.myStudyId)
151 self.HealOp = self.GetIHealingOperations (self.myStudyId)
152 self.InsertOp = self.GetIInsertOperations (self.myStudyId)
153 self.BoolOp = self.GetIBooleanOperations (self.myStudyId)
154 self.TrsfOp = self.GetITransformOperations(self.myStudyId)
155 self.LocalOp = self.GetILocalOperations (self.myStudyId)
156 self.MeasuOp = self.GetIMeasureOperations (self.myStudyId)
157 self.BlocksOp = self.GetIBlocksOperations (self.myStudyId)
158 self.GroupOp = self.GetIGroupOperations (self.myStudyId)
161 ## Get name for sub-shape aSubObj of shape aMainObj
163 # @ref swig_SubShapeAllSorted "Example"
164 def SubShapeName(self,aSubObj, aMainObj):
165 # Example: see GEOM_TestAll.py
167 #aSubId = orb.object_to_string(aSubObj)
168 #aMainId = orb.object_to_string(aMainObj)
169 #index = gg.getIndexTopology(aSubId, aMainId)
170 #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
171 index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
172 name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
175 ## Publish in study aShape with name aName
177 # \param aShape the shape to be published
178 # \param aName the name for the shape
179 # \param doRestoreSubShapes if True, finds and publishes also
180 # sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
181 # and published sub-shapes of arguments
182 # \param theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes for
183 # these arguments description
184 # \return study entry of the published shape in form of string
186 # @ref swig_MakeQuad4Vertices "Example"
187 def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
188 theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
189 # Example: see GEOM_TestAll.py
191 aSObject = self.AddInStudy(self.myStudy, aShape, aName, None)
192 if doRestoreSubShapes:
193 self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs,
194 theFindMethod, theInheritFirstArg)
196 print "addToStudy() failed"
198 return aShape.GetStudyEntry()
200 ## Publish in study aShape with name aName as sub-object of previously published aFather
202 # @ref swig_SubShapeAllSorted "Example"
203 def addToStudyInFather(self, aFather, aShape, aName):
204 # Example: see GEOM_TestAll.py
206 aSObject = self.AddInStudy(myStudy, aShape, aName, aFather)
208 print "addToStudyInFather() failed"
210 return aShape.GetStudyEntry()
212 # end of l1_geompy_auxiliary
215 ## @addtogroup l3_restore_ss
218 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
219 # To be used from python scripts out of geompy.addToStudy (non-default usage)
220 # \param theObject published GEOM object, arguments of which will be published
221 # \param theArgs list of GEOM_Object, operation arguments to be published.
222 # If this list is empty, all operation arguments will be published
223 # \param theFindMethod method to search subshapes, corresponding to arguments and
224 # their subshapes. Value from enumeration GEOM::find_shape_method.
225 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
226 # Do not publish subshapes in place of arguments, but only
227 # in place of subshapes of the first argument,
228 # because the whole shape corresponds to the first argument.
229 # Mainly to be used after transformations, but it also can be
230 # usefull after partition with one object shape, and some other
231 # operations, where only the first argument has to be considered.
232 # If theObject has only one argument shape, this flag is automatically
233 # considered as True, not regarding really passed value.
234 # \return True in case of success, False otherwise.
236 # @ref tui_restore_prs_params "Example"
237 def RestoreSubShapes (self, theObject, theArgs=[],
238 theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
239 # Example: see GEOM_TestAll.py
240 return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
241 theFindMethod, theInheritFirstArg)
243 # end of l3_restore_ss
246 ## @addtogroup l3_basic_go
249 ## Create point by three coordinates.
250 # @param theX The X coordinate of the point.
251 # @param theY The Y coordinate of the point.
252 # @param theZ The Z coordinate of the point.
253 # @return New GEOM_Object, containing the created point.
255 # @ref tui_creation_point "Example"
256 def MakeVertex(self,theX, theY, theZ):
257 # Example: see GEOM_TestAll.py
258 anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
259 RaiseIfFailed("MakePointXYZ", self.BasicOp)
262 ## Create a point, distant from the referenced point
263 # on the given distances along the coordinate axes.
264 # @param theReference The referenced point.
265 # @param theX Displacement from the referenced point along OX axis.
266 # @param theY Displacement from the referenced point along OY axis.
267 # @param theZ Displacement from the referenced point along OZ axis.
268 # @return New GEOM_Object, containing the created point.
270 # @ref tui_creation_point "Example"
271 def MakeVertexWithRef(self,theReference, theX, theY, theZ):
272 # Example: see GEOM_TestAll.py
273 anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
274 RaiseIfFailed("MakePointWithReference", self.BasicOp)
277 ## Create a point, corresponding to the given parameter on the given curve.
278 # @param theRefCurve The referenced curve.
279 # @param theParameter Value of parameter on the referenced curve.
280 # @return New GEOM_Object, containing the created point.
282 # @ref tui_creation_point "Example"
283 def MakeVertexOnCurve(self,theRefCurve, theParameter):
284 # Example: see GEOM_TestAll.py
285 anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter)
286 RaiseIfFailed("MakePointOnCurve", self.BasicOp)
289 ## Create a point, corresponding to the given parameters on the
291 # @param theRefSurf The referenced surface.
292 # @param theUParameter Value of U-parameter on the referenced surface.
293 # @param theVParameter Value of V-parameter on the referenced surface.
294 # @return New GEOM_Object, containing the created point.
296 # @ref swig_MakeVertexOnSurface "Example"
297 def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter):
298 # Example: see GEOM_TestAll.py
299 anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
300 RaiseIfFailed("MakePointOnSurface", self.BasicOp)
303 ## Create a point on intersection of two lines.
304 # @param theRefLine1, theRefLine2 The referenced lines.
305 # @return New GEOM_Object, containing the created point.
307 # @ref swig_MakeVertexOnLinesIntersection "Example"
308 def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2):
309 # Example: see GEOM_TestAll.py
310 anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
311 RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
314 ## Create a tangent, corresponding to the given parameter on the given curve.
315 # @param theRefCurve The referenced curve.
316 # @param theParameter Value of parameter on the referenced curve.
317 # @return New GEOM_Object, containing the created tangent.
319 # @ref swig_MakeTangentOnCurve "Example"
320 def MakeTangentOnCurve(self, theRefCurve, theParameter):
321 anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
322 RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
325 ## Create a vector with the given components.
326 # @param theDX X component of the vector.
327 # @param theDY Y component of the vector.
328 # @param theDZ Z component of the vector.
329 # @return New GEOM_Object, containing the created vector.
331 # @ref tui_creation_vector "Example"
332 def MakeVectorDXDYDZ(self,theDX, theDY, theDZ):
333 # Example: see GEOM_TestAll.py
334 anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
335 RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
338 ## Create a vector between two points.
339 # @param thePnt1 Start point for the vector.
340 # @param thePnt2 End point for the vector.
341 # @return New GEOM_Object, containing the created vector.
343 # @ref tui_creation_vector "Example"
344 def MakeVector(self,thePnt1, thePnt2):
345 # Example: see GEOM_TestAll.py
346 anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
347 RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
350 ## Create a line, passing through the given point
351 # and parrallel to the given direction
352 # @param thePnt Point. The resulting line will pass through it.
353 # @param theDir Direction. The resulting line will be parallel to it.
354 # @return New GEOM_Object, containing the created line.
356 # @ref tui_creation_line "Example"
357 def MakeLine(self,thePnt, theDir):
358 # Example: see GEOM_TestAll.py
359 anObj = self.BasicOp.MakeLine(thePnt, theDir)
360 RaiseIfFailed("MakeLine", self.BasicOp)
363 ## Create a line, passing through the given points
364 # @param thePnt1 First of two points, defining the line.
365 # @param thePnt2 Second of two points, defining the line.
366 # @return New GEOM_Object, containing the created line.
368 # @ref tui_creation_line "Example"
369 def MakeLineTwoPnt(self,thePnt1, thePnt2):
370 # Example: see GEOM_TestAll.py
371 anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
372 RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
375 ## Create a line on two faces intersection.
376 # @param theFace1 First of two faces, defining the line.
377 # @param theFace2 Second of two faces, defining the line.
378 # @return New GEOM_Object, containing the created line.
380 # @ref swig_MakeLineTwoFaces "Example"
381 def MakeLineTwoFaces(self, theFace1, theFace2):
382 # Example: see GEOM_TestAll.py
383 anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
384 RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
387 ## Create a plane, passing through the given point
388 # and normal to the given vector.
389 # @param thePnt Point, the plane has to pass through.
390 # @param theVec Vector, defining the plane normal direction.
391 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
392 # @return New GEOM_Object, containing the created plane.
394 # @ref tui_creation_plane "Example"
395 def MakePlane(self,thePnt, theVec, theTrimSize):
396 # Example: see GEOM_TestAll.py
397 anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
398 RaiseIfFailed("MakePlanePntVec", self.BasicOp)
401 ## Create a plane, passing through the three given points
402 # @param thePnt1 First of three points, defining the plane.
403 # @param thePnt2 Second of three points, defining the plane.
404 # @param thePnt3 Fird of three points, defining the plane.
405 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
406 # @return New GEOM_Object, containing the created plane.
408 # @ref tui_creation_plane "Example"
409 def MakePlaneThreePnt(self,thePnt1, thePnt2, thePnt3, theTrimSize):
410 # Example: see GEOM_TestAll.py
411 anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
412 RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
415 ## Create a plane, similar to the existing one, but with another size of representing face.
416 # @param theFace Referenced plane or LCS(Marker).
417 # @param theTrimSize New half size of a side of quadrangle face, representing the plane.
418 # @return New GEOM_Object, containing the created plane.
420 # @ref tui_creation_plane "Example"
421 def MakePlaneFace(self,theFace, theTrimSize):
422 # Example: see GEOM_TestAll.py
423 anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
424 RaiseIfFailed("MakePlaneFace", self.BasicOp)
427 ## Create a local coordinate system.
428 # @param OX,OY,OZ Three coordinates of coordinate system origin.
429 # @param XDX,XDY,XDZ Three components of OX direction
430 # @param YDX,YDY,YDZ Three components of OY direction
431 # @return New GEOM_Object, containing the created coordinate system.
433 # @ref swig_MakeMarker "Example"
434 def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ):
435 # Example: see GEOM_TestAll.py
436 anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
437 RaiseIfFailed("MakeMarker", self.BasicOp)
440 ## Create a local coordinate system.
441 # @param theOrigin Point of coordinate system origin.
442 # @param theXVec Vector of X direction
443 # @param theYVec Vector of Y direction
444 # @return New GEOM_Object, containing the created coordinate system.
446 # @ref swig_MakeMarker "Example"
447 def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec):
448 O = self.PointCoordinates( theOrigin )
450 for vec in [ theXVec, theYVec ]:
451 v1, v2 = self.SubShapeAll( vec, ShapeType["VERTEX"] )
452 p1 = self.PointCoordinates( v1 )
453 p2 = self.PointCoordinates( v2 )
454 for i in range( 0, 3 ):
455 OXOY.append( p2[i] - p1[i] )
457 anObj = self.BasicOp.MakeMarker( O[0], O[1], O[2],
458 OXOY[0], OXOY[1], OXOY[2],
459 OXOY[3], OXOY[4], OXOY[5], )
460 RaiseIfFailed("MakeMarker", self.BasicOp)
466 ## @addtogroup l4_curves
469 ## Create an arc of circle, passing through three given points.
470 # @param thePnt1 Start point of the arc.
471 # @param thePnt2 Middle point of the arc.
472 # @param thePnt3 End point of the arc.
473 # @return New GEOM_Object, containing the created arc.
475 # @ref swig_MakeArc "Example"
476 def MakeArc(self,thePnt1, thePnt2, thePnt3):
477 # Example: see GEOM_TestAll.py
478 anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
479 RaiseIfFailed("MakeArc", self.CurvesOp)
482 ## Create an arc of circle from a center and 2 points.
483 # @param thePnt1 Center of the arc
484 # @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
485 # @param thePnt3 End point of the arc (Gives also a direction)
486 # @param theSense Orientation of the arc
487 # @return New GEOM_Object, containing the created arc.
489 # @ref swig_MakeArc "Example"
490 def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False):
491 # Example: see GEOM_TestAll.py
492 anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
493 RaiseIfFailed("MakeArcCenter", self.CurvesOp)
496 ## Create a circle with given center, normal vector and radius.
497 # @param thePnt Circle center.
498 # @param theVec Vector, normal to the plane of the circle.
499 # @param theR Circle radius.
500 # @return New GEOM_Object, containing the created circle.
502 # @ref tui_creation_circle "Example"
503 def MakeCircle(self,thePnt, theVec, theR):
504 # Example: see GEOM_TestAll.py
505 anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
506 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
509 ## Create a circle, passing through three given points
510 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
511 # @return New GEOM_Object, containing the created circle.
513 # @ref tui_creation_circle "Example"
514 def MakeCircleThreePnt(self,thePnt1, thePnt2, thePnt3):
515 # Example: see GEOM_TestAll.py
516 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
517 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
520 ## Create a circle, with given point1 as center,
521 # passing through the point2 as radius and laying in the plane,
522 # defined by all three given points.
523 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
524 # @return New GEOM_Object, containing the created circle.
526 # @ref swig_MakeCircle "Example"
527 def MakeCircleCenter2Pnt(self,thePnt1, thePnt2, thePnt3):
528 # Example: see GEOM_example6.py
529 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
530 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
533 ## Create an ellipse with given center, normal vector and radiuses.
534 # @param thePnt Ellipse center.
535 # @param theVec Vector, normal to the plane of the ellipse.
536 # @param theRMajor Major ellipse radius.
537 # @param theRMinor Minor ellipse radius.
538 # @return New GEOM_Object, containing the created ellipse.
540 # @ref tui_creation_ellipse "Example"
541 def MakeEllipse(self,thePnt, theVec, theRMajor, theRMinor):
542 # Example: see GEOM_TestAll.py
543 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
544 RaiseIfFailed("MakeEllipse", self.CurvesOp)
547 ## Create a polyline on the set of points.
548 # @param thePoints Sequence of points for the polyline.
549 # @return New GEOM_Object, containing the created polyline.
551 # @ref tui_creation_curve "Example"
552 def MakePolyline(self,thePoints):
553 # Example: see GEOM_TestAll.py
554 anObj = self.CurvesOp.MakePolyline(thePoints)
555 RaiseIfFailed("MakePolyline", self.CurvesOp)
558 ## Create bezier curve on the set of points.
559 # @param thePoints Sequence of points for the bezier curve.
560 # @return New GEOM_Object, containing the created bezier curve.
562 # @ref tui_creation_curve "Example"
563 def MakeBezier(self,thePoints):
564 # Example: see GEOM_TestAll.py
565 anObj = self.CurvesOp.MakeSplineBezier(thePoints)
566 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
569 ## Create B-Spline curve on the set of points.
570 # @param thePoints Sequence of points for the B-Spline curve.
571 # @return New GEOM_Object, containing the created B-Spline curve.
573 # @ref tui_creation_curve "Example"
574 def MakeInterpol(self,thePoints):
575 # Example: see GEOM_TestAll.py
576 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints)
577 RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
583 ## @addtogroup l3_sketcher
586 ## Create a sketcher (wire or face), following the textual description,
587 # passed through <VAR>theCommand</VAR> argument. \n
588 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
589 # Format of the description string have to be the following:
591 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
594 # - x1, y1 are coordinates of the first sketcher point (zero by default),
596 # - "R angle" : Set the direction by angle
597 # - "D dx dy" : Set the direction by DX & DY
600 # - "TT x y" : Create segment by point at X & Y
601 # - "T dx dy" : Create segment by point with DX & DY
602 # - "L length" : Create segment by direction & Length
603 # - "IX x" : Create segment by direction & Intersect. X
604 # - "IY y" : Create segment by direction & Intersect. Y
607 # - "C radius length" : Create arc by direction, radius and length(in degree)
610 # - "WW" : Close Wire (to finish)
611 # - "WF" : Close Wire and build face (to finish)
613 # @param theCommand String, defining the sketcher in local
614 # coordinates of the working plane.
615 # @param theWorkingPlane Nine double values, defining origin,
616 # OZ and OX directions of the working plane.
617 # @return New GEOM_Object, containing the created wire.
619 # @ref tui_sketcher_page "Example"
620 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0]):
621 # Example: see GEOM_TestAll.py
622 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
623 RaiseIfFailed("MakeSketcher", self.CurvesOp)
626 ## Create a sketcher (wire or face), following the textual description,
627 # passed through <VAR>theCommand</VAR> argument. \n
628 # For format of the description string see the previous method.\n
629 # @param theCommand String, defining the sketcher in local
630 # coordinates of the working plane.
631 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
632 # @return New GEOM_Object, containing the created wire.
634 # @ref tui_sketcher_page "Example"
635 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane):
636 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
637 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
643 ## @addtogroup l3_3d_primitives
646 ## Create a box by coordinates of two opposite vertices.
648 # @ref tui_creation_box "Example"
649 def MakeBox(self,x1,y1,z1,x2,y2,z2):
650 # Example: see GEOM_TestAll.py
651 pnt1 = self.MakeVertex(x1,y1,z1)
652 pnt2 = self.MakeVertex(x2,y2,z2)
653 return self.MakeBoxTwoPnt(pnt1,pnt2)
655 ## Create a box with specified dimensions along the coordinate axes
656 # and with edges, parallel to the coordinate axes.
657 # Center of the box will be at point (DX/2, DY/2, DZ/2).
658 # @param theDX Length of Box edges, parallel to OX axis.
659 # @param theDY Length of Box edges, parallel to OY axis.
660 # @param theDZ Length of Box edges, parallel to OZ axis.
661 # @return New GEOM_Object, containing the created box.
663 # @ref tui_creation_box "Example"
664 def MakeBoxDXDYDZ(self,theDX, theDY, theDZ):
665 # Example: see GEOM_TestAll.py
666 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
667 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
670 ## Create a box with two specified opposite vertices,
671 # and with edges, parallel to the coordinate axes
672 # @param thePnt1 First of two opposite vertices.
673 # @param thePnt2 Second of two opposite vertices.
674 # @return New GEOM_Object, containing the created box.
676 # @ref tui_creation_box "Example"
677 def MakeBoxTwoPnt(self,thePnt1, thePnt2):
678 # Example: see GEOM_TestAll.py
679 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
680 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
683 ## Create a cylinder with given base point, axis, radius and height.
684 # @param thePnt Central point of cylinder base.
685 # @param theAxis Cylinder axis.
686 # @param theR Cylinder radius.
687 # @param theH Cylinder height.
688 # @return New GEOM_Object, containing the created cylinder.
690 # @ref tui_creation_cylinder "Example"
691 def MakeCylinder(self,thePnt, theAxis, theR, theH):
692 # Example: see GEOM_TestAll.py
693 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
694 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
697 ## Create a cylinder with given radius and height at
698 # the origin of coordinate system. Axis of the cylinder
699 # will be collinear to the OZ axis of the coordinate system.
700 # @param theR Cylinder radius.
701 # @param theH Cylinder height.
702 # @return New GEOM_Object, containing the created cylinder.
704 # @ref tui_creation_cylinder "Example"
705 def MakeCylinderRH(self,theR, theH):
706 # Example: see GEOM_TestAll.py
707 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
708 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
711 ## Create a sphere with given center and radius.
712 # @param thePnt Sphere center.
713 # @param theR Sphere radius.
714 # @return New GEOM_Object, containing the created sphere.
716 # @ref tui_creation_sphere "Example"
717 def MakeSpherePntR(self, thePnt, theR):
718 # Example: see GEOM_TestAll.py
719 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
720 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
723 ## Create a sphere with given center and radius.
724 # @param x,y,z Coordinates of sphere center.
725 # @param theR Sphere radius.
726 # @return New GEOM_Object, containing the created sphere.
728 # @ref tui_creation_sphere "Example"
729 def MakeSphere(self, x, y, z, theR):
730 # Example: see GEOM_TestAll.py
731 point = self.MakeVertex(x, y, z)
732 anObj = self.MakeSpherePntR(point, theR)
735 ## Create a sphere with given radius at the origin of coordinate system.
736 # @param theR Sphere radius.
737 # @return New GEOM_Object, containing the created sphere.
739 # @ref tui_creation_sphere "Example"
740 def MakeSphereR(self, theR):
741 # Example: see GEOM_TestAll.py
742 anObj = self.PrimOp.MakeSphereR(theR)
743 RaiseIfFailed("MakeSphereR", self.PrimOp)
746 ## Create a cone with given base point, axis, height and radiuses.
747 # @param thePnt Central point of the first cone base.
748 # @param theAxis Cone axis.
749 # @param theR1 Radius of the first cone base.
750 # @param theR2 Radius of the second cone base.
751 # \note If both radiuses are non-zero, the cone will be truncated.
752 # \note If the radiuses are equal, a cylinder will be created instead.
753 # @param theH Cone height.
754 # @return New GEOM_Object, containing the created cone.
756 # @ref tui_creation_cone "Example"
757 def MakeCone(self,thePnt, theAxis, theR1, theR2, theH):
758 # Example: see GEOM_TestAll.py
759 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
760 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
763 ## Create a cone with given height and radiuses at
764 # the origin of coordinate system. Axis of the cone will
765 # be collinear to the OZ axis of the coordinate system.
766 # @param theR1 Radius of the first cone base.
767 # @param theR2 Radius of the second cone base.
768 # \note If both radiuses are non-zero, the cone will be truncated.
769 # \note If the radiuses are equal, a cylinder will be created instead.
770 # @param theH Cone height.
771 # @return New GEOM_Object, containing the created cone.
773 # @ref tui_creation_cone "Example"
774 def MakeConeR1R2H(self,theR1, theR2, theH):
775 # Example: see GEOM_TestAll.py
776 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
777 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
780 ## Create a torus with given center, normal vector and radiuses.
781 # @param thePnt Torus central point.
782 # @param theVec Torus axis of symmetry.
783 # @param theRMajor Torus major radius.
784 # @param theRMinor Torus minor radius.
785 # @return New GEOM_Object, containing the created torus.
787 # @ref tui_creation_torus "Example"
788 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor):
789 # Example: see GEOM_TestAll.py
790 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
791 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
794 ## Create a torus with given radiuses at the origin of coordinate system.
795 # @param theRMajor Torus major radius.
796 # @param theRMinor Torus minor radius.
797 # @return New GEOM_Object, containing the created torus.
799 # @ref tui_creation_torus "Example"
800 def MakeTorusRR(self, theRMajor, theRMinor):
801 # Example: see GEOM_TestAll.py
802 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
803 RaiseIfFailed("MakeTorusRR", self.PrimOp)
806 # end of l3_3d_primitives
809 ## @addtogroup l3_complex
812 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
813 # @param theBase Base shape to be extruded.
814 # @param thePoint1 First end of extrusion vector.
815 # @param thePoint2 Second end of extrusion vector.
816 # @return New GEOM_Object, containing the created prism.
818 # @ref tui_creation_prism "Example"
819 def MakePrism(self, theBase, thePoint1, thePoint2):
820 # Example: see GEOM_TestAll.py
821 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
822 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
825 ## Create a shape by extrusion of the base shape along the vector,
826 # i.e. all the space, transfixed by the base shape during its translation
827 # along the vector on the given distance.
828 # @param theBase Base shape to be extruded.
829 # @param theVec Direction of extrusion.
830 # @param theH Prism dimension along theVec.
831 # @return New GEOM_Object, containing the created prism.
833 # @ref tui_creation_prism "Example"
834 def MakePrismVecH(self, theBase, theVec, theH):
835 # Example: see GEOM_TestAll.py
836 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
837 RaiseIfFailed("MakePrismVecH", self.PrimOp)
840 ## Create a shape by extrusion of the base shape along the vector,
841 # i.e. all the space, transfixed by the base shape during its translation
842 # along the vector on the given distance in 2 Ways (forward/backward) .
843 # @param theBase Base shape to be extruded.
844 # @param theVec Direction of extrusion.
845 # @param theH Prism dimension along theVec in forward direction.
846 # @return New GEOM_Object, containing the created prism.
848 # @ref tui_creation_prism "Example"
849 def MakePrismVecH2Ways(self, theBase, theVec, theH):
850 # Example: see GEOM_TestAll.py
851 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
852 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
855 ## Create a shape by revolution of the base shape around the axis
856 # on the given angle, i.e. all the space, transfixed by the base
857 # shape during its rotation around the axis on the given angle.
858 # @param theBase Base shape to be rotated.
859 # @param theAxis Rotation axis.
860 # @param theAngle Rotation angle in radians.
861 # @return New GEOM_Object, containing the created revolution.
863 # @ref tui_creation_revolution "Example"
864 def MakeRevolution(self, theBase, theAxis, theAngle):
865 # Example: see GEOM_TestAll.py
866 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
867 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
870 ## The Same Revolution but in both ways forward&backward.
871 def MakeRevolution2Ways(self, theBase, theAxis, theAngle):
872 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
873 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
876 ## Create a filling from the given compound of contours.
877 # @param theShape the compound of contours
878 # @param theMinDeg a minimal degree of BSpline surface to create
879 # @param theMaxDeg a maximal degree of BSpline surface to create
880 # @param theTol2D a 2d tolerance to be reached
881 # @param theTol3D a 3d tolerance to be reached
882 # @param theNbIter a number of iteration of approximation algorithm
883 # @param isApprox if True, BSpline curves are generated in the process
884 # of surface construction. By default it is False, that means
885 # the surface is created using Besier curves. The usage of
886 # Approximation makes the algorithm work slower, but allows
887 # building the surface for rather complex cases
888 # @return New GEOM_Object, containing the created filling surface.
890 # @ref tui_creation_filling "Example"
891 def MakeFilling(self, theShape, theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter, isApprox=0):
892 # Example: see GEOM_TestAll.py
893 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
894 theTol2D, theTol3D, theNbIter, isApprox)
895 RaiseIfFailed("MakeFilling", self.PrimOp)
898 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
899 # @param theSeqSections - set of specified sections.
900 # @param theModeSolid - mode defining building solid or shell
901 # @param thePreci - precision 3D used for smoothing by default 1.e-6
902 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
903 # @return New GEOM_Object, containing the created shell or solid.
905 # @ref swig_todo "Example"
906 def MakeThruSections(self,theSeqSections,theModeSolid,thePreci,theRuled):
907 # Example: see GEOM_TestAll.py
908 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
909 RaiseIfFailed("MakeThruSections", self.PrimOp)
912 ## Create a shape by extrusion of the base shape along
913 # the path shape. The path shape can be a wire or an edge.
914 # @param theBase Base shape to be extruded.
915 # @param thePath Path shape to extrude the base shape along it.
916 # @return New GEOM_Object, containing the created pipe.
918 # @ref tui_creation_pipe "Example"
919 def MakePipe(self,theBase, thePath):
920 # Example: see GEOM_TestAll.py
921 anObj = self.PrimOp.MakePipe(theBase, thePath)
922 RaiseIfFailed("MakePipe", self.PrimOp)
925 ## Create a shape by extrusion of the profile shape along
926 # the path shape. The path shape can be a wire or an edge.
927 # the several profiles can be specified in the several locations of path.
928 # @param theSeqBases - list of Bases shape to be extruded.
929 # @param theLocations - list of locations on the path corresponding
930 # specified list of the Bases shapes. Number of locations
931 # should be equal to number of bases or list of locations can be empty.
932 # @param thePath - Path shape to extrude the base shape along it.
933 # @param theWithContact - the mode defining that the section is translated to be in
934 # contact with the spine.
935 # @param theWithCorrection - defining that the section is rotated to be
936 # orthogonal to the spine tangent in the correspondent point
937 # @return New GEOM_Object, containing the created pipe.
939 # @ref tui_creation_pipe_with_diff_sec "Example"
940 def MakePipeWithDifferentSections(self, theSeqBases,
941 theLocations, thePath,
942 theWithContact, theWithCorrection):
943 anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
944 theLocations, thePath,
945 theWithContact, theWithCorrection)
946 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
949 ## Create a shape by extrusion of the profile shape along
950 # the path shape. The path shape can be a wire or a edge.
951 # the several profiles can be specified in the several locations of path.
952 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
953 # shell or face. If number of faces in neighbour sections
954 # aren't coincided result solid between such sections will
955 # be created using external boundaries of this shells.
956 # @param theSeqSubBases - list of corresponding subshapes of section shapes.
957 # This list is used for searching correspondences between
958 # faces in the sections. Size of this list must be equal
959 # to size of list of base shapes.
960 # @param theLocations - list of locations on the path corresponding
961 # specified list of the Bases shapes. Number of locations
962 # should be equal to number of bases. First and last
963 # locations must be coincided with first and last vertexes
964 # of path correspondingly.
965 # @param thePath - Path shape to extrude the base shape along it.
966 # @param theWithContact - the mode defining that the section is translated to be in
967 # contact with the spine.
968 # @param theWithCorrection - defining that the section is rotated to be
969 # orthogonal to the spine tangent in the correspondent point
970 # @return New GEOM_Object, containing the created solids.
972 # @ref tui_creation_pipe_with_shell_sec "Example"
973 def MakePipeWithShellSections(self,theSeqBases, theSeqSubBases,
974 theLocations, thePath,
975 theWithContact, theWithCorrection):
976 anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
977 theLocations, thePath,
978 theWithContact, theWithCorrection)
979 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
982 ## Create a shape by extrusion of the profile shape along
983 # the path shape. This function is used only for debug pipe
984 # functionality - it is a version of previous function
985 # (MakePipeWithShellSections(...)) which give a possibility to
986 # recieve information about creating pipe between each pair of
987 # sections step by step.
988 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
989 theLocations, thePath,
990 theWithContact, theWithCorrection):
992 nbsect = len(theSeqBases)
993 nbsubsect = len(theSeqSubBases)
994 #print "nbsect = ",nbsect
995 for i in range(1,nbsect):
997 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
998 tmpLocations = [ theLocations[i-1], theLocations[i] ]
1000 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
1001 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
1002 tmpLocations, thePath,
1003 theWithContact, theWithCorrection)
1004 if self.PrimOp.IsDone() == 0:
1005 print "Problems with pipe creation between ",i," and ",i+1," sections"
1006 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
1009 print "Pipe between ",i," and ",i+1," sections is OK"
1014 resc = self.MakeCompound(res)
1015 #resc = self.MakeSewing(res, 0.001)
1016 #print "resc: ",resc
1019 ## Create solids between given sections
1020 # @param theSeqBases - list of sections (shell or face).
1021 # @param theLocations - list of corresponding vertexes
1022 # @return New GEOM_Object, containing the created solids.
1024 # @ref tui_creation_pipe_without_path "Example"
1025 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations):
1026 anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
1027 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
1030 ## Create a shape by extrusion of the base shape along
1031 # the path shape with constant bi-normal direction along the given vector.
1032 # The path shape can be a wire or an edge.
1033 # @param theBase Base shape to be extruded.
1034 # @param thePath Path shape to extrude the base shape along it.
1035 # @param theVec Vector defines a constant binormal direction to keep the
1036 # same angle beetween the direction and the sections
1037 # along the sweep surface.
1038 # @return New GEOM_Object, containing the created pipe.
1040 # @ref tui_creation_pipe "Example"
1041 def MakePipeBiNormalAlongVector(self,theBase, thePath, theVec):
1042 # Example: see GEOM_TestAll.py
1043 anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
1044 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
1050 ## @addtogroup l3_advanced
1053 ## Create a linear edge with specified ends.
1054 # @param thePnt1 Point for the first end of edge.
1055 # @param thePnt2 Point for the second end of edge.
1056 # @return New GEOM_Object, containing the created edge.
1058 # @ref tui_creation_edge "Example"
1059 def MakeEdge(self,thePnt1, thePnt2):
1060 # Example: see GEOM_TestAll.py
1061 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
1062 RaiseIfFailed("MakeEdge", self.ShapesOp)
1065 ## Create a wire from the set of edges and wires.
1066 # @param theEdgesAndWires List of edges and/or wires.
1067 # @return New GEOM_Object, containing the created wire.
1069 # @ref tui_creation_wire "Example"
1070 def MakeWire(self,theEdgesAndWires):
1071 # Example: see GEOM_TestAll.py
1072 anObj = self.ShapesOp.MakeWire(theEdgesAndWires)
1073 RaiseIfFailed("MakeWire", self.ShapesOp)
1076 ## Create a face on the given wire.
1077 # @param theWire closed Wire or Edge to build the face on.
1078 # @param isPlanarWanted If TRUE, only planar face will be built.
1079 # If impossible, NULL object will be returned.
1080 # @return New GEOM_Object, containing the created face.
1082 # @ref tui_creation_face "Example"
1083 def MakeFace(self,theWire, isPlanarWanted):
1084 # Example: see GEOM_TestAll.py
1085 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
1086 RaiseIfFailed("MakeFace", self.ShapesOp)
1089 ## Create a face on the given wires set.
1090 # @param theWires List of closed wires or edges to build the face on.
1091 # @param isPlanarWanted If TRUE, only planar face will be built.
1092 # If impossible, NULL object will be returned.
1093 # @return New GEOM_Object, containing the created face.
1095 # @ref tui_creation_face "Example"
1096 def MakeFaceWires(self,theWires, isPlanarWanted):
1097 # Example: see GEOM_TestAll.py
1098 anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
1099 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
1102 ## Shortcut to MakeFaceWires()
1104 # @ref tui_creation_face "Example 1"
1105 # \n @ref swig_MakeFaces "Example 2"
1106 def MakeFaces(self,theWires, isPlanarWanted):
1107 # Example: see GEOM_TestOthers.py
1108 anObj = self.MakeFaceWires(theWires, isPlanarWanted)
1111 ## Create a shell from the set of faces and shells.
1112 # @param theFacesAndShells List of faces and/or shells.
1113 # @return New GEOM_Object, containing the created shell.
1115 # @ref tui_creation_shell "Example"
1116 def MakeShell(self,theFacesAndShells):
1117 # Example: see GEOM_TestAll.py
1118 anObj = self.ShapesOp.MakeShell(theFacesAndShells)
1119 RaiseIfFailed("MakeShell", self.ShapesOp)
1122 ## Create a solid, bounded by the given shells.
1123 # @param theShells Sequence of bounding shells.
1124 # @return New GEOM_Object, containing the created solid.
1126 # @ref tui_creation_solid "Example"
1127 def MakeSolid(self,theShells):
1128 # Example: see GEOM_TestAll.py
1129 anObj = self.ShapesOp.MakeSolidShells(theShells)
1130 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
1133 ## Create a compound of the given shapes.
1134 # @param theShapes List of shapes to put in compound.
1135 # @return New GEOM_Object, containing the created compound.
1137 # @ref tui_creation_compound "Example"
1138 def MakeCompound(self,theShapes):
1139 # Example: see GEOM_TestAll.py
1140 anObj = self.ShapesOp.MakeCompound(theShapes)
1141 RaiseIfFailed("MakeCompound", self.ShapesOp)
1144 # end of l3_advanced
1147 ## @addtogroup l2_measure
1150 ## Gives quantity of faces in the given shape.
1151 # @param theShape Shape to count faces of.
1152 # @return Quantity of faces.
1154 # @ref swig_NumberOfFaces "Example"
1155 def NumberOfFaces(self,theShape):
1156 # Example: see GEOM_TestOthers.py
1157 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
1158 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
1161 ## Gives quantity of edges in the given shape.
1162 # @param theShape Shape to count edges of.
1163 # @return Quantity of edges.
1165 # @ref swig_NumberOfEdges "Example"
1166 def NumberOfEdges(self,theShape):
1167 # Example: see GEOM_TestOthers.py
1168 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
1169 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
1175 ## @addtogroup l3_healing
1178 ## Reverses an orientation the given shape.
1179 # @param theShape Shape to be reversed.
1180 # @return The reversed copy of theShape.
1182 # @ref swig_ChangeOrientation "Example"
1183 def ChangeOrientation(self,theShape):
1184 # Example: see GEOM_TestAll.py
1185 anObj = self.ShapesOp.ChangeOrientation(theShape)
1186 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
1189 ## Shortcut to ChangeOrientation()
1191 # @ref swig_OrientationChange "Example"
1192 def OrientationChange(self,theShape):
1193 # Example: see GEOM_TestOthers.py
1194 anObj = self.ChangeOrientation(theShape)
1200 ## @addtogroup l4_obtain
1203 ## Retrieve all free faces from the given shape.
1204 # Free face is a face, which is not shared between two shells of the shape.
1205 # @param theShape Shape to find free faces in.
1206 # @return List of IDs of all free faces, contained in theShape.
1208 # @ref tui_measurement_tools_page "Example"
1209 def GetFreeFacesIDs(self,theShape):
1210 # Example: see GEOM_TestOthers.py
1211 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
1212 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
1215 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
1216 # @param theShape1 Shape to find sub-shapes in.
1217 # @param theShape2 Shape to find shared sub-shapes with.
1218 # @param theShapeType Type of sub-shapes to be retrieved.
1219 # @return List of sub-shapes of theShape1, shared with theShape2.
1221 # @ref swig_GetSharedShapes "Example"
1222 def GetSharedShapes(self,theShape1, theShape2, theShapeType):
1223 # Example: see GEOM_TestOthers.py
1224 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
1225 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
1228 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
1229 # situated relatively the specified plane by the certain way,
1230 # defined through <VAR>theState</VAR> parameter.
1231 # @param theShape Shape to find sub-shapes of.
1232 # @param theShapeType Type of sub-shapes to be retrieved.
1233 # @param theAx1 Vector (or line, or linear edge), specifying normal
1234 # direction and location of the plane to find shapes on.
1235 # @param theState The state of the subshapes to find. It can be one of
1236 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1237 # @return List of all found sub-shapes.
1239 # @ref swig_GetShapesOnPlane "Example"
1240 def GetShapesOnPlane(self,theShape, theShapeType, theAx1, theState):
1241 # Example: see GEOM_TestOthers.py
1242 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
1243 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
1246 ## Works like the above method, but returns list of sub-shapes indices
1248 # @ref swig_GetShapesOnPlaneIDs "Example"
1249 def GetShapesOnPlaneIDs(self,theShape, theShapeType, theAx1, theState):
1250 # Example: see GEOM_TestOthers.py
1251 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
1252 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
1255 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
1256 # situated relatively the specified plane by the certain way,
1257 # defined through <VAR>theState</VAR> parameter.
1258 # @param theShape Shape to find sub-shapes of.
1259 # @param theShapeType Type of sub-shapes to be retrieved.
1260 # @param theAx1 Vector (or line, or linear edge), specifying normal
1261 # direction of the plane to find shapes on.
1262 # @param thePnt Point specifying location of the plane to find shapes on.
1263 # @param theState The state of the subshapes to find. It can be one of
1264 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1265 # @return List of all found sub-shapes.
1267 # @ref swig_GetShapesOnPlaneWithLocation "Example"
1268 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState):
1269 # Example: see GEOM_TestOthers.py
1270 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
1271 theAx1, thePnt, theState)
1272 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
1275 ## Works like the above method, but returns list of sub-shapes indices
1277 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
1278 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
1279 # Example: see GEOM_TestOthers.py
1280 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
1281 theAx1, thePnt, theState)
1282 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
1285 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1286 # the specified cylinder by the certain way, defined through \a theState parameter.
1287 # @param theShape Shape to find sub-shapes of.
1288 # @param theShapeType Type of sub-shapes to be retrieved.
1289 # @param theAxis Vector (or line, or linear edge), specifying
1290 # axis of the cylinder to find shapes on.
1291 # @param theRadius Radius of the cylinder to find shapes on.
1292 # @param theState The state of the subshapes to find. It can be one of
1293 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1294 # @return List of all found sub-shapes.
1296 # @ref swig_GetShapesOnCylinder "Example"
1297 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState):
1298 # Example: see GEOM_TestOthers.py
1299 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
1300 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
1303 ## Works like the above method, but returns list of sub-shapes indices
1305 # @ref swig_GetShapesOnCylinderIDs "Example"
1306 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
1307 # Example: see GEOM_TestOthers.py
1308 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
1309 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
1312 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1313 # the specified sphere by the certain way, defined through \a theState parameter.
1314 # @param theShape Shape to find sub-shapes of.
1315 # @param theShapeType Type of sub-shapes to be retrieved.
1316 # @param theCenter Point, specifying center of the sphere to find shapes on.
1317 # @param theRadius Radius of the sphere to find shapes on.
1318 # @param theState The state of the subshapes to find. It can be one of
1319 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1320 # @return List of all found sub-shapes.
1322 # @ref swig_GetShapesOnSphere "Example"
1323 def GetShapesOnSphere(self,theShape, theShapeType, theCenter, theRadius, theState):
1324 # Example: see GEOM_TestOthers.py
1325 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
1326 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
1329 ## Works like the above method, but returns list of sub-shapes indices
1331 # @ref swig_GetShapesOnSphereIDs "Example"
1332 def GetShapesOnSphereIDs(self,theShape, theShapeType, theCenter, theRadius, theState):
1333 # Example: see GEOM_TestOthers.py
1334 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
1335 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
1338 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1339 # the specified quadrangle by the certain way, defined through \a theState parameter.
1340 # @param theShape Shape to find sub-shapes of.
1341 # @param theShapeType Type of sub-shapes to be retrieved.
1342 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
1343 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
1344 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
1345 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
1346 # @param theState The state of the subshapes to find. It can be one of
1347 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1348 # @return List of all found sub-shapes.
1350 # @ref swig_GetShapesOnQuadrangle "Example"
1351 def GetShapesOnQuadrangle(self, theShape, theShapeType,
1352 theTopLeftPoint, theTopRigthPoint,
1353 theBottomLeftPoint, theBottomRigthPoint, theState):
1354 # Example: see GEOM_TestOthers.py
1355 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
1356 theTopLeftPoint, theTopRigthPoint,
1357 theBottomLeftPoint, theBottomRigthPoint, theState)
1358 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
1361 ## Works like the above method, but returns list of sub-shapes indices
1363 # @ref swig_GetShapesOnQuadrangleIDs "Example"
1364 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
1365 theTopLeftPoint, theTopRigthPoint,
1366 theBottomLeftPoint, theBottomRigthPoint, theState):
1367 # Example: see GEOM_TestOthers.py
1368 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
1369 theTopLeftPoint, theTopRigthPoint,
1370 theBottomLeftPoint, theBottomRigthPoint, theState)
1371 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
1374 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1375 # the specified \a theBox by the certain way, defined through \a theState parameter.
1376 # @param theBox Shape for relative comparing.
1377 # @param theShape Shape to find sub-shapes of.
1378 # @param theShapeType Type of sub-shapes to be retrieved.
1379 # @param theState The state of the subshapes to find. It can be one of
1380 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1381 # @return List of all found sub-shapes.
1383 # @ref swig_GetShapesOnBox "Example"
1384 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState):
1385 # Example: see GEOM_TestOthers.py
1386 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
1387 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
1390 ## Works like the above method, but returns list of sub-shapes indices
1392 # @ref swig_GetShapesOnBoxIDs "Example"
1393 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
1394 # Example: see GEOM_TestOthers.py
1395 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
1396 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
1399 ## Find in \a theShape all sub-shapes of type \a theShapeType,
1400 # situated relatively the specified \a theCheckShape by the
1401 # certain way, defined through \a theState parameter.
1402 # @param theCheckShape Shape for relative comparing.
1403 # @param theShape Shape to find sub-shapes of.
1404 # @param theShapeType Type of sub-shapes to be retrieved.
1405 # @param theState The state of the subshapes to find. It can be one of
1406 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1407 # @return List of all found sub-shapes.
1409 # @ref swig_GetShapesOnShape "Example"
1410 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState):
1411 # Example: see GEOM_TestOthers.py
1412 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
1413 theShapeType, theState)
1414 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
1417 ## Works like the above method, but returns result as compound
1419 # @ref swig_GetShapesOnShapeAsCompound "Example"
1420 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState):
1421 # Example: see GEOM_TestOthers.py
1422 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
1423 theShapeType, theState)
1424 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
1427 ## Works like the above method, but returns list of sub-shapes indices
1429 # @ref swig_GetShapesOnShapeIDs "Example"
1430 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
1431 # Example: see GEOM_TestOthers.py
1432 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
1433 theShapeType, theState)
1434 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
1437 ## Get sub-shape(s) of theShapeWhere, which are
1438 # coincident with \a theShapeWhat or could be a part of it.
1439 # @param theShapeWhere Shape to find sub-shapes of.
1440 # @param theShapeWhat Shape, specifying what to find.
1441 # @return Group of all found sub-shapes or a single found sub-shape.
1443 # @ref swig_GetInPlace "Example"
1444 def GetInPlace(self,theShapeWhere, theShapeWhat):
1445 # Example: see GEOM_TestOthers.py
1446 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
1447 RaiseIfFailed("GetInPlace", self.ShapesOp)
1450 ## Get sub-shape(s) of \a theShapeWhere, which are
1451 # coincident with \a theShapeWhat or could be a part of it.
1453 # Implementation of this method is based on a saved history of an operation,
1454 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
1455 # arguments (an argument shape or a sub-shape of an argument shape).
1456 # The operation could be the Partition or one of boolean operations,
1457 # performed on simple shapes (not on compounds).
1459 # @param theShapeWhere Shape to find sub-shapes of.
1460 # @param theShapeWhat Shape, specifying what to find (must be in the
1461 # building history of the ShapeWhere).
1462 # @return Group of all found sub-shapes or a single found sub-shape.
1464 # @ref swig_GetInPlace "Example"
1465 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat):
1466 # Example: see GEOM_TestOthers.py
1467 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
1468 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
1471 ## Get sub-shape of theShapeWhere, which is
1472 # equal to \a theShapeWhat.
1473 # @param theShapeWhere Shape to find sub-shape of.
1474 # @param theShapeWhat Shape, specifying what to find.
1475 # @return New GEOM_Object for found sub-shape.
1477 # @ref swig_GetSame "Example"
1478 def GetSame(self,theShapeWhere, theShapeWhat):
1479 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
1480 RaiseIfFailed("GetSame", self.ShapesOp)
1486 ## @addtogroup l4_access
1489 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
1490 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
1492 # @ref swig_all_decompose "Example"
1493 def GetSubShape(self, aShape, ListOfID):
1494 # Example: see GEOM_TestAll.py
1495 anObj = self.AddSubShape(aShape,ListOfID)
1498 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
1500 # @ref swig_all_decompose "Example"
1501 def GetSubShapeID(self, aShape, aSubShape):
1502 # Example: see GEOM_TestAll.py
1503 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
1504 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
1510 ## @addtogroup l4_decompose
1513 ## Explode a shape on subshapes of a given type.
1514 # @param aShape Shape to be exploded.
1515 # @param aType Type of sub-shapes to be retrieved.
1516 # @return List of sub-shapes of type theShapeType, contained in theShape.
1518 # @ref swig_all_decompose "Example"
1519 def SubShapeAll(self, aShape, aType):
1520 # Example: see GEOM_TestAll.py
1521 ListObj = self.ShapesOp.MakeExplode(aShape,aType,0)
1522 RaiseIfFailed("MakeExplode", self.ShapesOp)
1525 ## Explode a shape on subshapes of a given type.
1526 # @param aShape Shape to be exploded.
1527 # @param aType Type of sub-shapes to be retrieved.
1528 # @return List of IDs of sub-shapes.
1530 # @ref swig_all_decompose "Example"
1531 def SubShapeAllIDs(self, aShape, aType):
1532 ListObj = self.ShapesOp.SubShapeAllIDs(aShape,aType,0)
1533 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
1536 ## Explode a shape on subshapes of a given type.
1537 # Sub-shapes will be sorted by coordinates of their gravity centers.
1538 # @param aShape Shape to be exploded.
1539 # @param aType Type of sub-shapes to be retrieved.
1540 # @return List of sub-shapes of type theShapeType, contained in theShape.
1542 # @ref swig_SubShapeAllSorted "Example"
1543 def SubShapeAllSorted(self, aShape, aType):
1544 # Example: see GEOM_TestAll.py
1545 ListObj = self.ShapesOp.MakeExplode(aShape,aType,1)
1546 RaiseIfFailed("MakeExplode", self.ShapesOp)
1549 ## Explode a shape on subshapes of a given type.
1550 # Sub-shapes will be sorted by coordinates of their gravity centers.
1551 # @param aShape Shape to be exploded.
1552 # @param aType Type of sub-shapes to be retrieved.
1553 # @return List of IDs of sub-shapes.
1555 # @ref swig_all_decompose "Example"
1556 def SubShapeAllSortedIDs(self, aShape, aType):
1557 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape,aType,1)
1558 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
1561 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
1562 # selected by they indices in list of all sub-shapes of type <VAR>aType</VAR>.
1563 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
1565 # @ref swig_all_decompose "Example"
1566 def SubShape(self, aShape, aType, ListOfInd):
1567 # Example: see GEOM_TestAll.py
1569 AllShapeList = self.SubShapeAll(aShape, aType)
1570 for ind in ListOfInd:
1571 ListOfIDs.append(self.GetSubShapeID(aShape, AllShapeList[ind - 1]))
1572 anObj = self.GetSubShape(aShape, ListOfIDs)
1575 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
1576 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
1577 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
1579 # @ref swig_all_decompose "Example"
1580 def SubShapeSorted(self,aShape, aType, ListOfInd):
1581 # Example: see GEOM_TestAll.py
1583 AllShapeList = self.SubShapeAllSorted(aShape, aType)
1584 for ind in ListOfInd:
1585 ListOfIDs.append(self.GetSubShapeID(aShape, AllShapeList[ind - 1]))
1586 anObj = self.GetSubShape(aShape, ListOfIDs)
1589 # end of l4_decompose
1592 ## @addtogroup l3_healing
1595 ## Apply a sequence of Shape Healing operators to the given object.
1596 # @param theShape Shape to be processed.
1597 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
1598 # @param theParameters List of names of parameters
1599 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
1600 # @param theValues List of values of parameters, in the same order
1601 # as parameters are listed in <VAR>theParameters</VAR> list.
1602 # @return New GEOM_Object, containing processed shape.
1604 # @ref tui_shape_processing "Example"
1605 def ProcessShape(self,theShape, theOperators, theParameters, theValues):
1606 # Example: see GEOM_TestHealing.py
1607 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
1608 RaiseIfFailed("ProcessShape", self.HealOp)
1611 ## Remove faces from the given object (shape).
1612 # @param theObject Shape to be processed.
1613 # @param theFaces Indices of faces to be removed, if EMPTY then the method
1614 # removes ALL faces of the given object.
1615 # @return New GEOM_Object, containing processed shape.
1617 # @ref tui_suppress_faces "Example"
1618 def SuppressFaces(self,theObject, theFaces):
1619 # Example: see GEOM_TestHealing.py
1620 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
1621 RaiseIfFailed("SuppressFaces", self.HealOp)
1624 ## Sewing of some shapes into single shape.
1626 # @ref tui_sewing "Example"
1627 def MakeSewing(self, ListShape, theTolerance):
1628 # Example: see GEOM_TestHealing.py
1629 comp = self.MakeCompound(ListShape)
1630 anObj = self.Sew(comp, theTolerance)
1633 ## Sewing of the given object.
1634 # @param theObject Shape to be processed.
1635 # @param theTolerance Required tolerance value.
1636 # @return New GEOM_Object, containing processed shape.
1637 def Sew(self, theObject, theTolerance):
1638 # Example: see MakeSewing() above
1639 anObj = self.HealOp.Sew(theObject, theTolerance)
1640 RaiseIfFailed("Sew", self.HealOp)
1643 ## Remove internal wires and edges from the given object (face).
1644 # @param theObject Shape to be processed.
1645 # @param theWires Indices of wires to be removed, if EMPTY then the method
1646 # removes ALL internal wires of the given object.
1647 # @return New GEOM_Object, containing processed shape.
1649 # @ref tui_suppress_internal_wires "Example"
1650 def SuppressInternalWires(self,theObject, theWires):
1651 # Example: see GEOM_TestHealing.py
1652 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
1653 RaiseIfFailed("RemoveIntWires", self.HealOp)
1656 ## Remove internal closed contours (holes) from the given object.
1657 # @param theObject Shape to be processed.
1658 # @param theWires Indices of wires to be removed, if EMPTY then the method
1659 # removes ALL internal holes of the given object
1660 # @return New GEOM_Object, containing processed shape.
1662 # @ref tui_suppress_holes "Example"
1663 def SuppressHoles(self,theObject, theWires):
1664 # Example: see GEOM_TestHealing.py
1665 anObj = self.HealOp.FillHoles(theObject, theWires)
1666 RaiseIfFailed("FillHoles", self.HealOp)
1669 ## Close an open wire.
1670 # @param theObject Shape to be processed.
1671 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
1672 # if -1, then <VAR>theObject</VAR> itself is a wire.
1673 # @param isCommonVertex If TRUE : closure by creation of a common vertex,
1674 # If FALS : closure by creation of an edge between ends.
1675 # @return New GEOM_Object, containing processed shape.
1677 # @ref tui_close_contour "Example"
1678 def CloseContour(self,theObject, theWires, isCommonVertex):
1679 # Example: see GEOM_TestHealing.py
1680 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
1681 RaiseIfFailed("CloseContour", self.HealOp)
1684 ## Addition of a point to a given edge object.
1685 # @param theObject Shape to be processed.
1686 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
1687 # if -1, then theObject itself is the edge.
1688 # @param theValue Value of parameter on edge or length parameter,
1689 # depending on \a isByParameter.
1690 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1],
1691 # if FALSE : \a theValue is treated as a length parameter [0..1]
1692 # @return New GEOM_Object, containing processed shape.
1694 # @ref tui_add_point_on_edge "Example"
1695 def DivideEdge(self,theObject, theEdgeIndex, theValue, isByParameter):
1696 # Example: see GEOM_TestHealing.py
1697 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
1698 RaiseIfFailed("DivideEdge", self.HealOp)
1701 ## Change orientation of the given object. Updates given shape.
1702 # @param theObject Shape to be processed.
1704 # @ref swig_todo "Example"
1705 def ChangeOrientationShell(self,theObject):
1706 theObject = self.HealOp.ChangeOrientation(theObject)
1707 RaiseIfFailed("ChangeOrientation", self.HealOp)
1710 ## Change orientation of the given object.
1711 # @param theObject Shape to be processed.
1712 # @return New GEOM_Object, containing processed shape.
1714 # @ref swig_todo "Example"
1715 def ChangeOrientationShellCopy(self,theObject):
1716 anObj = self.HealOp.ChangeOrientationCopy(theObject)
1717 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
1720 ## Get a list of wires (wrapped in GEOM_Object-s),
1721 # that constitute a free boundary of the given shape.
1722 # @param theObject Shape to get free boundary of.
1723 # @return [status, theClosedWires, theOpenWires]
1724 # status: FALSE, if an error(s) occured during the method execution.
1725 # theClosedWires: Closed wires on the free boundary of the given shape.
1726 # theOpenWires: Open wires on the free boundary of the given shape.
1728 # @ref tui_measurement_tools_page "Example"
1729 def GetFreeBoundary(self,theObject):
1730 # Example: see GEOM_TestHealing.py
1731 anObj = self.HealOp.GetFreeBoundary(theObject)
1732 RaiseIfFailed("GetFreeBoundary", self.HealOp)
1735 ## Replace coincident faces in theShape by one face.
1736 # @param theShape Initial shape.
1737 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
1738 # @param doKeepNonSolids If FALSE, only solids will present in the result,
1739 # otherwise all initial shapes.
1740 # @return New GEOM_Object, containing a copy of theShape without coincident faces.
1742 # @ref tui_glue_faces "Example"
1743 def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True):
1744 # Example: see GEOM_Spanner.py
1745 anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
1747 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
1750 ## Find coincident faces in theShape for possible gluing.
1751 # @param theShape Initial shape.
1752 # @param theTolerance Maximum distance between faces,
1753 # which can be considered as coincident.
1756 # @ref swig_todo "Example"
1757 def GetGlueFaces(self, theShape, theTolerance):
1758 # Example: see GEOM_Spanner.py
1759 anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
1760 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
1763 ## Replace coincident faces in theShape by one face
1764 # in compliance with given list of faces
1765 # @param theShape Initial shape.
1766 # @param theTolerance Maximum distance between faces,
1767 # which can be considered as coincident.
1768 # @param theFaces List of faces for gluing.
1769 # @param doKeepNonSolids If FALSE, only solids will present in the result,
1770 # otherwise all initial shapes.
1771 # @return New GEOM_Object, containing a copy of theShape
1772 # without some faces.
1774 # @ref swig_todo "Example"
1775 def MakeGlueFacesByList(self, theShape, theTolerance, theFaces, doKeepNonSolids=True):
1776 # Example: see GEOM_Spanner.py
1777 anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces, doKeepNonSolids)
1779 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
1785 ## @addtogroup l3_boolean Boolean Operations
1788 # -----------------------------------------------------------------------------
1789 # Boolean (Common, Cut, Fuse, Section)
1790 # -----------------------------------------------------------------------------
1792 ## Perform one of boolean operations on two given shapes.
1793 # @param theShape1 First argument for boolean operation.
1794 # @param theShape2 Second argument for boolean operation.
1795 # @param theOperation Indicates the operation to be done:
1796 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
1797 # @return New GEOM_Object, containing the result shape.
1799 # @ref tui_fuse "Example"
1800 def MakeBoolean(self,theShape1, theShape2, theOperation):
1801 # Example: see GEOM_TestAll.py
1802 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation)
1803 RaiseIfFailed("MakeBoolean", self.BoolOp)
1806 ## Shortcut to MakeBoolean(s1, s2, 1)
1808 # @ref tui_common "Example 1"
1809 # \n @ref swig_MakeCommon "Example 2"
1810 def MakeCommon(self, s1, s2):
1811 # Example: see GEOM_TestOthers.py
1812 return self.MakeBoolean(s1, s2, 1)
1814 ## Shortcut to MakeBoolean(s1, s2, 2)
1816 # @ref tui_cut "Example 1"
1817 # \n @ref swig_MakeCommon "Example 2"
1818 def MakeCut(self, s1, s2):
1819 # Example: see GEOM_TestOthers.py
1820 return self.MakeBoolean(s1, s2, 2)
1822 ## Shortcut to MakeBoolean(s1, s2, 3)
1824 # @ref tui_fuse "Example 1"
1825 # \n @ref swig_MakeCommon "Example 2"
1826 def MakeFuse(self, s1, s2):
1827 # Example: see GEOM_TestOthers.py
1828 return self.MakeBoolean(s1, s2, 3)
1830 ## Shortcut to MakeBoolean(s1, s2, 4)
1832 # @ref tui_section "Example 1"
1833 # \n @ref swig_MakeCommon "Example 2"
1834 def MakeSection(self, s1, s2):
1835 # Example: see GEOM_TestOthers.py
1836 return self.MakeBoolean(s1, s2, 4)
1841 ## @addtogroup l3_basic_op
1844 ## Perform partition operation.
1845 # @param ListShapes Shapes to be intersected.
1846 # @param ListTools Shapes to intersect theShapes.
1847 # !!!NOTE: Each compound from ListShapes and ListTools will be exploded
1848 # in order to avoid possible intersection between shapes from
1850 # @param Limit Type of resulting shapes (corresponding to TopAbs_ShapeEnum).
1851 # @param KeepNonlimitShapes: if this parameter == 0 - only shapes with
1852 # type <= Limit are kept in the result,
1853 # else - shapes with type > Limit are kept
1854 # also (if they exist)
1856 # After implementation new version of PartitionAlgo (October 2006)
1857 # other parameters are ignored by current functionality. They are kept
1858 # in this function only for support old versions.
1859 # Ignored parameters:
1860 # @param ListKeepInside Shapes, outside which the results will be deleted.
1861 # Each shape from theKeepInside must belong to theShapes also.
1862 # @param ListRemoveInside Shapes, inside which the results will be deleted.
1863 # Each shape from theRemoveInside must belong to theShapes also.
1864 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
1865 # @param ListMaterials Material indices for each shape. Make sence,
1866 # only if theRemoveWebs is TRUE.
1868 # @return New GEOM_Object, containing the result shapes.
1870 # @ref tui_partition "Example"
1871 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
1872 Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
1873 KeepNonlimitShapes=0):
1874 # Example: see GEOM_TestAll.py
1875 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
1876 ListKeepInside, ListRemoveInside,
1877 Limit, RemoveWebs, ListMaterials,
1878 KeepNonlimitShapes);
1879 RaiseIfFailed("MakePartition", self.BoolOp)
1882 ## Perform partition operation.
1883 # This method may be useful if it is needed to make a partition for
1884 # compound contains nonintersected shapes. Performance will be better
1885 # since intersection between shapes from compound is not performed.
1887 # Description of all parameters as in previous method MakePartition()
1889 # !!!NOTE: Passed compounds (via ListShapes or via ListTools)
1890 # have to consist of nonintersecting shapes.
1892 # @return New GEOM_Object, containing the result shapes.
1894 # @ref swig_todo "Example"
1895 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
1896 ListKeepInside=[], ListRemoveInside=[],
1897 Limit=ShapeType["SHAPE"], RemoveWebs=0,
1898 ListMaterials=[], KeepNonlimitShapes=0):
1899 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
1900 ListKeepInside, ListRemoveInside,
1901 Limit, RemoveWebs, ListMaterials,
1902 KeepNonlimitShapes);
1903 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
1906 ## Shortcut to MakePartition()
1908 # @ref tui_partition "Example 1"
1909 # \n @ref swig_Partition "Example 2"
1910 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
1911 Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
1912 KeepNonlimitShapes=0):
1913 # Example: see GEOM_TestOthers.py
1914 anObj = self.MakePartition(ListShapes, ListTools,
1915 ListKeepInside, ListRemoveInside,
1916 Limit, RemoveWebs, ListMaterials,
1917 KeepNonlimitShapes);
1920 ## Perform partition of the Shape with the Plane
1921 # @param theShape Shape to be intersected.
1922 # @param thePlane Tool shape, to intersect theShape.
1923 # @return New GEOM_Object, containing the result shape.
1925 # @ref tui_partition "Example"
1926 def MakeHalfPartition(self,theShape, thePlane):
1927 # Example: see GEOM_TestAll.py
1928 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
1929 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
1932 # end of l3_basic_op
1935 ## @addtogroup l3_transform
1938 ## Translate the given object along the vector, specified
1939 # by its end points, creating its copy before the translation.
1940 # @param theObject The object to be translated.
1941 # @param thePoint1 Start point of translation vector.
1942 # @param thePoint2 End point of translation vector.
1943 # @return New GEOM_Object, containing the translated object.
1945 # @ref tui_translation "Example 1"
1946 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
1947 def MakeTranslationTwoPoints(self,theObject, thePoint1, thePoint2):
1948 # Example: see GEOM_TestAll.py
1949 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
1950 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
1953 ## Translate the given object along the vector, specified
1954 # by its components, creating its copy before the translation.
1955 # @param theObject The object to be translated.
1956 # @param theDX,theDY,theDZ Components of translation vector.
1957 # @return New GEOM_Object, containing the translated object.
1959 # @ref tui_translation "Example"
1960 def MakeTranslation(self,theObject, theDX, theDY, theDZ):
1961 # Example: see GEOM_TestAll.py
1962 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
1963 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
1966 ## Translate the given object along the given vector,
1967 # creating its copy before the translation.
1968 # @param theObject The object to be translated.
1969 # @param theVector The translation vector.
1970 # @return New GEOM_Object, containing the translated object.
1972 # @ref tui_translation "Example"
1973 def MakeTranslationVector(self,theObject, theVector):
1974 # Example: see GEOM_TestAll.py
1975 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
1976 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
1979 ## Translate the given object along the given vector on given distance,
1980 # creating its copy before the translation.
1981 # @param theObject The object to be translated.
1982 # @param theVector The translation vector.
1983 # @param theDistance The translation distance.
1984 # @return New GEOM_Object, containing the translated object.
1986 # @ref tui_translation "Example"
1987 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance):
1988 # Example: see GEOM_TestAll.py
1989 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
1990 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
1993 ## Rotate the given object around the given axis
1994 # on the given angle, creating its copy before the rotatation.
1995 # @param theObject The object to be rotated.
1996 # @param theAxis Rotation axis.
1997 # @param theAngle Rotation angle in radians.
1998 # @return New GEOM_Object, containing the rotated object.
2000 # @ref tui_rotation "Example"
2001 def MakeRotation(self,theObject, theAxis, theAngle):
2002 # Example: see GEOM_TestAll.py
2003 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
2004 RaiseIfFailed("RotateCopy", self.TrsfOp)
2007 ## Rotate given object around vector perpendicular to plane
2008 # containing three points, creating its copy before the rotatation.
2009 # @param theObject The object to be rotated.
2010 # @param theCentPoint central point - the axis is the vector perpendicular to the plane
2011 # containing the three points.
2012 # @param thePoint1,thePoint2 - in a perpendicular plane of the axis.
2013 # @return New GEOM_Object, containing the rotated object.
2015 # @ref tui_rotation "Example"
2016 def MakeRotationThreePoints(self,theObject, theCentPoint, thePoint1, thePoint2):
2017 # Example: see GEOM_TestAll.py
2018 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
2019 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
2022 ## Scale the given object by the factor, creating its copy before the scaling.
2023 # @param theObject The object to be scaled.
2024 # @param thePoint Center point for scaling.
2025 # Passing None for it means scaling relatively the origin of global CS.
2026 # @param theFactor Scaling factor value.
2027 # @return New GEOM_Object, containing the scaled shape.
2029 # @ref tui_scale "Example"
2030 def MakeScaleTransform(self, theObject, thePoint, theFactor):
2031 # Example: see GEOM_TestAll.py
2032 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
2033 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
2036 ## Scale the given object by different factors along coordinate axes,
2037 # creating its copy before the scaling.
2038 # @param theObject The object to be scaled.
2039 # @param thePoint Center point for scaling.
2040 # Passing None for it means scaling relatively the origin of global CS.
2041 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
2042 # @return New GEOM_Object, containing the scaled shape.
2044 # @ref swig_scale "Example"
2045 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ):
2046 # Example: see GEOM_TestAll.py
2047 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
2048 theFactorX, theFactorY, theFactorZ)
2049 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
2052 ## Create an object, symmetrical
2053 # to the given one relatively the given plane.
2054 # @param theObject The object to be mirrored.
2055 # @param thePlane Plane of symmetry.
2056 # @return New GEOM_Object, containing the mirrored shape.
2058 # @ref tui_mirror "Example"
2059 def MakeMirrorByPlane(self,theObject, thePlane):
2060 # Example: see GEOM_TestAll.py
2061 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
2062 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
2065 ## Create an object, symmetrical
2066 # to the given one relatively the given axis.
2067 # @param theObject The object to be mirrored.
2068 # @param theAxis Axis of symmetry.
2069 # @return New GEOM_Object, containing the mirrored shape.
2071 # @ref tui_mirror "Example"
2072 def MakeMirrorByAxis(self,theObject, theAxis):
2073 # Example: see GEOM_TestAll.py
2074 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
2075 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
2078 ## Create an object, symmetrical
2079 # to the given one relatively the given point.
2080 # @param theObject The object to be mirrored.
2081 # @param thePoint Point of symmetry.
2082 # @return New GEOM_Object, containing the mirrored shape.
2084 # @ref tui_mirror "Example"
2085 def MakeMirrorByPoint(self,theObject, thePoint):
2086 # Example: see GEOM_TestAll.py
2087 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
2088 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
2091 ## Modify the Location of the given object by LCS,
2092 # creating its copy before the setting.
2093 # @param theObject The object to be displaced.
2094 # @param theStartLCS Coordinate system to perform displacement from it.
2095 # If \a theStartLCS is NULL, displacement
2096 # will be performed from global CS.
2097 # If \a theObject itself is used as \a theStartLCS,
2098 # its location will be changed to \a theEndLCS.
2099 # @param theEndLCS Coordinate system to perform displacement to it.
2100 # @return New GEOM_Object, containing the displaced shape.
2102 # @ref tui_modify_location "Example"
2103 def MakePosition(self,theObject, theStartLCS, theEndLCS):
2104 # Example: see GEOM_TestAll.py
2105 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
2106 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
2109 ## Create new object as offset of the given one.
2110 # @param theObject The base object for the offset.
2111 # @param theOffset Offset value.
2112 # @return New GEOM_Object, containing the offset object.
2114 # @ref tui_offset "Example"
2115 def MakeOffset(self,theObject, theOffset):
2116 # Example: see GEOM_TestAll.py
2117 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
2118 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
2121 # -----------------------------------------------------------------------------
2123 # -----------------------------------------------------------------------------
2125 ## Translate the given object along the given vector a given number times
2126 # @param theObject The object to be translated.
2127 # @param theVector Direction of the translation.
2128 # @param theStep Distance to translate on.
2129 # @param theNbTimes Quantity of translations to be done.
2130 # @return New GEOM_Object, containing compound of all
2131 # the shapes, obtained after each translation.
2133 # @ref tui_multi_translation "Example"
2134 def MakeMultiTranslation1D(self,theObject, theVector, theStep, theNbTimes):
2135 # Example: see GEOM_TestAll.py
2136 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
2137 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
2140 ## Conseqently apply two specified translations to theObject specified number of times.
2141 # @param theObject The object to be translated.
2142 # @param theVector1 Direction of the first translation.
2143 # @param theStep1 Step of the first translation.
2144 # @param theNbTimes1 Quantity of translations to be done along theVector1.
2145 # @param theVector2 Direction of the second translation.
2146 # @param theStep2 Step of the second translation.
2147 # @param theNbTimes2 Quantity of translations to be done along theVector2.
2148 # @return New GEOM_Object, containing compound of all
2149 # the shapes, obtained after each translation.
2151 # @ref tui_multi_translation "Example"
2152 def MakeMultiTranslation2D(self,theObject, theVector1, theStep1, theNbTimes1,
2153 theVector2, theStep2, theNbTimes2):
2154 # Example: see GEOM_TestAll.py
2155 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
2156 theVector2, theStep2, theNbTimes2)
2157 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
2160 ## Rotate the given object around the given axis a given number times.
2161 # Rotation angle will be 2*PI/theNbTimes.
2162 # @param theObject The object to be rotated.
2163 # @param theAxis The rotation axis.
2164 # @param theNbTimes Quantity of rotations to be done.
2165 # @return New GEOM_Object, containing compound of all the
2166 # shapes, obtained after each rotation.
2168 # @ref tui_multi_rotation "Example"
2169 def MultiRotate1D(self,theObject, theAxis, theNbTimes):
2170 # Example: see GEOM_TestAll.py
2171 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
2172 RaiseIfFailed("MultiRotate1D", self.TrsfOp)
2175 ## Rotate the given object around the
2176 # given axis on the given angle a given number
2177 # times and multi-translate each rotation result.
2178 # Translation direction passes through center of gravity
2179 # of rotated shape and its projection on the rotation axis.
2180 # @param theObject The object to be rotated.
2181 # @param theAxis Rotation axis.
2182 # @param theAngle Rotation angle in graduces.
2183 # @param theNbTimes1 Quantity of rotations to be done.
2184 # @param theStep Translation distance.
2185 # @param theNbTimes2 Quantity of translations to be done.
2186 # @return New GEOM_Object, containing compound of all the
2187 # shapes, obtained after each transformation.
2189 # @ref tui_multi_rotation "Example"
2190 def MultiRotate2D(self,theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2):
2191 # Example: see GEOM_TestAll.py
2192 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
2193 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
2196 ## The same, as MultiRotate1D(), but axis is given by direction and point
2197 # @ref swig_MakeMultiRotation "Example"
2198 def MakeMultiRotation1D(self,aShape,aDir,aPoint,aNbTimes):
2199 # Example: see GEOM_TestOthers.py
2200 aVec = self.MakeLine(aPoint,aDir)
2201 anObj = self.MultiRotate1D(aShape,aVec,aNbTimes)
2204 ## The same, as MultiRotate2D(), but axis is given by direction and point
2205 # @ref swig_MakeMultiRotation "Example"
2206 def MakeMultiRotation2D(self,aShape,aDir,aPoint,anAngle,nbtimes1,aStep,nbtimes2):
2207 # Example: see GEOM_TestOthers.py
2208 aVec = self.MakeLine(aPoint,aDir)
2209 anObj = self.MultiRotate2D(aShape,aVec,anAngle,nbtimes1,aStep,nbtimes2)
2212 # end of l3_transform
2215 ## @addtogroup l3_local
2218 ## Perform a fillet on all edges of the given shape.
2219 # @param theShape Shape, to perform fillet on.
2220 # @param theR Fillet radius.
2221 # @return New GEOM_Object, containing the result shape.
2223 # @ref tui_fillet "Example 1"
2224 # \n @ref swig_MakeFilletAll "Example 2"
2225 def MakeFilletAll(self,theShape, theR):
2226 # Example: see GEOM_TestOthers.py
2227 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
2228 RaiseIfFailed("MakeFilletAll", self.LocalOp)
2231 ## Perform a fillet on the specified edges/faces of the given shape
2232 # @param theShape Shape, to perform fillet on.
2233 # @param theR Fillet radius.
2234 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR>.
2235 # @param theListShapes Global indices of edges/faces to perform fillet on.
2236 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2237 # @return New GEOM_Object, containing the result shape.
2239 # @ref tui_fillet "Example"
2240 def MakeFillet(self,theShape, theR, theShapeType, theListShapes):
2241 # Example: see GEOM_TestAll.py
2243 if theShapeType == ShapeType["EDGE"]:
2244 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
2245 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
2247 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
2248 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
2251 ## The same that MakeFillet but with two Fillet Radius R1 and R2
2252 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes):
2254 if theShapeType == ShapeType["EDGE"]:
2255 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
2256 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
2258 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
2259 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
2262 ## Perform a symmetric chamfer on all edges of the given shape.
2263 # @param theShape Shape, to perform chamfer on.
2264 # @param theD Chamfer size along each face.
2265 # @return New GEOM_Object, containing the result shape.
2267 # @ref tui_chamfer "Example 1"
2268 # \n @ref swig_MakeChamferAll "Example 2"
2269 def MakeChamferAll(self,theShape, theD):
2270 # Example: see GEOM_TestOthers.py
2271 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
2272 RaiseIfFailed("MakeChamferAll", self.LocalOp)
2275 ## Perform a chamfer on edges, common to the specified faces,
2276 # with distance D1 on the Face1
2277 # @param theShape Shape, to perform chamfer on.
2278 # @param theD1 Chamfer size along \a theFace1.
2279 # @param theD2 Chamfer size along \a theFace2.
2280 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
2281 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2282 # @return New GEOM_Object, containing the result shape.
2284 # @ref tui_chamfer "Example"
2285 def MakeChamferEdge(self,theShape, theD1, theD2, theFace1, theFace2):
2286 # Example: see GEOM_TestAll.py
2287 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
2288 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
2291 ## The Same that MakeChamferEdge but with params theD is chamfer length and
2292 # theAngle is Angle of chamfer (angle in radians)
2293 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2):
2294 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
2295 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
2298 ## Perform a chamfer on all edges of the specified faces,
2299 # with distance D1 on the first specified face (if several for one edge)
2300 # @param theShape Shape, to perform chamfer on.
2301 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
2302 # connected to the edge, are in \a theFaces, \a theD1
2303 # will be get along face, which is nearer to \a theFaces beginning.
2304 # @param theD2 Chamfer size along another of two faces, connected to the edge.
2305 # @param theFaces Sequence of global indices of faces of \a theShape.
2306 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2307 # @return New GEOM_Object, containing the result shape.
2309 # @ref tui_chamfer "Example"
2310 def MakeChamferFaces(self,theShape, theD1, theD2, theFaces):
2311 # Example: see GEOM_TestAll.py
2312 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
2313 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
2316 ## The Same that MakeChamferFaces but with params theD is chamfer lenght and
2317 # theAngle is Angle of chamfer (angle in radians)
2319 # @ref swig_FilletChamfer "Example"
2320 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces):
2321 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
2322 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
2325 ## Perform a chamfer on edges,
2326 # with distance D1 on the first specified face (if several for one edge)
2327 # @param theShape Shape, to perform chamfer on.
2328 # @param theD1,theD2 Chamfer size
2329 # @param theEdges Sequence of edges of \a theShape.
2330 # @return New GEOM_Object, containing the result shape.
2332 # @ref swig_FilletChamfer "Example"
2333 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges):
2334 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
2335 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
2338 ## The Same that MakeChamferEdges but with params theD is chamfer lenght and
2339 # theAngle is Angle of chamfer (angle in radians)
2340 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges):
2341 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
2342 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
2345 ## Shortcut to MakeChamferEdge() and MakeChamferFaces()
2347 # @ref swig_MakeChamfer "Example"
2348 def MakeChamfer(self,aShape,d1,d2,aShapeType,ListShape):
2349 # Example: see GEOM_TestOthers.py
2351 if aShapeType == ShapeType["EDGE"]:
2352 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1])
2354 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape)
2360 ## @addtogroup l3_basic_op
2363 ## Perform an Archimde operation on the given shape with given parameters.
2364 # The object presenting the resulting face is returned.
2365 # @param theShape Shape to be put in water.
2366 # @param theWeight Weight og the shape.
2367 # @param theWaterDensity Density of the water.
2368 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
2369 # @return New GEOM_Object, containing a section of \a theShape
2370 # by a plane, corresponding to water level.
2372 # @ref tui_archimede "Example"
2373 def Archimede(self,theShape, theWeight, theWaterDensity, theMeshDeflection):
2374 # Example: see GEOM_TestAll.py
2375 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
2376 RaiseIfFailed("MakeArchimede", self.LocalOp)
2379 # end of l3_basic_op
2382 ## @addtogroup l2_measure
2385 ## Get point coordinates
2388 # @ref tui_measurement_tools_page "Example"
2389 def PointCoordinates(self,Point):
2390 # Example: see GEOM_TestMeasures.py
2391 aTuple = self.MeasuOp.PointCoordinates(Point)
2392 RaiseIfFailed("PointCoordinates", self.MeasuOp)
2395 ## Get summarized length of all wires,
2396 # area of surface and volume of the given shape.
2397 # @param theShape Shape to define properties of.
2398 # @return [theLength, theSurfArea, theVolume]
2399 # theLength: Summarized length of all wires of the given shape.
2400 # theSurfArea: Area of surface of the given shape.
2401 # theVolume: Volume of the given shape.
2403 # @ref tui_measurement_tools_page "Example"
2404 def BasicProperties(self,theShape):
2405 # Example: see GEOM_TestMeasures.py
2406 aTuple = self.MeasuOp.GetBasicProperties(theShape)
2407 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
2410 ## Get parameters of bounding box of the given shape
2411 # @param theShape Shape to obtain bounding box of.
2412 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
2413 # Xmin,Xmax: Limits of shape along OX axis.
2414 # Ymin,Ymax: Limits of shape along OY axis.
2415 # Zmin,Zmax: Limits of shape along OZ axis.
2417 # @ref tui_measurement_tools_page "Example"
2418 def BoundingBox(self,theShape):
2419 # Example: see GEOM_TestMeasures.py
2420 aTuple = self.MeasuOp.GetBoundingBox(theShape)
2421 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
2424 ## Get inertia matrix and moments of inertia of theShape.
2425 # @param theShape Shape to calculate inertia of.
2426 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
2427 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
2428 # Ix,Iy,Iz: Moments of inertia of the given shape.
2430 # @ref tui_measurement_tools_page "Example"
2431 def Inertia(self,theShape):
2432 # Example: see GEOM_TestMeasures.py
2433 aTuple = self.MeasuOp.GetInertia(theShape)
2434 RaiseIfFailed("GetInertia", self.MeasuOp)
2437 ## Get minimal distance between the given shapes.
2438 # @param theShape1,theShape2 Shapes to find minimal distance between.
2439 # @return Value of the minimal distance between the given shapes.
2441 # @ref tui_measurement_tools_page "Example"
2442 def MinDistance(self, theShape1, theShape2):
2443 # Example: see GEOM_TestMeasures.py
2444 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
2445 RaiseIfFailed("GetMinDistance", self.MeasuOp)
2448 ## Get minimal distance between the given shapes.
2449 # @param theShape1,theShape2 Shapes to find minimal distance between.
2450 # @return Value of the minimal distance between the given shapes.
2452 # @ref swig_all_measure "Example"
2453 def MinDistanceComponents(self, theShape1, theShape2):
2454 # Example: see GEOM_TestMeasures.py
2455 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
2456 RaiseIfFailed("GetMinDistance", self.MeasuOp)
2457 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
2460 ## Get angle between the given shapes in degrees.
2461 # @param theShape1,theShape2 Lines or linear edges to find angle between.
2462 # @return Value of the angle between the given shapes in degrees.
2464 # @ref tui_measurement_tools_page "Example"
2465 def GetAngle(self, theShape1, theShape2):
2466 # Example: see GEOM_TestMeasures.py
2467 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
2468 RaiseIfFailed("GetAngle", self.MeasuOp)
2470 ## Get angle between the given shapes in radians.
2471 # @param theShape1,theShape2 Lines or linear edges to find angle between.
2472 # @return Value of the angle between the given shapes in radians.
2474 # @ref tui_measurement_tools_page "Example"
2475 def GetAngleRadians(self, theShape1, theShape2):
2476 # Example: see GEOM_TestMeasures.py
2477 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
2478 RaiseIfFailed("GetAngle", self.MeasuOp)
2481 ## @name Curve Curvature Measurement
2482 # Methods for receiving radius of curvature of curves
2483 # in the given point
2486 ## Measure curvature of a curve at a point, set by parameter.
2487 # @ref swig_todo "Example"
2488 def CurveCurvatureByParam(self, theCurve, theParam):
2489 # Example: see GEOM_TestMeasures.py
2490 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
2491 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
2495 # @ref swig_todo "Example"
2496 def CurveCurvatureByPoint(self, theCurve, thePoint):
2497 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
2498 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
2502 ## @name Surface Curvature Measurement
2503 # Methods for receiving max and min radius of curvature of surfaces
2504 # in the given point
2508 ## @ref swig_todo "Example"
2509 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
2510 # Example: see GEOM_TestMeasures.py
2511 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
2512 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
2516 ## @ref swig_todo "Example"
2517 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
2518 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
2519 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
2523 ## @ref swig_todo "Example"
2524 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
2525 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
2526 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
2530 ## @ref swig_todo "Example"
2531 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
2532 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
2533 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
2537 ## Get min and max tolerances of sub-shapes of theShape
2538 # @param theShape Shape, to get tolerances of.
2539 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
2540 # FaceMin,FaceMax: Min and max tolerances of the faces.
2541 # EdgeMin,EdgeMax: Min and max tolerances of the edges.
2542 # VertMin,VertMax: Min and max tolerances of the vertices.
2544 # @ref tui_measurement_tools_page "Example"
2545 def Tolerance(self,theShape):
2546 # Example: see GEOM_TestMeasures.py
2547 aTuple = self.MeasuOp.GetTolerance(theShape)
2548 RaiseIfFailed("GetTolerance", self.MeasuOp)
2551 ## Obtain description of the given shape (number of sub-shapes of each type)
2552 # @param theShape Shape to be described.
2553 # @return Description of the given shape.
2555 # @ref tui_measurement_tools_page "Example"
2556 def WhatIs(self,theShape):
2557 # Example: see GEOM_TestMeasures.py
2558 aDescr = self.MeasuOp.WhatIs(theShape)
2559 RaiseIfFailed("WhatIs", self.MeasuOp)
2562 ## Get a point, situated at the centre of mass of theShape.
2563 # @param theShape Shape to define centre of mass of.
2564 # @return New GEOM_Object, containing the created point.
2566 # @ref tui_measurement_tools_page "Example"
2567 def MakeCDG(self,theShape):
2568 # Example: see GEOM_TestMeasures.py
2569 anObj = self.MeasuOp.GetCentreOfMass(theShape)
2570 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
2573 ## Get a normale to the given face. If the point is not given,
2574 # the normale is calculated at the center of mass.
2575 # @param theFace Face to define normale of.
2576 # @param theOptionalPoint Point to compute the normale at.
2577 # @return New GEOM_Object, containing the created vector.
2579 # @ref swig_todo "Example"
2580 def GetNormal(self, theFace, theOptionalPoint = None):
2581 # Example: see GEOM_TestMeasures.py
2582 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
2583 RaiseIfFailed("GetNormal", self.MeasuOp)
2586 ## Check a topology of the given shape.
2587 # @param theShape Shape to check validity of.
2588 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked,
2589 # if TRUE, the shape's geometry will be checked also.
2590 # @return TRUE, if the shape "seems to be valid".
2591 # If theShape is invalid, prints a description of problem.
2593 # @ref tui_measurement_tools_page "Example"
2594 def CheckShape(self,theShape, theIsCheckGeom = 0):
2595 # Example: see GEOM_TestMeasures.py
2597 (IsValid, Status) = self.MeasuOp.CheckShapeWithGeometry(theShape)
2598 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
2600 (IsValid, Status) = self.MeasuOp.CheckShape(theShape)
2601 RaiseIfFailed("CheckShape", self.MeasuOp)
2606 ## Get position (LCS) of theShape.
2608 # Origin of the LCS is situated at the shape's center of mass.
2609 # Axes of the LCS are obtained from shape's location or,
2610 # if the shape is a planar face, from position of its plane.
2612 # @param theShape Shape to calculate position of.
2613 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
2614 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
2615 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
2616 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
2618 # @ref swig_todo "Example"
2619 def GetPosition(self,theShape):
2620 # Example: see GEOM_TestMeasures.py
2621 aTuple = self.MeasuOp.GetPosition(theShape)
2622 RaiseIfFailed("GetPosition", self.MeasuOp)
2625 ## Get kind of theShape.
2627 # @param theShape Shape to get a kind of.
2628 # @return Returns a kind of shape in terms of <VAR>GEOM_IKindOfShape.shape_kind</VAR> enumeration
2629 # and a list of parameters, describing the shape.
2630 # @note Concrete meaning of each value, returned via \a theIntegers
2631 # or \a theDoubles list depends on the kind of the shape.
2632 # The full list of possible outputs is:
2634 # - geompy.kind.COMPOUND nb_solids nb_faces nb_edges nb_vertices
2635 # - geompy.kind.COMPSOLID nb_solids nb_faces nb_edges nb_vertices
2637 # - geompy.kind.SHELL geompy.info.CLOSED nb_faces nb_edges nb_vertices
2638 # - geompy.kind.SHELL geompy.info.UNCLOSED nb_faces nb_edges nb_vertices
2640 # - geompy.kind.WIRE geompy.info.CLOSED nb_edges nb_vertices
2641 # - geompy.kind.WIRE geompy.info.UNCLOSED nb_edges nb_vertices
2643 # - geompy.kind.SPHERE xc yc zc R
2644 # - geompy.kind.CYLINDER xb yb zb dx dy dz R H
2645 # - geompy.kind.BOX xc yc zc ax ay az
2646 # - geompy.kind.ROTATED_BOX xc yc zc zx zy zz xx xy xz ax ay az
2647 # - geompy.kind.TORUS xc yc zc dx dy dz R_1 R_2
2648 # - geompy.kind.CONE xb yb zb dx dy dz R_1 R_2 H
2649 # - geompy.kind.POLYHEDRON nb_faces nb_edges nb_vertices
2650 # - geompy.kind.SOLID nb_faces nb_edges nb_vertices
2652 # - geompy.kind.SPHERE2D xc yc zc R
2653 # - geompy.kind.CYLINDER2D xb yb zb dx dy dz R H
2654 # - geompy.kind.TORUS2D xc yc zc dx dy dz R_1 R_2
2655 # - geompy.kind.CONE2D xc yc zc dx dy dz R_1 R_2 H
2656 # - geompy.kind.DISK_CIRCLE xc yc zc dx dy dz R
2657 # - geompy.kind.DISK_ELLIPSE xc yc zc dx dy dz R_1 R_2
2658 # - geompy.kind.POLYGON xo yo zo dx dy dz nb_edges nb_vertices
2659 # - geompy.kind.PLANE xo yo zo dx dy dz
2660 # - geompy.kind.PLANAR xo yo zo dx dy dz nb_edges nb_vertices
2661 # - geompy.kind.FACE nb_edges nb_vertices
2663 # - geompy.kind.CIRCLE xc yc zc dx dy dz R
2664 # - geompy.kind.ARC_CIRCLE xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2
2665 # - geompy.kind.ELLIPSE xc yc zc dx dy dz R_1 R_2
2666 # - geompy.kind.ARC_ELLIPSE xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2
2667 # - geompy.kind.LINE xo yo zo dx dy dz
2668 # - geompy.kind.SEGMENT x1 y1 z1 x2 y2 z2
2669 # - geompy.kind.EDGE nb_vertices
2671 # - geompy.kind.VERTEX x y z
2673 # @ref swig_todo "Example"
2674 def KindOfShape(self,theShape):
2675 # Example: see GEOM_TestMeasures.py
2676 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
2677 RaiseIfFailed("KindOfShape", self.MeasuOp)
2679 aKind = aRoughTuple[0]
2680 anInts = aRoughTuple[1]
2681 aDbls = aRoughTuple[2]
2683 # Now there is no exception from this rule:
2684 aKindTuple = [aKind] + aDbls + anInts
2686 # If they are we will regroup parameters for such kind of shape.
2688 #if aKind == kind.SOME_KIND:
2689 # # SOME_KIND int int double int double double
2690 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
2697 ## @addtogroup l2_import_export
2700 ## Import a shape from the BREP or IGES or STEP file
2701 # (depends on given format) with given name.
2702 # @param theFileName The file, containing the shape.
2703 # @param theFormatName Specify format for the file reading.
2704 # Available formats can be obtained with InsertOp.ImportTranslators() method.
2705 # @return New GEOM_Object, containing the imported shape.
2707 # @ref swig_Import_Export "Example"
2708 def Import(self,theFileName, theFormatName):
2709 # Example: see GEOM_TestOthers.py
2710 anObj = self.InsertOp.Import(theFileName, theFormatName)
2711 RaiseIfFailed("Import", self.InsertOp)
2714 ## Shortcut to Import() for BREP format
2716 # @ref swig_Import_Export "Example"
2717 def ImportBREP(self,theFileName):
2718 # Example: see GEOM_TestOthers.py
2719 return self.Import(theFileName, "BREP")
2721 ## Shortcut to Import() for IGES format
2723 # @ref swig_Import_Export "Example"
2724 def ImportIGES(self,theFileName):
2725 # Example: see GEOM_TestOthers.py
2726 return self.Import(theFileName, "IGES")
2728 ## Shortcut to Import() for STEP format
2730 # @ref swig_Import_Export "Example"
2731 def ImportSTEP(self,theFileName):
2732 # Example: see GEOM_TestOthers.py
2733 return self.Import(theFileName, "STEP")
2735 ## Export the given shape into a file with given name.
2736 # @param theObject Shape to be stored in the file.
2737 # @param theFileName Name of the file to store the given shape in.
2738 # @param theFormatName Specify format for the shape storage.
2739 # Available formats can be obtained with InsertOp.ImportTranslators() method.
2741 # @ref swig_Import_Export "Example"
2742 def Export(self,theObject, theFileName, theFormatName):
2743 # Example: see GEOM_TestOthers.py
2744 self.InsertOp.Export(theObject, theFileName, theFormatName)
2745 if self.InsertOp.IsDone() == 0:
2746 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
2750 ## Shortcut to Export() for BREP format
2752 # @ref swig_Import_Export "Example"
2753 def ExportBREP(self,theObject, theFileName):
2754 # Example: see GEOM_TestOthers.py
2755 return self.Export(theObject, theFileName, "BREP")
2757 ## Shortcut to Export() for IGES format
2759 # @ref swig_Import_Export "Example"
2760 def ExportIGES(self,theObject, theFileName):
2761 # Example: see GEOM_TestOthers.py
2762 return self.Export(theObject, theFileName, "IGES")
2764 ## Shortcut to Export() for STEP format
2766 # @ref swig_Import_Export "Example"
2767 def ExportSTEP(self,theObject, theFileName):
2768 # Example: see GEOM_TestOthers.py
2769 return self.Export(theObject, theFileName, "STEP")
2771 # end of l2_import_export
2774 ## @addtogroup l3_blocks
2777 ## Create a quadrangle face from four edges. Order of Edges is not
2778 # important. It is not necessary that edges share the same vertex.
2779 # @param E1,E2,E3,E4 Edges for the face bound.
2780 # @return New GEOM_Object, containing the created face.
2782 # @ref tui_building_by_blocks_page "Example"
2783 def MakeQuad(self,E1, E2, E3, E4):
2784 # Example: see GEOM_Spanner.py
2785 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
2786 RaiseIfFailed("MakeQuad", self.BlocksOp)
2789 ## Create a quadrangle face on two edges.
2790 # The missing edges will be built by creating the shortest ones.
2791 # @param E1,E2 Two opposite edges for the face.
2792 # @return New GEOM_Object, containing the created face.
2794 # @ref tui_building_by_blocks_page "Example"
2795 def MakeQuad2Edges(self,E1, E2):
2796 # Example: see GEOM_Spanner.py
2797 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
2798 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
2801 ## Create a quadrangle face with specified corners.
2802 # The missing edges will be built by creating the shortest ones.
2803 # @param V1,V2,V3,V4 Corner vertices for the face.
2804 # @return New GEOM_Object, containing the created face.
2806 # @ref tui_building_by_blocks_page "Example 1"
2807 # \n @ref swig_MakeQuad4Vertices "Example 2"
2808 def MakeQuad4Vertices(self,V1, V2, V3, V4):
2809 # Example: see GEOM_Spanner.py
2810 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
2811 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
2814 ## Create a hexahedral solid, bounded by the six given faces. Order of
2815 # faces is not important. It is not necessary that Faces share the same edge.
2816 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
2817 # @return New GEOM_Object, containing the created solid.
2819 # @ref tui_building_by_blocks_page "Example 1"
2820 # \n @ref swig_MakeHexa "Example 2"
2821 def MakeHexa(self,F1, F2, F3, F4, F5, F6):
2822 # Example: see GEOM_Spanner.py
2823 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
2824 RaiseIfFailed("MakeHexa", self.BlocksOp)
2827 ## Create a hexahedral solid between two given faces.
2828 # The missing faces will be built by creating the smallest ones.
2829 # @param F1,F2 Two opposite faces for the hexahedral solid.
2830 # @return New GEOM_Object, containing the created solid.
2832 # @ref tui_building_by_blocks_page "Example 1"
2833 # \n @ref swig_MakeHexa2Faces "Example 2"
2834 def MakeHexa2Faces(self,F1, F2):
2835 # Example: see GEOM_Spanner.py
2836 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
2837 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
2843 ## @addtogroup l3_blocks_op
2846 ## Get a vertex, found in the given shape by its coordinates.
2847 # @param theShape Block or a compound of blocks.
2848 # @param theX,theY,theZ Coordinates of the sought vertex.
2849 # @param theEpsilon Maximum allowed distance between the resulting
2850 # vertex and point with the given coordinates.
2851 # @return New GEOM_Object, containing the found vertex.
2853 # @ref swig_GetPoint "Example"
2854 def GetPoint(self,theShape, theX, theY, theZ, theEpsilon):
2855 # Example: see GEOM_TestOthers.py
2856 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
2857 RaiseIfFailed("GetPoint", self.BlocksOp)
2860 ## Get an edge, found in the given shape by two given vertices.
2861 # @param theShape Block or a compound of blocks.
2862 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
2863 # @return New GEOM_Object, containing the found edge.
2865 # @ref swig_todo "Example"
2866 def GetEdge(self,theShape, thePoint1, thePoint2):
2867 # Example: see GEOM_Spanner.py
2868 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
2869 RaiseIfFailed("GetEdge", self.BlocksOp)
2872 ## Find an edge of the given shape, which has minimal distance to the given point.
2873 # @param theShape Block or a compound of blocks.
2874 # @param thePoint Point, close to the desired edge.
2875 # @return New GEOM_Object, containing the found edge.
2877 # @ref swig_GetEdgeNearPoint "Example"
2878 def GetEdgeNearPoint(self,theShape, thePoint):
2879 # Example: see GEOM_TestOthers.py
2880 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
2881 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
2884 ## Returns a face, found in the given shape by four given corner vertices.
2885 # @param theShape Block or a compound of blocks.
2886 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
2887 # @return New GEOM_Object, containing the found face.
2889 # @ref swig_todo "Example"
2890 def GetFaceByPoints(self,theShape, thePoint1, thePoint2, thePoint3, thePoint4):
2891 # Example: see GEOM_Spanner.py
2892 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
2893 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
2896 ## Get a face of block, found in the given shape by two given edges.
2897 # @param theShape Block or a compound of blocks.
2898 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
2899 # @return New GEOM_Object, containing the found face.
2901 # @ref swig_todo "Example"
2902 def GetFaceByEdges(self,theShape, theEdge1, theEdge2):
2903 # Example: see GEOM_Spanner.py
2904 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
2905 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
2908 ## Find a face, opposite to the given one in the given block.
2909 # @param theBlock Must be a hexahedral solid.
2910 # @param theFace Face of \a theBlock, opposite to the desired face.
2911 # @return New GEOM_Object, containing the found face.
2913 # @ref swig_GetOppositeFace "Example"
2914 def GetOppositeFace(self,theBlock, theFace):
2915 # Example: see GEOM_Spanner.py
2916 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
2917 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
2920 ## Find a face of the given shape, which has minimal distance to the given point.
2921 # @param theShape Block or a compound of blocks.
2922 # @param thePoint Point, close to the desired face.
2923 # @return New GEOM_Object, containing the found face.
2925 # @ref swig_GetFaceNearPoint "Example"
2926 def GetFaceNearPoint(self,theShape, thePoint):
2927 # Example: see GEOM_Spanner.py
2928 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
2929 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
2932 ## Find a face of block, whose outside normale has minimal angle with the given vector.
2933 # @param theBlock Block or a compound of blocks.
2934 # @param theVector Vector, close to the normale of the desired face.
2935 # @return New GEOM_Object, containing the found face.
2937 # @ref swig_todo "Example"
2938 def GetFaceByNormale(self, theBlock, theVector):
2939 # Example: see GEOM_Spanner.py
2940 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
2941 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
2944 # end of l3_blocks_op
2947 ## @addtogroup l4_blocks_measure
2950 ## Check, if the compound of blocks is given.
2951 # To be considered as a compound of blocks, the
2952 # given shape must satisfy the following conditions:
2953 # - Each element of the compound should be a Block (6 faces and 12 edges).
2954 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
2955 # - The compound should be connexe.
2956 # - The glue between two quadrangle faces should be applied.
2957 # @param theCompound The compound to check.
2958 # @return TRUE, if the given shape is a compound of blocks.
2959 # If theCompound is not valid, prints all discovered errors.
2961 # @ref tui_measurement_tools_page "Example 1"
2962 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
2963 def CheckCompoundOfBlocks(self,theCompound):
2964 # Example: see GEOM_Spanner.py
2965 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
2966 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
2968 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
2972 ## Remove all seam and degenerated edges from \a theShape.
2973 # Unite faces and edges, sharing one surface. It means that
2974 # this faces must have references to one C++ surface object (handle).
2975 # @param theShape The compound or single solid to remove irregular edges from.
2976 # @return Improved shape.
2978 # @ref swig_RemoveExtraEdges "Example"
2979 def RemoveExtraEdges(self,theShape):
2980 # Example: see GEOM_TestOthers.py
2981 anObj = self.BlocksOp.RemoveExtraEdges(theShape)
2982 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
2985 ## Check, if the given shape is a blocks compound.
2986 # Fix all detected errors.
2987 # \note Single block can be also fixed by this method.
2988 # @param theShape The compound to check and improve.
2989 # @return Improved compound.
2991 # @ref swig_CheckAndImprove "Example"
2992 def CheckAndImprove(self,theShape):
2993 # Example: see GEOM_TestOthers.py
2994 anObj = self.BlocksOp.CheckAndImprove(theShape)
2995 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
2998 # end of l4_blocks_measure
3001 ## @addtogroup l3_blocks_op
3004 ## Get all the blocks, contained in the given compound.
3005 # @param theCompound The compound to explode.
3006 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
3007 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
3008 # \note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
3009 # @return List of GEOM_Objects, containing the retrieved blocks.
3011 # @ref tui_explode_on_blocks "Example 1"
3012 # \n @ref swig_MakeBlockExplode "Example 2"
3013 def MakeBlockExplode(self,theCompound, theMinNbFaces, theMaxNbFaces):
3014 # Example: see GEOM_TestOthers.py
3015 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
3016 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
3019 ## Find block, containing the given point inside its volume or on boundary.
3020 # @param theCompound Compound, to find block in.
3021 # @param thePoint Point, close to the desired block. If the point lays on
3022 # boundary between some blocks, we return block with nearest center.
3023 # @return New GEOM_Object, containing the found block.
3025 # @ref swig_todo "Example"
3026 def GetBlockNearPoint(self,theCompound, thePoint):
3027 # Example: see GEOM_Spanner.py
3028 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
3029 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
3032 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
3033 # @param theCompound Compound, to find block in.
3034 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
3035 # @return New GEOM_Object, containing the found block.
3037 # @ref swig_GetBlockByParts "Example"
3038 def GetBlockByParts(self,theCompound, theParts):
3039 # Example: see GEOM_TestOthers.py
3040 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
3041 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
3044 ## Return all blocks, containing all the elements, passed as the parts.
3045 # @param theCompound Compound, to find blocks in.
3046 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
3047 # @return List of GEOM_Objects, containing the found blocks.
3049 # @ref swig_todo "Example"
3050 def GetBlocksByParts(self,theCompound, theParts):
3051 # Example: see GEOM_Spanner.py
3052 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
3053 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
3056 ## Multi-transformate block and glue the result.
3057 # Transformation is defined so, as to superpose direction faces.
3058 # @param Block Hexahedral solid to be multi-transformed.
3059 # @param DirFace1 ID of First direction face.
3060 # @param DirFace2 ID of Second direction face.
3061 # @param NbTimes Quantity of transformations to be done.
3062 # \note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
3063 # @return New GEOM_Object, containing the result shape.
3065 # @ref tui_multi_transformation "Example"
3066 def MakeMultiTransformation1D(self,Block, DirFace1, DirFace2, NbTimes):
3067 # Example: see GEOM_Spanner.py
3068 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
3069 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
3072 ## Multi-transformate block and glue the result.
3073 # @param Block Hexahedral solid to be multi-transformed.
3074 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
3075 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
3076 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
3077 # @return New GEOM_Object, containing the result shape.
3079 # @ref tui_multi_transformation "Example"
3080 def MakeMultiTransformation2D(self,Block, DirFace1U, DirFace2U, NbTimesU,
3081 DirFace1V, DirFace2V, NbTimesV):
3082 # Example: see GEOM_Spanner.py
3083 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
3084 DirFace1V, DirFace2V, NbTimesV)
3085 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
3088 ## Build all possible propagation groups.
3089 # Propagation group is a set of all edges, opposite to one (main)
3090 # edge of this group directly or through other opposite edges.
3091 # Notion of Opposite Edge make sence only on quadrangle face.
3092 # @param theShape Shape to build propagation groups on.
3093 # @return List of GEOM_Objects, each of them is a propagation group.
3095 # @ref swig_Propagate "Example"
3096 def Propagate(self,theShape):
3097 # Example: see GEOM_TestOthers.py
3098 listChains = self.BlocksOp.Propagate(theShape)
3099 RaiseIfFailed("Propagate", self.BlocksOp)
3102 # end of l3_blocks_op
3105 ## @addtogroup l3_groups
3108 ## Creates a new group which will store sub shapes of theMainShape
3109 # @param theMainShape is a GEOM object on which the group is selected
3110 # @param theShapeType defines a shape type of the group
3111 # @return a newly created GEOM group
3113 # @ref tui_working_with_groups_page "Example 1"
3114 # \n @ref swig_CreateGroup "Example 2"
3115 def CreateGroup(self,theMainShape, theShapeType):
3116 # Example: see GEOM_TestOthers.py
3117 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
3118 RaiseIfFailed("CreateGroup", self.GroupOp)
3121 ## Adds a sub object with ID theSubShapeId to the group
3122 # @param theGroup is a GEOM group to which the new sub shape is added
3123 # @param theSubShapeID is a sub shape ID in the main object.
3124 # \note Use method GetSubShapeID() to get an unique ID of the sub shape
3126 # @ref tui_working_with_groups_page "Example"
3127 def AddObject(self,theGroup, theSubShapeID):
3128 # Example: see GEOM_TestOthers.py
3129 self.GroupOp.AddObject(theGroup, theSubShapeID)
3130 RaiseIfFailed("AddObject", self.GroupOp)
3133 ## Removes a sub object with ID \a theSubShapeId from the group
3134 # @param theGroup is a GEOM group from which the new sub shape is removed
3135 # @param theSubShapeID is a sub shape ID in the main object.
3136 # \note Use method GetSubShapeID() to get an unique ID of the sub shape
3138 # @ref tui_working_with_groups_page "Example"
3139 def RemoveObject(self,theGroup, theSubShapeID):
3140 # Example: see GEOM_TestOthers.py
3141 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
3142 RaiseIfFailed("RemoveObject", self.GroupOp)
3145 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
3146 # @param theGroup is a GEOM group to which the new sub shapes are added.
3147 # @param theSubShapes is a list of sub shapes to be added.
3149 # @ref tui_working_with_groups_page "Example"
3150 def UnionList (self,theGroup, theSubShapes):
3151 # Example: see GEOM_TestOthers.py
3152 self.GroupOp.UnionList(theGroup, theSubShapes)
3153 RaiseIfFailed("UnionList", self.GroupOp)
3156 ## Works like the above method, but argument
3157 # theSubShapes here is a list of sub-shapes indices
3159 # @ref swig_UnionIDs "Example"
3160 def UnionIDs(self,theGroup, theSubShapes):
3161 # Example: see GEOM_TestOthers.py
3162 self.GroupOp.UnionIDs(theGroup, theSubShapes)
3163 RaiseIfFailed("UnionIDs", self.GroupOp)
3166 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
3167 # @param theGroup is a GEOM group from which the sub-shapes are removed.
3168 # @param theSubShapes is a list of sub-shapes to be removed.
3170 # @ref tui_working_with_groups_page "Example"
3171 def DifferenceList (self,theGroup, theSubShapes):
3172 # Example: see GEOM_TestOthers.py
3173 self.GroupOp.DifferenceList(theGroup, theSubShapes)
3174 RaiseIfFailed("DifferenceList", self.GroupOp)
3177 ## Works like the above method, but argument
3178 # theSubShapes here is a list of sub-shapes indices
3180 # @ref swig_DifferenceIDs "Example"
3181 def DifferenceIDs(self,theGroup, theSubShapes):
3182 # Example: see GEOM_TestOthers.py
3183 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
3184 RaiseIfFailed("DifferenceIDs", self.GroupOp)
3187 ## Returns a list of sub objects ID stored in the group
3188 # @param theGroup is a GEOM group for which a list of IDs is requested
3190 # @ref swig_GetObjectIDs "Example"
3191 def GetObjectIDs(self,theGroup):
3192 # Example: see GEOM_TestOthers.py
3193 ListIDs = self.GroupOp.GetObjects(theGroup)
3194 RaiseIfFailed("GetObjects", self.GroupOp)
3197 ## Returns a type of sub objects stored in the group
3198 # @param theGroup is a GEOM group which type is returned.
3200 # @ref swig_GetType "Example"
3201 def GetType(self,theGroup):
3202 # Example: see GEOM_TestOthers.py
3203 aType = self.GroupOp.GetType(theGroup)
3204 RaiseIfFailed("GetType", self.GroupOp)
3207 ## Returns a main shape associated with the group
3208 # @param theGroup is a GEOM group for which a main shape object is requested
3209 # @return a GEOM object which is a main shape for theGroup
3211 # @ref swig_GetMainShape "Example"
3212 def GetMainShape(self,theGroup):
3213 # Example: see GEOM_TestOthers.py
3214 anObj = self.GroupOp.GetMainShape(theGroup)
3215 RaiseIfFailed("GetMainShape", self.GroupOp)
3218 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
3219 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
3221 # @ref swig_todo "Example"
3222 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1):
3223 edges = self.SubShapeAll(theShape, ShapeType["EDGE"])
3226 Props = self.BasicProperties(edge)
3227 if min_length <= Props[0] and Props[0] <= max_length:
3228 if (not include_min) and (min_length == Props[0]):
3231 if (not include_max) and (Props[0] == max_length):
3234 edges_in_range.append(edge)
3236 if len(edges_in_range) <= 0:
3237 print "No edges found by given criteria"
3240 group_edges = self.CreateGroup(theShape, ShapeType["EDGE"])
3241 self.UnionList(group_edges, edges_in_range)
3245 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
3246 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
3248 # @ref swig_todo "Example"
3249 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
3250 nb_selected = sg.SelectedCount()
3252 print "Select a shape before calling this function, please."
3255 print "Only one shape must be selected"
3258 id_shape = sg.getSelected(0)
3259 shape = IDToObject( id_shape )
3261 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
3265 if include_min: left_str = " <= "
3266 if include_max: right_str = " <= "
3268 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
3269 + left_str + "length" + right_str + `max_length`)
3271 sg.updateObjBrowser(1)
3278 ## Create a copy of the given object
3279 # @ingroup l1_geompy_auxiliary
3281 # @ref swig_all_advanced "Example"
3282 def MakeCopy(self,theOriginal):
3283 # Example: see GEOM_TestAll.py
3284 anObj = self.InsertOp.MakeCopy(theOriginal)
3285 RaiseIfFailed("MakeCopy", self.InsertOp)
3288 ## Add Path to load python scripts from
3289 # @ingroup l1_geompy_auxiliary
3290 def addPath(self,Path):
3291 if (sys.path.count(Path) < 1):
3292 sys.path.append(Path)
3295 #Register the new proxy for GEOM_Gen
3296 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geompyDC)