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
85 ## Enumeration ShapeType as a dictionary
86 # @ingroup l1_geompy_auxiliary
87 ShapeType = {"COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8}
89 ## Raise an Error, containing the Method_name, if Operation is Failed
90 ## @ingroup l1_geompy_auxiliary
91 def RaiseIfFailed (Method_name, Operation):
92 if Operation.IsDone() == 0 and Operation.GetErrorCode() != "NOT_FOUND_ANY":
93 raise RuntimeError, Method_name + " : " + Operation.GetErrorCode()
95 ## Kinds of shape enumeration
96 # @ingroup l1_geompy_auxiliary
97 kind = GEOM.GEOM_IKindOfShape
99 ## Information about closed/unclosed state of shell or wire
100 # @ingroup l1_geompy_auxiliary
107 class geompyDC(GEOM._objref_GEOM_Gen):
109 ## @addtogroup l1_geompy_auxiliary
112 GEOM._objref_GEOM_Gen.__init__(self)
113 self.myBuilder = None
131 def init_geom(self,theStudy):
132 self.myStudy = theStudy
133 self.myStudyId = self.myStudy._get_StudyId()
134 self.myBuilder = self.myStudy.NewBuilder()
135 self.father = self.myStudy.FindComponent("GEOM")
136 if self.father is None:
137 self.father = self.myBuilder.NewComponent("GEOM")
138 A1 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributeName")
139 FName = A1._narrow(SALOMEDS.AttributeName)
140 FName.SetValue("Geometry")
141 A2 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributePixMap")
142 aPixmap = A2._narrow(SALOMEDS.AttributePixMap)
143 aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry")
144 self.myBuilder.DefineComponentInstance(self.father,self)
146 self.BasicOp = self.GetIBasicOperations (self.myStudyId)
147 self.CurvesOp = self.GetICurvesOperations (self.myStudyId)
148 self.PrimOp = self.GetI3DPrimOperations (self.myStudyId)
149 self.ShapesOp = self.GetIShapesOperations (self.myStudyId)
150 self.HealOp = self.GetIHealingOperations (self.myStudyId)
151 self.InsertOp = self.GetIInsertOperations (self.myStudyId)
152 self.BoolOp = self.GetIBooleanOperations (self.myStudyId)
153 self.TrsfOp = self.GetITransformOperations(self.myStudyId)
154 self.LocalOp = self.GetILocalOperations (self.myStudyId)
155 self.MeasuOp = self.GetIMeasureOperations (self.myStudyId)
156 self.BlocksOp = self.GetIBlocksOperations (self.myStudyId)
157 self.GroupOp = self.GetIGroupOperations (self.myStudyId)
160 ## Get name for sub-shape aSubObj of shape aMainObj
162 # @ref swig_SubShapeAllSorted "Example"
163 def SubShapeName(self,aSubObj, aMainObj):
164 # Example: see GEOM_TestAll.py
166 #aSubId = orb.object_to_string(aSubObj)
167 #aMainId = orb.object_to_string(aMainObj)
168 #index = gg.getIndexTopology(aSubId, aMainId)
169 #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
170 index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
171 name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
174 ## Publish in study aShape with name aName
176 # \param aShape the shape to be published
177 # \param aName the name for the shape
178 # \param doRestoreSubShapes if True, finds and publishes also
179 # sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
180 # and published sub-shapes of arguments
181 # \param theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes for
182 # these arguments description
183 # \return study entry of the published shape in form of string
185 # @ref swig_MakeQuad4Vertices "Example"
186 def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
187 theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
188 # Example: see GEOM_TestAll.py
190 aSObject = self.AddInStudy(self.myStudy, aShape, aName, None)
191 if doRestoreSubShapes:
192 self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs,
193 theFindMethod, theInheritFirstArg)
195 print "addToStudy() failed"
197 return aShape.GetStudyEntry()
199 ## Publish in study aShape with name aName as sub-object of previously published aFather
201 # @ref swig_SubShapeAllSorted "Example"
202 def addToStudyInFather(self, aFather, aShape, aName):
203 # Example: see GEOM_TestAll.py
205 aSObject = self.AddInStudy(myStudy, aShape, aName, aFather)
207 print "addToStudyInFather() failed"
209 return aShape.GetStudyEntry()
211 # end of l1_geompy_auxiliary
214 ## @addtogroup l3_restore_ss
217 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
218 # To be used from python scripts out of geompy.addToStudy (non-default usage)
219 # \param theStudy the study, in which theObject is published already,
220 # and in which the arguments will be published
221 # \param theObject published GEOM object, arguments of which will be published
222 # \param theArgs list of GEOM_Object, operation arguments to be published.
223 # If this list is empty, all operation arguments will be published
224 # \param theFindMethod method to search subshapes, corresponding to arguments and
225 # their subshapes. Value from enumeration GEOM::find_shape_method.
226 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
227 # Do not publish subshapes in place of arguments, but only
228 # in place of subshapes of the first argument,
229 # because the whole shape corresponds to the first argument.
230 # Mainly to be used after transformations, but it also can be
231 # usefull after partition with one object shape, and some other
232 # operations, where only the first argument has to be considered.
233 # If theObject has only one argument shape, this flag is automatically
234 # considered as True, not regarding really passed value.
235 # \return True in case of success, False otherwise.
237 # @ref tui_restore_prs_params "Example"
238 def RestoreSubShapes (self, theObject, theArgs=[],
239 theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
240 # Example: see GEOM_TestAll.py
241 return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
242 theFindMethod, theInheritFirstArg)
244 # end of l3_restore_ss
247 ## @addtogroup l3_basic_go
250 ## Create point by three coordinates.
251 # @param theX The X coordinate of the point.
252 # @param theY The Y coordinate of the point.
253 # @param theZ The Z coordinate of the point.
254 # @return New GEOM_Object, containing the created point.
256 # @ref tui_creation_point "Example"
257 def MakeVertex(self,theX, theY, theZ):
258 # Example: see GEOM_TestAll.py
259 anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
260 RaiseIfFailed("MakePointXYZ", self.BasicOp)
263 ## Create a point, distant from the referenced point
264 # on the given distances along the coordinate axes.
265 # @param theReference The referenced point.
266 # @param theX Displacement from the referenced point along OX axis.
267 # @param theY Displacement from the referenced point along OY axis.
268 # @param theZ Displacement from the referenced point along OZ axis.
269 # @return New GEOM_Object, containing the created point.
271 # @ref tui_creation_point "Example"
272 def MakeVertexWithRef(self,theReference, theX, theY, theZ):
273 # Example: see GEOM_TestAll.py
274 anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
275 RaiseIfFailed("MakePointWithReference", self.BasicOp)
278 ## Create a point, corresponding to the given parameter on the given curve.
279 # @param theRefCurve The referenced curve.
280 # @param theParameter Value of parameter on the referenced curve.
281 # @return New GEOM_Object, containing the created point.
283 # @ref tui_creation_point "Example"
284 def MakeVertexOnCurve(self,theRefCurve, theParameter):
285 # Example: see GEOM_TestAll.py
286 anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter)
287 RaiseIfFailed("MakePointOnCurve", self.BasicOp)
290 ## Create a point, corresponding to the given parameters on the
292 # @param theRefSurf The referenced surface.
293 # @param theUParameter Value of U-parameter on the referenced surface.
294 # @param theVParameter Value of V-parameter on the referenced surface.
295 # @return New GEOM_Object, containing the created point.
297 # @ref swig_MakeVertexOnSurface "Example"
298 def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter):
299 # Example: see GEOM_TestAll.py
300 anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
301 RaiseIfFailed("MakePointOnSurface", self.BasicOp)
304 ## Create a point on intersection of two lines.
305 # @param theRefLine1, theRefLine2 The referenced lines.
306 # @return New GEOM_Object, containing the created point.
308 # @ref swig_MakeVertexOnLinesIntersection "Example"
309 def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2):
310 # Example: see GEOM_TestAll.py
311 anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
312 RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
315 ## Create a tangent, corresponding to the given parameter on the given curve.
316 # @param theRefCurve The referenced curve.
317 # @param theParameter Value of parameter on the referenced curve.
318 # @return New GEOM_Object, containing the created tangent.
320 # @ref swig_MakeTangentOnCurve "Example"
321 def MakeTangentOnCurve(self, theRefCurve, theParameter):
322 anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
323 RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
326 ## Create a vector with the given components.
327 # @param theDX X component of the vector.
328 # @param theDY Y component of the vector.
329 # @param theDZ Z component of the vector.
330 # @return New GEOM_Object, containing the created vector.
332 # @ref tui_creation_vector "Example"
333 def MakeVectorDXDYDZ(self,theDX, theDY, theDZ):
334 # Example: see GEOM_TestAll.py
335 anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
336 RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
339 ## Create a vector between two points.
340 # @param thePnt1 Start point for the vector.
341 # @param thePnt2 End point for the vector.
342 # @return New GEOM_Object, containing the created vector.
344 # @ref tui_creation_vector "Example"
345 def MakeVector(self,thePnt1, thePnt2):
346 # Example: see GEOM_TestAll.py
347 anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
348 RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
351 ## Create a line, passing through the given point
352 # and parrallel to the given direction
353 # @param thePnt Point. The resulting line will pass through it.
354 # @param theDir Direction. The resulting line will be parallel to it.
355 # @return New GEOM_Object, containing the created line.
357 # @ref tui_creation_line "Example"
358 def MakeLine(self,thePnt, theDir):
359 # Example: see GEOM_TestAll.py
360 anObj = self.BasicOp.MakeLine(thePnt, theDir)
361 RaiseIfFailed("MakeLine", self.BasicOp)
364 ## Create a line, passing through the given points
365 # @param thePnt1 First of two points, defining the line.
366 # @param thePnt2 Second of two points, defining the line.
367 # @return New GEOM_Object, containing the created line.
369 # @ref tui_creation_line "Example"
370 def MakeLineTwoPnt(self,thePnt1, thePnt2):
371 # Example: see GEOM_TestAll.py
372 anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
373 RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
376 ## Create a line on two faces intersection.
377 # @param theFace1 First of two faces, defining the line.
378 # @param theFace2 Second of two faces, defining the line.
379 # @return New GEOM_Object, containing the created line.
381 # @ref swig_MakeLineTwoFaces "Example"
382 def MakeLineTwoFaces(self, theFace1, theFace2):
383 # Example: see GEOM_TestAll.py
384 anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
385 RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
388 ## Create a plane, passing through the given point
389 # and normal to the given vector.
390 # @param thePnt Point, the plane has to pass through.
391 # @param theVec Vector, defining the plane normal direction.
392 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
393 # @return New GEOM_Object, containing the created plane.
395 # @ref tui_creation_plane "Example"
396 def MakePlane(self,thePnt, theVec, theTrimSize):
397 # Example: see GEOM_TestAll.py
398 anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
399 RaiseIfFailed("MakePlanePntVec", self.BasicOp)
402 ## Create a plane, passing through the three given points
403 # @param thePnt1 First of three points, defining the plane.
404 # @param thePnt2 Second of three points, defining the plane.
405 # @param thePnt3 Fird of three points, defining the plane.
406 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
407 # @return New GEOM_Object, containing the created plane.
409 # @ref tui_creation_plane "Example"
410 def MakePlaneThreePnt(self,thePnt1, thePnt2, thePnt3, theTrimSize):
411 # Example: see GEOM_TestAll.py
412 anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
413 RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
416 ## Create a plane, similar to the existing one, but with another size of representing face.
417 # @param theFace Referenced plane or LCS(Marker).
418 # @param theTrimSize New half size of a side of quadrangle face, representing the plane.
419 # @return New GEOM_Object, containing the created plane.
421 # @ref tui_creation_plane "Example"
422 def MakePlaneFace(self,theFace, theTrimSize):
423 # Example: see GEOM_TestAll.py
424 anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
425 RaiseIfFailed("MakePlaneFace", self.BasicOp)
428 ## Create a local coordinate system.
429 # @param OX,OY,OZ Three coordinates of coordinate system origin.
430 # @param XDX,XDY,XDZ Three components of OX direction
431 # @param YDX,YDY,YDZ Three components of OY direction
432 # @return New GEOM_Object, containing the created coordinate system.
434 # @ref swig_MakeMarker "Example"
435 def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ):
436 # Example: see GEOM_TestAll.py
437 anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
438 RaiseIfFailed("MakeMarker", self.BasicOp)
441 ## Create a local coordinate system.
442 # @param theOrigin Point of coordinate system origin.
443 # @param theXVec Vector of X direction
444 # @param theYVec Vector of Y direction
445 # @return New GEOM_Object, containing the created coordinate system.
447 # @ref swig_MakeMarker "Example"
448 def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec):
449 O = self.PointCoordinates( theOrigin )
451 for vec in [ theXVec, theYVec ]:
452 v1, v2 = self.SubShapeAll( vec, ShapeType["VERTEX"] )
453 p1 = self.PointCoordinates( v1 )
454 p2 = self.PointCoordinates( v2 )
455 for i in range( 0, 3 ):
456 OXOY.append( p2[i] - p1[i] )
458 anObj = self.BasicOp.MakeMarker( O[0], O[1], O[2],
459 OXOY[0], OXOY[1], OXOY[2],
460 OXOY[3], OXOY[4], OXOY[5], )
461 RaiseIfFailed("MakeMarker", self.BasicOp)
467 ## @addtogroup l4_curves
470 ## Create an arc of circle, passing through three given points.
471 # @param thePnt1 Start point of the arc.
472 # @param thePnt2 Middle point of the arc.
473 # @param thePnt3 End point of the arc.
474 # @return New GEOM_Object, containing the created arc.
476 # @ref swig_MakeArc "Example"
477 def MakeArc(self,thePnt1, thePnt2, thePnt3):
478 # Example: see GEOM_TestAll.py
479 anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
480 RaiseIfFailed("MakeArc", self.CurvesOp)
483 ## Create an arc of circle from a center and 2 points.
484 # @param thePnt1 Center of the arc
485 # @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
486 # @param thePnt3 End point of the arc (Gives also a direction)
487 # @param theSense Orientation of the arc
488 # @return New GEOM_Object, containing the created arc.
490 # @ref swig_MakeArc "Example"
491 def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False):
492 # Example: see GEOM_TestAll.py
493 anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
494 RaiseIfFailed("MakeArcCenter", self.CurvesOp)
497 ## Create a circle with given center, normal vector and radius.
498 # @param thePnt Circle center.
499 # @param theVec Vector, normal to the plane of the circle.
500 # @param theR Circle radius.
501 # @return New GEOM_Object, containing the created circle.
503 # @ref tui_creation_circle "Example"
504 def MakeCircle(self,thePnt, theVec, theR):
505 # Example: see GEOM_TestAll.py
506 anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
507 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
510 ## Create a circle, passing through three given points
511 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
512 # @return New GEOM_Object, containing the created circle.
514 # @ref tui_creation_circle "Example"
515 def MakeCircleThreePnt(self,thePnt1, thePnt2, thePnt3):
516 # Example: see GEOM_TestAll.py
517 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
518 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
521 ## Create a circle, with given point1 as center,
522 # passing through the point2 as radius and laying in the plane,
523 # defined by all three given points.
524 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
525 # @return New GEOM_Object, containing the created circle.
527 # @ref swig_MakeCircle "Example"
528 def MakeCircleCenter2Pnt(self,thePnt1, thePnt2, thePnt3):
529 # Example: see GEOM_example6.py
530 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
531 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
534 ## Create an ellipse with given center, normal vector and radiuses.
535 # @param thePnt Ellipse center.
536 # @param theVec Vector, normal to the plane of the ellipse.
537 # @param theRMajor Major ellipse radius.
538 # @param theRMinor Minor ellipse radius.
539 # @return New GEOM_Object, containing the created ellipse.
541 # @ref tui_creation_ellipse "Example"
542 def MakeEllipse(self,thePnt, theVec, theRMajor, theRMinor):
543 # Example: see GEOM_TestAll.py
544 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
545 RaiseIfFailed("MakeEllipse", self.CurvesOp)
548 ## Create a polyline on the set of points.
549 # @param thePoints Sequence of points for the polyline.
550 # @return New GEOM_Object, containing the created polyline.
552 # @ref tui_creation_curve "Example"
553 def MakePolyline(self,thePoints):
554 # Example: see GEOM_TestAll.py
555 anObj = self.CurvesOp.MakePolyline(thePoints)
556 RaiseIfFailed("MakePolyline", self.CurvesOp)
559 ## Create bezier curve on the set of points.
560 # @param thePoints Sequence of points for the bezier curve.
561 # @return New GEOM_Object, containing the created bezier curve.
563 # @ref tui_creation_curve "Example"
564 def MakeBezier(self,thePoints):
565 # Example: see GEOM_TestAll.py
566 anObj = self.CurvesOp.MakeSplineBezier(thePoints)
567 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
570 ## Create B-Spline curve on the set of points.
571 # @param thePoints Sequence of points for the B-Spline curve.
572 # @return New GEOM_Object, containing the created B-Spline curve.
574 # @ref tui_creation_curve "Example"
575 def MakeInterpol(self,thePoints):
576 # Example: see GEOM_TestAll.py
577 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints)
578 RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
584 ## @addtogroup l3_sketcher
587 ## Create a sketcher (wire or face), following the textual description,
588 # passed through <VAR>theCommand</VAR> argument. \n
589 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
590 # Format of the description string have to be the following:
592 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
595 # - x1, y1 are coordinates of the first sketcher point (zero by default),
597 # - "R angle" : Set the direction by angle
598 # - "D dx dy" : Set the direction by DX & DY
601 # - "TT x y" : Create segment by point at X & Y
602 # - "T dx dy" : Create segment by point with DX & DY
603 # - "L length" : Create segment by direction & Length
604 # - "IX x" : Create segment by direction & Intersect. X
605 # - "IY y" : Create segment by direction & Intersect. Y
608 # - "C radius length" : Create arc by direction, radius and length(in degree)
611 # - "WW" : Close Wire (to finish)
612 # - "WF" : Close Wire and build face (to finish)
614 # @param theCommand String, defining the sketcher in local
615 # coordinates of the working plane.
616 # @param theWorkingPlane Nine double values, defining origin,
617 # OZ and OX directions of the working plane.
618 # @return New GEOM_Object, containing the created wire.
620 # @ref tui_sketcher_page "Example"
621 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0]):
622 # Example: see GEOM_TestAll.py
623 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
624 RaiseIfFailed("MakeSketcher", self.CurvesOp)
627 ## Create a sketcher (wire or face), following the textual description,
628 # passed through <VAR>theCommand</VAR> argument. \n
629 # For format of the description string see the previous method.\n
630 # @param theCommand String, defining the sketcher in local
631 # coordinates of the working plane.
632 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
633 # @return New GEOM_Object, containing the created wire.
635 # @ref tui_sketcher_page "Example"
636 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane):
637 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
638 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
644 ## @addtogroup l3_3d_primitives
647 ## Create a box by coordinates of two opposite vertices.
649 # @ref tui_creation_box "Example"
650 def MakeBox(self,x1,y1,z1,x2,y2,z2):
651 # Example: see GEOM_TestAll.py
652 pnt1 = self.MakeVertex(x1,y1,z1)
653 pnt2 = self.MakeVertex(x2,y2,z2)
654 return self.MakeBoxTwoPnt(pnt1,pnt2)
656 ## Create a box with specified dimensions along the coordinate axes
657 # and with edges, parallel to the coordinate axes.
658 # Center of the box will be at point (DX/2, DY/2, DZ/2).
659 # @param theDX Length of Box edges, parallel to OX axis.
660 # @param theDY Length of Box edges, parallel to OY axis.
661 # @param theDZ Length of Box edges, parallel to OZ axis.
662 # @return New GEOM_Object, containing the created box.
664 # @ref tui_creation_box "Example"
665 def MakeBoxDXDYDZ(self,theDX, theDY, theDZ):
666 # Example: see GEOM_TestAll.py
667 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
668 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
671 ## Create a box with two specified opposite vertices,
672 # and with edges, parallel to the coordinate axes
673 # @param thePnt1 First of two opposite vertices.
674 # @param thePnt2 Second of two opposite vertices.
675 # @return New GEOM_Object, containing the created box.
677 # @ref tui_creation_box "Example"
678 def MakeBoxTwoPnt(self,thePnt1, thePnt2):
679 # Example: see GEOM_TestAll.py
680 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
681 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
684 ## Create a cylinder with given base point, axis, radius and height.
685 # @param thePnt Central point of cylinder base.
686 # @param theAxis Cylinder axis.
687 # @param theR Cylinder radius.
688 # @param theH Cylinder height.
689 # @return New GEOM_Object, containing the created cylinder.
691 # @ref tui_creation_cylinder "Example"
692 def MakeCylinder(self,thePnt, theAxis, theR, theH):
693 # Example: see GEOM_TestAll.py
694 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
695 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
698 ## Create a cylinder with given radius and height at
699 # the origin of coordinate system. Axis of the cylinder
700 # will be collinear to the OZ axis of the coordinate system.
701 # @param theR Cylinder radius.
702 # @param theH Cylinder height.
703 # @return New GEOM_Object, containing the created cylinder.
705 # @ref tui_creation_cylinder "Example"
706 def MakeCylinderRH(self,theR, theH):
707 # Example: see GEOM_TestAll.py
708 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
709 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
712 ## Create a sphere with given center and radius.
713 # @param thePnt Sphere center.
714 # @param theR Sphere radius.
715 # @return New GEOM_Object, containing the created sphere.
717 # @ref tui_creation_sphere "Example"
718 def MakeSpherePntR(self, thePnt, theR):
719 # Example: see GEOM_TestAll.py
720 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
721 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
724 ## Create a sphere with given center and radius.
725 # @param x,y,z Coordinates of sphere center.
726 # @param theR Sphere radius.
727 # @return New GEOM_Object, containing the created sphere.
729 # @ref tui_creation_sphere "Example"
730 def MakeSphere(self, x, y, z, theR):
731 # Example: see GEOM_TestAll.py
732 point = self.MakeVertex(x, y, z)
733 anObj = self.MakeSpherePntR(point, theR)
736 ## Create a sphere with given radius at the origin of coordinate system.
737 # @param theR Sphere radius.
738 # @return New GEOM_Object, containing the created sphere.
740 # @ref tui_creation_sphere "Example"
741 def MakeSphereR(self, theR):
742 # Example: see GEOM_TestAll.py
743 anObj = self.PrimOp.MakeSphereR(theR)
744 RaiseIfFailed("MakeSphereR", self.PrimOp)
747 ## Create a cone with given base point, axis, height and radiuses.
748 # @param thePnt Central point of the first cone base.
749 # @param theAxis Cone axis.
750 # @param theR1 Radius of the first cone base.
751 # @param theR2 Radius of the second cone base.
752 # \note If both radiuses are non-zero, the cone will be truncated.
753 # \note If the radiuses are equal, a cylinder will be created instead.
754 # @param theH Cone height.
755 # @return New GEOM_Object, containing the created cone.
757 # @ref tui_creation_cone "Example"
758 def MakeCone(self,thePnt, theAxis, theR1, theR2, theH):
759 # Example: see GEOM_TestAll.py
760 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
761 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
764 ## Create a cone with given height and radiuses at
765 # the origin of coordinate system. Axis of the cone will
766 # be collinear to the OZ axis of the coordinate system.
767 # @param theR1 Radius of the first cone base.
768 # @param theR2 Radius of the second cone base.
769 # \note If both radiuses are non-zero, the cone will be truncated.
770 # \note If the radiuses are equal, a cylinder will be created instead.
771 # @param theH Cone height.
772 # @return New GEOM_Object, containing the created cone.
774 # @ref tui_creation_cone "Example"
775 def MakeConeR1R2H(self,theR1, theR2, theH):
776 # Example: see GEOM_TestAll.py
777 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
778 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
781 ## Create a torus with given center, normal vector and radiuses.
782 # @param thePnt Torus central point.
783 # @param theVec Torus axis of symmetry.
784 # @param theRMajor Torus major radius.
785 # @param theRMinor Torus minor radius.
786 # @return New GEOM_Object, containing the created torus.
788 # @ref tui_creation_torus "Example"
789 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor):
790 # Example: see GEOM_TestAll.py
791 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
792 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
795 ## Create a torus with given radiuses at the origin of coordinate system.
796 # @param theRMajor Torus major radius.
797 # @param theRMinor Torus minor radius.
798 # @return New GEOM_Object, containing the created torus.
800 # @ref tui_creation_torus "Example"
801 def MakeTorusRR(self, theRMajor, theRMinor):
802 # Example: see GEOM_TestAll.py
803 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
804 RaiseIfFailed("MakeTorusRR", self.PrimOp)
807 # end of l3_3d_primitives
810 ## @addtogroup l3_complex
813 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
814 # @param theBase Base shape to be extruded.
815 # @param thePoint1 First end of extrusion vector.
816 # @param thePoint2 Second end of extrusion vector.
817 # @return New GEOM_Object, containing the created prism.
819 # @ref tui_creation_prism "Example"
820 def MakePrism(self, theBase, thePoint1, thePoint2):
821 # Example: see GEOM_TestAll.py
822 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
823 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
826 ## Create a shape by extrusion of the base shape along the vector,
827 # i.e. all the space, transfixed by the base shape during its translation
828 # along the vector on the given distance.
829 # @param theBase Base shape to be extruded.
830 # @param theVec Direction of extrusion.
831 # @param theH Prism dimension along theVec.
832 # @return New GEOM_Object, containing the created prism.
834 # @ref tui_creation_prism "Example"
835 def MakePrismVecH(self, theBase, theVec, theH):
836 # Example: see GEOM_TestAll.py
837 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
838 RaiseIfFailed("MakePrismVecH", self.PrimOp)
841 ## Create a shape by extrusion of the base shape along the vector,
842 # i.e. all the space, transfixed by the base shape during its translation
843 # along the vector on the given distance in 2 Ways (forward/backward) .
844 # @param theBase Base shape to be extruded.
845 # @param theVec Direction of extrusion.
846 # @param theH Prism dimension along theVec in forward direction.
847 # @return New GEOM_Object, containing the created prism.
849 # @ref tui_creation_prism "Example"
850 def MakePrismVecH2Ways(self, theBase, theVec, theH):
851 # Example: see GEOM_TestAll.py
852 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
853 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
856 ## Create a shape by revolution of the base shape around the axis
857 # on the given angle, i.e. all the space, transfixed by the base
858 # shape during its rotation around the axis on the given angle.
859 # @param theBase Base shape to be rotated.
860 # @param theAxis Rotation axis.
861 # @param theAngle Rotation angle in radians.
862 # @return New GEOM_Object, containing the created revolution.
864 # @ref tui_creation_revolution "Example"
865 def MakeRevolution(self, theBase, theAxis, theAngle):
866 # Example: see GEOM_TestAll.py
867 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
868 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
871 ## The Same Revolution but in both ways forward&backward.
872 def MakeRevolution2Ways(self, theBase, theAxis, theAngle):
873 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
874 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
877 ## Create a filling from the given compound of contours.
878 # @param theShape the compound of contours
879 # @param theMinDeg a minimal degree of BSpline surface to create
880 # @param theMaxDeg a maximal degree of BSpline surface to create
881 # @param theTol2D a 2d tolerance to be reached
882 # @param theTol3D a 3d tolerance to be reached
883 # @param theNbIter a number of iteration of approximation algorithm
884 # @param isApprox if True, BSpline curves are generated in the process
885 # of surface construction. By default it is False, that means
886 # the surface is created using Besier curves. The usage of
887 # Approximation makes the algorithm work slower, but allows
888 # building the surface for rather complex cases
889 # @return New GEOM_Object, containing the created filling surface.
891 # @ref tui_creation_filling "Example"
892 def MakeFilling(self, theShape, theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter, isApprox=0):
893 # Example: see GEOM_TestAll.py
894 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
895 theTol2D, theTol3D, theNbIter, isApprox)
896 RaiseIfFailed("MakeFilling", self.PrimOp)
899 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
900 # @param theSeqSections - set of specified sections.
901 # @param theModeSolid - mode defining building solid or shell
902 # @param thePreci - precision 3D used for smoothing by default 1.e-6
903 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
904 # @return New GEOM_Object, containing the created shell or solid.
906 # @ref swig_todo "Example"
907 def MakeThruSections(self,theSeqSections,theModeSolid,thePreci,theRuled):
908 # Example: see GEOM_TestAll.py
909 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
910 RaiseIfFailed("MakeThruSections", self.PrimOp)
913 ## Create a shape by extrusion of the base shape along
914 # the path shape. The path shape can be a wire or an edge.
915 # @param theBase Base shape to be extruded.
916 # @param thePath Path shape to extrude the base shape along it.
917 # @return New GEOM_Object, containing the created pipe.
919 # @ref tui_creation_pipe "Example"
920 def MakePipe(self,theBase, thePath):
921 # Example: see GEOM_TestAll.py
922 anObj = self.PrimOp.MakePipe(theBase, thePath)
923 RaiseIfFailed("MakePipe", self.PrimOp)
926 ## Create a shape by extrusion of the profile shape along
927 # the path shape. The path shape can be a wire or an edge.
928 # the several profiles can be specified in the several locations of path.
929 # @param theSeqBases - list of Bases shape to be extruded.
930 # @param theLocations - list of locations on the path corresponding
931 # specified list of the Bases shapes. Number of locations
932 # should be equal to number of bases or list of locations can be empty.
933 # @param thePath - Path shape to extrude the base shape along it.
934 # @param theWithContact - the mode defining that the section is translated to be in
935 # contact with the spine.
936 # @param theWithCorrection - defining that the section is rotated to be
937 # orthogonal to the spine tangent in the correspondent point
938 # @return New GEOM_Object, containing the created pipe.
940 # @ref swig_todo "Example"
941 def MakePipeWithDifferentSections(self, theSeqBases,
942 theLocations, thePath,
943 theWithContact, theWithCorrection):
944 anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
945 theLocations, thePath,
946 theWithContact, theWithCorrection)
947 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
950 ## Create a shape by extrusion of the profile shape along
951 # the path shape. The path shape can be a shell or a face.
952 # the several profiles can be specified in the several locations of path.
953 # @param theSeqBases - list of Bases shape to be extruded.
954 # @param theSeqSubBases - list of corresponding subshapes of section shapes.
955 # @param theLocations - list of locations on the path corresponding
956 # specified list of the Bases shapes. Number of locations
957 # should be equal to number of bases. First and last
958 # locations must be coincided with first and last vertexes
959 # of path correspondingly.
960 # @param thePath - Path shape to extrude the base shape along it.
961 # @param theWithContact - the mode defining that the section is translated to be in
962 # contact with the spine.
963 # @param theWithCorrection - defining that the section is rotated to be
964 # orthogonal to the spine tangent in the correspondent point
965 # @return New GEOM_Object, containing the created solids.
967 # @ref swig_todo "Example"
968 def MakePipeWithShellSections(self,theSeqBases, theSeqSubBases,
969 theLocations, thePath,
970 theWithContact, theWithCorrection):
971 anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
972 theLocations, thePath,
973 theWithContact, theWithCorrection)
974 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
977 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
978 theLocations, thePath,
979 theWithContact, theWithCorrection):
981 nbsect = len(theSeqBases)
982 nbsubsect = len(theSeqSubBases)
983 #print "nbsect = ",nbsect
984 for i in range(1,nbsect):
986 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
987 tmpLocations = [ theLocations[i-1], theLocations[i] ]
989 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
990 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
991 tmpLocations, thePath,
992 theWithContact, theWithCorrection)
993 if self.PrimOp.IsDone() == 0:
994 print "Problems with pipe creation between ",i," and ",i+1," sections"
995 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
998 print "Pipe between ",i," and ",i+1," sections is OK"
1003 resc = self.MakeCompound(res)
1004 #resc = self.MakeSewing(res, 0.001)
1005 #print "resc: ",resc
1008 ## Create solids between given sections
1009 # @param theSeqBases - list of sections (shell or face).
1010 # @param theLocations - list of corresponding vertexes
1011 # @return New GEOM_Object, containing the created solids.
1013 # @ref swig_todo "Example"
1014 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations):
1015 anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
1016 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
1022 ## @addtogroup l3_advanced
1025 ## Create a linear edge with specified ends.
1026 # @param thePnt1 Point for the first end of edge.
1027 # @param thePnt2 Point for the second end of edge.
1028 # @return New GEOM_Object, containing the created edge.
1030 # @ref tui_creation_edge "Example"
1031 def MakeEdge(self,thePnt1, thePnt2):
1032 # Example: see GEOM_TestAll.py
1033 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
1034 RaiseIfFailed("MakeEdge", self.ShapesOp)
1037 ## Create a wire from the set of edges and wires.
1038 # @param theEdgesAndWires List of edges and/or wires.
1039 # @return New GEOM_Object, containing the created wire.
1041 # @ref tui_creation_wire "Example"
1042 def MakeWire(self,theEdgesAndWires):
1043 # Example: see GEOM_TestAll.py
1044 anObj = self.ShapesOp.MakeWire(theEdgesAndWires)
1045 RaiseIfFailed("MakeWire", self.ShapesOp)
1048 ## Create a face on the given wire.
1049 # @param theWire closed Wire or Edge to build the face on.
1050 # @param isPlanarWanted If TRUE, only planar face will be built.
1051 # If impossible, NULL object will be returned.
1052 # @return New GEOM_Object, containing the created face.
1054 # @ref tui_creation_face "Example"
1055 def MakeFace(self,theWire, isPlanarWanted):
1056 # Example: see GEOM_TestAll.py
1057 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
1058 RaiseIfFailed("MakeFace", self.ShapesOp)
1061 ## Create a face on the given wires set.
1062 # @param theWires List of closed wires or edges to build the face on.
1063 # @param isPlanarWanted If TRUE, only planar face will be built.
1064 # If impossible, NULL object will be returned.
1065 # @return New GEOM_Object, containing the created face.
1067 # @ref tui_creation_face "Example"
1068 def MakeFaceWires(self,theWires, isPlanarWanted):
1069 # Example: see GEOM_TestAll.py
1070 anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
1071 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
1074 ## Shortcut to MakeFaceWires()
1076 # @ref tui_creation_face "Example 1"
1077 # \n @ref swig_MakeFaces "Example 2"
1078 def MakeFaces(self,theWires, isPlanarWanted):
1079 # Example: see GEOM_TestOthers.py
1080 anObj = self.MakeFaceWires(theWires, isPlanarWanted)
1083 ## Create a shell from the set of faces and shells.
1084 # @param theFacesAndShells List of faces and/or shells.
1085 # @return New GEOM_Object, containing the created shell.
1087 # @ref tui_creation_shell "Example"
1088 def MakeShell(self,theFacesAndShells):
1089 # Example: see GEOM_TestAll.py
1090 anObj = self.ShapesOp.MakeShell(theFacesAndShells)
1091 RaiseIfFailed("MakeShell", self.ShapesOp)
1094 ## Create a solid, bounded by the given shells.
1095 # @param theShells Sequence of bounding shells.
1096 # @return New GEOM_Object, containing the created solid.
1098 # @ref tui_creation_solid "Example"
1099 def MakeSolid(self,theShells):
1100 # Example: see GEOM_TestAll.py
1101 anObj = self.ShapesOp.MakeSolidShells(theShells)
1102 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
1105 ## Create a compound of the given shapes.
1106 # @param theShapes List of shapes to put in compound.
1107 # @return New GEOM_Object, containing the created compound.
1109 # @ref tui_creation_compound "Example"
1110 def MakeCompound(self,theShapes):
1111 # Example: see GEOM_TestAll.py
1112 anObj = self.ShapesOp.MakeCompound(theShapes)
1113 RaiseIfFailed("MakeCompound", self.ShapesOp)
1116 # end of l3_advanced
1119 ## @addtogroup l2_measure
1122 ## Gives quantity of faces in the given shape.
1123 # @param theShape Shape to count faces of.
1124 # @return Quantity of faces.
1126 # @ref swig_NumberOfFaces "Example"
1127 def NumberOfFaces(self,theShape):
1128 # Example: see GEOM_TestOthers.py
1129 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
1130 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
1133 ## Gives quantity of edges in the given shape.
1134 # @param theShape Shape to count edges of.
1135 # @return Quantity of edges.
1137 # @ref swig_NumberOfEdges "Example"
1138 def NumberOfEdges(self,theShape):
1139 # Example: see GEOM_TestOthers.py
1140 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
1141 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
1147 ## @addtogroup l3_healing
1150 ## Reverses an orientation the given shape.
1151 # @param theShape Shape to be reversed.
1152 # @return The reversed copy of theShape.
1154 # @ref swig_ChangeOrientation "Example"
1155 def ChangeOrientation(self,theShape):
1156 # Example: see GEOM_TestAll.py
1157 anObj = self.ShapesOp.ChangeOrientation(theShape)
1158 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
1161 ## Shortcut to ChangeOrientation()
1163 # @ref swig_OrientationChange "Example"
1164 def OrientationChange(self,theShape):
1165 # Example: see GEOM_TestOthers.py
1166 anObj = self.ChangeOrientation(theShape)
1172 ## @addtogroup l4_obtain
1175 ## Retrieve all free faces from the given shape.
1176 # Free face is a face, which is not shared between two shells of the shape.
1177 # @param theShape Shape to find free faces in.
1178 # @return List of IDs of all free faces, contained in theShape.
1180 # @ref tui_measurement_tools_page "Example"
1181 def GetFreeFacesIDs(self,theShape):
1182 # Example: see GEOM_TestOthers.py
1183 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
1184 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
1187 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
1188 # @param theShape1 Shape to find sub-shapes in.
1189 # @param theShape2 Shape to find shared sub-shapes with.
1190 # @param theShapeType Type of sub-shapes to be retrieved.
1191 # @return List of sub-shapes of theShape1, shared with theShape2.
1193 # @ref swig_GetSharedShapes "Example"
1194 def GetSharedShapes(self,theShape1, theShape2, theShapeType):
1195 # Example: see GEOM_TestOthers.py
1196 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
1197 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
1200 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
1201 # situated relatively the specified plane by the certain way,
1202 # defined through <VAR>theState</VAR> parameter.
1203 # @param theShape Shape to find sub-shapes of.
1204 # @param theShapeType Type of sub-shapes to be retrieved.
1205 # @param theAx1 Vector (or line, or linear edge), specifying normal
1206 # direction and location of the plane to find shapes on.
1207 # @param theState The state of the subshapes to find. It can be one of
1208 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1209 # @return List of all found sub-shapes.
1211 # @ref swig_GetShapesOnPlane "Example"
1212 def GetShapesOnPlane(self,theShape, theShapeType, theAx1, theState):
1213 # Example: see GEOM_TestOthers.py
1214 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
1215 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
1218 ## Works like the above method, but returns list of sub-shapes indices
1220 # @ref swig_GetShapesOnPlaneIDs "Example"
1221 def GetShapesOnPlaneIDs(self,theShape, theShapeType, theAx1, theState):
1222 # Example: see GEOM_TestOthers.py
1223 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
1224 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
1227 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
1228 # situated relatively the specified plane by the certain way,
1229 # defined through <VAR>theState</VAR> parameter.
1230 # @param theShape Shape to find sub-shapes of.
1231 # @param theShapeType Type of sub-shapes to be retrieved.
1232 # @param theAx1 Vector (or line, or linear edge), specifying normal
1233 # direction of the plane to find shapes on.
1234 # @param thePnt Point specifying 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_GetShapesOnPlaneWithLocation "Example"
1240 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState):
1241 # Example: see GEOM_TestOthers.py
1242 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
1243 theAx1, thePnt, theState)
1244 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
1247 ## Works like the above method, but returns list of sub-shapes indices
1249 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
1250 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
1251 # Example: see GEOM_TestOthers.py
1252 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
1253 theAx1, thePnt, theState)
1254 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
1257 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1258 # the specified cylinder by the certain way, defined through \a theState parameter.
1259 # @param theShape Shape to find sub-shapes of.
1260 # @param theShapeType Type of sub-shapes to be retrieved.
1261 # @param theAxis Vector (or line, or linear edge), specifying
1262 # axis of the cylinder to find shapes on.
1263 # @param theRadius Radius of the cylinder to find shapes on.
1264 # @param theState The state of the subshapes to find. It can be one of
1265 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1266 # @return List of all found sub-shapes.
1268 # @ref swig_GetShapesOnCylinder "Example"
1269 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState):
1270 # Example: see GEOM_TestOthers.py
1271 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
1272 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
1275 ## Works like the above method, but returns list of sub-shapes indices
1277 # @ref swig_GetShapesOnCylinderIDs "Example"
1278 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
1279 # Example: see GEOM_TestOthers.py
1280 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
1281 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
1284 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1285 # the specified sphere by the certain way, defined through \a theState parameter.
1286 # @param theShape Shape to find sub-shapes of.
1287 # @param theShapeType Type of sub-shapes to be retrieved.
1288 # @param theCenter Point, specifying center of the sphere to find shapes on.
1289 # @param theRadius Radius of the sphere to find shapes on.
1290 # @param theState The state of the subshapes to find. It can be one of
1291 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1292 # @return List of all found sub-shapes.
1294 # @ref swig_GetShapesOnSphere "Example"
1295 def GetShapesOnSphere(self,theShape, theShapeType, theCenter, theRadius, theState):
1296 # Example: see GEOM_TestOthers.py
1297 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
1298 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
1301 ## Works like the above method, but returns list of sub-shapes indices
1303 # @ref swig_GetShapesOnSphereIDs "Example"
1304 def GetShapesOnSphereIDs(self,theShape, theShapeType, theCenter, theRadius, theState):
1305 # Example: see GEOM_TestOthers.py
1306 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
1307 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
1310 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1311 # the specified quadrangle by the certain way, defined through \a theState parameter.
1312 # @param theShape Shape to find sub-shapes of.
1313 # @param theShapeType Type of sub-shapes to be retrieved.
1314 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
1315 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
1316 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
1317 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
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_GetShapesOnQuadrangle "Example"
1323 def GetShapesOnQuadrangle(self, theShape, theShapeType,
1324 theTopLeftPoint, theTopRigthPoint,
1325 theBottomLeftPoint, theBottomRigthPoint, theState):
1326 # Example: see GEOM_TestOthers.py
1327 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
1328 theTopLeftPoint, theTopRigthPoint,
1329 theBottomLeftPoint, theBottomRigthPoint, theState)
1330 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
1333 ## Works like the above method, but returns list of sub-shapes indices
1335 # @ref swig_GetShapesOnQuadrangleIDs "Example"
1336 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
1337 theTopLeftPoint, theTopRigthPoint,
1338 theBottomLeftPoint, theBottomRigthPoint, theState):
1339 # Example: see GEOM_TestOthers.py
1340 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
1341 theTopLeftPoint, theTopRigthPoint,
1342 theBottomLeftPoint, theBottomRigthPoint, theState)
1343 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
1346 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1347 # the specified \a theBox by the certain way, defined through \a theState parameter.
1348 # @param theBox Shape for relative comparing.
1349 # @param theShape Shape to find sub-shapes of.
1350 # @param theShapeType Type of sub-shapes to be retrieved.
1351 # @param theState The state of the subshapes to find. It can be one of
1352 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1353 # @return List of all found sub-shapes.
1355 # @ref swig_GetShapesOnBox "Example"
1356 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState):
1357 # Example: see GEOM_TestOthers.py
1358 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
1359 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
1362 ## Works like the above method, but returns list of sub-shapes indices
1364 # @ref swig_GetShapesOnBoxIDs "Example"
1365 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
1366 # Example: see GEOM_TestOthers.py
1367 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
1368 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
1371 ## Find in \a theShape all sub-shapes of type \a theShapeType,
1372 # situated relatively the specified \a theCheckShape by the
1373 # certain way, defined through \a theState parameter.
1374 # @param theCheckShape Shape for relative comparing.
1375 # @param theShape Shape to find sub-shapes of.
1376 # @param theShapeType Type of sub-shapes to be retrieved.
1377 # @param theState The state of the subshapes to find. It can be one of
1378 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1379 # @return List of all found sub-shapes.
1381 # @ref swig_GetShapesOnShape "Example"
1382 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState):
1383 # Example: see GEOM_TestOthers.py
1384 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
1385 theShapeType, theState)
1386 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
1389 ## Works like the above method, but returns result as compound
1391 # @ref swig_GetShapesOnShapeAsCompound "Example"
1392 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState):
1393 # Example: see GEOM_TestOthers.py
1394 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
1395 theShapeType, theState)
1396 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
1399 ## Works like the above method, but returns list of sub-shapes indices
1401 # @ref swig_GetShapesOnShapeIDs "Example"
1402 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
1403 # Example: see GEOM_TestOthers.py
1404 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
1405 theShapeType, theState)
1406 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
1409 ## Get sub-shape(s) of theShapeWhere, which are
1410 # coincident with \a theShapeWhat or could be a part of it.
1411 # @param theShapeWhere Shape to find sub-shapes of.
1412 # @param theShapeWhat Shape, specifying what to find.
1413 # @return Group of all found sub-shapes or a single found sub-shape.
1415 # @ref swig_GetInPlace "Example"
1416 def GetInPlace(self,theShapeWhere, theShapeWhat):
1417 # Example: see GEOM_TestOthers.py
1418 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
1419 RaiseIfFailed("GetInPlace", self.ShapesOp)
1422 ## Get sub-shape(s) of \a theShapeWhere, which are
1423 # coincident with \a theShapeWhat or could be a part of it.
1425 # Implementation of this method is based on a saved history of an operation,
1426 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
1427 # arguments (an argument shape or a sub-shape of an argument shape).
1428 # The operation could be the Partition or one of boolean operations,
1429 # performed on simple shapes (not on compounds).
1431 # @param theShapeWhere Shape to find sub-shapes of.
1432 # @param theShapeWhat Shape, specifying what to find (must be in the
1433 # building history of the ShapeWhere).
1434 # @return Group of all found sub-shapes or a single found sub-shape.
1436 # @ref swig_GetInPlace "Example"
1437 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat):
1438 # Example: see GEOM_TestOthers.py
1439 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
1440 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
1443 ## Get sub-shape of theShapeWhere, which is
1444 # equal to \a theShapeWhat.
1445 # @param theShapeWhere Shape to find sub-shape of.
1446 # @param theShapeWhat Shape, specifying what to find.
1447 # @return New GEOM_Object for found sub-shape.
1449 # @ref swig_GetSame "Example"
1450 def GetSame(self,theShapeWhere, theShapeWhat):
1451 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
1452 RaiseIfFailed("GetSame", self.ShapesOp)
1458 ## @addtogroup l4_access
1461 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
1462 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
1464 # @ref swig_all_decompose "Example"
1465 def GetSubShape(self, aShape, ListOfID):
1466 # Example: see GEOM_TestAll.py
1467 anObj = self.AddSubShape(aShape,ListOfID)
1470 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
1472 # @ref swig_all_decompose "Example"
1473 def GetSubShapeID(self, aShape, aSubShape):
1474 # Example: see GEOM_TestAll.py
1475 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
1476 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
1482 ## @addtogroup l4_decompose
1485 ## Explode a shape on subshapes of a given type.
1486 # @param aShape Shape to be exploded.
1487 # @param aType Type of sub-shapes to be retrieved.
1488 # @return List of sub-shapes of type theShapeType, contained in theShape.
1490 # @ref swig_all_decompose "Example"
1491 def SubShapeAll(self, aShape, aType):
1492 # Example: see GEOM_TestAll.py
1493 ListObj = self.ShapesOp.MakeExplode(aShape,aType,0)
1494 RaiseIfFailed("MakeExplode", self.ShapesOp)
1497 ## Explode a shape on subshapes of a given type.
1498 # @param aShape Shape to be exploded.
1499 # @param aType Type of sub-shapes to be retrieved.
1500 # @return List of IDs of sub-shapes.
1502 # @ref swig_all_decompose "Example"
1503 def SubShapeAllIDs(self, aShape, aType):
1504 ListObj = self.ShapesOp.SubShapeAllIDs(aShape,aType,0)
1505 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
1508 ## Explode a shape on subshapes of a given type.
1509 # Sub-shapes will be sorted by coordinates of their gravity centers.
1510 # @param aShape Shape to be exploded.
1511 # @param aType Type of sub-shapes to be retrieved.
1512 # @return List of sub-shapes of type theShapeType, contained in theShape.
1514 # @ref swig_SubShapeAllSorted "Example"
1515 def SubShapeAllSorted(self, aShape, aType):
1516 # Example: see GEOM_TestAll.py
1517 ListObj = self.ShapesOp.MakeExplode(aShape,aType,1)
1518 RaiseIfFailed("MakeExplode", self.ShapesOp)
1521 ## Explode a shape on subshapes of a given type.
1522 # Sub-shapes will be sorted by coordinates of their gravity centers.
1523 # @param aShape Shape to be exploded.
1524 # @param aType Type of sub-shapes to be retrieved.
1525 # @return List of IDs of sub-shapes.
1527 # @ref swig_all_decompose "Example"
1528 def SubShapeAllSortedIDs(self, aShape, aType):
1529 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape,aType,1)
1530 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
1533 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
1534 # selected by they indices in list of all sub-shapes of type <VAR>aType</VAR>.
1535 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
1537 # @ref swig_all_decompose "Example"
1538 def SubShape(self, aShape, aType, ListOfInd):
1539 # Example: see GEOM_TestAll.py
1541 AllShapeList = self.SubShapeAll(aShape, aType)
1542 for ind in ListOfInd:
1543 ListOfIDs.append(self.GetSubShapeID(aShape, AllShapeList[ind - 1]))
1544 anObj = self.GetSubShape(aShape, ListOfIDs)
1547 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
1548 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
1549 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
1551 # @ref swig_all_decompose "Example"
1552 def SubShapeSorted(self,aShape, aType, ListOfInd):
1553 # Example: see GEOM_TestAll.py
1555 AllShapeList = self.SubShapeAllSorted(aShape, aType)
1556 for ind in ListOfInd:
1557 ListOfIDs.append(self.GetSubShapeID(aShape, AllShapeList[ind - 1]))
1558 anObj = self.GetSubShape(aShape, ListOfIDs)
1561 # end of l4_decompose
1564 ## @addtogroup l3_healing
1567 ## Apply a sequence of Shape Healing operators to the given object.
1568 # @param theShape Shape to be processed.
1569 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
1570 # @param theParameters List of names of parameters
1571 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
1572 # @param theValues List of values of parameters, in the same order
1573 # as parameters are listed in <VAR>theParameters</VAR> list.
1574 # @return New GEOM_Object, containing processed shape.
1576 # @ref tui_shape_processing "Example"
1577 def ProcessShape(self,theShape, theOperators, theParameters, theValues):
1578 # Example: see GEOM_TestHealing.py
1579 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
1580 RaiseIfFailed("ProcessShape", self.HealOp)
1583 ## Remove faces from the given object (shape).
1584 # @param theObject Shape to be processed.
1585 # @param theFaces Indices of faces to be removed, if EMPTY then the method
1586 # removes ALL faces of the given object.
1587 # @return New GEOM_Object, containing processed shape.
1589 # @ref tui_suppress_faces "Example"
1590 def SuppressFaces(self,theObject, theFaces):
1591 # Example: see GEOM_TestHealing.py
1592 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
1593 RaiseIfFailed("SuppressFaces", self.HealOp)
1596 ## Sewing of some shapes into single shape.
1598 # @ref tui_sewing "Example"
1599 def MakeSewing(self, ListShape, theTolerance):
1600 # Example: see GEOM_TestHealing.py
1601 comp = self.MakeCompound(ListShape)
1602 anObj = self.Sew(comp, theTolerance)
1605 ## Sewing of the given object.
1606 # @param theObject Shape to be processed.
1607 # @param theTolerance Required tolerance value.
1608 # @return New GEOM_Object, containing processed shape.
1609 def Sew(self, theObject, theTolerance):
1610 # Example: see MakeSewing() above
1611 anObj = self.HealOp.Sew(theObject, theTolerance)
1612 RaiseIfFailed("Sew", self.HealOp)
1615 ## Remove internal wires and edges from the given object (face).
1616 # @param theObject Shape to be processed.
1617 # @param theWires Indices of wires to be removed, if EMPTY then the method
1618 # removes ALL internal wires of the given object.
1619 # @return New GEOM_Object, containing processed shape.
1621 # @ref tui_suppress_internal_wires "Example"
1622 def SuppressInternalWires(self,theObject, theWires):
1623 # Example: see GEOM_TestHealing.py
1624 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
1625 RaiseIfFailed("RemoveIntWires", self.HealOp)
1628 ## Remove internal closed contours (holes) from the given object.
1629 # @param theObject Shape to be processed.
1630 # @param theWires Indices of wires to be removed, if EMPTY then the method
1631 # removes ALL internal holes of the given object
1632 # @return New GEOM_Object, containing processed shape.
1634 # @ref tui_suppress_holes "Example"
1635 def SuppressHoles(self,theObject, theWires):
1636 # Example: see GEOM_TestHealing.py
1637 anObj = self.HealOp.FillHoles(theObject, theWires)
1638 RaiseIfFailed("FillHoles", self.HealOp)
1641 ## Close an open wire.
1642 # @param theObject Shape to be processed.
1643 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
1644 # if -1, then <VAR>theObject</VAR> itself is a wire.
1645 # @param isCommonVertex If TRUE : closure by creation of a common vertex,
1646 # If FALS : closure by creation of an edge between ends.
1647 # @return New GEOM_Object, containing processed shape.
1649 # @ref tui_close_contour "Example"
1650 def CloseContour(self,theObject, theWires, isCommonVertex):
1651 # Example: see GEOM_TestHealing.py
1652 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
1653 RaiseIfFailed("CloseContour", self.HealOp)
1656 ## Addition of a point to a given edge object.
1657 # @param theObject Shape to be processed.
1658 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
1659 # if -1, then theObject itself is the edge.
1660 # @param theValue Value of parameter on edge or length parameter,
1661 # depending on \a isByParameter.
1662 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1],
1663 # if FALSE : \a theValue is treated as a length parameter [0..1]
1664 # @return New GEOM_Object, containing processed shape.
1666 # @ref tui_add_point_on_edge "Example"
1667 def DivideEdge(self,theObject, theEdgeIndex, theValue, isByParameter):
1668 # Example: see GEOM_TestHealing.py
1669 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
1670 RaiseIfFailed("DivideEdge", self.HealOp)
1673 ## Change orientation of the given object.
1674 # @param theObject Shape to be processed.
1675 # @update given shape
1677 # @ref swig_todo "Example"
1678 def ChangeOrientationShell(self,theObject):
1679 theObject = self.HealOp.ChangeOrientation(theObject)
1680 RaiseIfFailed("ChangeOrientation", self.HealOp)
1683 ## Change orientation of the given object.
1684 # @param theObject Shape to be processed.
1685 # @return New GEOM_Object, containing processed shape.
1687 # @ref swig_todo "Example"
1688 def ChangeOrientationShellCopy(self,theObject):
1689 anObj = self.HealOp.ChangeOrientationCopy(theObject)
1690 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
1693 ## Get a list of wires (wrapped in GEOM_Object-s),
1694 # that constitute a free boundary of the given shape.
1695 # @param theObject Shape to get free boundary of.
1696 # @return [status, theClosedWires, theOpenWires]
1697 # status: FALSE, if an error(s) occured during the method execution.
1698 # theClosedWires: Closed wires on the free boundary of the given shape.
1699 # theOpenWires: Open wires on the free boundary of the given shape.
1701 # @ref tui_measurement_tools_page "Example"
1702 def GetFreeBoundary(self,theObject):
1703 # Example: see GEOM_TestHealing.py
1704 anObj = self.HealOp.GetFreeBoundary(theObject)
1705 RaiseIfFailed("GetFreeBoundary", self.HealOp)
1708 ## Replace coincident faces in theShape by one face.
1709 # @param theShape Initial shape.
1710 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
1711 # @param doKeepNonSolids If FALSE, only solids will present in the result,
1712 # otherwise all initial shapes.
1713 # @return New GEOM_Object, containing a copy of theShape without coincident faces.
1715 # @ref tui_glue_faces "Example"
1716 def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True):
1717 # Example: see GEOM_Spanner.py
1718 anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
1720 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
1723 ## Find coincident faces in theShape for possible gluing.
1724 # @param theShape Initial shape.
1725 # @param theTolerance Maximum distance between faces,
1726 # which can be considered as coincident.
1729 # @ref swig_todo "Example"
1730 def GetGlueFaces(self, theShape, theTolerance):
1731 # Example: see GEOM_Spanner.py
1732 anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
1733 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
1736 ## Replace coincident faces in theShape by one face
1737 # in compliance with given list of faces
1738 # @param theShape Initial shape.
1739 # @param theTolerance Maximum distance between faces,
1740 # which can be considered as coincident.
1741 # @param theFaces List of faces for gluing.
1742 # @param doKeepNonSolids If FALSE, only solids will present in the result,
1743 # otherwise all initial shapes.
1744 # @return New GEOM_Object, containing a copy of theShape
1745 # without some faces.
1747 # @ref swig_todo "Example"
1748 def MakeGlueFacesByList(self, theShape, theTolerance, theFaces, doKeepNonSolids=True):
1749 # Example: see GEOM_Spanner.py
1750 anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces, doKeepNonSolids)
1752 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
1758 ## @addtogroup l3_boolean Boolean Operations
1761 # -----------------------------------------------------------------------------
1762 # Boolean (Common, Cut, Fuse, Section)
1763 # -----------------------------------------------------------------------------
1765 ## Perform one of boolean operations on two given shapes.
1766 # @param theShape1 First argument for boolean operation.
1767 # @param theShape2 Second argument for boolean operation.
1768 # @param theOperation Indicates the operation to be done:
1769 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
1770 # @return New GEOM_Object, containing the result shape.
1772 # @ref tui_fuse "Example"
1773 def MakeBoolean(self,theShape1, theShape2, theOperation):
1774 # Example: see GEOM_TestAll.py
1775 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation)
1776 RaiseIfFailed("MakeBoolean", self.BoolOp)
1779 ## Shortcut to MakeBoolean(s1, s2, 1)
1781 # @ref tui_common "Example 1"
1782 # \n @ref swig_MakeCommon "Example 2"
1783 def MakeCommon(self, s1, s2):
1784 # Example: see GEOM_TestOthers.py
1785 return self.MakeBoolean(s1, s2, 1)
1787 ## Shortcut to MakeBoolean(s1, s2, 2)
1789 # @ref tui_cut "Example 1"
1790 # \n @ref swig_MakeCommon "Example 2"
1791 def MakeCut(self, s1, s2):
1792 # Example: see GEOM_TestOthers.py
1793 return self.MakeBoolean(s1, s2, 2)
1795 ## Shortcut to MakeBoolean(s1, s2, 3)
1797 # @ref tui_fuse "Example 1"
1798 # \n @ref swig_MakeCommon "Example 2"
1799 def MakeFuse(self, s1, s2):
1800 # Example: see GEOM_TestOthers.py
1801 return self.MakeBoolean(s1, s2, 3)
1803 ## Shortcut to MakeBoolean(s1, s2, 4)
1805 # @ref tui_section "Example 1"
1806 # \n @ref swig_MakeCommon "Example 2"
1807 def MakeSection(self, s1, s2):
1808 # Example: see GEOM_TestOthers.py
1809 return self.MakeBoolean(s1, s2, 4)
1814 ## @addtogroup l3_basic_op
1817 ## Perform partition operation.
1818 # @param ListShapes Shapes to be intersected.
1819 # @param ListTools Shapes to intersect theShapes.
1820 # !!!NOTE: Each compound from ListShapes and ListTools will be exploded
1821 # in order to avoid possible intersection between shapes from
1823 # @param Limit Type of resulting shapes (corresponding to TopAbs_ShapeEnum).
1824 # @param KeepNonlimitShapes: if this parameter == 0 - only shapes with
1825 # type <= Limit are kept in the result,
1826 # else - shapes with type > Limit are kept
1827 # also (if they exist)
1829 # After implementation new version of PartitionAlgo (October 2006)
1830 # other parameters are ignored by current functionality. They are kept
1831 # in this function only for support old versions.
1832 # Ignored parameters:
1833 # @param ListKeepInside Shapes, outside which the results will be deleted.
1834 # Each shape from theKeepInside must belong to theShapes also.
1835 # @param ListRemoveInside Shapes, inside which the results will be deleted.
1836 # Each shape from theRemoveInside must belong to theShapes also.
1837 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
1838 # @param ListMaterials Material indices for each shape. Make sence,
1839 # only if theRemoveWebs is TRUE.
1841 # @return New GEOM_Object, containing the result shapes.
1843 # @ref tui_partition "Example"
1844 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
1845 Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
1846 KeepNonlimitShapes=0):
1847 # Example: see GEOM_TestAll.py
1848 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
1849 ListKeepInside, ListRemoveInside,
1850 Limit, RemoveWebs, ListMaterials,
1851 KeepNonlimitShapes);
1852 RaiseIfFailed("MakePartition", self.BoolOp)
1855 ## Perform partition operation.
1856 # This method may be useful if it is needed to make a partition for
1857 # compound contains nonintersected shapes. Performance will be better
1858 # since intersection between shapes from compound is not performed.
1860 # Description of all parameters as in previous method MakePartition()
1862 # !!!NOTE: Passed compounds (via ListShapes or via ListTools)
1863 # have to consist of nonintersecting shapes.
1865 # @return New GEOM_Object, containing the result shapes.
1867 # @ref swig_todo "Example"
1868 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
1869 ListKeepInside=[], ListRemoveInside=[],
1870 Limit=ShapeType["SHAPE"], RemoveWebs=0,
1871 ListMaterials=[], KeepNonlimitShapes=0):
1872 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
1873 ListKeepInside, ListRemoveInside,
1874 Limit, RemoveWebs, ListMaterials,
1875 KeepNonlimitShapes);
1876 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
1879 ## Shortcut to MakePartition()
1881 # @ref tui_partition "Example 1"
1882 # \n @ref swig_Partition "Example 2"
1883 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
1884 Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
1885 KeepNonlimitShapes=0):
1886 # Example: see GEOM_TestOthers.py
1887 anObj = self.MakePartition(ListShapes, ListTools,
1888 ListKeepInside, ListRemoveInside,
1889 Limit, RemoveWebs, ListMaterials,
1890 KeepNonlimitShapes);
1893 ## Perform partition of the Shape with the Plane
1894 # @param theShape Shape to be intersected.
1895 # @param thePlane Tool shape, to intersect theShape.
1896 # @return New GEOM_Object, containing the result shape.
1898 # @ref tui_partition "Example"
1899 def MakeHalfPartition(self,theShape, thePlane):
1900 # Example: see GEOM_TestAll.py
1901 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
1902 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
1905 # end of l3_basic_op
1908 ## @addtogroup l3_transform
1911 ## Translate the given object along the vector, specified
1912 # by its end points, creating its copy before the translation.
1913 # @param theObject The object to be translated.
1914 # @param thePoint1 Start point of translation vector.
1915 # @param thePoint2 End point of translation vector.
1916 # @return New GEOM_Object, containing the translated object.
1918 # @ref tui_translation "Example 1"
1919 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
1920 def MakeTranslationTwoPoints(self,theObject, thePoint1, thePoint2):
1921 # Example: see GEOM_TestAll.py
1922 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
1923 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
1926 ## Translate the given object along the vector, specified
1927 # by its components, creating its copy before the translation.
1928 # @param theObject The object to be translated.
1929 # @param theDX,theDY,theDZ Components of translation vector.
1930 # @return New GEOM_Object, containing the translated object.
1932 # @ref tui_translation "Example"
1933 def MakeTranslation(self,theObject, theDX, theDY, theDZ):
1934 # Example: see GEOM_TestAll.py
1935 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
1936 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
1939 ## Translate the given object along the given vector,
1940 # creating its copy before the translation.
1941 # @param theObject The object to be translated.
1942 # @param theVector The translation vector.
1943 # @return New GEOM_Object, containing the translated object.
1945 # @ref tui_translation "Example"
1946 def MakeTranslationVector(self,theObject, theVector):
1947 # Example: see GEOM_TestAll.py
1948 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
1949 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
1952 ## Translate the given object along the given vector on given distance,
1953 # creating its copy before the translation.
1954 # @param theObject The object to be translated.
1955 # @param theVector The translation vector.
1956 # @param theDistance The translation distance.
1957 # @return New GEOM_Object, containing the translated object.
1959 # @ref tui_translation "Example"
1960 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance):
1961 # Example: see GEOM_TestAll.py
1962 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
1963 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
1966 ## Rotate the given object around the given axis
1967 # on the given angle, creating its copy before the rotatation.
1968 # @param theObject The object to be rotated.
1969 # @param theAxis Rotation axis.
1970 # @param theAngle Rotation angle in radians.
1971 # @return New GEOM_Object, containing the rotated object.
1973 # @ref tui_rotation "Example"
1974 def MakeRotation(self,theObject, theAxis, theAngle):
1975 # Example: see GEOM_TestAll.py
1976 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
1977 RaiseIfFailed("RotateCopy", self.TrsfOp)
1980 ## Rotate given object around vector perpendicular to plane
1981 # containing three points, creating its copy before the rotatation.
1982 # @param theObject The object to be rotated.
1983 # @param theCentPoint central point - the axis is the vector perpendicular to the plane
1984 # containing the three points.
1985 # @param thePoint1,thePoint2 - in a perpendicular plane of the axis.
1986 # @return New GEOM_Object, containing the rotated object.
1988 # @ref tui_rotation "Example"
1989 def MakeRotationThreePoints(self,theObject, theCentPoint, thePoint1, thePoint2):
1990 # Example: see GEOM_TestAll.py
1991 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
1992 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
1995 ## Scale the given object by the factor, creating its copy before the scaling.
1996 # @param theObject The object to be scaled.
1997 # @param thePoint Center point for scaling.
1998 # @param theFactor Scaling factor value.
1999 # @return New GEOM_Object, containing the scaled shape.
2001 # @ref tui_scale "Example"
2002 def MakeScaleTransform(self,theObject, thePoint, theFactor):
2003 # Example: see GEOM_TestAll.py
2004 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
2005 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
2008 ## Create an object, symmetrical
2009 # to the given one relatively the given plane.
2010 # @param theObject The object to be mirrored.
2011 # @param thePlane Plane of symmetry.
2012 # @return New GEOM_Object, containing the mirrored shape.
2014 # @ref tui_mirror "Example"
2015 def MakeMirrorByPlane(self,theObject, thePlane):
2016 # Example: see GEOM_TestAll.py
2017 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
2018 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
2021 ## Create an object, symmetrical
2022 # to the given one relatively the given axis.
2023 # @param theObject The object to be mirrored.
2024 # @param theAxis Axis of symmetry.
2025 # @return New GEOM_Object, containing the mirrored shape.
2027 # @ref tui_mirror "Example"
2028 def MakeMirrorByAxis(self,theObject, theAxis):
2029 # Example: see GEOM_TestAll.py
2030 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
2031 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
2034 ## Create an object, symmetrical
2035 # to the given one relatively the given point.
2036 # @param theObject The object to be mirrored.
2037 # @param thePoint Point of symmetry.
2038 # @return New GEOM_Object, containing the mirrored shape.
2040 # @ref tui_mirror "Example"
2041 def MakeMirrorByPoint(self,theObject, thePoint):
2042 # Example: see GEOM_TestAll.py
2043 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
2044 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
2047 ## Modify the Location of the given object by LCS,
2048 # creating its copy before the setting.
2049 # @param theObject The object to be displaced.
2050 # @param theStartLCS Coordinate system to perform displacement from it.
2051 # If \a theStartLCS is NULL, displacement
2052 # will be performed from global CS.
2053 # If \a theObject itself is used as \a theStartLCS,
2054 # its location will be changed to \a theEndLCS.
2055 # @param theEndLCS Coordinate system to perform displacement to it.
2056 # @return New GEOM_Object, containing the displaced shape.
2058 # @ref tui_modify_location "Example"
2059 def MakePosition(self,theObject, theStartLCS, theEndLCS):
2060 # Example: see GEOM_TestAll.py
2061 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
2062 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
2065 ## Create new object as offset of the given one.
2066 # @param theObject The base object for the offset.
2067 # @param theOffset Offset value.
2068 # @return New GEOM_Object, containing the offset object.
2070 # @ref tui_offset "Example"
2071 def MakeOffset(self,theObject, theOffset):
2072 # Example: see GEOM_TestAll.py
2073 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
2074 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
2077 # -----------------------------------------------------------------------------
2079 # -----------------------------------------------------------------------------
2081 ## Translate the given object along the given vector a given number times
2082 # @param theObject The object to be translated.
2083 # @param theVector Direction of the translation.
2084 # @param theStep Distance to translate on.
2085 # @param theNbTimes Quantity of translations to be done.
2086 # @return New GEOM_Object, containing compound of all
2087 # the shapes, obtained after each translation.
2089 # @ref tui_multi_translation "Example"
2090 def MakeMultiTranslation1D(self,theObject, theVector, theStep, theNbTimes):
2091 # Example: see GEOM_TestAll.py
2092 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
2093 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
2096 ## Conseqently apply two specified translations to theObject specified number of times.
2097 # @param theObject The object to be translated.
2098 # @param theVector1 Direction of the first translation.
2099 # @param theStep1 Step of the first translation.
2100 # @param theNbTimes1 Quantity of translations to be done along theVector1.
2101 # @param theVector2 Direction of the second translation.
2102 # @param theStep2 Step of the second translation.
2103 # @param theNbTimes2 Quantity of translations to be done along theVector2.
2104 # @return New GEOM_Object, containing compound of all
2105 # the shapes, obtained after each translation.
2107 # @ref tui_multi_translation "Example"
2108 def MakeMultiTranslation2D(self,theObject, theVector1, theStep1, theNbTimes1,
2109 theVector2, theStep2, theNbTimes2):
2110 # Example: see GEOM_TestAll.py
2111 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
2112 theVector2, theStep2, theNbTimes2)
2113 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
2116 ## Rotate the given object around the given axis a given number times.
2117 # Rotation angle will be 2*PI/theNbTimes.
2118 # @param theObject The object to be rotated.
2119 # @param theAxis The rotation axis.
2120 # @param theNbTimes Quantity of rotations to be done.
2121 # @return New GEOM_Object, containing compound of all the
2122 # shapes, obtained after each rotation.
2124 # @ref tui_multi_rotation "Example"
2125 def MultiRotate1D(self,theObject, theAxis, theNbTimes):
2126 # Example: see GEOM_TestAll.py
2127 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
2128 RaiseIfFailed("MultiRotate1D", self.TrsfOp)
2131 ## Rotate the given object around the
2132 # given axis on the given angle a given number
2133 # times and multi-translate each rotation result.
2134 # Translation direction passes through center of gravity
2135 # of rotated shape and its projection on the rotation axis.
2136 # @param theObject The object to be rotated.
2137 # @param theAxis Rotation axis.
2138 # @param theAngle Rotation angle in graduces.
2139 # @param theNbTimes1 Quantity of rotations to be done.
2140 # @param theStep Translation distance.
2141 # @param theNbTimes2 Quantity of translations to be done.
2142 # @return New GEOM_Object, containing compound of all the
2143 # shapes, obtained after each transformation.
2145 # @ref tui_multi_rotation "Example"
2146 def MultiRotate2D(self,theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2):
2147 # Example: see GEOM_TestAll.py
2148 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
2149 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
2152 ## The same, as MultiRotate1D(), but axis is given by direction and point
2153 # @ref swig_MakeMultiRotation "Example"
2154 def MakeMultiRotation1D(self,aShape,aDir,aPoint,aNbTimes):
2155 # Example: see GEOM_TestOthers.py
2156 aVec = self.MakeLine(aPoint,aDir)
2157 anObj = self.MultiRotate1D(aShape,aVec,aNbTimes)
2160 ## The same, as MultiRotate2D(), but axis is given by direction and point
2161 # @ref swig_MakeMultiRotation "Example"
2162 def MakeMultiRotation2D(self,aShape,aDir,aPoint,anAngle,nbtimes1,aStep,nbtimes2):
2163 # Example: see GEOM_TestOthers.py
2164 aVec = self.MakeLine(aPoint,aDir)
2165 anObj = self.MultiRotate2D(aShape,aVec,anAngle,nbtimes1,aStep,nbtimes2)
2168 # end of l3_transform
2171 ## @addtogroup l3_local
2174 ## Perform a fillet on all edges of the given shape.
2175 # @param theShape Shape, to perform fillet on.
2176 # @param theR Fillet radius.
2177 # @return New GEOM_Object, containing the result shape.
2179 # @ref tui_fillet "Example 1"
2180 # \n @ref swig_MakeFilletAll "Example 2"
2181 def MakeFilletAll(self,theShape, theR):
2182 # Example: see GEOM_TestOthers.py
2183 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
2184 RaiseIfFailed("MakeFilletAll", self.LocalOp)
2187 ## Perform a fillet on the specified edges/faces of the given shape
2188 # @param theShape Shape, to perform fillet on.
2189 # @param theR Fillet radius.
2190 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR>.
2191 # @param theListShapes Global indices of edges/faces to perform fillet on.
2192 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2193 # @return New GEOM_Object, containing the result shape.
2195 # @ref tui_fillet "Example"
2196 def MakeFillet(self,theShape, theR, theShapeType, theListShapes):
2197 # Example: see GEOM_TestAll.py
2199 if theShapeType == ShapeType["EDGE"]:
2200 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
2201 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
2203 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
2204 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
2207 ## The same that MakeFillet but with two Fillet Radius R1 and R2
2208 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes):
2210 if theShapeType == ShapeType["EDGE"]:
2211 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
2212 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
2214 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
2215 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
2218 ## Perform a symmetric chamfer on all edges of the given shape.
2219 # @param theShape Shape, to perform chamfer on.
2220 # @param theD Chamfer size along each face.
2221 # @return New GEOM_Object, containing the result shape.
2223 # @ref tui_chamfer "Example 1"
2224 # \n @ref swig_MakeChamferAll "Example 2"
2225 def MakeChamferAll(self,theShape, theD):
2226 # Example: see GEOM_TestOthers.py
2227 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
2228 RaiseIfFailed("MakeChamferAll", self.LocalOp)
2231 ## Perform a chamfer on edges, common to the specified faces,
2232 # with distance D1 on the Face1
2233 # @param theShape Shape, to perform chamfer on.
2234 # @param theD1 Chamfer size along \a theFace1.
2235 # @param theD2 Chamfer size along \a theFace2.
2236 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
2237 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2238 # @return New GEOM_Object, containing the result shape.
2240 # @ref tui_chamfer "Example"
2241 def MakeChamferEdge(self,theShape, theD1, theD2, theFace1, theFace2):
2242 # Example: see GEOM_TestAll.py
2243 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
2244 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
2247 ## The Same that MakeChamferEdge but with params theD is chamfer length and
2248 # theAngle is Angle of chamfer (angle in radians)
2249 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2):
2250 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
2251 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
2254 ## Perform a chamfer on all edges of the specified faces,
2255 # with distance D1 on the first specified face (if several for one edge)
2256 # @param theShape Shape, to perform chamfer on.
2257 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
2258 # connected to the edge, are in \a theFaces, \a theD1
2259 # will be get along face, which is nearer to \a theFaces beginning.
2260 # @param theD2 Chamfer size along another of two faces, connected to the edge.
2261 # @param theFaces Sequence of global indices of faces of \a theShape.
2262 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2263 # @return New GEOM_Object, containing the result shape.
2265 # @ref tui_chamfer "Example"
2266 def MakeChamferFaces(self,theShape, theD1, theD2, theFaces):
2267 # Example: see GEOM_TestAll.py
2268 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
2269 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
2272 ## The Same that MakeChamferFaces but with params theD is chamfer lenght and
2273 # theAngle is Angle of chamfer (angle in radians)
2275 # @ref swig_FilletChamfer "Example"
2276 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces):
2277 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
2278 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
2281 ## Perform a chamfer on edges,
2282 # with distance D1 on the first specified face (if several for one edge)
2283 # @param theShape Shape, to perform chamfer on.
2284 # @param theD1,theD2 Chamfer size
2285 # @param theEdges Sequence of edges of \a theShape.
2286 # @return New GEOM_Object, containing the result shape.
2288 # @ref swig_FilletChamfer "Example"
2289 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges):
2290 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
2291 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
2294 ## The Same that MakeChamferEdges but with params theD is chamfer lenght and
2295 # theAngle is Angle of chamfer (angle in radians)
2296 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges):
2297 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
2298 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
2301 ## Shortcut to MakeChamferEdge() and MakeChamferFaces()
2303 # @ref swig_MakeChamfer "Example"
2304 def MakeChamfer(self,aShape,d1,d2,aShapeType,ListShape):
2305 # Example: see GEOM_TestOthers.py
2307 if aShapeType == ShapeType["EDGE"]:
2308 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1])
2310 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape)
2316 ## @addtogroup l3_basic_op
2319 ## Perform an Archimde operation on the given shape with given parameters.
2320 # The object presenting the resulting face is returned.
2321 # @param theShape Shape to be put in water.
2322 # @param theWeight Weight og the shape.
2323 # @param theWaterDensity Density of the water.
2324 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
2325 # @return New GEOM_Object, containing a section of \a theShape
2326 # by a plane, corresponding to water level.
2328 # @ref tui_archimede "Example"
2329 def Archimede(self,theShape, theWeight, theWaterDensity, theMeshDeflection):
2330 # Example: see GEOM_TestAll.py
2331 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
2332 RaiseIfFailed("MakeArchimede", self.LocalOp)
2335 # end of l3_basic_op
2338 ## @addtogroup l2_measure
2341 ## Get point coordinates
2344 # @ref tui_measurement_tools_page "Example"
2345 def PointCoordinates(self,Point):
2346 # Example: see GEOM_TestMeasures.py
2347 aTuple = self.MeasuOp.PointCoordinates(Point)
2348 RaiseIfFailed("PointCoordinates", self.MeasuOp)
2351 ## Get summarized length of all wires,
2352 # area of surface and volume of the given shape.
2353 # @param theShape Shape to define properties of.
2354 # @return [theLength, theSurfArea, theVolume]
2355 # theLength: Summarized length of all wires of the given shape.
2356 # theSurfArea: Area of surface of the given shape.
2357 # theVolume: Volume of the given shape.
2359 # @ref tui_measurement_tools_page "Example"
2360 def BasicProperties(self,theShape):
2361 # Example: see GEOM_TestMeasures.py
2362 aTuple = self.MeasuOp.GetBasicProperties(theShape)
2363 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
2366 ## Get parameters of bounding box of the given shape
2367 # @param theShape Shape to obtain bounding box of.
2368 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
2369 # Xmin,Xmax: Limits of shape along OX axis.
2370 # Ymin,Ymax: Limits of shape along OY axis.
2371 # Zmin,Zmax: Limits of shape along OZ axis.
2373 # @ref tui_measurement_tools_page "Example"
2374 def BoundingBox(self,theShape):
2375 # Example: see GEOM_TestMeasures.py
2376 aTuple = self.MeasuOp.GetBoundingBox(theShape)
2377 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
2380 ## Get inertia matrix and moments of inertia of theShape.
2381 # @param theShape Shape to calculate inertia of.
2382 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
2383 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
2384 # Ix,Iy,Iz: Moments of inertia of the given shape.
2386 # @ref tui_measurement_tools_page "Example"
2387 def Inertia(self,theShape):
2388 # Example: see GEOM_TestMeasures.py
2389 aTuple = self.MeasuOp.GetInertia(theShape)
2390 RaiseIfFailed("GetInertia", self.MeasuOp)
2393 ## Get minimal distance between the given shapes.
2394 # @param theShape1,theShape2 Shapes to find minimal distance between.
2395 # @return Value of the minimal distance between the given shapes.
2397 # @ref tui_measurement_tools_page "Example"
2398 def MinDistance(self, theShape1, theShape2):
2399 # Example: see GEOM_TestMeasures.py
2400 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
2401 RaiseIfFailed("GetMinDistance", self.MeasuOp)
2404 ## Get minimal distance between the given shapes.
2405 # @param theShape1,theShape2 Shapes to find minimal distance between.
2406 # @return Value of the minimal distance between the given shapes.
2408 # @ref swig_all_measure "Example"
2409 def MinDistanceComponents(self, theShape1, theShape2):
2410 # Example: see GEOM_TestMeasures.py
2411 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
2412 RaiseIfFailed("GetMinDistance", self.MeasuOp)
2413 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
2416 ## Get angle between the given shapes.
2417 # @param theShape1,theShape2 Lines or linear edges to find angle between.
2418 # @return Value of the angle between the given shapes.
2420 # @ref tui_measurement_tools_page "Example"
2421 def GetAngle(self, theShape1, theShape2):
2422 # Example: see GEOM_TestMeasures.py
2423 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
2424 RaiseIfFailed("GetAngle", self.MeasuOp)
2427 ## @name Curve Curvature Measurement
2428 # Methods for receiving radius of curvature of curves
2429 # in the given point
2432 ## Measure curvature of a curve at a point, set by parameter.
2433 # @ref swig_todo "Example"
2434 def CurveCurvatureByParam(self, theCurve, theParam):
2435 # Example: see GEOM_TestMeasures.py
2436 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
2437 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
2441 # @ref swig_todo "Example"
2442 def CurveCurvatureByPoint(self, theCurve, thePoint):
2443 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
2444 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
2448 ## @name Surface Curvature Measurement
2449 # Methods for receiving max and min radius of curvature of surfaces
2450 # in the given point
2454 ## @ref swig_todo "Example"
2455 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
2456 # Example: see GEOM_TestMeasures.py
2457 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
2458 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
2462 ## @ref swig_todo "Example"
2463 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
2464 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
2465 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
2469 ## @ref swig_todo "Example"
2470 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
2471 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
2472 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
2476 ## @ref swig_todo "Example"
2477 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
2478 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
2479 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
2483 ## Get min and max tolerances of sub-shapes of theShape
2484 # @param theShape Shape, to get tolerances of.
2485 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
2486 # FaceMin,FaceMax: Min and max tolerances of the faces.
2487 # EdgeMin,EdgeMax: Min and max tolerances of the edges.
2488 # VertMin,VertMax: Min and max tolerances of the vertices.
2490 # @ref tui_measurement_tools_page "Example"
2491 def Tolerance(self,theShape):
2492 # Example: see GEOM_TestMeasures.py
2493 aTuple = self.MeasuOp.GetTolerance(theShape)
2494 RaiseIfFailed("GetTolerance", self.MeasuOp)
2497 ## Obtain description of the given shape (number of sub-shapes of each type)
2498 # @param theShape Shape to be described.
2499 # @return Description of the given shape.
2501 # @ref tui_measurement_tools_page "Example"
2502 def WhatIs(self,theShape):
2503 # Example: see GEOM_TestMeasures.py
2504 aDescr = self.MeasuOp.WhatIs(theShape)
2505 RaiseIfFailed("WhatIs", self.MeasuOp)
2508 ## Get a point, situated at the centre of mass of theShape.
2509 # @param theShape Shape to define centre of mass of.
2510 # @return New GEOM_Object, containing the created point.
2512 # @ref tui_measurement_tools_page "Example"
2513 def MakeCDG(self,theShape):
2514 # Example: see GEOM_TestMeasures.py
2515 anObj = self.MeasuOp.GetCentreOfMass(theShape)
2516 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
2519 ## Get a normale to the given face. If the point is not given,
2520 # the normale is calculated at the center of mass.
2521 # @param theFace Face to define normale of.
2522 # @param theOptionalPoint Point to compute the normale at.
2523 # @return New GEOM_Object, containing the created vector.
2525 # @ref swig_todo "Example"
2526 def GetNormal(self, theFace, theOptionalPoint = None):
2527 # Example: see GEOM_TestMeasures.py
2528 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
2529 RaiseIfFailed("GetNormal", self.MeasuOp)
2532 ## Check a topology of the given shape.
2533 # @param theShape Shape to check validity of.
2534 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked,
2535 # if TRUE, the shape's geometry will be checked also.
2536 # @return TRUE, if the shape "seems to be valid".
2537 # If theShape is invalid, prints a description of problem.
2539 # @ref tui_measurement_tools_page "Example"
2540 def CheckShape(self,theShape, theIsCheckGeom = 0):
2541 # Example: see GEOM_TestMeasures.py
2543 (IsValid, Status) = self.MeasuOp.CheckShapeWithGeometry(theShape)
2544 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
2546 (IsValid, Status) = self.MeasuOp.CheckShape(theShape)
2547 RaiseIfFailed("CheckShape", self.MeasuOp)
2552 ## Get position (LCS) of theShape.
2554 # Origin of the LCS is situated at the shape's center of mass.
2555 # Axes of the LCS are obtained from shape's location or,
2556 # if the shape is a planar face, from position of its plane.
2558 # @param theShape Shape to calculate position of.
2559 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
2560 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
2561 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
2562 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
2564 # @ref swig_todo "Example"
2565 def GetPosition(self,theShape):
2566 # Example: see GEOM_TestMeasures.py
2567 aTuple = self.MeasuOp.GetPosition(theShape)
2568 RaiseIfFailed("GetPosition", self.MeasuOp)
2571 ## Get kind of theShape.
2573 # @param theShape Shape to get a kind of.
2574 # @return Returns a kind of shape in terms of <VAR>GEOM_IKindOfShape.shape_kind</VAR> enumeration
2575 # and a list of parameters, describing the shape.
2576 # @note Concrete meaning of each value, returned via \a theIntegers
2577 # or \a theDoubles list depends on the kind of the shape.
2578 # The full list of possible outputs is:
2580 # - geompy.kind.COMPOUND nb_solids nb_faces nb_edges nb_vertices
2581 # - geompy.kind.COMPSOLID nb_solids nb_faces nb_edges nb_vertices
2583 # - geompy.kind.SHELL geompy.info.CLOSED nb_faces nb_edges nb_vertices
2584 # - geompy.kind.SHELL geompy.info.UNCLOSED nb_faces nb_edges nb_vertices
2586 # - geompy.kind.WIRE geompy.info.CLOSED nb_edges nb_vertices
2587 # - geompy.kind.WIRE geompy.info.UNCLOSED nb_edges nb_vertices
2589 # - geompy.kind.SPHERE xc yc zc R
2590 # - geompy.kind.CYLINDER xb yb zb dx dy dz R H
2591 # - geompy.kind.BOX xc yc zc ax ay az
2592 # - geompy.kind.ROTATED_BOX xc yc zc zx zy zz xx xy xz ax ay az
2593 # - geompy.kind.TORUS xc yc zc dx dy dz R_1 R_2
2594 # - geompy.kind.CONE xb yb zb dx dy dz R_1 R_2 H
2595 # - geompy.kind.POLYHEDRON nb_faces nb_edges nb_vertices
2596 # - geompy.kind.SOLID nb_faces nb_edges nb_vertices
2598 # - geompy.kind.SPHERE2D xc yc zc R
2599 # - geompy.kind.CYLINDER2D xb yb zb dx dy dz R H
2600 # - geompy.kind.TORUS2D xc yc zc dx dy dz R_1 R_2
2601 # - geompy.kind.CONE2D xc yc zc dx dy dz R_1 R_2 H
2602 # - geompy.kind.DISK_CIRCLE xc yc zc dx dy dz R
2603 # - geompy.kind.DISK_ELLIPSE xc yc zc dx dy dz R_1 R_2
2604 # - geompy.kind.POLYGON xo yo zo dx dy dz nb_edges nb_vertices
2605 # - geompy.kind.PLANE xo yo zo dx dy dz
2606 # - geompy.kind.PLANAR xo yo zo dx dy dz nb_edges nb_vertices
2607 # - geompy.kind.FACE nb_edges nb_vertices
2609 # - geompy.kind.CIRCLE xc yc zc dx dy dz R
2610 # - geompy.kind.ARC_CIRCLE xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2
2611 # - geompy.kind.ELLIPSE xc yc zc dx dy dz R_1 R_2
2612 # - geompy.kind.ARC_ELLIPSE xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2
2613 # - geompy.kind.LINE xo yo zo dx dy dz
2614 # - geompy.kind.SEGMENT x1 y1 z1 x2 y2 z2
2615 # - geompy.kind.EDGE nb_vertices
2617 # - geompy.kind.VERTEX x y z
2619 # @ref swig_todo "Example"
2620 def KindOfShape(self,theShape):
2621 # Example: see GEOM_TestMeasures.py
2622 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
2623 RaiseIfFailed("KindOfShape", self.MeasuOp)
2625 aKind = aRoughTuple[0]
2626 anInts = aRoughTuple[1]
2627 aDbls = aRoughTuple[2]
2629 # Now there is no exception from this rule:
2630 aKindTuple = [aKind] + aDbls + anInts
2632 # If they are we will regroup parameters for such kind of shape.
2634 #if aKind == kind.SOME_KIND:
2635 # # SOME_KIND int int double int double double
2636 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
2643 ## @addtogroup l2_import_export
2646 ## Import a shape from the BREP or IGES or STEP file
2647 # (depends on given format) with given name.
2648 # @param theFileName The file, containing the shape.
2649 # @param theFormatName Specify format for the file reading.
2650 # Available formats can be obtained with InsertOp.ImportTranslators() method.
2651 # @return New GEOM_Object, containing the imported shape.
2653 # @ref swig_Import_Export "Example"
2654 def Import(self,theFileName, theFormatName):
2655 # Example: see GEOM_TestOthers.py
2656 anObj = self.InsertOp.Import(theFileName, theFormatName)
2657 RaiseIfFailed("Import", self.InsertOp)
2660 ## Shortcut to Import() for BREP format
2662 # @ref swig_Import_Export "Example"
2663 def ImportBREP(self,theFileName):
2664 # Example: see GEOM_TestOthers.py
2665 return self.Import(theFileName, "BREP")
2667 ## Shortcut to Import() for IGES format
2669 # @ref swig_Import_Export "Example"
2670 def ImportIGES(self,theFileName):
2671 # Example: see GEOM_TestOthers.py
2672 return self.Import(theFileName, "IGES")
2674 ## Shortcut to Import() for STEP format
2676 # @ref swig_Import_Export "Example"
2677 def ImportSTEP(self,theFileName):
2678 # Example: see GEOM_TestOthers.py
2679 return self.Import(theFileName, "STEP")
2681 ## Export the given shape into a file with given name.
2682 # @param theObject Shape to be stored in the file.
2683 # @param theFileName Name of the file to store the given shape in.
2684 # @param theFormatName Specify format for the shape storage.
2685 # Available formats can be obtained with InsertOp.ImportTranslators() method.
2687 # @ref swig_Import_Export "Example"
2688 def Export(self,theObject, theFileName, theFormatName):
2689 # Example: see GEOM_TestOthers.py
2690 self.InsertOp.Export(theObject, theFileName, theFormatName)
2691 if self.InsertOp.IsDone() == 0:
2692 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
2696 ## Shortcut to Export() for BREP format
2698 # @ref swig_Import_Export "Example"
2699 def ExportBREP(self,theObject, theFileName):
2700 # Example: see GEOM_TestOthers.py
2701 return self.Export(theObject, theFileName, "BREP")
2703 ## Shortcut to Export() for IGES format
2705 # @ref swig_Import_Export "Example"
2706 def ExportIGES(self,theObject, theFileName):
2707 # Example: see GEOM_TestOthers.py
2708 return self.Export(theObject, theFileName, "IGES")
2710 ## Shortcut to Export() for STEP format
2712 # @ref swig_Import_Export "Example"
2713 def ExportSTEP(self,theObject, theFileName):
2714 # Example: see GEOM_TestOthers.py
2715 return self.Export(theObject, theFileName, "STEP")
2717 # end of l2_import_export
2720 ## @addtogroup l3_blocks
2723 ## Create a quadrangle face from four edges. Order of Edges is not
2724 # important. It is not necessary that edges share the same vertex.
2725 # @param E1,E2,E3,E4 Edges for the face bound.
2726 # @return New GEOM_Object, containing the created face.
2728 # @ref tui_building_by_blocks_page "Example"
2729 def MakeQuad(self,E1, E2, E3, E4):
2730 # Example: see GEOM_Spanner.py
2731 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
2732 RaiseIfFailed("MakeQuad", self.BlocksOp)
2735 ## Create a quadrangle face on two edges.
2736 # The missing edges will be built by creating the shortest ones.
2737 # @param E1,E2 Two opposite edges for the face.
2738 # @return New GEOM_Object, containing the created face.
2740 # @ref tui_building_by_blocks_page "Example"
2741 def MakeQuad2Edges(self,E1, E2):
2742 # Example: see GEOM_Spanner.py
2743 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
2744 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
2747 ## Create a quadrangle face with specified corners.
2748 # The missing edges will be built by creating the shortest ones.
2749 # @param V1,V2,V3,V4 Corner vertices for the face.
2750 # @return New GEOM_Object, containing the created face.
2752 # @ref tui_building_by_blocks_page "Example 1"
2753 # \n @ref swig_MakeQuad4Vertices "Example 2"
2754 def MakeQuad4Vertices(self,V1, V2, V3, V4):
2755 # Example: see GEOM_Spanner.py
2756 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
2757 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
2760 ## Create a hexahedral solid, bounded by the six given faces. Order of
2761 # faces is not important. It is not necessary that Faces share the same edge.
2762 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
2763 # @return New GEOM_Object, containing the created solid.
2765 # @ref tui_building_by_blocks_page "Example 1"
2766 # \n @ref swig_MakeHexa "Example 2"
2767 def MakeHexa(self,F1, F2, F3, F4, F5, F6):
2768 # Example: see GEOM_Spanner.py
2769 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
2770 RaiseIfFailed("MakeHexa", self.BlocksOp)
2773 ## Create a hexahedral solid between two given faces.
2774 # The missing faces will be built by creating the smallest ones.
2775 # @param F1,F2 Two opposite faces for the hexahedral solid.
2776 # @return New GEOM_Object, containing the created solid.
2778 # @ref tui_building_by_blocks_page "Example 1"
2779 # \n @ref swig_MakeHexa2Faces "Example 2"
2780 def MakeHexa2Faces(self,F1, F2):
2781 # Example: see GEOM_Spanner.py
2782 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
2783 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
2789 ## @addtogroup l3_blocks_op
2792 ## Get a vertex, found in the given shape by its coordinates.
2793 # @param theShape Block or a compound of blocks.
2794 # @param theX,theY,theZ Coordinates of the sought vertex.
2795 # @param theEpsilon Maximum allowed distance between the resulting
2796 # vertex and point with the given coordinates.
2797 # @return New GEOM_Object, containing the found vertex.
2799 # @ref swig_GetPoint "Example"
2800 def GetPoint(self,theShape, theX, theY, theZ, theEpsilon):
2801 # Example: see GEOM_TestOthers.py
2802 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
2803 RaiseIfFailed("GetPoint", self.BlocksOp)
2806 ## Get an edge, found in the given shape by two given vertices.
2807 # @param theShape Block or a compound of blocks.
2808 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
2809 # @return New GEOM_Object, containing the found edge.
2811 # @ref swig_todo "Example"
2812 def GetEdge(self,theShape, thePoint1, thePoint2):
2813 # Example: see GEOM_Spanner.py
2814 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
2815 RaiseIfFailed("GetEdge", self.BlocksOp)
2818 ## Find an edge of the given shape, which has minimal distance to the given point.
2819 # @param theShape Block or a compound of blocks.
2820 # @param thePoint Point, close to the desired edge.
2821 # @return New GEOM_Object, containing the found edge.
2823 # @ref swig_GetEdgeNearPoint "Example"
2824 def GetEdgeNearPoint(self,theShape, thePoint):
2825 # Example: see GEOM_TestOthers.py
2826 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
2827 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
2830 ## Returns a face, found in the given shape by four given corner vertices.
2831 # @param theShape Block or a compound of blocks.
2832 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
2833 # @return New GEOM_Object, containing the found face.
2835 # @ref swig_todo "Example"
2836 def GetFaceByPoints(self,theShape, thePoint1, thePoint2, thePoint3, thePoint4):
2837 # Example: see GEOM_Spanner.py
2838 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
2839 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
2842 ## Get a face of block, found in the given shape by two given edges.
2843 # @param theShape Block or a compound of blocks.
2844 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
2845 # @return New GEOM_Object, containing the found face.
2847 # @ref swig_todo "Example"
2848 def GetFaceByEdges(self,theShape, theEdge1, theEdge2):
2849 # Example: see GEOM_Spanner.py
2850 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
2851 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
2854 ## Find a face, opposite to the given one in the given block.
2855 # @param theBlock Must be a hexahedral solid.
2856 # @param theFace Face of \a theBlock, opposite to the desired face.
2857 # @return New GEOM_Object, containing the found face.
2859 # @ref swig_GetOppositeFace "Example"
2860 def GetOppositeFace(self,theBlock, theFace):
2861 # Example: see GEOM_Spanner.py
2862 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
2863 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
2866 ## Find a face of the given shape, which has minimal distance to the given point.
2867 # @param theShape Block or a compound of blocks.
2868 # @param thePoint Point, close to the desired face.
2869 # @return New GEOM_Object, containing the found face.
2871 # @ref swig_GetFaceNearPoint "Example"
2872 def GetFaceNearPoint(self,theShape, thePoint):
2873 # Example: see GEOM_Spanner.py
2874 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
2875 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
2878 ## Find a face of block, whose outside normale has minimal angle with the given vector.
2879 # @param theBlock Block or a compound of blocks.
2880 # @param theVector Vector, close to the normale of the desired face.
2881 # @return New GEOM_Object, containing the found face.
2883 # @ref swig_todo "Example"
2884 def GetFaceByNormale(self, theBlock, theVector):
2885 # Example: see GEOM_Spanner.py
2886 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
2887 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
2890 # end of l3_blocks_op
2893 ## @addtogroup l4_blocks_measure
2896 ## Check, if the compound of blocks is given.
2897 # To be considered as a compound of blocks, the
2898 # given shape must satisfy the following conditions:
2899 # - Each element of the compound should be a Block (6 faces and 12 edges).
2900 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
2901 # - The compound should be connexe.
2902 # - The glue between two quadrangle faces should be applied.
2903 # @param theCompound The compound to check.
2904 # @return TRUE, if the given shape is a compound of blocks.
2905 # If theCompound is not valid, prints all discovered errors.
2907 # @ref tui_measurement_tools_page "Example 1"
2908 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
2909 def CheckCompoundOfBlocks(self,theCompound):
2910 # Example: see GEOM_Spanner.py
2911 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
2912 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
2914 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
2918 ## Remove all seam and degenerated edges from \a theShape.
2919 # Unite faces and edges, sharing one surface. It means that
2920 # this faces must have references to one C++ surface object (handle).
2921 # @param theShape The compound or single solid to remove irregular edges from.
2922 # @return Improved shape.
2924 # @ref swig_RemoveExtraEdges "Example"
2925 def RemoveExtraEdges(self,theShape):
2926 # Example: see GEOM_TestOthers.py
2927 anObj = self.BlocksOp.RemoveExtraEdges(theShape)
2928 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
2931 ## Check, if the given shape is a blocks compound.
2932 # Fix all detected errors.
2933 # \note Single block can be also fixed by this method.
2934 # @param theShape The compound to check and improve.
2935 # @return Improved compound.
2937 # @ref swig_CheckAndImprove "Example"
2938 def CheckAndImprove(self,theShape):
2939 # Example: see GEOM_TestOthers.py
2940 anObj = self.BlocksOp.CheckAndImprove(theShape)
2941 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
2944 # end of l4_blocks_measure
2947 ## @addtogroup l3_blocks_op
2950 ## Get all the blocks, contained in the given compound.
2951 # @param theCompound The compound to explode.
2952 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
2953 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
2954 # \note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
2955 # @return List of GEOM_Objects, containing the retrieved blocks.
2957 # @ref tui_explode_on_blocks "Example 1"
2958 # \n @ref swig_MakeBlockExplode "Example 2"
2959 def MakeBlockExplode(self,theCompound, theMinNbFaces, theMaxNbFaces):
2960 # Example: see GEOM_TestOthers.py
2961 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
2962 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
2965 ## Find block, containing the given point inside its volume or on boundary.
2966 # @param theCompound Compound, to find block in.
2967 # @param thePoint Point, close to the desired block. If the point lays on
2968 # boundary between some blocks, we return block with nearest center.
2969 # @return New GEOM_Object, containing the found block.
2971 # @ref swig_todo "Example"
2972 def GetBlockNearPoint(self,theCompound, thePoint):
2973 # Example: see GEOM_Spanner.py
2974 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
2975 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
2978 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
2979 # @param theCompound Compound, to find block in.
2980 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
2981 # @return New GEOM_Object, containing the found block.
2983 # @ref swig_GetBlockByParts "Example"
2984 def GetBlockByParts(self,theCompound, theParts):
2985 # Example: see GEOM_TestOthers.py
2986 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
2987 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
2990 ## Return all blocks, containing all the elements, passed as the parts.
2991 # @param theCompound Compound, to find blocks in.
2992 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
2993 # @return List of GEOM_Objects, containing the found blocks.
2995 # @ref swig_todo "Example"
2996 def GetBlocksByParts(self,theCompound, theParts):
2997 # Example: see GEOM_Spanner.py
2998 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
2999 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
3002 ## Multi-transformate block and glue the result.
3003 # Transformation is defined so, as to superpose direction faces.
3004 # @param Block Hexahedral solid to be multi-transformed.
3005 # @param DirFace1 ID of First direction face.
3006 # @param DirFace2 ID of Second direction face.
3007 # @param NbTimes Quantity of transformations to be done.
3008 # \note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
3009 # @return New GEOM_Object, containing the result shape.
3011 # @ref tui_multi_transformation "Example"
3012 def MakeMultiTransformation1D(self,Block, DirFace1, DirFace2, NbTimes):
3013 # Example: see GEOM_Spanner.py
3014 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
3015 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
3018 ## Multi-transformate block and glue the result.
3019 # @param Block Hexahedral solid to be multi-transformed.
3020 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
3021 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
3022 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
3023 # @return New GEOM_Object, containing the result shape.
3025 # @ref tui_multi_transformation "Example"
3026 def MakeMultiTransformation2D(self,Block, DirFace1U, DirFace2U, NbTimesU,
3027 DirFace1V, DirFace2V, NbTimesV):
3028 # Example: see GEOM_Spanner.py
3029 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
3030 DirFace1V, DirFace2V, NbTimesV)
3031 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
3034 ## Build all possible propagation groups.
3035 # Propagation group is a set of all edges, opposite to one (main)
3036 # edge of this group directly or through other opposite edges.
3037 # Notion of Opposite Edge make sence only on quadrangle face.
3038 # @param theShape Shape to build propagation groups on.
3039 # @return List of GEOM_Objects, each of them is a propagation group.
3041 # @ref swig_Propagate "Example"
3042 def Propagate(self,theShape):
3043 # Example: see GEOM_TestOthers.py
3044 listChains = self.BlocksOp.Propagate(theShape)
3045 RaiseIfFailed("Propagate", self.BlocksOp)
3048 # end of l3_blocks_op
3051 ## @addtogroup l3_groups
3054 ## Creates a new group which will store sub shapes of theMainShape
3055 # @param theMainShape is a GEOM object on which the group is selected
3056 # @param theShapeType defines a shape type of the group
3057 # @return a newly created GEOM group
3059 # @ref tui_working_with_groups_page "Example 1"
3060 # \n @ref swig_CreateGroup "Example 2"
3061 def CreateGroup(self,theMainShape, theShapeType):
3062 # Example: see GEOM_TestOthers.py
3063 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
3064 RaiseIfFailed("CreateGroup", self.GroupOp)
3067 ## Adds a sub object with ID theSubShapeId to the group
3068 # @param theGroup is a GEOM group to which the new sub shape is added
3069 # @param theSubShapeID is a sub shape ID in the main object.
3070 # \note Use method GetSubShapeID() to get an unique ID of the sub shape
3072 # @ref tui_working_with_groups_page "Example"
3073 def AddObject(self,theGroup, theSubShapeID):
3074 # Example: see GEOM_TestOthers.py
3075 self.GroupOp.AddObject(theGroup, theSubShapeID)
3076 RaiseIfFailed("AddObject", self.GroupOp)
3079 ## Removes a sub object with ID \a theSubShapeId from the group
3080 # @param theGroup is a GEOM group from which the new sub shape is removed
3081 # @param theSubShapeID is a sub shape ID in the main object.
3082 # \note Use method GetSubShapeID() to get an unique ID of the sub shape
3084 # @ref tui_working_with_groups_page "Example"
3085 def RemoveObject(self,theGroup, theSubShapeID):
3086 # Example: see GEOM_TestOthers.py
3087 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
3088 RaiseIfFailed("RemoveObject", self.GroupOp)
3091 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
3092 # @param theGroup is a GEOM group to which the new sub shapes are added.
3093 # @param theSubShapes is a list of sub shapes to be added.
3095 # @ref tui_working_with_groups_page "Example"
3096 def UnionList (self,theGroup, theSubShapes):
3097 # Example: see GEOM_TestOthers.py
3098 self.GroupOp.UnionList(theGroup, theSubShapes)
3099 RaiseIfFailed("UnionList", self.GroupOp)
3102 ## Works like the above method, but argument
3103 # theSubShapes here is a list of sub-shapes indices
3105 # @ref swig_UnionIDs "Example"
3106 def UnionIDs(self,theGroup, theSubShapes):
3107 # Example: see GEOM_TestOthers.py
3108 self.GroupOp.UnionIDs(theGroup, theSubShapes)
3109 RaiseIfFailed("UnionIDs", self.GroupOp)
3112 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
3113 # @param theGroup is a GEOM group from which the sub-shapes are removed.
3114 # @param theSubShapes is a list of sub-shapes to be removed.
3116 # @ref tui_working_with_groups_page "Example"
3117 def DifferenceList (self,theGroup, theSubShapes):
3118 # Example: see GEOM_TestOthers.py
3119 self.GroupOp.DifferenceList(theGroup, theSubShapes)
3120 RaiseIfFailed("DifferenceList", self.GroupOp)
3123 ## Works like the above method, but argument
3124 # theSubShapes here is a list of sub-shapes indices
3126 # @ref swig_DifferenceIDs "Example"
3127 def DifferenceIDs(self,theGroup, theSubShapes):
3128 # Example: see GEOM_TestOthers.py
3129 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
3130 RaiseIfFailed("DifferenceIDs", self.GroupOp)
3133 ## Returns a list of sub objects ID stored in the group
3134 # @param theGroup is a GEOM group for which a list of IDs is requested
3136 # @ref swig_GetObjectIDs "Example"
3137 def GetObjectIDs(self,theGroup):
3138 # Example: see GEOM_TestOthers.py
3139 ListIDs = self.GroupOp.GetObjects(theGroup)
3140 RaiseIfFailed("GetObjects", self.GroupOp)
3143 ## Returns a type of sub objects stored in the group
3144 # @param theGroup is a GEOM group which type is returned.
3146 # @ref swig_GetType "Example"
3147 def GetType(self,theGroup):
3148 # Example: see GEOM_TestOthers.py
3149 aType = self.GroupOp.GetType(theGroup)
3150 RaiseIfFailed("GetType", self.GroupOp)
3153 ## Returns a main shape associated with the group
3154 # @param theGroup is a GEOM group for which a main shape object is requested
3155 # @return a GEOM object which is a main shape for theGroup
3157 # @ref swig_GetMainShape "Example"
3158 def GetMainShape(self,theGroup):
3159 # Example: see GEOM_TestOthers.py
3160 anObj = self.GroupOp.GetMainShape(theGroup)
3161 RaiseIfFailed("GetMainShape", self.GroupOp)
3164 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
3165 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
3167 # @ref swig_todo "Example"
3168 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1):
3169 edges = self.SubShapeAll(theShape, ShapeType["EDGE"])
3172 Props = self.BasicProperties(edge)
3173 if min_length <= Props[0] and Props[0] <= max_length:
3174 if (not include_min) and (min_length == Props[0]):
3177 if (not include_max) and (Props[0] == max_length):
3180 edges_in_range.append(edge)
3182 if len(edges_in_range) <= 0:
3183 print "No edges found by given criteria"
3186 group_edges = self.CreateGroup(theShape, ShapeType["EDGE"])
3187 self.UnionList(group_edges, edges_in_range)
3191 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
3192 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
3194 # @ref swig_todo "Example"
3195 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
3196 nb_selected = sg.SelectedCount()
3198 print "Select a shape before calling this function, please."
3201 print "Only one shape must be selected"
3204 id_shape = sg.getSelected(0)
3205 shape = IDToObject( id_shape )
3207 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
3211 if include_min: left_str = " <= "
3212 if include_max: right_str = " <= "
3214 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
3215 + left_str + "length" + right_str + `max_length`)
3217 sg.updateObjBrowser(1)
3224 ## Create a copy of the given object
3225 # @ingroup l1_geompy_auxiliary
3227 # @ref swig_all_advanced "Example"
3228 def MakeCopy(self,theOriginal):
3229 # Example: see GEOM_TestAll.py
3230 anObj = self.InsertOp.MakeCopy(theOriginal)
3231 RaiseIfFailed("MakeCopy", self.InsertOp)
3234 ## Add Path to load python scripts from
3235 # @ingroup l1_geompy_auxiliary
3236 def addPath(self,Path):
3237 if (sys.path.count(Path) < 1):
3238 sys.path.append(Path)
3241 #Register the new proxy for GEOM_Gen
3242 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geompyDC)