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
83 from salome_notebook import *
88 ## Enumeration ShapeType as a dictionary
89 # @ingroup l1_geompy_auxiliary
90 ShapeType = {"COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8}
92 ## Raise an Error, containing the Method_name, if Operation is Failed
93 ## @ingroup l1_geompy_auxiliary
94 def RaiseIfFailed (Method_name, Operation):
95 if Operation.IsDone() == 0 and Operation.GetErrorCode() != "NOT_FOUND_ANY":
96 raise RuntimeError, Method_name + " : " + Operation.GetErrorCode()
98 ## Return list of variables value from salome notebook
99 ## @ingroup l1_geompy_auxiliary
100 def ParseParameters(*parameters):
103 for parameter in parameters:
104 if isinstance(parameter,str):
105 if notebook.isVariable(parameter):
106 Result.append(notebook.get(parameter))
110 Result.append(parameter)
113 StringResult = StringResult + str(parameter)
114 StringResult = StringResult + ":"
116 StringResult = StringResult[:len(StringResult)-1]
117 Result.append(StringResult)
121 ## Kinds of shape enumeration
122 # @ingroup l1_geompy_auxiliary
123 kind = GEOM.GEOM_IKindOfShape
125 ## Information about closed/unclosed state of shell or wire
126 # @ingroup l1_geompy_auxiliary
133 class geompyDC(GEOM._objref_GEOM_Gen):
135 ## @addtogroup l1_geompy_auxiliary
138 GEOM._objref_GEOM_Gen.__init__(self)
139 self.myBuilder = None
157 def init_geom(self,theStudy):
158 self.myStudy = theStudy
159 self.myStudyId = self.myStudy._get_StudyId()
160 self.myBuilder = self.myStudy.NewBuilder()
161 self.father = self.myStudy.FindComponent("GEOM")
162 if self.father is None:
163 self.father = self.myBuilder.NewComponent("GEOM")
164 A1 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributeName")
165 FName = A1._narrow(SALOMEDS.AttributeName)
166 FName.SetValue("Geometry")
167 A2 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributePixMap")
168 aPixmap = A2._narrow(SALOMEDS.AttributePixMap)
169 aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry")
170 self.myBuilder.DefineComponentInstance(self.father,self)
172 self.BasicOp = self.GetIBasicOperations (self.myStudyId)
173 self.CurvesOp = self.GetICurvesOperations (self.myStudyId)
174 self.PrimOp = self.GetI3DPrimOperations (self.myStudyId)
175 self.ShapesOp = self.GetIShapesOperations (self.myStudyId)
176 self.HealOp = self.GetIHealingOperations (self.myStudyId)
177 self.InsertOp = self.GetIInsertOperations (self.myStudyId)
178 self.BoolOp = self.GetIBooleanOperations (self.myStudyId)
179 self.TrsfOp = self.GetITransformOperations(self.myStudyId)
180 self.LocalOp = self.GetILocalOperations (self.myStudyId)
181 self.MeasuOp = self.GetIMeasureOperations (self.myStudyId)
182 self.BlocksOp = self.GetIBlocksOperations (self.myStudyId)
183 self.GroupOp = self.GetIGroupOperations (self.myStudyId)
186 ## Get name for sub-shape aSubObj of shape aMainObj
188 # @ref swig_SubShapeAllSorted "Example"
189 def SubShapeName(self,aSubObj, aMainObj):
190 # Example: see GEOM_TestAll.py
192 #aSubId = orb.object_to_string(aSubObj)
193 #aMainId = orb.object_to_string(aMainObj)
194 #index = gg.getIndexTopology(aSubId, aMainId)
195 #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
196 index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
197 name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
200 ## Publish in study aShape with name aName
202 # \param aShape the shape to be published
203 # \param aName the name for the shape
204 # \param doRestoreSubShapes if True, finds and publishes also
205 # sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
206 # and published sub-shapes of arguments
207 # \param theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes for
208 # these arguments description
209 # \return study entry of the published shape in form of string
211 # @ref swig_MakeQuad4Vertices "Example"
212 def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
213 theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
214 # Example: see GEOM_TestAll.py
216 aSObject = self.AddInStudy(self.myStudy, aShape, aName, None)
217 if doRestoreSubShapes:
218 self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs,
219 theFindMethod, theInheritFirstArg)
221 print "addToStudy() failed"
223 return aShape.GetStudyEntry()
225 ## Publish in study aShape with name aName as sub-object of previously published aFather
227 # @ref swig_SubShapeAllSorted "Example"
228 def addToStudyInFather(self, aFather, aShape, aName):
229 # Example: see GEOM_TestAll.py
231 aSObject = self.AddInStudy(myStudy, aShape, aName, aFather)
233 print "addToStudyInFather() failed"
235 return aShape.GetStudyEntry()
237 # end of l1_geompy_auxiliary
240 ## @addtogroup l3_restore_ss
243 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
244 # To be used from python scripts out of geompy.addToStudy (non-default usage)
245 # \param theObject published GEOM object, arguments of which will be published
246 # \param theArgs list of GEOM_Object, operation arguments to be published.
247 # If this list is empty, all operation arguments will be published
248 # \param theFindMethod method to search subshapes, corresponding to arguments and
249 # their subshapes. Value from enumeration GEOM::find_shape_method.
250 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
251 # Do not publish subshapes in place of arguments, but only
252 # in place of subshapes of the first argument,
253 # because the whole shape corresponds to the first argument.
254 # Mainly to be used after transformations, but it also can be
255 # usefull after partition with one object shape, and some other
256 # operations, where only the first argument has to be considered.
257 # If theObject has only one argument shape, this flag is automatically
258 # considered as True, not regarding really passed value.
259 # \return True in case of success, False otherwise.
261 # @ref tui_restore_prs_params "Example"
262 def RestoreSubShapes (self, theObject, theArgs=[],
263 theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
264 # Example: see GEOM_TestAll.py
265 return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
266 theFindMethod, theInheritFirstArg)
268 # end of l3_restore_ss
271 ## @addtogroup l3_basic_go
274 ## Create point by three coordinates.
275 # @param theX The X coordinate of the point.
276 # @param theY The Y coordinate of the point.
277 # @param theZ The Z coordinate of the point.
278 # @return New GEOM_Object, containing the created point.
280 # @ref tui_creation_point "Example"
281 def MakeVertex(self,theX, theY, theZ):
282 # Example: see GEOM_TestAll.py
283 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
284 anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
285 RaiseIfFailed("MakePointXYZ", self.BasicOp)
286 anObj.SetParameters(Parameters)
289 ## Create a point, distant from the referenced point
290 # on the given distances along the coordinate axes.
291 # @param theReference The referenced point.
292 # @param theX Displacement from the referenced point along OX axis.
293 # @param theY Displacement from the referenced point along OY axis.
294 # @param theZ Displacement from the referenced point along OZ axis.
295 # @return New GEOM_Object, containing the created point.
297 # @ref tui_creation_point "Example"
298 def MakeVertexWithRef(self,theReference, theX, theY, theZ):
299 # Example: see GEOM_TestAll.py
300 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
301 anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
302 RaiseIfFailed("MakePointWithReference", self.BasicOp)
303 anObj.SetParameters(Parameters)
306 ## Create a point, corresponding to the given parameter on the given curve.
307 # @param theRefCurve The referenced curve.
308 # @param theParameter Value of parameter on the referenced curve.
309 # @return New GEOM_Object, containing the created point.
311 # @ref tui_creation_point "Example"
312 def MakeVertexOnCurve(self,theRefCurve, theParameter):
313 # Example: see GEOM_TestAll.py
314 theParameter, Parameters = ParseParameters(theParameter)
315 anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter)
316 RaiseIfFailed("MakePointOnCurve", self.BasicOp)
317 anObj.SetParameters(Parameters)
320 ## Create a point, corresponding to the given parameters on the
322 # @param theRefSurf The referenced surface.
323 # @param theUParameter Value of U-parameter on the referenced surface.
324 # @param theVParameter Value of V-parameter on the referenced surface.
325 # @return New GEOM_Object, containing the created point.
327 # @ref swig_MakeVertexOnSurface "Example"
328 def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter):
329 theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
330 # Example: see GEOM_TestAll.py
331 anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
332 RaiseIfFailed("MakePointOnSurface", self.BasicOp)
333 anObj.SetParameters(Parameters);
336 ## Create a point on intersection of two lines.
337 # @param theRefLine1, theRefLine2 The referenced lines.
338 # @return New GEOM_Object, containing the created point.
340 # @ref swig_MakeVertexOnLinesIntersection "Example"
341 def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2):
342 # Example: see GEOM_TestAll.py
343 anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
344 RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
347 ## Create a tangent, corresponding to the given parameter on the given curve.
348 # @param theRefCurve The referenced curve.
349 # @param theParameter Value of parameter on the referenced curve.
350 # @return New GEOM_Object, containing the created tangent.
352 # @ref swig_MakeTangentOnCurve "Example"
353 def MakeTangentOnCurve(self, theRefCurve, theParameter):
354 anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
355 RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
358 ## Create a vector with the given components.
359 # @param theDX X component of the vector.
360 # @param theDY Y component of the vector.
361 # @param theDZ Z component of the vector.
362 # @return New GEOM_Object, containing the created vector.
364 # @ref tui_creation_vector "Example"
365 def MakeVectorDXDYDZ(self,theDX, theDY, theDZ):
366 # Example: see GEOM_TestAll.py
367 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
368 anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
369 RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
370 anObj.SetParameters(Parameters)
373 ## Create a vector between two points.
374 # @param thePnt1 Start point for the vector.
375 # @param thePnt2 End point for the vector.
376 # @return New GEOM_Object, containing the created vector.
378 # @ref tui_creation_vector "Example"
379 def MakeVector(self,thePnt1, thePnt2):
380 # Example: see GEOM_TestAll.py
381 anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
382 RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
385 ## Create a line, passing through the given point
386 # and parrallel to the given direction
387 # @param thePnt Point. The resulting line will pass through it.
388 # @param theDir Direction. The resulting line will be parallel to it.
389 # @return New GEOM_Object, containing the created line.
391 # @ref tui_creation_line "Example"
392 def MakeLine(self,thePnt, theDir):
393 # Example: see GEOM_TestAll.py
394 anObj = self.BasicOp.MakeLine(thePnt, theDir)
395 RaiseIfFailed("MakeLine", self.BasicOp)
398 ## Create a line, passing through the given points
399 # @param thePnt1 First of two points, defining the line.
400 # @param thePnt2 Second of two points, defining the line.
401 # @return New GEOM_Object, containing the created line.
403 # @ref tui_creation_line "Example"
404 def MakeLineTwoPnt(self,thePnt1, thePnt2):
405 # Example: see GEOM_TestAll.py
406 anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
407 RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
410 ## Create a line on two faces intersection.
411 # @param theFace1 First of two faces, defining the line.
412 # @param theFace2 Second of two faces, defining the line.
413 # @return New GEOM_Object, containing the created line.
415 # @ref swig_MakeLineTwoFaces "Example"
416 def MakeLineTwoFaces(self, theFace1, theFace2):
417 # Example: see GEOM_TestAll.py
418 anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
419 RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
422 ## Create a plane, passing through the given point
423 # and normal to the given vector.
424 # @param thePnt Point, the plane has to pass through.
425 # @param theVec Vector, defining the plane normal direction.
426 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
427 # @return New GEOM_Object, containing the created plane.
429 # @ref tui_creation_plane "Example"
430 def MakePlane(self,thePnt, theVec, theTrimSize):
431 # Example: see GEOM_TestAll.py
432 theTrimSize, Parameters = ParseParameters(theTrimSize);
433 anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
434 RaiseIfFailed("MakePlanePntVec", self.BasicOp)
435 anObj.SetParameters(Parameters)
438 ## Create a plane, passing through the three given points
439 # @param thePnt1 First of three points, defining the plane.
440 # @param thePnt2 Second of three points, defining the plane.
441 # @param thePnt3 Fird of three points, defining the plane.
442 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
443 # @return New GEOM_Object, containing the created plane.
445 # @ref tui_creation_plane "Example"
446 def MakePlaneThreePnt(self,thePnt1, thePnt2, thePnt3, theTrimSize):
447 # Example: see GEOM_TestAll.py
448 theTrimSize, Parameters = ParseParameters(theTrimSize);
449 anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
450 RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
451 anObj.SetParameters(Parameters)
454 ## Create a plane, similar to the existing one, but with another size of representing face.
455 # @param theFace Referenced plane or LCS(Marker).
456 # @param theTrimSize New half size of a side of quadrangle face, representing the plane.
457 # @return New GEOM_Object, containing the created plane.
459 # @ref tui_creation_plane "Example"
460 def MakePlaneFace(self,theFace, theTrimSize):
461 # Example: see GEOM_TestAll.py
462 theTrimSize, Parameters = ParseParameters(theTrimSize);
463 anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
464 RaiseIfFailed("MakePlaneFace", self.BasicOp)
465 anObj.SetParameters(Parameters)
468 ## Create a local coordinate system.
469 # @param OX,OY,OZ Three coordinates of coordinate system origin.
470 # @param XDX,XDY,XDZ Three components of OX direction
471 # @param YDX,YDY,YDZ Three components of OY direction
472 # @return New GEOM_Object, containing the created coordinate system.
474 # @ref swig_MakeMarker "Example"
475 def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ):
476 # Example: see GEOM_TestAll.py
477 OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
478 anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
479 RaiseIfFailed("MakeMarker", self.BasicOp)
480 anObj.SetParameters(Parameters)
483 ## Create a local coordinate system.
484 # @param theOrigin Point of coordinate system origin.
485 # @param theXVec Vector of X direction
486 # @param theYVec Vector of Y direction
487 # @return New GEOM_Object, containing the created coordinate system.
489 # @ref swig_MakeMarker "Example"
490 def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec):
491 O = self.PointCoordinates( theOrigin )
493 for vec in [ theXVec, theYVec ]:
494 v1, v2 = self.SubShapeAll( vec, ShapeType["VERTEX"] )
495 p1 = self.PointCoordinates( v1 )
496 p2 = self.PointCoordinates( v2 )
497 for i in range( 0, 3 ):
498 OXOY.append( p2[i] - p1[i] )
500 anObj = self.BasicOp.MakeMarker( O[0], O[1], O[2],
501 OXOY[0], OXOY[1], OXOY[2],
502 OXOY[3], OXOY[4], OXOY[5], )
503 RaiseIfFailed("MakeMarker", self.BasicOp)
509 ## @addtogroup l4_curves
512 ## Create an arc of circle, passing through three given points.
513 # @param thePnt1 Start point of the arc.
514 # @param thePnt2 Middle point of the arc.
515 # @param thePnt3 End point of the arc.
516 # @return New GEOM_Object, containing the created arc.
518 # @ref swig_MakeArc "Example"
519 def MakeArc(self,thePnt1, thePnt2, thePnt3):
520 # Example: see GEOM_TestAll.py
521 anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
522 RaiseIfFailed("MakeArc", self.CurvesOp)
525 ## Create an arc of circle from a center and 2 points.
526 # @param thePnt1 Center of the arc
527 # @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
528 # @param thePnt3 End point of the arc (Gives also a direction)
529 # @param theSense Orientation of the arc
530 # @return New GEOM_Object, containing the created arc.
532 # @ref swig_MakeArc "Example"
533 def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False):
534 # Example: see GEOM_TestAll.py
535 anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
536 RaiseIfFailed("MakeArcCenter", self.CurvesOp)
539 ## Create a circle with given center, normal vector and radius.
540 # @param thePnt Circle center.
541 # @param theVec Vector, normal to the plane of the circle.
542 # @param theR Circle radius.
543 # @return New GEOM_Object, containing the created circle.
545 # @ref tui_creation_circle "Example"
546 def MakeCircle(self, thePnt, theVec, theR):
547 # Example: see GEOM_TestAll.py
548 theR, Parameters = ParseParameters(theR)
549 anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
550 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
551 anObj.SetParameters(Parameters)
554 ## Create a circle with given radius.
555 # Center of the circle will be in the origin of global
556 # coordinate system and normal vector will be codirected with Z axis
557 # @param theR Circle radius.
558 # @return New GEOM_Object, containing the created circle.
559 def MakeCircleR(self, theR):
560 anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
561 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
564 ## Create a circle, passing through three given points
565 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
566 # @return New GEOM_Object, containing the created circle.
568 # @ref tui_creation_circle "Example"
569 def MakeCircleThreePnt(self,thePnt1, thePnt2, thePnt3):
570 # Example: see GEOM_TestAll.py
571 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
572 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
575 ## Create a circle, with given point1 as center,
576 # passing through the point2 as radius and laying in the plane,
577 # defined by all three given points.
578 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
579 # @return New GEOM_Object, containing the created circle.
581 # @ref swig_MakeCircle "Example"
582 def MakeCircleCenter2Pnt(self,thePnt1, thePnt2, thePnt3):
583 # Example: see GEOM_example6.py
584 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
585 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
588 ## Create an ellipse with given center, normal vector and radiuses.
589 # @param thePnt Ellipse center.
590 # @param theVec Vector, normal to the plane of the ellipse.
591 # @param theRMajor Major ellipse radius.
592 # @param theRMinor Minor ellipse radius.
593 # @return New GEOM_Object, containing the created ellipse.
595 # @ref tui_creation_ellipse "Example"
596 def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor):
597 # Example: see GEOM_TestAll.py
598 theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
599 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
600 RaiseIfFailed("MakeEllipse", self.CurvesOp)
601 anObj.SetParameters(Parameters)
604 ## Create an ellipse with given radiuses.
605 # Center of the ellipse will be in the origin of global
606 # coordinate system and normal vector will be codirected with Z axis
607 # @param theRMajor Major ellipse radius.
608 # @param theRMinor Minor ellipse radius.
609 # @return New GEOM_Object, containing the created ellipse.
610 def MakeEllipseRR(self, theRMajor, theRMinor):
611 anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
612 RaiseIfFailed("MakeEllipse", self.CurvesOp)
615 ## Create a polyline on the set of points.
616 # @param thePoints Sequence of points for the polyline.
617 # @return New GEOM_Object, containing the created polyline.
619 # @ref tui_creation_curve "Example"
620 def MakePolyline(self,thePoints):
621 # Example: see GEOM_TestAll.py
622 anObj = self.CurvesOp.MakePolyline(thePoints)
623 RaiseIfFailed("MakePolyline", self.CurvesOp)
626 ## Create bezier curve on the set of points.
627 # @param thePoints Sequence of points for the bezier curve.
628 # @return New GEOM_Object, containing the created bezier curve.
630 # @ref tui_creation_curve "Example"
631 def MakeBezier(self,thePoints):
632 # Example: see GEOM_TestAll.py
633 anObj = self.CurvesOp.MakeSplineBezier(thePoints)
634 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
637 ## Create B-Spline curve on the set of points.
638 # @param thePoints Sequence of points for the B-Spline curve.
639 # @return New GEOM_Object, containing the created B-Spline curve.
641 # @ref tui_creation_curve "Example"
642 def MakeInterpol(self,thePoints):
643 # Example: see GEOM_TestAll.py
644 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints)
645 RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
651 ## @addtogroup l3_sketcher
654 ## Create a sketcher (wire or face), following the textual description,
655 # passed through <VAR>theCommand</VAR> argument. \n
656 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
657 # Format of the description string have to be the following:
659 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
662 # - x1, y1 are coordinates of the first sketcher point (zero by default),
664 # - "R angle" : Set the direction by angle
665 # - "D dx dy" : Set the direction by DX & DY
668 # - "TT x y" : Create segment by point at X & Y
669 # - "T dx dy" : Create segment by point with DX & DY
670 # - "L length" : Create segment by direction & Length
671 # - "IX x" : Create segment by direction & Intersect. X
672 # - "IY y" : Create segment by direction & Intersect. Y
675 # - "C radius length" : Create arc by direction, radius and length(in degree)
678 # - "WW" : Close Wire (to finish)
679 # - "WF" : Close Wire and build face (to finish)
681 # @param theCommand String, defining the sketcher in local
682 # coordinates of the working plane.
683 # @param theWorkingPlane Nine double values, defining origin,
684 # OZ and OX directions of the working plane.
685 # @return New GEOM_Object, containing the created wire.
687 # @ref tui_sketcher_page "Example"
688 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0]):
689 # Example: see GEOM_TestAll.py
690 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
691 RaiseIfFailed("MakeSketcher", self.CurvesOp)
694 ## Create a sketcher (wire or face), following the textual description,
695 # passed through <VAR>theCommand</VAR> argument. \n
696 # For format of the description string see the previous method.\n
697 # @param theCommand String, defining the sketcher in local
698 # coordinates of the working plane.
699 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
700 # @return New GEOM_Object, containing the created wire.
702 # @ref tui_sketcher_page "Example"
703 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane):
704 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
705 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
711 ## @addtogroup l3_3d_primitives
714 ## Create a box by coordinates of two opposite vertices.
716 # @ref tui_creation_box "Example"
717 def MakeBox(self,x1,y1,z1,x2,y2,z2):
718 # Example: see GEOM_TestAll.py
719 pnt1 = self.MakeVertex(x1,y1,z1)
720 pnt2 = self.MakeVertex(x2,y2,z2)
721 return self.MakeBoxTwoPnt(pnt1,pnt2)
723 ## Create a box with specified dimensions along the coordinate axes
724 # and with edges, parallel to the coordinate axes.
725 # Center of the box will be at point (DX/2, DY/2, DZ/2).
726 # @param theDX Length of Box edges, parallel to OX axis.
727 # @param theDY Length of Box edges, parallel to OY axis.
728 # @param theDZ Length of Box edges, parallel to OZ axis.
729 # @return New GEOM_Object, containing the created box.
731 # @ref tui_creation_box "Example"
732 def MakeBoxDXDYDZ(self,theDX, theDY, theDZ):
733 # Example: see GEOM_TestAll.py
734 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
735 self.PrimOp.SetParameters(Parameters)
736 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
737 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
740 ## Create a box with two specified opposite vertices,
741 # and with edges, parallel to the coordinate axes
742 # @param thePnt1 First of two opposite vertices.
743 # @param thePnt2 Second of two opposite vertices.
744 # @return New GEOM_Object, containing the created box.
746 # @ref tui_creation_box "Example"
747 def MakeBoxTwoPnt(self,thePnt1, thePnt2):
748 # Example: see GEOM_TestAll.py
749 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
750 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
753 ## Create a face with specified dimensions along OX-OY coordinate axes,
754 # with edges, parallel to this coordinate axes.
755 # @param theH height of Face.
756 # @param theW width of Face.
757 # @param theOrientation orientation belong axis OXY OYZ OZX
758 # @return New GEOM_Object, containing the created face.
760 # @ref tui_creation_face "Example"
761 def MakeFaceHW(self,theH, theW, theOrientation):
762 # Example: see GEOM_TestAll.py
763 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
764 RaiseIfFailed("MakeFaceHW", self.PrimOp)
767 ## Create a face from another plane and two sizes,
768 # vertical size and horisontal size.
769 # @param theObj Normale vector to the creating face or
771 # @param theH Height (vertical size).
772 # @param theW Width (horisontal size).
773 # @return New GEOM_Object, containing the created face.
775 # @ref tui_creation_face "Example"
776 def MakeFaceObjHW(self, theObj, theH, theW):
777 # Example: see GEOM_TestAll.py
778 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
779 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
782 ## Create a disk with given center, normal vector and radius.
783 # @param thePnt Disk center.
784 # @param theVec Vector, normal to the plane of the disk.
785 # @param theR Disk radius.
786 # @return New GEOM_Object, containing the created disk.
788 # @ref tui_creation_disk "Example"
789 def MakeDiskPntVecR(self,thePnt, theVec, theR):
790 # Example: see GEOM_TestAll.py
791 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
792 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
795 ## Create a disk, passing through three given points
796 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
797 # @return New GEOM_Object, containing the created disk.
799 # @ref tui_creation_disk "Example"
800 def MakeDiskThreePnt(self,thePnt1, thePnt2, thePnt3):
801 # Example: see GEOM_TestAll.py
802 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
803 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
806 ## Create a disk with specified dimensions along OX-OY coordinate axes.
807 # @param theR Radius of Face.
808 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
809 # @return New GEOM_Object, containing the created disk.
811 # @ref tui_creation_face "Example"
812 def MakeDiskR(self,theR, theOrientation):
813 # Example: see GEOM_TestAll.py
814 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
815 RaiseIfFailed("MakeDiskR", self.PrimOp)
818 ## Create a cylinder with given base point, axis, radius and height.
819 # @param thePnt Central point of cylinder base.
820 # @param theAxis Cylinder axis.
821 # @param theR Cylinder radius.
822 # @param theH Cylinder height.
823 # @return New GEOM_Object, containing the created cylinder.
825 # @ref tui_creation_cylinder "Example"
826 def MakeCylinder(self,thePnt, theAxis, theR, theH):
827 # Example: see GEOM_TestAll.py
828 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
829 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
832 ## Create a cylinder with given radius and height at
833 # the origin of coordinate system. Axis of the cylinder
834 # will be collinear to the OZ axis of the coordinate system.
835 # @param theR Cylinder radius.
836 # @param theH Cylinder height.
837 # @return New GEOM_Object, containing the created cylinder.
839 # @ref tui_creation_cylinder "Example"
840 def MakeCylinderRH(self,theR, theH):
841 # Example: see GEOM_TestAll.py
842 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
843 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
846 ## Create a sphere with given center and radius.
847 # @param thePnt Sphere center.
848 # @param theR Sphere radius.
849 # @return New GEOM_Object, containing the created sphere.
851 # @ref tui_creation_sphere "Example"
852 def MakeSpherePntR(self, thePnt, theR):
853 # Example: see GEOM_TestAll.py
854 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
855 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
858 ## Create a sphere with given center and radius.
859 # @param x,y,z Coordinates of sphere center.
860 # @param theR Sphere radius.
861 # @return New GEOM_Object, containing the created sphere.
863 # @ref tui_creation_sphere "Example"
864 def MakeSphere(self, x, y, z, theR):
865 # Example: see GEOM_TestAll.py
866 point = self.MakeVertex(x, y, z)
867 anObj = self.MakeSpherePntR(point, theR)
870 ## Create a sphere with given radius at the origin of coordinate system.
871 # @param theR Sphere radius.
872 # @return New GEOM_Object, containing the created sphere.
874 # @ref tui_creation_sphere "Example"
875 def MakeSphereR(self, theR):
876 # Example: see GEOM_TestAll.py
877 anObj = self.PrimOp.MakeSphereR(theR)
878 RaiseIfFailed("MakeSphereR", self.PrimOp)
881 ## Create a cone with given base point, axis, height and radiuses.
882 # @param thePnt Central point of the first cone base.
883 # @param theAxis Cone axis.
884 # @param theR1 Radius of the first cone base.
885 # @param theR2 Radius of the second cone base.
886 # \note If both radiuses are non-zero, the cone will be truncated.
887 # \note If the radiuses are equal, a cylinder will be created instead.
888 # @param theH Cone height.
889 # @return New GEOM_Object, containing the created cone.
891 # @ref tui_creation_cone "Example"
892 def MakeCone(self,thePnt, theAxis, theR1, theR2, theH):
893 # Example: see GEOM_TestAll.py
894 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
895 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
898 ## Create a cone with given height and radiuses at
899 # the origin of coordinate system. Axis of the cone will
900 # be collinear to the OZ axis of the coordinate system.
901 # @param theR1 Radius of the first cone base.
902 # @param theR2 Radius of the second cone base.
903 # \note If both radiuses are non-zero, the cone will be truncated.
904 # \note If the radiuses are equal, a cylinder will be created instead.
905 # @param theH Cone height.
906 # @return New GEOM_Object, containing the created cone.
908 # @ref tui_creation_cone "Example"
909 def MakeConeR1R2H(self,theR1, theR2, theH):
910 # Example: see GEOM_TestAll.py
911 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
912 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
915 ## Create a torus with given center, normal vector and radiuses.
916 # @param thePnt Torus central point.
917 # @param theVec Torus axis of symmetry.
918 # @param theRMajor Torus major radius.
919 # @param theRMinor Torus minor radius.
920 # @return New GEOM_Object, containing the created torus.
922 # @ref tui_creation_torus "Example"
923 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor):
924 # Example: see GEOM_TestAll.py
925 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
926 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
929 ## Create a torus with given radiuses at the origin of coordinate system.
930 # @param theRMajor Torus major radius.
931 # @param theRMinor Torus minor radius.
932 # @return New GEOM_Object, containing the created torus.
934 # @ref tui_creation_torus "Example"
935 def MakeTorusRR(self, theRMajor, theRMinor):
936 # Example: see GEOM_TestAll.py
937 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
938 RaiseIfFailed("MakeTorusRR", self.PrimOp)
941 # end of l3_3d_primitives
944 ## @addtogroup l3_complex
947 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
948 # @param theBase Base shape to be extruded.
949 # @param thePoint1 First end of extrusion vector.
950 # @param thePoint2 Second end of extrusion vector.
951 # @return New GEOM_Object, containing the created prism.
953 # @ref tui_creation_prism "Example"
954 def MakePrism(self, theBase, thePoint1, thePoint2):
955 # Example: see GEOM_TestAll.py
956 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
957 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
960 ## Create a shape by extrusion of the base shape along the vector,
961 # i.e. all the space, transfixed by the base shape during its translation
962 # along the vector on the given distance.
963 # @param theBase Base shape to be extruded.
964 # @param theVec Direction of extrusion.
965 # @param theH Prism dimension along theVec.
966 # @return New GEOM_Object, containing the created prism.
968 # @ref tui_creation_prism "Example"
969 def MakePrismVecH(self, theBase, theVec, theH):
970 # Example: see GEOM_TestAll.py
971 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
972 RaiseIfFailed("MakePrismVecH", self.PrimOp)
975 ## Create a shape by extrusion of the base shape along the vector,
976 # i.e. all the space, transfixed by the base shape during its translation
977 # along the vector on the given distance in 2 Ways (forward/backward) .
978 # @param theBase Base shape to be extruded.
979 # @param theVec Direction of extrusion.
980 # @param theH Prism dimension along theVec in forward direction.
981 # @return New GEOM_Object, containing the created prism.
983 # @ref tui_creation_prism "Example"
984 def MakePrismVecH2Ways(self, theBase, theVec, theH):
985 # Example: see GEOM_TestAll.py
986 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
987 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
990 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
991 # @param theBase Base shape to be extruded.
992 # @param theDX, theDY, theDZ Directions of extrusion.
993 # @return New GEOM_Object, containing the created prism.
995 # @ref tui_creation_prism "Example"
996 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ):
997 # Example: see GEOM_TestAll.py
998 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
999 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
1002 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
1003 # i.e. all the space, transfixed by the base shape during its translation
1004 # along the vector on the given distance in 2 Ways (forward/backward) .
1005 # @param theBase Base shape to be extruded.
1006 # @param theDX, theDY, theDZ Directions of extrusion.
1007 # @return New GEOM_Object, containing the created prism.
1009 # @ref tui_creation_prism "Example"
1010 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ):
1011 # Example: see GEOM_TestAll.py
1012 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
1013 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
1016 ## Create a shape by revolution of the base shape around the axis
1017 # on the given angle, i.e. all the space, transfixed by the base
1018 # shape during its rotation around the axis on the given angle.
1019 # @param theBase Base shape to be rotated.
1020 # @param theAxis Rotation axis.
1021 # @param theAngle Rotation angle in radians.
1022 # @return New GEOM_Object, containing the created revolution.
1024 # @ref tui_creation_revolution "Example"
1025 def MakeRevolution(self, theBase, theAxis, theAngle):
1026 # Example: see GEOM_TestAll.py
1027 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
1028 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
1031 ## The Same Revolution but in both ways forward&backward.
1032 def MakeRevolution2Ways(self, theBase, theAxis, theAngle):
1033 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
1034 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
1037 ## Create a filling from the given compound of contours.
1038 # @param theShape the compound of contours
1039 # @param theMinDeg a minimal degree of BSpline surface to create
1040 # @param theMaxDeg a maximal degree of BSpline surface to create
1041 # @param theTol2D a 2d tolerance to be reached
1042 # @param theTol3D a 3d tolerance to be reached
1043 # @param theNbIter a number of iteration of approximation algorithm
1044 # @param isApprox if True, BSpline curves are generated in the process
1045 # of surface construction. By default it is False, that means
1046 # the surface is created using Besier curves. The usage of
1047 # Approximation makes the algorithm work slower, but allows
1048 # building the surface for rather complex cases
1049 # @return New GEOM_Object, containing the created filling surface.
1051 # @ref tui_creation_filling "Example"
1052 def MakeFilling(self, theShape, theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter, isApprox=0):
1053 # Example: see GEOM_TestAll.py
1054 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
1055 theTol2D, theTol3D, theNbIter, isApprox)
1056 RaiseIfFailed("MakeFilling", self.PrimOp)
1059 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
1060 # @param theSeqSections - set of specified sections.
1061 # @param theModeSolid - mode defining building solid or shell
1062 # @param thePreci - precision 3D used for smoothing by default 1.e-6
1063 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
1064 # @return New GEOM_Object, containing the created shell or solid.
1066 # @ref swig_todo "Example"
1067 def MakeThruSections(self,theSeqSections,theModeSolid,thePreci,theRuled):
1068 # Example: see GEOM_TestAll.py
1069 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
1070 RaiseIfFailed("MakeThruSections", self.PrimOp)
1073 ## Create a shape by extrusion of the base shape along
1074 # the path shape. The path shape can be a wire or an edge.
1075 # @param theBase Base shape to be extruded.
1076 # @param thePath Path shape to extrude the base shape along it.
1077 # @return New GEOM_Object, containing the created pipe.
1079 # @ref tui_creation_pipe "Example"
1080 def MakePipe(self,theBase, thePath):
1081 # Example: see GEOM_TestAll.py
1082 anObj = self.PrimOp.MakePipe(theBase, thePath)
1083 RaiseIfFailed("MakePipe", self.PrimOp)
1086 ## Create a shape by extrusion of the profile shape along
1087 # the path shape. The path shape can be a wire or an edge.
1088 # the several profiles can be specified in the several locations of path.
1089 # @param theSeqBases - list of Bases shape to be extruded.
1090 # @param theLocations - list of locations on the path corresponding
1091 # specified list of the Bases shapes. Number of locations
1092 # should be equal to number of bases or list of locations can be empty.
1093 # @param thePath - Path shape to extrude the base shape along it.
1094 # @param theWithContact - the mode defining that the section is translated to be in
1095 # contact with the spine.
1096 # @param theWithCorrection - defining that the section is rotated to be
1097 # orthogonal to the spine tangent in the correspondent point
1098 # @return New GEOM_Object, containing the created pipe.
1100 # @ref tui_creation_pipe_with_diff_sec "Example"
1101 def MakePipeWithDifferentSections(self, theSeqBases,
1102 theLocations, thePath,
1103 theWithContact, theWithCorrection):
1104 anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
1105 theLocations, thePath,
1106 theWithContact, theWithCorrection)
1107 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
1110 ## Create a shape by extrusion of the profile shape along
1111 # the path shape. The path shape can be a wire or a edge.
1112 # the several profiles can be specified in the several locations of path.
1113 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
1114 # shell or face. If number of faces in neighbour sections
1115 # aren't coincided result solid between such sections will
1116 # be created using external boundaries of this shells.
1117 # @param theSeqSubBases - list of corresponding subshapes of section shapes.
1118 # This list is used for searching correspondences between
1119 # faces in the sections. Size of this list must be equal
1120 # to size of list of base shapes.
1121 # @param theLocations - list of locations on the path corresponding
1122 # specified list of the Bases shapes. Number of locations
1123 # should be equal to number of bases. First and last
1124 # locations must be coincided with first and last vertexes
1125 # of path correspondingly.
1126 # @param thePath - Path shape to extrude the base shape along it.
1127 # @param theWithContact - the mode defining that the section is translated to be in
1128 # contact with the spine.
1129 # @param theWithCorrection - defining that the section is rotated to be
1130 # orthogonal to the spine tangent in the correspondent point
1131 # @return New GEOM_Object, containing the created solids.
1133 # @ref tui_creation_pipe_with_shell_sec "Example"
1134 def MakePipeWithShellSections(self,theSeqBases, theSeqSubBases,
1135 theLocations, thePath,
1136 theWithContact, theWithCorrection):
1137 anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
1138 theLocations, thePath,
1139 theWithContact, theWithCorrection)
1140 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
1143 ## Create a shape by extrusion of the profile shape along
1144 # the path shape. This function is used only for debug pipe
1145 # functionality - it is a version of previous function
1146 # (MakePipeWithShellSections(...)) which give a possibility to
1147 # recieve information about creating pipe between each pair of
1148 # sections step by step.
1149 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
1150 theLocations, thePath,
1151 theWithContact, theWithCorrection):
1153 nbsect = len(theSeqBases)
1154 nbsubsect = len(theSeqSubBases)
1155 #print "nbsect = ",nbsect
1156 for i in range(1,nbsect):
1158 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
1159 tmpLocations = [ theLocations[i-1], theLocations[i] ]
1161 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
1162 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
1163 tmpLocations, thePath,
1164 theWithContact, theWithCorrection)
1165 if self.PrimOp.IsDone() == 0:
1166 print "Problems with pipe creation between ",i," and ",i+1," sections"
1167 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
1170 print "Pipe between ",i," and ",i+1," sections is OK"
1175 resc = self.MakeCompound(res)
1176 #resc = self.MakeSewing(res, 0.001)
1177 #print "resc: ",resc
1180 ## Create solids between given sections
1181 # @param theSeqBases - list of sections (shell or face).
1182 # @param theLocations - list of corresponding vertexes
1183 # @return New GEOM_Object, containing the created solids.
1185 # @ref tui_creation_pipe_without_path "Example"
1186 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations):
1187 anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
1188 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
1191 ## Create a shape by extrusion of the base shape along
1192 # the path shape with constant bi-normal direction along the given vector.
1193 # The path shape can be a wire or an edge.
1194 # @param theBase Base shape to be extruded.
1195 # @param thePath Path shape to extrude the base shape along it.
1196 # @param theVec Vector defines a constant binormal direction to keep the
1197 # same angle beetween the direction and the sections
1198 # along the sweep surface.
1199 # @return New GEOM_Object, containing the created pipe.
1201 # @ref tui_creation_pipe "Example"
1202 def MakePipeBiNormalAlongVector(self,theBase, thePath, theVec):
1203 # Example: see GEOM_TestAll.py
1204 anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
1205 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
1211 ## @addtogroup l3_advanced
1214 ## Create a linear edge with specified ends.
1215 # @param thePnt1 Point for the first end of edge.
1216 # @param thePnt2 Point for the second end of edge.
1217 # @return New GEOM_Object, containing the created edge.
1219 # @ref tui_creation_edge "Example"
1220 def MakeEdge(self,thePnt1, thePnt2):
1221 # Example: see GEOM_TestAll.py
1222 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
1223 RaiseIfFailed("MakeEdge", self.ShapesOp)
1226 ## Create a wire from the set of edges and wires.
1227 # @param theEdgesAndWires List of edges and/or wires.
1228 # @return New GEOM_Object, containing the created wire.
1230 # @ref tui_creation_wire "Example"
1231 def MakeWire(self,theEdgesAndWires):
1232 # Example: see GEOM_TestAll.py
1233 anObj = self.ShapesOp.MakeWire(theEdgesAndWires)
1234 RaiseIfFailed("MakeWire", self.ShapesOp)
1237 ## Create a face on the given wire.
1238 # @param theWire closed Wire or Edge to build the face on.
1239 # @param isPlanarWanted If TRUE, only planar face will be built.
1240 # If impossible, NULL object will be returned.
1241 # @return New GEOM_Object, containing the created face.
1243 # @ref tui_creation_face "Example"
1244 def MakeFace(self,theWire, isPlanarWanted):
1245 # Example: see GEOM_TestAll.py
1246 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
1247 RaiseIfFailed("MakeFace", self.ShapesOp)
1250 ## Create a face on the given wires set.
1251 # @param theWires List of closed wires or edges to build the face on.
1252 # @param isPlanarWanted If TRUE, only planar face will be built.
1253 # If impossible, NULL object will be returned.
1254 # @return New GEOM_Object, containing the created face.
1256 # @ref tui_creation_face "Example"
1257 def MakeFaceWires(self,theWires, isPlanarWanted):
1258 # Example: see GEOM_TestAll.py
1259 anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
1260 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
1263 ## Shortcut to MakeFaceWires()
1265 # @ref tui_creation_face "Example 1"
1266 # \n @ref swig_MakeFaces "Example 2"
1267 def MakeFaces(self,theWires, isPlanarWanted):
1268 # Example: see GEOM_TestOthers.py
1269 anObj = self.MakeFaceWires(theWires, isPlanarWanted)
1272 ## Create a shell from the set of faces and shells.
1273 # @param theFacesAndShells List of faces and/or shells.
1274 # @return New GEOM_Object, containing the created shell.
1276 # @ref tui_creation_shell "Example"
1277 def MakeShell(self,theFacesAndShells):
1278 # Example: see GEOM_TestAll.py
1279 anObj = self.ShapesOp.MakeShell(theFacesAndShells)
1280 RaiseIfFailed("MakeShell", self.ShapesOp)
1283 ## Create a solid, bounded by the given shells.
1284 # @param theShells Sequence of bounding shells.
1285 # @return New GEOM_Object, containing the created solid.
1287 # @ref tui_creation_solid "Example"
1288 def MakeSolid(self,theShells):
1289 # Example: see GEOM_TestAll.py
1290 anObj = self.ShapesOp.MakeSolidShells(theShells)
1291 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
1294 ## Create a compound of the given shapes.
1295 # @param theShapes List of shapes to put in compound.
1296 # @return New GEOM_Object, containing the created compound.
1298 # @ref tui_creation_compound "Example"
1299 def MakeCompound(self,theShapes):
1300 # Example: see GEOM_TestAll.py
1301 anObj = self.ShapesOp.MakeCompound(theShapes)
1302 RaiseIfFailed("MakeCompound", self.ShapesOp)
1305 # end of l3_advanced
1308 ## @addtogroup l2_measure
1311 ## Gives quantity of faces in the given shape.
1312 # @param theShape Shape to count faces of.
1313 # @return Quantity of faces.
1315 # @ref swig_NumberOfFaces "Example"
1316 def NumberOfFaces(self,theShape):
1317 # Example: see GEOM_TestOthers.py
1318 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
1319 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
1322 ## Gives quantity of edges in the given shape.
1323 # @param theShape Shape to count edges of.
1324 # @return Quantity of edges.
1326 # @ref swig_NumberOfEdges "Example"
1327 def NumberOfEdges(self,theShape):
1328 # Example: see GEOM_TestOthers.py
1329 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
1330 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
1336 ## @addtogroup l3_healing
1339 ## Reverses an orientation the given shape.
1340 # @param theShape Shape to be reversed.
1341 # @return The reversed copy of theShape.
1343 # @ref swig_ChangeOrientation "Example"
1344 def ChangeOrientation(self,theShape):
1345 # Example: see GEOM_TestAll.py
1346 anObj = self.ShapesOp.ChangeOrientation(theShape)
1347 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
1350 ## Shortcut to ChangeOrientation()
1352 # @ref swig_OrientationChange "Example"
1353 def OrientationChange(self,theShape):
1354 # Example: see GEOM_TestOthers.py
1355 anObj = self.ChangeOrientation(theShape)
1361 ## @addtogroup l4_obtain
1364 ## Retrieve all free faces from the given shape.
1365 # Free face is a face, which is not shared between two shells of the shape.
1366 # @param theShape Shape to find free faces in.
1367 # @return List of IDs of all free faces, contained in theShape.
1369 # @ref tui_measurement_tools_page "Example"
1370 def GetFreeFacesIDs(self,theShape):
1371 # Example: see GEOM_TestOthers.py
1372 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
1373 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
1376 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
1377 # @param theShape1 Shape to find sub-shapes in.
1378 # @param theShape2 Shape to find shared sub-shapes with.
1379 # @param theShapeType Type of sub-shapes to be retrieved.
1380 # @return List of sub-shapes of theShape1, shared with theShape2.
1382 # @ref swig_GetSharedShapes "Example"
1383 def GetSharedShapes(self,theShape1, theShape2, theShapeType):
1384 # Example: see GEOM_TestOthers.py
1385 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
1386 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
1389 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
1390 # situated relatively the specified plane by the certain way,
1391 # defined through <VAR>theState</VAR> parameter.
1392 # @param theShape Shape to find sub-shapes of.
1393 # @param theShapeType Type of sub-shapes to be retrieved.
1394 # @param theAx1 Vector (or line, or linear edge), specifying normal
1395 # direction and location of the plane to find shapes on.
1396 # @param theState The state of the subshapes to find. It can be one of
1397 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1398 # @return List of all found sub-shapes.
1400 # @ref swig_GetShapesOnPlane "Example"
1401 def GetShapesOnPlane(self,theShape, theShapeType, theAx1, theState):
1402 # Example: see GEOM_TestOthers.py
1403 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
1404 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
1407 ## Works like the above method, but returns list of sub-shapes indices
1409 # @ref swig_GetShapesOnPlaneIDs "Example"
1410 def GetShapesOnPlaneIDs(self,theShape, theShapeType, theAx1, theState):
1411 # Example: see GEOM_TestOthers.py
1412 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
1413 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
1416 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
1417 # situated relatively the specified plane by the certain way,
1418 # defined through <VAR>theState</VAR> parameter.
1419 # @param theShape Shape to find sub-shapes of.
1420 # @param theShapeType Type of sub-shapes to be retrieved.
1421 # @param theAx1 Vector (or line, or linear edge), specifying normal
1422 # direction of the plane to find shapes on.
1423 # @param thePnt Point specifying location of the plane to find shapes on.
1424 # @param theState The state of the subshapes to find. It can be one of
1425 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1426 # @return List of all found sub-shapes.
1428 # @ref swig_GetShapesOnPlaneWithLocation "Example"
1429 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState):
1430 # Example: see GEOM_TestOthers.py
1431 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
1432 theAx1, thePnt, theState)
1433 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
1436 ## Works like the above method, but returns list of sub-shapes indices
1438 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
1439 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
1440 # Example: see GEOM_TestOthers.py
1441 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
1442 theAx1, thePnt, theState)
1443 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
1446 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1447 # the specified cylinder by the certain way, defined through \a theState parameter.
1448 # @param theShape Shape to find sub-shapes of.
1449 # @param theShapeType Type of sub-shapes to be retrieved.
1450 # @param theAxis Vector (or line, or linear edge), specifying
1451 # axis of the cylinder to find shapes on.
1452 # @param theRadius Radius of the cylinder to find shapes on.
1453 # @param theState The state of the subshapes to find. It can be one of
1454 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1455 # @return List of all found sub-shapes.
1457 # @ref swig_GetShapesOnCylinder "Example"
1458 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState):
1459 # Example: see GEOM_TestOthers.py
1460 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
1461 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
1464 ## Works like the above method, but returns list of sub-shapes indices
1466 # @ref swig_GetShapesOnCylinderIDs "Example"
1467 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
1468 # Example: see GEOM_TestOthers.py
1469 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
1470 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
1473 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1474 # the specified sphere by the certain way, defined through \a theState parameter.
1475 # @param theShape Shape to find sub-shapes of.
1476 # @param theShapeType Type of sub-shapes to be retrieved.
1477 # @param theCenter Point, specifying center of the sphere to find shapes on.
1478 # @param theRadius Radius of the sphere to find shapes on.
1479 # @param theState The state of the subshapes to find. It can be one of
1480 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1481 # @return List of all found sub-shapes.
1483 # @ref swig_GetShapesOnSphere "Example"
1484 def GetShapesOnSphere(self,theShape, theShapeType, theCenter, theRadius, theState):
1485 # Example: see GEOM_TestOthers.py
1486 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
1487 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
1490 ## Works like the above method, but returns list of sub-shapes indices
1492 # @ref swig_GetShapesOnSphereIDs "Example"
1493 def GetShapesOnSphereIDs(self,theShape, theShapeType, theCenter, theRadius, theState):
1494 # Example: see GEOM_TestOthers.py
1495 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
1496 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
1499 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1500 # the specified quadrangle by the certain way, defined through \a theState parameter.
1501 # @param theShape Shape to find sub-shapes of.
1502 # @param theShapeType Type of sub-shapes to be retrieved.
1503 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
1504 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
1505 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
1506 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
1507 # @param theState The state of the subshapes to find. It can be one of
1508 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1509 # @return List of all found sub-shapes.
1511 # @ref swig_GetShapesOnQuadrangle "Example"
1512 def GetShapesOnQuadrangle(self, theShape, theShapeType,
1513 theTopLeftPoint, theTopRigthPoint,
1514 theBottomLeftPoint, theBottomRigthPoint, theState):
1515 # Example: see GEOM_TestOthers.py
1516 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
1517 theTopLeftPoint, theTopRigthPoint,
1518 theBottomLeftPoint, theBottomRigthPoint, theState)
1519 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
1522 ## Works like the above method, but returns list of sub-shapes indices
1524 # @ref swig_GetShapesOnQuadrangleIDs "Example"
1525 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
1526 theTopLeftPoint, theTopRigthPoint,
1527 theBottomLeftPoint, theBottomRigthPoint, theState):
1528 # Example: see GEOM_TestOthers.py
1529 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
1530 theTopLeftPoint, theTopRigthPoint,
1531 theBottomLeftPoint, theBottomRigthPoint, theState)
1532 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
1535 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1536 # the specified \a theBox by the certain way, defined through \a theState parameter.
1537 # @param theBox Shape for relative comparing.
1538 # @param theShape Shape to find sub-shapes of.
1539 # @param theShapeType Type of sub-shapes to be retrieved.
1540 # @param theState The state of the subshapes to find. It can be one of
1541 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1542 # @return List of all found sub-shapes.
1544 # @ref swig_GetShapesOnBox "Example"
1545 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState):
1546 # Example: see GEOM_TestOthers.py
1547 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
1548 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
1551 ## Works like the above method, but returns list of sub-shapes indices
1553 # @ref swig_GetShapesOnBoxIDs "Example"
1554 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
1555 # Example: see GEOM_TestOthers.py
1556 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
1557 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
1560 ## Find in \a theShape all sub-shapes of type \a theShapeType,
1561 # situated relatively the specified \a theCheckShape by the
1562 # certain way, defined through \a theState parameter.
1563 # @param theCheckShape Shape for relative comparing.
1564 # @param theShape Shape to find sub-shapes of.
1565 # @param theShapeType Type of sub-shapes to be retrieved.
1566 # @param theState The state of the subshapes to find. It can be one of
1567 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1568 # @return List of all found sub-shapes.
1570 # @ref swig_GetShapesOnShape "Example"
1571 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState):
1572 # Example: see GEOM_TestOthers.py
1573 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
1574 theShapeType, theState)
1575 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
1578 ## Works like the above method, but returns result as compound
1580 # @ref swig_GetShapesOnShapeAsCompound "Example"
1581 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState):
1582 # Example: see GEOM_TestOthers.py
1583 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
1584 theShapeType, theState)
1585 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
1588 ## Works like the above method, but returns list of sub-shapes indices
1590 # @ref swig_GetShapesOnShapeIDs "Example"
1591 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
1592 # Example: see GEOM_TestOthers.py
1593 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
1594 theShapeType, theState)
1595 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
1598 ## Get sub-shape(s) of theShapeWhere, which are
1599 # coincident with \a theShapeWhat or could be a part of it.
1600 # @param theShapeWhere Shape to find sub-shapes of.
1601 # @param theShapeWhat Shape, specifying what to find.
1602 # @return Group of all found sub-shapes or a single found sub-shape.
1604 # @ref swig_GetInPlace "Example"
1605 def GetInPlace(self,theShapeWhere, theShapeWhat):
1606 # Example: see GEOM_TestOthers.py
1607 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
1608 RaiseIfFailed("GetInPlace", self.ShapesOp)
1611 ## Get sub-shape(s) of \a theShapeWhere, which are
1612 # coincident with \a theShapeWhat or could be a part of it.
1614 # Implementation of this method is based on a saved history of an operation,
1615 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
1616 # arguments (an argument shape or a sub-shape of an argument shape).
1617 # The operation could be the Partition or one of boolean operations,
1618 # performed on simple shapes (not on compounds).
1620 # @param theShapeWhere Shape to find sub-shapes of.
1621 # @param theShapeWhat Shape, specifying what to find (must be in the
1622 # building history of the ShapeWhere).
1623 # @return Group of all found sub-shapes or a single found sub-shape.
1625 # @ref swig_GetInPlace "Example"
1626 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat):
1627 # Example: see GEOM_TestOthers.py
1628 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
1629 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
1632 ## Get sub-shape of theShapeWhere, which is
1633 # equal to \a theShapeWhat.
1634 # @param theShapeWhere Shape to find sub-shape of.
1635 # @param theShapeWhat Shape, specifying what to find.
1636 # @return New GEOM_Object for found sub-shape.
1638 # @ref swig_GetSame "Example"
1639 def GetSame(self,theShapeWhere, theShapeWhat):
1640 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
1641 RaiseIfFailed("GetSame", self.ShapesOp)
1647 ## @addtogroup l4_access
1650 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
1651 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
1653 # @ref swig_all_decompose "Example"
1654 def GetSubShape(self, aShape, ListOfID):
1655 # Example: see GEOM_TestAll.py
1656 anObj = self.AddSubShape(aShape,ListOfID)
1659 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
1661 # @ref swig_all_decompose "Example"
1662 def GetSubShapeID(self, aShape, aSubShape):
1663 # Example: see GEOM_TestAll.py
1664 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
1665 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
1671 ## @addtogroup l4_decompose
1674 ## Explode a shape on subshapes of a given type.
1675 # @param aShape Shape to be exploded.
1676 # @param aType Type of sub-shapes to be retrieved.
1677 # @return List of sub-shapes of type theShapeType, contained in theShape.
1679 # @ref swig_all_decompose "Example"
1680 def SubShapeAll(self, aShape, aType):
1681 # Example: see GEOM_TestAll.py
1682 ListObj = self.ShapesOp.MakeExplode(aShape,aType,0)
1683 RaiseIfFailed("MakeExplode", self.ShapesOp)
1686 ## Explode a shape on subshapes of a given type.
1687 # @param aShape Shape to be exploded.
1688 # @param aType Type of sub-shapes to be retrieved.
1689 # @return List of IDs of sub-shapes.
1691 # @ref swig_all_decompose "Example"
1692 def SubShapeAllIDs(self, aShape, aType):
1693 ListObj = self.ShapesOp.SubShapeAllIDs(aShape,aType,0)
1694 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
1697 ## Explode a shape on subshapes of a given type.
1698 # Sub-shapes will be sorted by coordinates of their gravity centers.
1699 # @param aShape Shape to be exploded.
1700 # @param aType Type of sub-shapes to be retrieved.
1701 # @return List of sub-shapes of type theShapeType, contained in theShape.
1703 # @ref swig_SubShapeAllSorted "Example"
1704 def SubShapeAllSorted(self, aShape, aType):
1705 # Example: see GEOM_TestAll.py
1706 ListObj = self.ShapesOp.MakeExplode(aShape,aType,1)
1707 RaiseIfFailed("MakeExplode", self.ShapesOp)
1710 ## Explode a shape on subshapes of a given type.
1711 # Sub-shapes will be sorted by coordinates of their gravity centers.
1712 # @param aShape Shape to be exploded.
1713 # @param aType Type of sub-shapes to be retrieved.
1714 # @return List of IDs of sub-shapes.
1716 # @ref swig_all_decompose "Example"
1717 def SubShapeAllSortedIDs(self, aShape, aType):
1718 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape,aType,1)
1719 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
1722 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
1723 # selected by they indices in list of all sub-shapes of type <VAR>aType</VAR>.
1724 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
1726 # @ref swig_all_decompose "Example"
1727 def SubShape(self, aShape, aType, ListOfInd):
1728 # Example: see GEOM_TestAll.py
1730 AllShapeList = self.SubShapeAll(aShape, aType)
1731 for ind in ListOfInd:
1732 ListOfIDs.append(self.GetSubShapeID(aShape, AllShapeList[ind - 1]))
1733 anObj = self.GetSubShape(aShape, ListOfIDs)
1736 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
1737 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
1738 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
1740 # @ref swig_all_decompose "Example"
1741 def SubShapeSorted(self,aShape, aType, ListOfInd):
1742 # Example: see GEOM_TestAll.py
1744 AllShapeList = self.SubShapeAllSorted(aShape, aType)
1745 for ind in ListOfInd:
1746 ListOfIDs.append(self.GetSubShapeID(aShape, AllShapeList[ind - 1]))
1747 anObj = self.GetSubShape(aShape, ListOfIDs)
1750 # end of l4_decompose
1753 ## @addtogroup l3_healing
1756 ## Apply a sequence of Shape Healing operators to the given object.
1757 # @param theShape Shape to be processed.
1758 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
1759 # @param theParameters List of names of parameters
1760 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
1761 # @param theValues List of values of parameters, in the same order
1762 # as parameters are listed in <VAR>theParameters</VAR> list.
1763 # @return New GEOM_Object, containing processed shape.
1765 # @ref tui_shape_processing "Example"
1766 def ProcessShape(self,theShape, theOperators, theParameters, theValues):
1767 # Example: see GEOM_TestHealing.py
1768 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
1769 RaiseIfFailed("ProcessShape", self.HealOp)
1772 ## Remove faces from the given object (shape).
1773 # @param theObject Shape to be processed.
1774 # @param theFaces Indices of faces to be removed, if EMPTY then the method
1775 # removes ALL faces of the given object.
1776 # @return New GEOM_Object, containing processed shape.
1778 # @ref tui_suppress_faces "Example"
1779 def SuppressFaces(self,theObject, theFaces):
1780 # Example: see GEOM_TestHealing.py
1781 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
1782 RaiseIfFailed("SuppressFaces", self.HealOp)
1785 ## Sewing of some shapes into single shape.
1787 # @ref tui_sewing "Example"
1788 def MakeSewing(self, ListShape, theTolerance):
1789 # Example: see GEOM_TestHealing.py
1790 comp = self.MakeCompound(ListShape)
1791 anObj = self.Sew(comp, theTolerance)
1794 ## Sewing of the given object.
1795 # @param theObject Shape to be processed.
1796 # @param theTolerance Required tolerance value.
1797 # @return New GEOM_Object, containing processed shape.
1798 def Sew(self, theObject, theTolerance):
1799 # Example: see MakeSewing() above
1800 anObj = self.HealOp.Sew(theObject, theTolerance)
1801 RaiseIfFailed("Sew", self.HealOp)
1804 ## Remove internal wires and edges from the given object (face).
1805 # @param theObject Shape to be processed.
1806 # @param theWires Indices of wires to be removed, if EMPTY then the method
1807 # removes ALL internal wires of the given object.
1808 # @return New GEOM_Object, containing processed shape.
1810 # @ref tui_suppress_internal_wires "Example"
1811 def SuppressInternalWires(self,theObject, theWires):
1812 # Example: see GEOM_TestHealing.py
1813 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
1814 RaiseIfFailed("RemoveIntWires", self.HealOp)
1817 ## Remove internal closed contours (holes) from the given object.
1818 # @param theObject Shape to be processed.
1819 # @param theWires Indices of wires to be removed, if EMPTY then the method
1820 # removes ALL internal holes of the given object
1821 # @return New GEOM_Object, containing processed shape.
1823 # @ref tui_suppress_holes "Example"
1824 def SuppressHoles(self,theObject, theWires):
1825 # Example: see GEOM_TestHealing.py
1826 anObj = self.HealOp.FillHoles(theObject, theWires)
1827 RaiseIfFailed("FillHoles", self.HealOp)
1830 ## Close an open wire.
1831 # @param theObject Shape to be processed.
1832 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
1833 # if -1, then <VAR>theObject</VAR> itself is a wire.
1834 # @param isCommonVertex If TRUE : closure by creation of a common vertex,
1835 # If FALS : closure by creation of an edge between ends.
1836 # @return New GEOM_Object, containing processed shape.
1838 # @ref tui_close_contour "Example"
1839 def CloseContour(self,theObject, theWires, isCommonVertex):
1840 # Example: see GEOM_TestHealing.py
1841 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
1842 RaiseIfFailed("CloseContour", self.HealOp)
1845 ## Addition of a point to a given edge object.
1846 # @param theObject Shape to be processed.
1847 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
1848 # if -1, then theObject itself is the edge.
1849 # @param theValue Value of parameter on edge or length parameter,
1850 # depending on \a isByParameter.
1851 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1],
1852 # if FALSE : \a theValue is treated as a length parameter [0..1]
1853 # @return New GEOM_Object, containing processed shape.
1855 # @ref tui_add_point_on_edge "Example"
1856 def DivideEdge(self,theObject, theEdgeIndex, theValue, isByParameter):
1857 # Example: see GEOM_TestHealing.py
1858 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
1859 RaiseIfFailed("DivideEdge", self.HealOp)
1862 ## Change orientation of the given object. Updates given shape.
1863 # @param theObject Shape to be processed.
1865 # @ref swig_todo "Example"
1866 def ChangeOrientationShell(self,theObject):
1867 theObject = self.HealOp.ChangeOrientation(theObject)
1868 RaiseIfFailed("ChangeOrientation", self.HealOp)
1871 ## Change orientation of the given object.
1872 # @param theObject Shape to be processed.
1873 # @return New GEOM_Object, containing processed shape.
1875 # @ref swig_todo "Example"
1876 def ChangeOrientationShellCopy(self,theObject):
1877 anObj = self.HealOp.ChangeOrientationCopy(theObject)
1878 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
1881 ## Get a list of wires (wrapped in GEOM_Object-s),
1882 # that constitute a free boundary of the given shape.
1883 # @param theObject Shape to get free boundary of.
1884 # @return [status, theClosedWires, theOpenWires]
1885 # status: FALSE, if an error(s) occured during the method execution.
1886 # theClosedWires: Closed wires on the free boundary of the given shape.
1887 # theOpenWires: Open wires on the free boundary of the given shape.
1889 # @ref tui_measurement_tools_page "Example"
1890 def GetFreeBoundary(self,theObject):
1891 # Example: see GEOM_TestHealing.py
1892 anObj = self.HealOp.GetFreeBoundary(theObject)
1893 RaiseIfFailed("GetFreeBoundary", self.HealOp)
1896 ## Replace coincident faces in theShape by one face.
1897 # @param theShape Initial shape.
1898 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
1899 # @param doKeepNonSolids If FALSE, only solids will present in the result,
1900 # otherwise all initial shapes.
1901 # @return New GEOM_Object, containing a copy of theShape without coincident faces.
1903 # @ref tui_glue_faces "Example"
1904 def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True):
1905 # Example: see GEOM_Spanner.py
1906 anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
1908 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
1911 ## Find coincident faces in theShape for possible gluing.
1912 # @param theShape Initial shape.
1913 # @param theTolerance Maximum distance between faces,
1914 # which can be considered as coincident.
1917 # @ref swig_todo "Example"
1918 def GetGlueFaces(self, theShape, theTolerance):
1919 # Example: see GEOM_Spanner.py
1920 anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
1921 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
1924 ## Replace coincident faces in theShape by one face
1925 # in compliance with given list of faces
1926 # @param theShape Initial shape.
1927 # @param theTolerance Maximum distance between faces,
1928 # which can be considered as coincident.
1929 # @param theFaces List of faces for gluing.
1930 # @param doKeepNonSolids If FALSE, only solids will present in the result,
1931 # otherwise all initial shapes.
1932 # @return New GEOM_Object, containing a copy of theShape
1933 # without some faces.
1935 # @ref swig_todo "Example"
1936 def MakeGlueFacesByList(self, theShape, theTolerance, theFaces, doKeepNonSolids=True):
1937 # Example: see GEOM_Spanner.py
1938 anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces, doKeepNonSolids)
1940 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
1946 ## @addtogroup l3_boolean Boolean Operations
1949 # -----------------------------------------------------------------------------
1950 # Boolean (Common, Cut, Fuse, Section)
1951 # -----------------------------------------------------------------------------
1953 ## Perform one of boolean operations on two given shapes.
1954 # @param theShape1 First argument for boolean operation.
1955 # @param theShape2 Second argument for boolean operation.
1956 # @param theOperation Indicates the operation to be done:
1957 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
1958 # @return New GEOM_Object, containing the result shape.
1960 # @ref tui_fuse "Example"
1961 def MakeBoolean(self,theShape1, theShape2, theOperation):
1962 # Example: see GEOM_TestAll.py
1963 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation)
1964 RaiseIfFailed("MakeBoolean", self.BoolOp)
1967 ## Shortcut to MakeBoolean(s1, s2, 1)
1969 # @ref tui_common "Example 1"
1970 # \n @ref swig_MakeCommon "Example 2"
1971 def MakeCommon(self, s1, s2):
1972 # Example: see GEOM_TestOthers.py
1973 return self.MakeBoolean(s1, s2, 1)
1975 ## Shortcut to MakeBoolean(s1, s2, 2)
1977 # @ref tui_cut "Example 1"
1978 # \n @ref swig_MakeCommon "Example 2"
1979 def MakeCut(self, s1, s2):
1980 # Example: see GEOM_TestOthers.py
1981 return self.MakeBoolean(s1, s2, 2)
1983 ## Shortcut to MakeBoolean(s1, s2, 3)
1985 # @ref tui_fuse "Example 1"
1986 # \n @ref swig_MakeCommon "Example 2"
1987 def MakeFuse(self, s1, s2):
1988 # Example: see GEOM_TestOthers.py
1989 return self.MakeBoolean(s1, s2, 3)
1991 ## Shortcut to MakeBoolean(s1, s2, 4)
1993 # @ref tui_section "Example 1"
1994 # \n @ref swig_MakeCommon "Example 2"
1995 def MakeSection(self, s1, s2):
1996 # Example: see GEOM_TestOthers.py
1997 return self.MakeBoolean(s1, s2, 4)
2002 ## @addtogroup l3_basic_op
2005 ## Perform partition operation.
2006 # @param ListShapes Shapes to be intersected.
2007 # @param ListTools Shapes to intersect theShapes.
2008 # !!!NOTE: Each compound from ListShapes and ListTools will be exploded
2009 # in order to avoid possible intersection between shapes from
2011 # @param Limit Type of resulting shapes (corresponding to TopAbs_ShapeEnum).
2012 # @param KeepNonlimitShapes: if this parameter == 0 - only shapes with
2013 # type <= Limit are kept in the result,
2014 # else - shapes with type > Limit are kept
2015 # also (if they exist)
2017 # After implementation new version of PartitionAlgo (October 2006)
2018 # other parameters are ignored by current functionality. They are kept
2019 # in this function only for support old versions.
2020 # Ignored parameters:
2021 # @param ListKeepInside Shapes, outside which the results will be deleted.
2022 # Each shape from theKeepInside must belong to theShapes also.
2023 # @param ListRemoveInside Shapes, inside which the results will be deleted.
2024 # Each shape from theRemoveInside must belong to theShapes also.
2025 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
2026 # @param ListMaterials Material indices for each shape. Make sence,
2027 # only if theRemoveWebs is TRUE.
2029 # @return New GEOM_Object, containing the result shapes.
2031 # @ref tui_partition "Example"
2032 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
2033 Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
2034 KeepNonlimitShapes=0):
2035 # Example: see GEOM_TestAll.py
2036 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
2037 ListKeepInside, ListRemoveInside,
2038 Limit, RemoveWebs, ListMaterials,
2039 KeepNonlimitShapes);
2040 RaiseIfFailed("MakePartition", self.BoolOp)
2043 ## Perform partition operation.
2044 # This method may be useful if it is needed to make a partition for
2045 # compound contains nonintersected shapes. Performance will be better
2046 # since intersection between shapes from compound is not performed.
2048 # Description of all parameters as in previous method MakePartition()
2050 # !!!NOTE: Passed compounds (via ListShapes or via ListTools)
2051 # have to consist of nonintersecting shapes.
2053 # @return New GEOM_Object, containing the result shapes.
2055 # @ref swig_todo "Example"
2056 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
2057 ListKeepInside=[], ListRemoveInside=[],
2058 Limit=ShapeType["SHAPE"], RemoveWebs=0,
2059 ListMaterials=[], KeepNonlimitShapes=0):
2060 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
2061 ListKeepInside, ListRemoveInside,
2062 Limit, RemoveWebs, ListMaterials,
2063 KeepNonlimitShapes);
2064 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
2067 ## Shortcut to MakePartition()
2069 # @ref tui_partition "Example 1"
2070 # \n @ref swig_Partition "Example 2"
2071 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
2072 Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
2073 KeepNonlimitShapes=0):
2074 # Example: see GEOM_TestOthers.py
2075 anObj = self.MakePartition(ListShapes, ListTools,
2076 ListKeepInside, ListRemoveInside,
2077 Limit, RemoveWebs, ListMaterials,
2078 KeepNonlimitShapes);
2081 ## Perform partition of the Shape with the Plane
2082 # @param theShape Shape to be intersected.
2083 # @param thePlane Tool shape, to intersect theShape.
2084 # @return New GEOM_Object, containing the result shape.
2086 # @ref tui_partition "Example"
2087 def MakeHalfPartition(self,theShape, thePlane):
2088 # Example: see GEOM_TestAll.py
2089 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
2090 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
2093 # end of l3_basic_op
2096 ## @addtogroup l3_transform
2099 ## Translate the given object along the vector, specified
2100 # by its end points, creating its copy before the translation.
2101 # @param theObject The object to be translated.
2102 # @param thePoint1 Start point of translation vector.
2103 # @param thePoint2 End point of translation vector.
2104 # @return New GEOM_Object, containing the translated object.
2106 # @ref tui_translation "Example 1"
2107 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
2108 def MakeTranslationTwoPoints(self,theObject, thePoint1, thePoint2):
2109 # Example: see GEOM_TestAll.py
2110 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
2111 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
2114 ## Translate the given object along the vector, specified
2115 # by its components, creating its copy before the translation.
2116 # @param theObject The object to be translated.
2117 # @param theDX,theDY,theDZ Components of translation vector.
2118 # @return New GEOM_Object, containing the translated object.
2120 # @ref tui_translation "Example"
2121 def MakeTranslation(self,theObject, theDX, theDY, theDZ):
2122 # Example: see GEOM_TestAll.py
2123 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
2124 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
2127 ## Translate the given object along the given vector,
2128 # creating its copy before the translation.
2129 # @param theObject The object to be translated.
2130 # @param theVector The translation vector.
2131 # @return New GEOM_Object, containing the translated object.
2133 # @ref tui_translation "Example"
2134 def MakeTranslationVector(self,theObject, theVector):
2135 # Example: see GEOM_TestAll.py
2136 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
2137 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
2140 ## Translate the given object along the given vector on given distance,
2141 # creating its copy before the translation.
2142 # @param theObject The object to be translated.
2143 # @param theVector The translation vector.
2144 # @param theDistance The translation distance.
2145 # @return New GEOM_Object, containing the translated object.
2147 # @ref tui_translation "Example"
2148 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance):
2149 # Example: see GEOM_TestAll.py
2150 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
2151 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
2154 ## Rotate the given object around the given axis
2155 # on the given angle, creating its copy before the rotatation.
2156 # @param theObject The object to be rotated.
2157 # @param theAxis Rotation axis.
2158 # @param theAngle Rotation angle in radians.
2159 # @return New GEOM_Object, containing the rotated object.
2161 # @ref tui_rotation "Example"
2162 def MakeRotation(self,theObject, theAxis, theAngle):
2163 # Example: see GEOM_TestAll.py
2164 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
2165 RaiseIfFailed("RotateCopy", self.TrsfOp)
2168 ## Rotate given object around vector perpendicular to plane
2169 # containing three points, creating its copy before the rotatation.
2170 # @param theObject The object to be rotated.
2171 # @param theCentPoint central point - the axis is the vector perpendicular to the plane
2172 # containing the three points.
2173 # @param thePoint1,thePoint2 - in a perpendicular plane of the axis.
2174 # @return New GEOM_Object, containing the rotated object.
2176 # @ref tui_rotation "Example"
2177 def MakeRotationThreePoints(self,theObject, theCentPoint, thePoint1, thePoint2):
2178 # Example: see GEOM_TestAll.py
2179 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
2180 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
2183 ## Scale the given object by the factor, creating its copy before the scaling.
2184 # @param theObject The object to be scaled.
2185 # @param thePoint Center point for scaling.
2186 # Passing None for it means scaling relatively the origin of global CS.
2187 # @param theFactor Scaling factor value.
2188 # @return New GEOM_Object, containing the scaled shape.
2190 # @ref tui_scale "Example"
2191 def MakeScaleTransform(self, theObject, thePoint, theFactor):
2192 # Example: see GEOM_TestAll.py
2193 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
2194 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
2197 ## Scale the given object by different factors along coordinate axes,
2198 # creating its copy before the scaling.
2199 # @param theObject The object to be scaled.
2200 # @param thePoint Center point for scaling.
2201 # Passing None for it means scaling relatively the origin of global CS.
2202 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
2203 # @return New GEOM_Object, containing the scaled shape.
2205 # @ref swig_scale "Example"
2206 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ):
2207 # Example: see GEOM_TestAll.py
2208 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
2209 theFactorX, theFactorY, theFactorZ)
2210 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
2213 ## Create an object, symmetrical
2214 # to the given one relatively the given plane.
2215 # @param theObject The object to be mirrored.
2216 # @param thePlane Plane of symmetry.
2217 # @return New GEOM_Object, containing the mirrored shape.
2219 # @ref tui_mirror "Example"
2220 def MakeMirrorByPlane(self,theObject, thePlane):
2221 # Example: see GEOM_TestAll.py
2222 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
2223 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
2226 ## Create an object, symmetrical
2227 # to the given one relatively the given axis.
2228 # @param theObject The object to be mirrored.
2229 # @param theAxis Axis of symmetry.
2230 # @return New GEOM_Object, containing the mirrored shape.
2232 # @ref tui_mirror "Example"
2233 def MakeMirrorByAxis(self,theObject, theAxis):
2234 # Example: see GEOM_TestAll.py
2235 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
2236 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
2239 ## Create an object, symmetrical
2240 # to the given one relatively the given point.
2241 # @param theObject The object to be mirrored.
2242 # @param thePoint Point of symmetry.
2243 # @return New GEOM_Object, containing the mirrored shape.
2245 # @ref tui_mirror "Example"
2246 def MakeMirrorByPoint(self,theObject, thePoint):
2247 # Example: see GEOM_TestAll.py
2248 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
2249 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
2252 ## Modify the Location of the given object by LCS,
2253 # creating its copy before the setting.
2254 # @param theObject The object to be displaced.
2255 # @param theStartLCS Coordinate system to perform displacement from it.
2256 # If \a theStartLCS is NULL, displacement
2257 # will be performed from global CS.
2258 # If \a theObject itself is used as \a theStartLCS,
2259 # its location will be changed to \a theEndLCS.
2260 # @param theEndLCS Coordinate system to perform displacement to it.
2261 # @return New GEOM_Object, containing the displaced shape.
2263 # @ref tui_modify_location "Example"
2264 def MakePosition(self,theObject, theStartLCS, theEndLCS):
2265 # Example: see GEOM_TestAll.py
2266 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
2267 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
2270 ## Create new object as offset of the given one.
2271 # @param theObject The base object for the offset.
2272 # @param theOffset Offset value.
2273 # @return New GEOM_Object, containing the offset object.
2275 # @ref tui_offset "Example"
2276 def MakeOffset(self,theObject, theOffset):
2277 # Example: see GEOM_TestAll.py
2278 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
2279 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
2282 # -----------------------------------------------------------------------------
2284 # -----------------------------------------------------------------------------
2286 ## Translate the given object along the given vector a given number times
2287 # @param theObject The object to be translated.
2288 # @param theVector Direction of the translation.
2289 # @param theStep Distance to translate on.
2290 # @param theNbTimes Quantity of translations to be done.
2291 # @return New GEOM_Object, containing compound of all
2292 # the shapes, obtained after each translation.
2294 # @ref tui_multi_translation "Example"
2295 def MakeMultiTranslation1D(self,theObject, theVector, theStep, theNbTimes):
2296 # Example: see GEOM_TestAll.py
2297 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
2298 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
2301 ## Conseqently apply two specified translations to theObject specified number of times.
2302 # @param theObject The object to be translated.
2303 # @param theVector1 Direction of the first translation.
2304 # @param theStep1 Step of the first translation.
2305 # @param theNbTimes1 Quantity of translations to be done along theVector1.
2306 # @param theVector2 Direction of the second translation.
2307 # @param theStep2 Step of the second translation.
2308 # @param theNbTimes2 Quantity of translations to be done along theVector2.
2309 # @return New GEOM_Object, containing compound of all
2310 # the shapes, obtained after each translation.
2312 # @ref tui_multi_translation "Example"
2313 def MakeMultiTranslation2D(self,theObject, theVector1, theStep1, theNbTimes1,
2314 theVector2, theStep2, theNbTimes2):
2315 # Example: see GEOM_TestAll.py
2316 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
2317 theVector2, theStep2, theNbTimes2)
2318 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
2321 ## Rotate the given object around the given axis a given number times.
2322 # Rotation angle will be 2*PI/theNbTimes.
2323 # @param theObject The object to be rotated.
2324 # @param theAxis The rotation axis.
2325 # @param theNbTimes Quantity of rotations to be done.
2326 # @return New GEOM_Object, containing compound of all the
2327 # shapes, obtained after each rotation.
2329 # @ref tui_multi_rotation "Example"
2330 def MultiRotate1D(self,theObject, theAxis, theNbTimes):
2331 # Example: see GEOM_TestAll.py
2332 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
2333 RaiseIfFailed("MultiRotate1D", self.TrsfOp)
2336 ## Rotate the given object around the
2337 # given axis on the given angle a given number
2338 # times and multi-translate each rotation result.
2339 # Translation direction passes through center of gravity
2340 # of rotated shape and its projection on the rotation axis.
2341 # @param theObject The object to be rotated.
2342 # @param theAxis Rotation axis.
2343 # @param theAngle Rotation angle in graduces.
2344 # @param theNbTimes1 Quantity of rotations to be done.
2345 # @param theStep Translation distance.
2346 # @param theNbTimes2 Quantity of translations to be done.
2347 # @return New GEOM_Object, containing compound of all the
2348 # shapes, obtained after each transformation.
2350 # @ref tui_multi_rotation "Example"
2351 def MultiRotate2D(self,theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2):
2352 # Example: see GEOM_TestAll.py
2353 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
2354 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
2357 ## The same, as MultiRotate1D(), but axis is given by direction and point
2358 # @ref swig_MakeMultiRotation "Example"
2359 def MakeMultiRotation1D(self,aShape,aDir,aPoint,aNbTimes):
2360 # Example: see GEOM_TestOthers.py
2361 aVec = self.MakeLine(aPoint,aDir)
2362 anObj = self.MultiRotate1D(aShape,aVec,aNbTimes)
2365 ## The same, as MultiRotate2D(), but axis is given by direction and point
2366 # @ref swig_MakeMultiRotation "Example"
2367 def MakeMultiRotation2D(self,aShape,aDir,aPoint,anAngle,nbtimes1,aStep,nbtimes2):
2368 # Example: see GEOM_TestOthers.py
2369 aVec = self.MakeLine(aPoint,aDir)
2370 anObj = self.MultiRotate2D(aShape,aVec,anAngle,nbtimes1,aStep,nbtimes2)
2373 # end of l3_transform
2376 ## @addtogroup l3_local
2379 ## Perform a fillet on all edges of the given shape.
2380 # @param theShape Shape, to perform fillet on.
2381 # @param theR Fillet radius.
2382 # @return New GEOM_Object, containing the result shape.
2384 # @ref tui_fillet "Example 1"
2385 # \n @ref swig_MakeFilletAll "Example 2"
2386 def MakeFilletAll(self,theShape, theR):
2387 # Example: see GEOM_TestOthers.py
2388 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
2389 RaiseIfFailed("MakeFilletAll", self.LocalOp)
2392 ## Perform a fillet on the specified edges/faces of the given shape
2393 # @param theShape Shape, to perform fillet on.
2394 # @param theR Fillet radius.
2395 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR>.
2396 # @param theListShapes Global indices of edges/faces to perform fillet on.
2397 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2398 # @return New GEOM_Object, containing the result shape.
2400 # @ref tui_fillet "Example"
2401 def MakeFillet(self,theShape, theR, theShapeType, theListShapes):
2402 # Example: see GEOM_TestAll.py
2404 if theShapeType == ShapeType["EDGE"]:
2405 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
2406 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
2408 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
2409 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
2412 ## The same that MakeFillet but with two Fillet Radius R1 and R2
2413 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes):
2415 if theShapeType == ShapeType["EDGE"]:
2416 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
2417 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
2419 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
2420 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
2423 ## Perform a symmetric chamfer on all edges of the given shape.
2424 # @param theShape Shape, to perform chamfer on.
2425 # @param theD Chamfer size along each face.
2426 # @return New GEOM_Object, containing the result shape.
2428 # @ref tui_chamfer "Example 1"
2429 # \n @ref swig_MakeChamferAll "Example 2"
2430 def MakeChamferAll(self,theShape, theD):
2431 # Example: see GEOM_TestOthers.py
2432 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
2433 RaiseIfFailed("MakeChamferAll", self.LocalOp)
2436 ## Perform a chamfer on edges, common to the specified faces,
2437 # with distance D1 on the Face1
2438 # @param theShape Shape, to perform chamfer on.
2439 # @param theD1 Chamfer size along \a theFace1.
2440 # @param theD2 Chamfer size along \a theFace2.
2441 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
2442 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2443 # @return New GEOM_Object, containing the result shape.
2445 # @ref tui_chamfer "Example"
2446 def MakeChamferEdge(self,theShape, theD1, theD2, theFace1, theFace2):
2447 # Example: see GEOM_TestAll.py
2448 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
2449 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
2452 ## The Same that MakeChamferEdge but with params theD is chamfer length and
2453 # theAngle is Angle of chamfer (angle in radians)
2454 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2):
2455 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
2456 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
2459 ## Perform a chamfer on all edges of the specified faces,
2460 # with distance D1 on the first specified face (if several for one edge)
2461 # @param theShape Shape, to perform chamfer on.
2462 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
2463 # connected to the edge, are in \a theFaces, \a theD1
2464 # will be get along face, which is nearer to \a theFaces beginning.
2465 # @param theD2 Chamfer size along another of two faces, connected to the edge.
2466 # @param theFaces Sequence of global indices of faces of \a theShape.
2467 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2468 # @return New GEOM_Object, containing the result shape.
2470 # @ref tui_chamfer "Example"
2471 def MakeChamferFaces(self,theShape, theD1, theD2, theFaces):
2472 # Example: see GEOM_TestAll.py
2473 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
2474 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
2477 ## The Same that MakeChamferFaces but with params theD is chamfer lenght and
2478 # theAngle is Angle of chamfer (angle in radians)
2480 # @ref swig_FilletChamfer "Example"
2481 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces):
2482 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
2483 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
2486 ## Perform a chamfer on edges,
2487 # with distance D1 on the first specified face (if several for one edge)
2488 # @param theShape Shape, to perform chamfer on.
2489 # @param theD1,theD2 Chamfer size
2490 # @param theEdges Sequence of edges of \a theShape.
2491 # @return New GEOM_Object, containing the result shape.
2493 # @ref swig_FilletChamfer "Example"
2494 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges):
2495 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
2496 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
2499 ## The Same that MakeChamferEdges but with params theD is chamfer lenght and
2500 # theAngle is Angle of chamfer (angle in radians)
2501 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges):
2502 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
2503 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
2506 ## Shortcut to MakeChamferEdge() and MakeChamferFaces()
2508 # @ref swig_MakeChamfer "Example"
2509 def MakeChamfer(self,aShape,d1,d2,aShapeType,ListShape):
2510 # Example: see GEOM_TestOthers.py
2512 if aShapeType == ShapeType["EDGE"]:
2513 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1])
2515 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape)
2521 ## @addtogroup l3_basic_op
2524 ## Perform an Archimde operation on the given shape with given parameters.
2525 # The object presenting the resulting face is returned.
2526 # @param theShape Shape to be put in water.
2527 # @param theWeight Weight og the shape.
2528 # @param theWaterDensity Density of the water.
2529 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
2530 # @return New GEOM_Object, containing a section of \a theShape
2531 # by a plane, corresponding to water level.
2533 # @ref tui_archimede "Example"
2534 def Archimede(self,theShape, theWeight, theWaterDensity, theMeshDeflection):
2535 # Example: see GEOM_TestAll.py
2536 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
2537 RaiseIfFailed("MakeArchimede", self.LocalOp)
2540 # end of l3_basic_op
2543 ## @addtogroup l2_measure
2546 ## Get point coordinates
2549 # @ref tui_measurement_tools_page "Example"
2550 def PointCoordinates(self,Point):
2551 # Example: see GEOM_TestMeasures.py
2552 aTuple = self.MeasuOp.PointCoordinates(Point)
2553 RaiseIfFailed("PointCoordinates", self.MeasuOp)
2556 ## Get summarized length of all wires,
2557 # area of surface and volume of the given shape.
2558 # @param theShape Shape to define properties of.
2559 # @return [theLength, theSurfArea, theVolume]
2560 # theLength: Summarized length of all wires of the given shape.
2561 # theSurfArea: Area of surface of the given shape.
2562 # theVolume: Volume of the given shape.
2564 # @ref tui_measurement_tools_page "Example"
2565 def BasicProperties(self,theShape):
2566 # Example: see GEOM_TestMeasures.py
2567 aTuple = self.MeasuOp.GetBasicProperties(theShape)
2568 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
2571 ## Get parameters of bounding box of the given shape
2572 # @param theShape Shape to obtain bounding box of.
2573 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
2574 # Xmin,Xmax: Limits of shape along OX axis.
2575 # Ymin,Ymax: Limits of shape along OY axis.
2576 # Zmin,Zmax: Limits of shape along OZ axis.
2578 # @ref tui_measurement_tools_page "Example"
2579 def BoundingBox(self,theShape):
2580 # Example: see GEOM_TestMeasures.py
2581 aTuple = self.MeasuOp.GetBoundingBox(theShape)
2582 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
2585 ## Get inertia matrix and moments of inertia of theShape.
2586 # @param theShape Shape to calculate inertia of.
2587 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
2588 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
2589 # Ix,Iy,Iz: Moments of inertia of the given shape.
2591 # @ref tui_measurement_tools_page "Example"
2592 def Inertia(self,theShape):
2593 # Example: see GEOM_TestMeasures.py
2594 aTuple = self.MeasuOp.GetInertia(theShape)
2595 RaiseIfFailed("GetInertia", self.MeasuOp)
2598 ## Get minimal distance between the given shapes.
2599 # @param theShape1,theShape2 Shapes to find minimal distance between.
2600 # @return Value of the minimal distance between the given shapes.
2602 # @ref tui_measurement_tools_page "Example"
2603 def MinDistance(self, theShape1, theShape2):
2604 # Example: see GEOM_TestMeasures.py
2605 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
2606 RaiseIfFailed("GetMinDistance", self.MeasuOp)
2609 ## Get minimal distance between the given shapes.
2610 # @param theShape1,theShape2 Shapes to find minimal distance between.
2611 # @return Value of the minimal distance between the given shapes.
2613 # @ref swig_all_measure "Example"
2614 def MinDistanceComponents(self, theShape1, theShape2):
2615 # Example: see GEOM_TestMeasures.py
2616 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
2617 RaiseIfFailed("GetMinDistance", self.MeasuOp)
2618 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
2621 ## Get angle between the given shapes in degrees.
2622 # @param theShape1,theShape2 Lines or linear edges to find angle between.
2623 # @return Value of the angle between the given shapes in degrees.
2625 # @ref tui_measurement_tools_page "Example"
2626 def GetAngle(self, theShape1, theShape2):
2627 # Example: see GEOM_TestMeasures.py
2628 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
2629 RaiseIfFailed("GetAngle", self.MeasuOp)
2631 ## Get angle between the given shapes in radians.
2632 # @param theShape1,theShape2 Lines or linear edges to find angle between.
2633 # @return Value of the angle between the given shapes in radians.
2635 # @ref tui_measurement_tools_page "Example"
2636 def GetAngleRadians(self, theShape1, theShape2):
2637 # Example: see GEOM_TestMeasures.py
2638 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
2639 RaiseIfFailed("GetAngle", self.MeasuOp)
2642 ## @name Curve Curvature Measurement
2643 # Methods for receiving radius of curvature of curves
2644 # in the given point
2647 ## Measure curvature of a curve at a point, set by parameter.
2648 # @ref swig_todo "Example"
2649 def CurveCurvatureByParam(self, theCurve, theParam):
2650 # Example: see GEOM_TestMeasures.py
2651 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
2652 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
2656 # @ref swig_todo "Example"
2657 def CurveCurvatureByPoint(self, theCurve, thePoint):
2658 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
2659 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
2663 ## @name Surface Curvature Measurement
2664 # Methods for receiving max and min radius of curvature of surfaces
2665 # in the given point
2669 ## @ref swig_todo "Example"
2670 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
2671 # Example: see GEOM_TestMeasures.py
2672 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
2673 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
2677 ## @ref swig_todo "Example"
2678 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
2679 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
2680 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
2684 ## @ref swig_todo "Example"
2685 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
2686 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
2687 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
2691 ## @ref swig_todo "Example"
2692 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
2693 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
2694 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
2698 ## Get min and max tolerances of sub-shapes of theShape
2699 # @param theShape Shape, to get tolerances of.
2700 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
2701 # FaceMin,FaceMax: Min and max tolerances of the faces.
2702 # EdgeMin,EdgeMax: Min and max tolerances of the edges.
2703 # VertMin,VertMax: Min and max tolerances of the vertices.
2705 # @ref tui_measurement_tools_page "Example"
2706 def Tolerance(self,theShape):
2707 # Example: see GEOM_TestMeasures.py
2708 aTuple = self.MeasuOp.GetTolerance(theShape)
2709 RaiseIfFailed("GetTolerance", self.MeasuOp)
2712 ## Obtain description of the given shape (number of sub-shapes of each type)
2713 # @param theShape Shape to be described.
2714 # @return Description of the given shape.
2716 # @ref tui_measurement_tools_page "Example"
2717 def WhatIs(self,theShape):
2718 # Example: see GEOM_TestMeasures.py
2719 aDescr = self.MeasuOp.WhatIs(theShape)
2720 RaiseIfFailed("WhatIs", self.MeasuOp)
2723 ## Get a point, situated at the centre of mass of theShape.
2724 # @param theShape Shape to define centre of mass of.
2725 # @return New GEOM_Object, containing the created point.
2727 # @ref tui_measurement_tools_page "Example"
2728 def MakeCDG(self,theShape):
2729 # Example: see GEOM_TestMeasures.py
2730 anObj = self.MeasuOp.GetCentreOfMass(theShape)
2731 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
2734 ## Get a normale to the given face. If the point is not given,
2735 # the normale is calculated at the center of mass.
2736 # @param theFace Face to define normale of.
2737 # @param theOptionalPoint Point to compute the normale at.
2738 # @return New GEOM_Object, containing the created vector.
2740 # @ref swig_todo "Example"
2741 def GetNormal(self, theFace, theOptionalPoint = None):
2742 # Example: see GEOM_TestMeasures.py
2743 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
2744 RaiseIfFailed("GetNormal", self.MeasuOp)
2747 ## Check a topology of the given shape.
2748 # @param theShape Shape to check validity of.
2749 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked,
2750 # if TRUE, the shape's geometry will be checked also.
2751 # @return TRUE, if the shape "seems to be valid".
2752 # If theShape is invalid, prints a description of problem.
2754 # @ref tui_measurement_tools_page "Example"
2755 def CheckShape(self,theShape, theIsCheckGeom = 0):
2756 # Example: see GEOM_TestMeasures.py
2758 (IsValid, Status) = self.MeasuOp.CheckShapeWithGeometry(theShape)
2759 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
2761 (IsValid, Status) = self.MeasuOp.CheckShape(theShape)
2762 RaiseIfFailed("CheckShape", self.MeasuOp)
2767 ## Get position (LCS) of theShape.
2769 # Origin of the LCS is situated at the shape's center of mass.
2770 # Axes of the LCS are obtained from shape's location or,
2771 # if the shape is a planar face, from position of its plane.
2773 # @param theShape Shape to calculate position of.
2774 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
2775 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
2776 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
2777 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
2779 # @ref swig_todo "Example"
2780 def GetPosition(self,theShape):
2781 # Example: see GEOM_TestMeasures.py
2782 aTuple = self.MeasuOp.GetPosition(theShape)
2783 RaiseIfFailed("GetPosition", self.MeasuOp)
2786 ## Get kind of theShape.
2788 # @param theShape Shape to get a kind of.
2789 # @return Returns a kind of shape in terms of <VAR>GEOM_IKindOfShape.shape_kind</VAR> enumeration
2790 # and a list of parameters, describing the shape.
2791 # @note Concrete meaning of each value, returned via \a theIntegers
2792 # or \a theDoubles list depends on the kind of the shape.
2793 # The full list of possible outputs is:
2795 # - geompy.kind.COMPOUND nb_solids nb_faces nb_edges nb_vertices
2796 # - geompy.kind.COMPSOLID nb_solids nb_faces nb_edges nb_vertices
2798 # - geompy.kind.SHELL geompy.info.CLOSED nb_faces nb_edges nb_vertices
2799 # - geompy.kind.SHELL geompy.info.UNCLOSED nb_faces nb_edges nb_vertices
2801 # - geompy.kind.WIRE geompy.info.CLOSED nb_edges nb_vertices
2802 # - geompy.kind.WIRE geompy.info.UNCLOSED nb_edges nb_vertices
2804 # - geompy.kind.SPHERE xc yc zc R
2805 # - geompy.kind.CYLINDER xb yb zb dx dy dz R H
2806 # - geompy.kind.BOX xc yc zc ax ay az
2807 # - geompy.kind.ROTATED_BOX xc yc zc zx zy zz xx xy xz ax ay az
2808 # - geompy.kind.TORUS xc yc zc dx dy dz R_1 R_2
2809 # - geompy.kind.CONE xb yb zb dx dy dz R_1 R_2 H
2810 # - geompy.kind.POLYHEDRON nb_faces nb_edges nb_vertices
2811 # - geompy.kind.SOLID nb_faces nb_edges nb_vertices
2813 # - geompy.kind.SPHERE2D xc yc zc R
2814 # - geompy.kind.CYLINDER2D xb yb zb dx dy dz R H
2815 # - geompy.kind.TORUS2D xc yc zc dx dy dz R_1 R_2
2816 # - geompy.kind.CONE2D xc yc zc dx dy dz R_1 R_2 H
2817 # - geompy.kind.DISK_CIRCLE xc yc zc dx dy dz R
2818 # - geompy.kind.DISK_ELLIPSE xc yc zc dx dy dz R_1 R_2
2819 # - geompy.kind.POLYGON xo yo zo dx dy dz nb_edges nb_vertices
2820 # - geompy.kind.PLANE xo yo zo dx dy dz
2821 # - geompy.kind.PLANAR xo yo zo dx dy dz nb_edges nb_vertices
2822 # - geompy.kind.FACE nb_edges nb_vertices
2824 # - geompy.kind.CIRCLE xc yc zc dx dy dz R
2825 # - geompy.kind.ARC_CIRCLE xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2
2826 # - geompy.kind.ELLIPSE xc yc zc dx dy dz R_1 R_2
2827 # - geompy.kind.ARC_ELLIPSE xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2
2828 # - geompy.kind.LINE xo yo zo dx dy dz
2829 # - geompy.kind.SEGMENT x1 y1 z1 x2 y2 z2
2830 # - geompy.kind.EDGE nb_vertices
2832 # - geompy.kind.VERTEX x y z
2834 # @ref swig_todo "Example"
2835 def KindOfShape(self,theShape):
2836 # Example: see GEOM_TestMeasures.py
2837 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
2838 RaiseIfFailed("KindOfShape", self.MeasuOp)
2840 aKind = aRoughTuple[0]
2841 anInts = aRoughTuple[1]
2842 aDbls = aRoughTuple[2]
2844 # Now there is no exception from this rule:
2845 aKindTuple = [aKind] + aDbls + anInts
2847 # If they are we will regroup parameters for such kind of shape.
2849 #if aKind == kind.SOME_KIND:
2850 # # SOME_KIND int int double int double double
2851 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
2858 ## @addtogroup l2_import_export
2861 ## Import a shape from the BREP or IGES or STEP file
2862 # (depends on given format) with given name.
2863 # @param theFileName The file, containing the shape.
2864 # @param theFormatName Specify format for the file reading.
2865 # Available formats can be obtained with InsertOp.ImportTranslators() method.
2866 # @return New GEOM_Object, containing the imported shape.
2868 # @ref swig_Import_Export "Example"
2869 def Import(self,theFileName, theFormatName):
2870 # Example: see GEOM_TestOthers.py
2871 anObj = self.InsertOp.Import(theFileName, theFormatName)
2872 RaiseIfFailed("Import", self.InsertOp)
2875 ## Shortcut to Import() for BREP format
2877 # @ref swig_Import_Export "Example"
2878 def ImportBREP(self,theFileName):
2879 # Example: see GEOM_TestOthers.py
2880 return self.Import(theFileName, "BREP")
2882 ## Shortcut to Import() for IGES format
2884 # @ref swig_Import_Export "Example"
2885 def ImportIGES(self,theFileName):
2886 # Example: see GEOM_TestOthers.py
2887 return self.Import(theFileName, "IGES")
2889 ## Shortcut to Import() for STEP format
2891 # @ref swig_Import_Export "Example"
2892 def ImportSTEP(self,theFileName):
2893 # Example: see GEOM_TestOthers.py
2894 return self.Import(theFileName, "STEP")
2896 ## Export the given shape into a file with given name.
2897 # @param theObject Shape to be stored in the file.
2898 # @param theFileName Name of the file to store the given shape in.
2899 # @param theFormatName Specify format for the shape storage.
2900 # Available formats can be obtained with InsertOp.ImportTranslators() method.
2902 # @ref swig_Import_Export "Example"
2903 def Export(self,theObject, theFileName, theFormatName):
2904 # Example: see GEOM_TestOthers.py
2905 self.InsertOp.Export(theObject, theFileName, theFormatName)
2906 if self.InsertOp.IsDone() == 0:
2907 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
2911 ## Shortcut to Export() for BREP format
2913 # @ref swig_Import_Export "Example"
2914 def ExportBREP(self,theObject, theFileName):
2915 # Example: see GEOM_TestOthers.py
2916 return self.Export(theObject, theFileName, "BREP")
2918 ## Shortcut to Export() for IGES format
2920 # @ref swig_Import_Export "Example"
2921 def ExportIGES(self,theObject, theFileName):
2922 # Example: see GEOM_TestOthers.py
2923 return self.Export(theObject, theFileName, "IGES")
2925 ## Shortcut to Export() for STEP format
2927 # @ref swig_Import_Export "Example"
2928 def ExportSTEP(self,theObject, theFileName):
2929 # Example: see GEOM_TestOthers.py
2930 return self.Export(theObject, theFileName, "STEP")
2932 # end of l2_import_export
2935 ## @addtogroup l3_blocks
2938 ## Create a quadrangle face from four edges. Order of Edges is not
2939 # important. It is not necessary that edges share the same vertex.
2940 # @param E1,E2,E3,E4 Edges for the face bound.
2941 # @return New GEOM_Object, containing the created face.
2943 # @ref tui_building_by_blocks_page "Example"
2944 def MakeQuad(self,E1, E2, E3, E4):
2945 # Example: see GEOM_Spanner.py
2946 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
2947 RaiseIfFailed("MakeQuad", self.BlocksOp)
2950 ## Create a quadrangle face on two edges.
2951 # The missing edges will be built by creating the shortest ones.
2952 # @param E1,E2 Two opposite edges for the face.
2953 # @return New GEOM_Object, containing the created face.
2955 # @ref tui_building_by_blocks_page "Example"
2956 def MakeQuad2Edges(self,E1, E2):
2957 # Example: see GEOM_Spanner.py
2958 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
2959 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
2962 ## Create a quadrangle face with specified corners.
2963 # The missing edges will be built by creating the shortest ones.
2964 # @param V1,V2,V3,V4 Corner vertices for the face.
2965 # @return New GEOM_Object, containing the created face.
2967 # @ref tui_building_by_blocks_page "Example 1"
2968 # \n @ref swig_MakeQuad4Vertices "Example 2"
2969 def MakeQuad4Vertices(self,V1, V2, V3, V4):
2970 # Example: see GEOM_Spanner.py
2971 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
2972 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
2975 ## Create a hexahedral solid, bounded by the six given faces. Order of
2976 # faces is not important. It is not necessary that Faces share the same edge.
2977 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
2978 # @return New GEOM_Object, containing the created solid.
2980 # @ref tui_building_by_blocks_page "Example 1"
2981 # \n @ref swig_MakeHexa "Example 2"
2982 def MakeHexa(self,F1, F2, F3, F4, F5, F6):
2983 # Example: see GEOM_Spanner.py
2984 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
2985 RaiseIfFailed("MakeHexa", self.BlocksOp)
2988 ## Create a hexahedral solid between two given faces.
2989 # The missing faces will be built by creating the smallest ones.
2990 # @param F1,F2 Two opposite faces for the hexahedral solid.
2991 # @return New GEOM_Object, containing the created solid.
2993 # @ref tui_building_by_blocks_page "Example 1"
2994 # \n @ref swig_MakeHexa2Faces "Example 2"
2995 def MakeHexa2Faces(self,F1, F2):
2996 # Example: see GEOM_Spanner.py
2997 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
2998 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
3004 ## @addtogroup l3_blocks_op
3007 ## Get a vertex, found in the given shape by its coordinates.
3008 # @param theShape Block or a compound of blocks.
3009 # @param theX,theY,theZ Coordinates of the sought vertex.
3010 # @param theEpsilon Maximum allowed distance between the resulting
3011 # vertex and point with the given coordinates.
3012 # @return New GEOM_Object, containing the found vertex.
3014 # @ref swig_GetPoint "Example"
3015 def GetPoint(self,theShape, theX, theY, theZ, theEpsilon):
3016 # Example: see GEOM_TestOthers.py
3017 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
3018 RaiseIfFailed("GetPoint", self.BlocksOp)
3021 ## Get an edge, found in the given shape by two given vertices.
3022 # @param theShape Block or a compound of blocks.
3023 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
3024 # @return New GEOM_Object, containing the found edge.
3026 # @ref swig_todo "Example"
3027 def GetEdge(self,theShape, thePoint1, thePoint2):
3028 # Example: see GEOM_Spanner.py
3029 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
3030 RaiseIfFailed("GetEdge", self.BlocksOp)
3033 ## Find an edge of the given shape, which has minimal distance to the given point.
3034 # @param theShape Block or a compound of blocks.
3035 # @param thePoint Point, close to the desired edge.
3036 # @return New GEOM_Object, containing the found edge.
3038 # @ref swig_GetEdgeNearPoint "Example"
3039 def GetEdgeNearPoint(self,theShape, thePoint):
3040 # Example: see GEOM_TestOthers.py
3041 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
3042 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
3045 ## Returns a face, found in the given shape by four given corner vertices.
3046 # @param theShape Block or a compound of blocks.
3047 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
3048 # @return New GEOM_Object, containing the found face.
3050 # @ref swig_todo "Example"
3051 def GetFaceByPoints(self,theShape, thePoint1, thePoint2, thePoint3, thePoint4):
3052 # Example: see GEOM_Spanner.py
3053 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
3054 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
3057 ## Get a face of block, found in the given shape by two given edges.
3058 # @param theShape Block or a compound of blocks.
3059 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
3060 # @return New GEOM_Object, containing the found face.
3062 # @ref swig_todo "Example"
3063 def GetFaceByEdges(self,theShape, theEdge1, theEdge2):
3064 # Example: see GEOM_Spanner.py
3065 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
3066 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
3069 ## Find a face, opposite to the given one in the given block.
3070 # @param theBlock Must be a hexahedral solid.
3071 # @param theFace Face of \a theBlock, opposite to the desired face.
3072 # @return New GEOM_Object, containing the found face.
3074 # @ref swig_GetOppositeFace "Example"
3075 def GetOppositeFace(self,theBlock, theFace):
3076 # Example: see GEOM_Spanner.py
3077 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
3078 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
3081 ## Find a face of the given shape, which has minimal distance to the given point.
3082 # @param theShape Block or a compound of blocks.
3083 # @param thePoint Point, close to the desired face.
3084 # @return New GEOM_Object, containing the found face.
3086 # @ref swig_GetFaceNearPoint "Example"
3087 def GetFaceNearPoint(self,theShape, thePoint):
3088 # Example: see GEOM_Spanner.py
3089 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
3090 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
3093 ## Find a face of block, whose outside normale has minimal angle with the given vector.
3094 # @param theBlock Block or a compound of blocks.
3095 # @param theVector Vector, close to the normale of the desired face.
3096 # @return New GEOM_Object, containing the found face.
3098 # @ref swig_todo "Example"
3099 def GetFaceByNormale(self, theBlock, theVector):
3100 # Example: see GEOM_Spanner.py
3101 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
3102 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
3105 # end of l3_blocks_op
3108 ## @addtogroup l4_blocks_measure
3111 ## Check, if the compound of blocks is given.
3112 # To be considered as a compound of blocks, the
3113 # given shape must satisfy the following conditions:
3114 # - Each element of the compound should be a Block (6 faces and 12 edges).
3115 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
3116 # - The compound should be connexe.
3117 # - The glue between two quadrangle faces should be applied.
3118 # @param theCompound The compound to check.
3119 # @return TRUE, if the given shape is a compound of blocks.
3120 # If theCompound is not valid, prints all discovered errors.
3122 # @ref tui_measurement_tools_page "Example 1"
3123 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
3124 def CheckCompoundOfBlocks(self,theCompound):
3125 # Example: see GEOM_Spanner.py
3126 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
3127 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
3129 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
3133 ## Remove all seam and degenerated edges from \a theShape.
3134 # Unite faces and edges, sharing one surface. It means that
3135 # this faces must have references to one C++ surface object (handle).
3136 # @param theShape The compound or single solid to remove irregular edges from.
3137 # @return Improved shape.
3139 # @ref swig_RemoveExtraEdges "Example"
3140 def RemoveExtraEdges(self,theShape):
3141 # Example: see GEOM_TestOthers.py
3142 anObj = self.BlocksOp.RemoveExtraEdges(theShape)
3143 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
3146 ## Check, if the given shape is a blocks compound.
3147 # Fix all detected errors.
3148 # \note Single block can be also fixed by this method.
3149 # @param theShape The compound to check and improve.
3150 # @return Improved compound.
3152 # @ref swig_CheckAndImprove "Example"
3153 def CheckAndImprove(self,theShape):
3154 # Example: see GEOM_TestOthers.py
3155 anObj = self.BlocksOp.CheckAndImprove(theShape)
3156 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
3159 # end of l4_blocks_measure
3162 ## @addtogroup l3_blocks_op
3165 ## Get all the blocks, contained in the given compound.
3166 # @param theCompound The compound to explode.
3167 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
3168 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
3169 # \note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
3170 # @return List of GEOM_Objects, containing the retrieved blocks.
3172 # @ref tui_explode_on_blocks "Example 1"
3173 # \n @ref swig_MakeBlockExplode "Example 2"
3174 def MakeBlockExplode(self,theCompound, theMinNbFaces, theMaxNbFaces):
3175 # Example: see GEOM_TestOthers.py
3176 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
3177 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
3180 ## Find block, containing the given point inside its volume or on boundary.
3181 # @param theCompound Compound, to find block in.
3182 # @param thePoint Point, close to the desired block. If the point lays on
3183 # boundary between some blocks, we return block with nearest center.
3184 # @return New GEOM_Object, containing the found block.
3186 # @ref swig_todo "Example"
3187 def GetBlockNearPoint(self,theCompound, thePoint):
3188 # Example: see GEOM_Spanner.py
3189 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
3190 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
3193 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
3194 # @param theCompound Compound, to find block in.
3195 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
3196 # @return New GEOM_Object, containing the found block.
3198 # @ref swig_GetBlockByParts "Example"
3199 def GetBlockByParts(self,theCompound, theParts):
3200 # Example: see GEOM_TestOthers.py
3201 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
3202 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
3205 ## Return all blocks, containing all the elements, passed as the parts.
3206 # @param theCompound Compound, to find blocks in.
3207 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
3208 # @return List of GEOM_Objects, containing the found blocks.
3210 # @ref swig_todo "Example"
3211 def GetBlocksByParts(self,theCompound, theParts):
3212 # Example: see GEOM_Spanner.py
3213 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
3214 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
3217 ## Multi-transformate block and glue the result.
3218 # Transformation is defined so, as to superpose direction faces.
3219 # @param Block Hexahedral solid to be multi-transformed.
3220 # @param DirFace1 ID of First direction face.
3221 # @param DirFace2 ID of Second direction face.
3222 # @param NbTimes Quantity of transformations to be done.
3223 # \note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
3224 # @return New GEOM_Object, containing the result shape.
3226 # @ref tui_multi_transformation "Example"
3227 def MakeMultiTransformation1D(self,Block, DirFace1, DirFace2, NbTimes):
3228 # Example: see GEOM_Spanner.py
3229 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
3230 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
3233 ## Multi-transformate block and glue the result.
3234 # @param Block Hexahedral solid to be multi-transformed.
3235 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
3236 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
3237 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
3238 # @return New GEOM_Object, containing the result shape.
3240 # @ref tui_multi_transformation "Example"
3241 def MakeMultiTransformation2D(self,Block, DirFace1U, DirFace2U, NbTimesU,
3242 DirFace1V, DirFace2V, NbTimesV):
3243 # Example: see GEOM_Spanner.py
3244 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
3245 DirFace1V, DirFace2V, NbTimesV)
3246 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
3249 ## Build all possible propagation groups.
3250 # Propagation group is a set of all edges, opposite to one (main)
3251 # edge of this group directly or through other opposite edges.
3252 # Notion of Opposite Edge make sence only on quadrangle face.
3253 # @param theShape Shape to build propagation groups on.
3254 # @return List of GEOM_Objects, each of them is a propagation group.
3256 # @ref swig_Propagate "Example"
3257 def Propagate(self,theShape):
3258 # Example: see GEOM_TestOthers.py
3259 listChains = self.BlocksOp.Propagate(theShape)
3260 RaiseIfFailed("Propagate", self.BlocksOp)
3263 # end of l3_blocks_op
3266 ## @addtogroup l3_groups
3269 ## Creates a new group which will store sub shapes of theMainShape
3270 # @param theMainShape is a GEOM object on which the group is selected
3271 # @param theShapeType defines a shape type of the group
3272 # @return a newly created GEOM group
3274 # @ref tui_working_with_groups_page "Example 1"
3275 # \n @ref swig_CreateGroup "Example 2"
3276 def CreateGroup(self,theMainShape, theShapeType):
3277 # Example: see GEOM_TestOthers.py
3278 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
3279 RaiseIfFailed("CreateGroup", self.GroupOp)
3282 ## Adds a sub object with ID theSubShapeId to the group
3283 # @param theGroup is a GEOM group to which the new sub shape is added
3284 # @param theSubShapeID is a sub shape ID in the main object.
3285 # \note Use method GetSubShapeID() to get an unique ID of the sub shape
3287 # @ref tui_working_with_groups_page "Example"
3288 def AddObject(self,theGroup, theSubShapeID):
3289 # Example: see GEOM_TestOthers.py
3290 self.GroupOp.AddObject(theGroup, theSubShapeID)
3291 RaiseIfFailed("AddObject", self.GroupOp)
3294 ## Removes a sub object with ID \a theSubShapeId from the group
3295 # @param theGroup is a GEOM group from which the new sub shape is removed
3296 # @param theSubShapeID is a sub shape ID in the main object.
3297 # \note Use method GetSubShapeID() to get an unique ID of the sub shape
3299 # @ref tui_working_with_groups_page "Example"
3300 def RemoveObject(self,theGroup, theSubShapeID):
3301 # Example: see GEOM_TestOthers.py
3302 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
3303 RaiseIfFailed("RemoveObject", self.GroupOp)
3306 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
3307 # @param theGroup is a GEOM group to which the new sub shapes are added.
3308 # @param theSubShapes is a list of sub shapes to be added.
3310 # @ref tui_working_with_groups_page "Example"
3311 def UnionList (self,theGroup, theSubShapes):
3312 # Example: see GEOM_TestOthers.py
3313 self.GroupOp.UnionList(theGroup, theSubShapes)
3314 RaiseIfFailed("UnionList", self.GroupOp)
3317 ## Works like the above method, but argument
3318 # theSubShapes here is a list of sub-shapes indices
3320 # @ref swig_UnionIDs "Example"
3321 def UnionIDs(self,theGroup, theSubShapes):
3322 # Example: see GEOM_TestOthers.py
3323 self.GroupOp.UnionIDs(theGroup, theSubShapes)
3324 RaiseIfFailed("UnionIDs", self.GroupOp)
3327 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
3328 # @param theGroup is a GEOM group from which the sub-shapes are removed.
3329 # @param theSubShapes is a list of sub-shapes to be removed.
3331 # @ref tui_working_with_groups_page "Example"
3332 def DifferenceList (self,theGroup, theSubShapes):
3333 # Example: see GEOM_TestOthers.py
3334 self.GroupOp.DifferenceList(theGroup, theSubShapes)
3335 RaiseIfFailed("DifferenceList", self.GroupOp)
3338 ## Works like the above method, but argument
3339 # theSubShapes here is a list of sub-shapes indices
3341 # @ref swig_DifferenceIDs "Example"
3342 def DifferenceIDs(self,theGroup, theSubShapes):
3343 # Example: see GEOM_TestOthers.py
3344 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
3345 RaiseIfFailed("DifferenceIDs", self.GroupOp)
3348 ## Returns a list of sub objects ID stored in the group
3349 # @param theGroup is a GEOM group for which a list of IDs is requested
3351 # @ref swig_GetObjectIDs "Example"
3352 def GetObjectIDs(self,theGroup):
3353 # Example: see GEOM_TestOthers.py
3354 ListIDs = self.GroupOp.GetObjects(theGroup)
3355 RaiseIfFailed("GetObjects", self.GroupOp)
3358 ## Returns a type of sub objects stored in the group
3359 # @param theGroup is a GEOM group which type is returned.
3361 # @ref swig_GetType "Example"
3362 def GetType(self,theGroup):
3363 # Example: see GEOM_TestOthers.py
3364 aType = self.GroupOp.GetType(theGroup)
3365 RaiseIfFailed("GetType", self.GroupOp)
3368 ## Returns a main shape associated with the group
3369 # @param theGroup is a GEOM group for which a main shape object is requested
3370 # @return a GEOM object which is a main shape for theGroup
3372 # @ref swig_GetMainShape "Example"
3373 def GetMainShape(self,theGroup):
3374 # Example: see GEOM_TestOthers.py
3375 anObj = self.GroupOp.GetMainShape(theGroup)
3376 RaiseIfFailed("GetMainShape", self.GroupOp)
3379 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
3380 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
3382 # @ref swig_todo "Example"
3383 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1):
3384 edges = self.SubShapeAll(theShape, ShapeType["EDGE"])
3387 Props = self.BasicProperties(edge)
3388 if min_length <= Props[0] and Props[0] <= max_length:
3389 if (not include_min) and (min_length == Props[0]):
3392 if (not include_max) and (Props[0] == max_length):
3395 edges_in_range.append(edge)
3397 if len(edges_in_range) <= 0:
3398 print "No edges found by given criteria"
3401 group_edges = self.CreateGroup(theShape, ShapeType["EDGE"])
3402 self.UnionList(group_edges, edges_in_range)
3406 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
3407 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
3409 # @ref swig_todo "Example"
3410 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
3411 nb_selected = sg.SelectedCount()
3413 print "Select a shape before calling this function, please."
3416 print "Only one shape must be selected"
3419 id_shape = sg.getSelected(0)
3420 shape = IDToObject( id_shape )
3422 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
3426 if include_min: left_str = " <= "
3427 if include_max: right_str = " <= "
3429 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
3430 + left_str + "length" + right_str + `max_length`)
3432 sg.updateObjBrowser(1)
3439 ## Create a copy of the given object
3440 # @ingroup l1_geompy_auxiliary
3442 # @ref swig_all_advanced "Example"
3443 def MakeCopy(self,theOriginal):
3444 # Example: see GEOM_TestAll.py
3445 anObj = self.InsertOp.MakeCopy(theOriginal)
3446 RaiseIfFailed("MakeCopy", self.InsertOp)
3449 ## Add Path to load python scripts from
3450 # @ingroup l1_geompy_auxiliary
3451 def addPath(self,Path):
3452 if (sys.path.count(Path) < 1):
3453 sys.path.append(Path)
3456 #Register the new proxy for GEOM_Gen
3457 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geompyDC)