1 # Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 # Copyright (C) 2003-2007 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
22 # GEOM GEOM_SWIG : binding of C++ omplementaion with Python
24 # Author : Paul RASCLE, EDF
32 ## @defgroup l1_geompy_auxiliary Auxiliary data structures and methods
34 ## @defgroup l1_geompy_purpose All package methods, grouped by their purpose
36 ## @defgroup l2_import_export Importing/exporting geometrical objects
37 ## @defgroup l2_creating Creating geometrical objects
39 ## @defgroup l3_basic_go Creating Basic Geometric Objects
41 ## @defgroup l4_curves Creating Curves
44 ## @defgroup l3_3d_primitives Creating 3D Primitives
45 ## @defgroup l3_complex Creating Complex Objects
46 ## @defgroup l3_groups Working with groups
47 ## @defgroup l3_blocks Building by blocks
49 ## @defgroup l4_blocks_measure Check and Improve
52 ## @defgroup l3_sketcher Sketcher
53 ## @defgroup l3_advanced Creating Advanced Geometrical Objects
55 ## @defgroup l4_decompose Decompose objects
56 ## @defgroup l4_access Access to sub-shapes by their unique IDs inside the main shape
57 ## @defgroup l4_obtain Access to subshapes by a criteria
62 ## @defgroup l2_transforming Transforming geometrical objects
64 ## @defgroup l3_basic_op Basic Operations
65 ## @defgroup l3_boolean Boolean Operations
66 ## @defgroup l3_transform Transformation Operations
67 ## @defgroup l3_local Local Operations (Fillet and Chamfer)
68 ## @defgroup l3_blocks_op Blocks Operations
69 ## @defgroup l3_healing Repairing Operations
70 ## @defgroup l3_restore_ss Restore presentation parameters and a tree of subshapes
73 ## @defgroup l2_measure Using measurement tools
81 from salome_notebook import *
86 ## Enumeration ShapeType as a dictionary
87 # @ingroup l1_geompy_auxiliary
88 ShapeType = {"COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8}
90 ## Raise an Error, containing the Method_name, if Operation is Failed
91 ## @ingroup l1_geompy_auxiliary
92 def RaiseIfFailed (Method_name, Operation):
93 if Operation.IsDone() == 0 and Operation.GetErrorCode() != "NOT_FOUND_ANY":
94 raise RuntimeError, Method_name + " : " + Operation.GetErrorCode()
96 ## Return list of variables value from salome notebook
97 ## @ingroup l1_geompy_auxiliary
98 def ParseParameters(*parameters):
101 for parameter in parameters:
102 if isinstance(parameter,str):
103 if notebook.isVariable(parameter):
104 Result.append(notebook.get(parameter))
106 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
108 Result.append(parameter)
111 StringResult = StringResult + str(parameter)
112 StringResult = StringResult + ":"
114 StringResult = StringResult[:len(StringResult)-1]
115 Result.append(StringResult)
118 ## Return list of variables value from salome notebook
119 ## @ingroup l1_geompy_auxiliary
123 for parameter in list:
124 if isinstance(parameter,str) and notebook.isVariable(parameter):
125 Result.append(str(notebook.get(parameter)))
128 Result.append(str(parameter))
131 StringResult = StringResult + str(parameter)
132 StringResult = StringResult + ":"
134 StringResult = StringResult[:len(StringResult)-1]
135 return Result, StringResult
137 ## Return list of variables value from salome notebook
138 ## @ingroup l1_geompy_auxiliary
139 def ParseSketcherCommand(command):
142 sections = command.split(":")
143 for section in sections:
144 parameters = section.split(" ")
146 for parameter in parameters:
147 if paramIndex > 1 and parameter.find("'") != -1:
148 parameter = parameter.replace("'","")
149 if notebook.isVariable(parameter):
150 Result = Result + str(notebook.get(parameter)) + " "
153 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
157 Result = Result + str(parameter) + " "
160 StringResult = StringResult + parameter
161 StringResult = StringResult + ":"
163 paramIndex = paramIndex + 1
165 Result = Result[:len(Result)-1] + ":"
167 Result = Result[:len(Result)-1]
168 return Result, StringResult
170 ## Kinds of shape enumeration
171 # @ingroup l1_geompy_auxiliary
172 kind = GEOM.GEOM_IKindOfShape
174 ## Information about closed/unclosed state of shell or wire
175 # @ingroup l1_geompy_auxiliary
182 class geompyDC(GEOM._objref_GEOM_Gen):
185 GEOM._objref_GEOM_Gen.__init__(self)
186 self.myBuilder = None
204 ## @addtogroup l1_geompy_auxiliary
206 def init_geom(self,theStudy):
207 self.myStudy = theStudy
208 self.myStudyId = self.myStudy._get_StudyId()
209 self.myBuilder = self.myStudy.NewBuilder()
210 self.father = self.myStudy.FindComponent("GEOM")
211 if self.father is None:
212 self.father = self.myBuilder.NewComponent("GEOM")
213 A1 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributeName")
214 FName = A1._narrow(SALOMEDS.AttributeName)
215 FName.SetValue("Geometry")
216 A2 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributePixMap")
217 aPixmap = A2._narrow(SALOMEDS.AttributePixMap)
218 aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry")
219 self.myBuilder.DefineComponentInstance(self.father,self)
221 self.BasicOp = self.GetIBasicOperations (self.myStudyId)
222 self.CurvesOp = self.GetICurvesOperations (self.myStudyId)
223 self.PrimOp = self.GetI3DPrimOperations (self.myStudyId)
224 self.ShapesOp = self.GetIShapesOperations (self.myStudyId)
225 self.HealOp = self.GetIHealingOperations (self.myStudyId)
226 self.InsertOp = self.GetIInsertOperations (self.myStudyId)
227 self.BoolOp = self.GetIBooleanOperations (self.myStudyId)
228 self.TrsfOp = self.GetITransformOperations(self.myStudyId)
229 self.LocalOp = self.GetILocalOperations (self.myStudyId)
230 self.MeasuOp = self.GetIMeasureOperations (self.myStudyId)
231 self.BlocksOp = self.GetIBlocksOperations (self.myStudyId)
232 self.GroupOp = self.GetIGroupOperations (self.myStudyId)
235 ## Get name for sub-shape aSubObj of shape aMainObj
237 # @ref swig_SubShapeAllSorted "Example"
238 def SubShapeName(self,aSubObj, aMainObj):
239 # Example: see GEOM_TestAll.py
241 #aSubId = orb.object_to_string(aSubObj)
242 #aMainId = orb.object_to_string(aMainObj)
243 #index = gg.getIndexTopology(aSubId, aMainId)
244 #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
245 index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
246 name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
249 ## Publish in study aShape with name aName
251 # \param aShape the shape to be published
252 # \param aName the name for the shape
253 # \param doRestoreSubShapes if True, finds and publishes also
254 # sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
255 # and published sub-shapes of arguments
256 # \param theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes for
257 # these arguments description
258 # \return study entry of the published shape in form of string
260 # @ref swig_MakeQuad4Vertices "Example"
261 def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
262 theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
263 # Example: see GEOM_TestAll.py
265 aSObject = self.AddInStudy(self.myStudy, aShape, aName, None)
266 if doRestoreSubShapes:
267 self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs,
268 theFindMethod, theInheritFirstArg)
270 print "addToStudy() failed"
272 return aShape.GetStudyEntry()
274 ## Publish in study aShape with name aName as sub-object of previously published aFather
276 # @ref swig_SubShapeAllSorted "Example"
277 def addToStudyInFather(self, aFather, aShape, aName):
278 # Example: see GEOM_TestAll.py
280 aSObject = self.AddInStudy(self.myStudy, aShape, aName, aFather)
282 print "addToStudyInFather() failed"
284 return aShape.GetStudyEntry()
286 # end of l1_geompy_auxiliary
289 ## @addtogroup l3_restore_ss
292 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
293 # To be used from python scripts out of geompy.addToStudy (non-default usage)
294 # \param theObject published GEOM object, arguments of which will be published
295 # \param theArgs list of GEOM_Object, operation arguments to be published.
296 # If this list is empty, all operation arguments will be published
297 # \param theFindMethod method to search subshapes, corresponding to arguments and
298 # their subshapes. Value from enumeration GEOM::find_shape_method.
299 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
300 # Do not publish subshapes in place of arguments, but only
301 # in place of subshapes of the first argument,
302 # because the whole shape corresponds to the first argument.
303 # Mainly to be used after transformations, but it also can be
304 # usefull after partition with one object shape, and some other
305 # operations, where only the first argument has to be considered.
306 # If theObject has only one argument shape, this flag is automatically
307 # considered as True, not regarding really passed value.
308 # \return True in case of success, False otherwise.
310 # @ref tui_restore_prs_params "Example"
311 def RestoreSubShapes (self, theObject, theArgs=[],
312 theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
313 # Example: see GEOM_TestAll.py
314 return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
315 theFindMethod, theInheritFirstArg)
317 # end of l3_restore_ss
320 ## @addtogroup l3_basic_go
323 ## Create point by three coordinates.
324 # @param theX The X coordinate of the point.
325 # @param theY The Y coordinate of the point.
326 # @param theZ The Z coordinate of the point.
327 # @return New GEOM_Object, containing the created point.
329 # @ref tui_creation_point "Example"
330 def MakeVertex(self,theX, theY, theZ):
331 # Example: see GEOM_TestAll.py
332 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
333 anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
334 RaiseIfFailed("MakePointXYZ", self.BasicOp)
335 anObj.SetParameters(Parameters)
338 ## Create a point, distant from the referenced point
339 # on the given distances along the coordinate axes.
340 # @param theReference The referenced point.
341 # @param theX Displacement from the referenced point along OX axis.
342 # @param theY Displacement from the referenced point along OY axis.
343 # @param theZ Displacement from the referenced point along OZ axis.
344 # @return New GEOM_Object, containing the created point.
346 # @ref tui_creation_point "Example"
347 def MakeVertexWithRef(self,theReference, theX, theY, theZ):
348 # Example: see GEOM_TestAll.py
349 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
350 anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
351 RaiseIfFailed("MakePointWithReference", self.BasicOp)
352 anObj.SetParameters(Parameters)
355 ## Create a point, corresponding to the given parameter on the given curve.
356 # @param theRefCurve The referenced curve.
357 # @param theParameter Value of parameter on the referenced curve.
358 # @return New GEOM_Object, containing the created point.
360 # @ref tui_creation_point "Example"
361 def MakeVertexOnCurve(self,theRefCurve, theParameter):
362 # Example: see GEOM_TestAll.py
363 theParameter, Parameters = ParseParameters(theParameter)
364 anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter)
365 RaiseIfFailed("MakePointOnCurve", self.BasicOp)
366 anObj.SetParameters(Parameters)
369 ## Create a point, corresponding to the given parameters on the
371 # @param theRefSurf The referenced surface.
372 # @param theUParameter Value of U-parameter on the referenced surface.
373 # @param theVParameter Value of V-parameter on the referenced surface.
374 # @return New GEOM_Object, containing the created point.
376 # @ref swig_MakeVertexOnSurface "Example"
377 def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter):
378 theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
379 # Example: see GEOM_TestAll.py
380 anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
381 RaiseIfFailed("MakePointOnSurface", self.BasicOp)
382 anObj.SetParameters(Parameters);
385 ## Create a point on intersection of two lines.
386 # @param theRefLine1, theRefLine2 The referenced lines.
387 # @return New GEOM_Object, containing the created point.
389 # @ref swig_MakeVertexOnLinesIntersection "Example"
390 def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2):
391 # Example: see GEOM_TestAll.py
392 anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
393 RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
396 ## Create a tangent, corresponding to the given parameter on the given curve.
397 # @param theRefCurve The referenced curve.
398 # @param theParameter Value of parameter on the referenced curve.
399 # @return New GEOM_Object, containing the created tangent.
401 # @ref swig_MakeTangentOnCurve "Example"
402 def MakeTangentOnCurve(self, theRefCurve, theParameter):
403 anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
404 RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
407 ## Create a tangent plane to specified face in the point with specified parameters.
408 # @param theFace - face for which tangent plane shuold be built.
409 # @param theParameterU - value of parameter by U
410 # @param theParameterV - value of parameter Vthe
411 # @param theTrimSize - defines sizes of created face
412 # Values of parameters should be between 0. and 1.0
413 # return New GEOM_Object, containing the face built on tangent plane.
414 def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize):
415 anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
416 RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
419 ## Create a vector with the given components.
420 # @param theDX X component of the vector.
421 # @param theDY Y component of the vector.
422 # @param theDZ Z component of the vector.
423 # @return New GEOM_Object, containing the created vector.
425 # @ref tui_creation_vector "Example"
426 def MakeVectorDXDYDZ(self,theDX, theDY, theDZ):
427 # Example: see GEOM_TestAll.py
428 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
429 anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
430 RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
431 anObj.SetParameters(Parameters)
434 ## Create a vector between two points.
435 # @param thePnt1 Start point for the vector.
436 # @param thePnt2 End point for the vector.
437 # @return New GEOM_Object, containing the created vector.
439 # @ref tui_creation_vector "Example"
440 def MakeVector(self,thePnt1, thePnt2):
441 # Example: see GEOM_TestAll.py
442 anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
443 RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
446 ## Create a line, passing through the given point
447 # and parrallel to the given direction
448 # @param thePnt Point. The resulting line will pass through it.
449 # @param theDir Direction. The resulting line will be parallel to it.
450 # @return New GEOM_Object, containing the created line.
452 # @ref tui_creation_line "Example"
453 def MakeLine(self,thePnt, theDir):
454 # Example: see GEOM_TestAll.py
455 anObj = self.BasicOp.MakeLine(thePnt, theDir)
456 RaiseIfFailed("MakeLine", self.BasicOp)
459 ## Create a line, passing through the given points
460 # @param thePnt1 First of two points, defining the line.
461 # @param thePnt2 Second of two points, defining the line.
462 # @return New GEOM_Object, containing the created line.
464 # @ref tui_creation_line "Example"
465 def MakeLineTwoPnt(self,thePnt1, thePnt2):
466 # Example: see GEOM_TestAll.py
467 anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
468 RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
471 ## Create a line on two faces intersection.
472 # @param theFace1 First of two faces, defining the line.
473 # @param theFace2 Second of two faces, defining the line.
474 # @return New GEOM_Object, containing the created line.
476 # @ref swig_MakeLineTwoFaces "Example"
477 def MakeLineTwoFaces(self, theFace1, theFace2):
478 # Example: see GEOM_TestAll.py
479 anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
480 RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
483 ## Create a plane, passing through the given point
484 # and normal to the given vector.
485 # @param thePnt Point, the plane has to pass through.
486 # @param theVec Vector, defining the plane normal direction.
487 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
488 # @return New GEOM_Object, containing the created plane.
490 # @ref tui_creation_plane "Example"
491 def MakePlane(self,thePnt, theVec, theTrimSize):
492 # Example: see GEOM_TestAll.py
493 theTrimSize, Parameters = ParseParameters(theTrimSize);
494 anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
495 RaiseIfFailed("MakePlanePntVec", self.BasicOp)
496 anObj.SetParameters(Parameters)
499 ## Create a plane, passing through the three given points
500 # @param thePnt1 First of three points, defining the plane.
501 # @param thePnt2 Second of three points, defining the plane.
502 # @param thePnt3 Fird of three points, defining the plane.
503 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
504 # @return New GEOM_Object, containing the created plane.
506 # @ref tui_creation_plane "Example"
507 def MakePlaneThreePnt(self,thePnt1, thePnt2, thePnt3, theTrimSize):
508 # Example: see GEOM_TestAll.py
509 theTrimSize, Parameters = ParseParameters(theTrimSize);
510 anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
511 RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
512 anObj.SetParameters(Parameters)
515 ## Create a plane, similar to the existing one, but with another size of representing face.
516 # @param theFace Referenced plane or LCS(Marker).
517 # @param theTrimSize New half size of a side of quadrangle face, representing the plane.
518 # @return New GEOM_Object, containing the created plane.
520 # @ref tui_creation_plane "Example"
521 def MakePlaneFace(self,theFace, theTrimSize):
522 # Example: see GEOM_TestAll.py
523 theTrimSize, Parameters = ParseParameters(theTrimSize);
524 anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
525 RaiseIfFailed("MakePlaneFace", self.BasicOp)
526 anObj.SetParameters(Parameters)
529 ## Create a plane, passing through the 2 vectors
530 # with center in a start point of the first vector.
531 # @param theVec1 Vector, defining center point and plane direction.
532 # @param theVec2 Vector, defining the plane normal direction.
533 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
534 # @return New GEOM_Object, containing the created plane.
536 # @ref tui_creation_plane "Example"
537 def MakePlane2Vec(self,theVec1, theVec2, theTrimSize):
538 # Example: see GEOM_TestAll.py
539 theTrimSize, Parameters = ParseParameters(theTrimSize);
540 anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
541 RaiseIfFailed("MakePlane2Vec", self.BasicOp)
542 anObj.SetParameters(Parameters)
545 ## Create a plane, based on a Local coordinate system.
546 # @param theLCS coordinate system, defining plane.
547 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
548 # @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
549 # @return New GEOM_Object, containing the created plane.
551 # @ref tui_creation_plane "Example"
552 def MakePlaneLCS(self,theLCS, theTrimSize, theOrientation):
553 # Example: see GEOM_TestAll.py
554 theTrimSize, Parameters = ParseParameters(theTrimSize);
555 anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
556 RaiseIfFailed("MakePlaneLCS", self.BasicOp)
557 anObj.SetParameters(Parameters)
560 ## Create a local coordinate system.
561 # @param OX,OY,OZ Three coordinates of coordinate system origin.
562 # @param XDX,XDY,XDZ Three components of OX direction
563 # @param YDX,YDY,YDZ Three components of OY direction
564 # @return New GEOM_Object, containing the created coordinate system.
566 # @ref swig_MakeMarker "Example"
567 def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ):
568 # Example: see GEOM_TestAll.py
569 OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
570 anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
571 RaiseIfFailed("MakeMarker", self.BasicOp)
572 anObj.SetParameters(Parameters)
575 ## Create a local coordinate system.
576 # @param theOrigin Point of coordinate system origin.
577 # @param theXVec Vector of X direction
578 # @param theYVec Vector of Y direction
579 # @return New GEOM_Object, containing the created coordinate system.
581 # @ref swig_MakeMarker "Example"
582 def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec):
583 O = self.PointCoordinates( theOrigin )
585 for vec in [ theXVec, theYVec ]:
586 v1, v2 = self.SubShapeAll( vec, ShapeType["VERTEX"] )
587 p1 = self.PointCoordinates( v1 )
588 p2 = self.PointCoordinates( v2 )
589 for i in range( 0, 3 ):
590 OXOY.append( p2[i] - p1[i] )
592 anObj = self.BasicOp.MakeMarker( O[0], O[1], O[2],
593 OXOY[0], OXOY[1], OXOY[2],
594 OXOY[3], OXOY[4], OXOY[5], )
595 RaiseIfFailed("MakeMarker", self.BasicOp)
601 ## @addtogroup l4_curves
604 ## Create an arc of circle, passing through three given points.
605 # @param thePnt1 Start point of the arc.
606 # @param thePnt2 Middle point of the arc.
607 # @param thePnt3 End point of the arc.
608 # @return New GEOM_Object, containing the created arc.
610 # @ref swig_MakeArc "Example"
611 def MakeArc(self,thePnt1, thePnt2, thePnt3):
612 # Example: see GEOM_TestAll.py
613 anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
614 RaiseIfFailed("MakeArc", self.CurvesOp)
617 ## Create an arc of circle from a center and 2 points.
618 # @param thePnt1 Center of the arc
619 # @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
620 # @param thePnt3 End point of the arc (Gives also a direction)
621 # @param theSense Orientation of the arc
622 # @return New GEOM_Object, containing the created arc.
624 # @ref swig_MakeArc "Example"
625 def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False):
626 # Example: see GEOM_TestAll.py
627 anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
628 RaiseIfFailed("MakeArcCenter", self.CurvesOp)
631 ## Create an arc of ellipse, of center and two points.
632 # @param theCenter Center of the arc.
633 # @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
634 # @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
635 # @return New GEOM_Object, containing the created arc.
637 # @ref swig_MakeArc "Example"
638 def MakeArcOfEllipse(self,theCenter, thePnt1, thePnt2):
639 # Example: see GEOM_TestAll.py
640 anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
641 RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
644 ## Create a circle with given center, normal vector and radius.
645 # @param thePnt Circle center.
646 # @param theVec Vector, normal to the plane of the circle.
647 # @param theR Circle radius.
648 # @return New GEOM_Object, containing the created circle.
650 # @ref tui_creation_circle "Example"
651 def MakeCircle(self, thePnt, theVec, theR):
652 # Example: see GEOM_TestAll.py
653 theR, Parameters = ParseParameters(theR)
654 anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
655 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
656 anObj.SetParameters(Parameters)
659 ## Create a circle with given radius.
660 # Center of the circle will be in the origin of global
661 # coordinate system and normal vector will be codirected with Z axis
662 # @param theR Circle radius.
663 # @return New GEOM_Object, containing the created circle.
664 def MakeCircleR(self, theR):
665 anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
666 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
669 ## Create a circle, passing through three given points
670 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
671 # @return New GEOM_Object, containing the created circle.
673 # @ref tui_creation_circle "Example"
674 def MakeCircleThreePnt(self,thePnt1, thePnt2, thePnt3):
675 # Example: see GEOM_TestAll.py
676 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
677 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
680 ## Create a circle, with given point1 as center,
681 # passing through the point2 as radius and laying in the plane,
682 # defined by all three given points.
683 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
684 # @return New GEOM_Object, containing the created circle.
686 # @ref swig_MakeCircle "Example"
687 def MakeCircleCenter2Pnt(self,thePnt1, thePnt2, thePnt3):
688 # Example: see GEOM_example6.py
689 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
690 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
693 ## Create an ellipse with given center, normal vector and radiuses.
694 # @param thePnt Ellipse center.
695 # @param theVec Vector, normal to the plane of the ellipse.
696 # @param theRMajor Major ellipse radius.
697 # @param theRMinor Minor ellipse radius.
698 # @param theVecMaj Vector, direction of the ellipse's main axis.
699 # @return New GEOM_Object, containing the created ellipse.
701 # @ref tui_creation_ellipse "Example"
702 def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None):
703 # Example: see GEOM_TestAll.py
704 theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
705 if theVecMaj is not None:
706 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
708 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
710 RaiseIfFailed("MakeEllipse", self.CurvesOp)
711 anObj.SetParameters(Parameters)
714 ## Create an ellipse with given radiuses.
715 # Center of the ellipse will be in the origin of global
716 # coordinate system and normal vector will be codirected with Z axis
717 # @param theRMajor Major ellipse radius.
718 # @param theRMinor Minor ellipse radius.
719 # @return New GEOM_Object, containing the created ellipse.
720 def MakeEllipseRR(self, theRMajor, theRMinor):
721 anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
722 RaiseIfFailed("MakeEllipse", self.CurvesOp)
725 ## Create a polyline on the set of points.
726 # @param thePoints Sequence of points for the polyline.
727 # @return New GEOM_Object, containing the created polyline.
729 # @ref tui_creation_curve "Example"
730 def MakePolyline(self,thePoints):
731 # Example: see GEOM_TestAll.py
732 anObj = self.CurvesOp.MakePolyline(thePoints)
733 RaiseIfFailed("MakePolyline", self.CurvesOp)
736 ## Create bezier curve on the set of points.
737 # @param thePoints Sequence of points for the bezier curve.
738 # @return New GEOM_Object, containing the created bezier curve.
740 # @ref tui_creation_curve "Example"
741 def MakeBezier(self,thePoints):
742 # Example: see GEOM_TestAll.py
743 anObj = self.CurvesOp.MakeSplineBezier(thePoints)
744 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
747 ## Create B-Spline curve on the set of points.
748 # @param thePoints Sequence of points for the B-Spline curve.
749 # @return New GEOM_Object, containing the created B-Spline curve.
751 # @ref tui_creation_curve "Example"
752 def MakeInterpol(self,thePoints):
753 # Example: see GEOM_TestAll.py
754 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints)
755 RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
761 ## @addtogroup l3_sketcher
764 ## Create a sketcher (wire or face), following the textual description,
765 # passed through <VAR>theCommand</VAR> argument. \n
766 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
767 # Format of the description string have to be the following:
769 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
772 # - x1, y1 are coordinates of the first sketcher point (zero by default),
774 # - "R angle" : Set the direction by angle
775 # - "D dx dy" : Set the direction by DX & DY
778 # - "TT x y" : Create segment by point at X & Y
779 # - "T dx dy" : Create segment by point with DX & DY
780 # - "L length" : Create segment by direction & Length
781 # - "IX x" : Create segment by direction & Intersect. X
782 # - "IY y" : Create segment by direction & Intersect. Y
785 # - "C radius length" : Create arc by direction, radius and length(in degree)
788 # - "WW" : Close Wire (to finish)
789 # - "WF" : Close Wire and build face (to finish)
791 # @param theCommand String, defining the sketcher in local
792 # coordinates of the working plane.
793 # @param theWorkingPlane Nine double values, defining origin,
794 # OZ and OX directions of the working plane.
795 # @return New GEOM_Object, containing the created wire.
797 # @ref tui_sketcher_page "Example"
798 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0]):
799 # Example: see GEOM_TestAll.py
800 theCommand,Parameters = ParseSketcherCommand(theCommand)
801 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
802 RaiseIfFailed("MakeSketcher", self.CurvesOp)
803 anObj.SetParameters(Parameters)
806 ## Create a sketcher (wire or face), following the textual description,
807 # passed through <VAR>theCommand</VAR> argument. \n
808 # For format of the description string see the previous method.\n
809 # @param theCommand String, defining the sketcher in local
810 # coordinates of the working plane.
811 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
812 # @return New GEOM_Object, containing the created wire.
814 # @ref tui_sketcher_page "Example"
815 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane):
816 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
817 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
820 ## Create a sketcher wire, following the numerical description,
821 # passed through <VAR>theCoordinates</VAR> argument. \n
822 # @param theCoordinates double values, defining points to create a wire,
824 # @return New GEOM_Object, containing the created wire.
826 # @ref tui_sketcher_page "Example"
827 def Make3DSketcher(self, theCoordinates):
828 anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
829 RaiseIfFailed("Make3DSketcher", self.CurvesOp)
835 ## @addtogroup l3_3d_primitives
838 ## Create a box by coordinates of two opposite vertices.
840 # @ref tui_creation_box "Example"
841 def MakeBox(self,x1,y1,z1,x2,y2,z2):
842 # Example: see GEOM_TestAll.py
843 pnt1 = self.MakeVertex(x1,y1,z1)
844 pnt2 = self.MakeVertex(x2,y2,z2)
845 return self.MakeBoxTwoPnt(pnt1,pnt2)
847 ## Create a box with specified dimensions along the coordinate axes
848 # and with edges, parallel to the coordinate axes.
849 # Center of the box will be at point (DX/2, DY/2, DZ/2).
850 # @param theDX Length of Box edges, parallel to OX axis.
851 # @param theDY Length of Box edges, parallel to OY axis.
852 # @param theDZ Length of Box edges, parallel to OZ axis.
853 # @return New GEOM_Object, containing the created box.
855 # @ref tui_creation_box "Example"
856 def MakeBoxDXDYDZ(self,theDX, theDY, theDZ):
857 # Example: see GEOM_TestAll.py
858 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
859 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
860 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
861 anObj.SetParameters(Parameters)
864 ## Create a box with two specified opposite vertices,
865 # and with edges, parallel to the coordinate axes
866 # @param thePnt1 First of two opposite vertices.
867 # @param thePnt2 Second of two opposite vertices.
868 # @return New GEOM_Object, containing the created box.
870 # @ref tui_creation_box "Example"
871 def MakeBoxTwoPnt(self,thePnt1, thePnt2):
872 # Example: see GEOM_TestAll.py
873 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
874 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
877 ## Create a face with specified dimensions along OX-OY coordinate axes,
878 # with edges, parallel to this coordinate axes.
879 # @param theH height of Face.
880 # @param theW width of Face.
881 # @param theOrientation orientation belong axis OXY OYZ OZX
882 # @return New GEOM_Object, containing the created face.
884 # @ref tui_creation_face "Example"
885 def MakeFaceHW(self,theH, theW, theOrientation):
886 # Example: see GEOM_TestAll.py
887 theH,theW,Parameters = ParseParameters(theH, theW)
888 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
889 RaiseIfFailed("MakeFaceHW", self.PrimOp)
890 anObj.SetParameters(Parameters)
893 ## Create a face from another plane and two sizes,
894 # vertical size and horisontal size.
895 # @param theObj Normale vector to the creating face or
897 # @param theH Height (vertical size).
898 # @param theW Width (horisontal size).
899 # @return New GEOM_Object, containing the created face.
901 # @ref tui_creation_face "Example"
902 def MakeFaceObjHW(self, theObj, theH, theW):
903 # Example: see GEOM_TestAll.py
904 theH,theW,Parameters = ParseParameters(theH, theW)
905 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
906 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
907 anObj.SetParameters(Parameters)
910 ## Create a disk with given center, normal vector and radius.
911 # @param thePnt Disk center.
912 # @param theVec Vector, normal to the plane of the disk.
913 # @param theR Disk radius.
914 # @return New GEOM_Object, containing the created disk.
916 # @ref tui_creation_disk "Example"
917 def MakeDiskPntVecR(self,thePnt, theVec, theR):
918 # Example: see GEOM_TestAll.py
919 theR,Parameters = ParseParameters(theR)
920 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
921 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
922 anObj.SetParameters(Parameters)
925 ## Create a disk, passing through three given points
926 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
927 # @return New GEOM_Object, containing the created disk.
929 # @ref tui_creation_disk "Example"
930 def MakeDiskThreePnt(self,thePnt1, thePnt2, thePnt3):
931 # Example: see GEOM_TestAll.py
932 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
933 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
936 ## Create a disk with specified dimensions along OX-OY coordinate axes.
937 # @param theR Radius of Face.
938 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
939 # @return New GEOM_Object, containing the created disk.
941 # @ref tui_creation_face "Example"
942 def MakeDiskR(self,theR, theOrientation):
943 # Example: see GEOM_TestAll.py
944 theR,Parameters = ParseParameters(theR)
945 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
946 RaiseIfFailed("MakeDiskR", self.PrimOp)
947 anObj.SetParameters(Parameters)
950 ## Create a cylinder with given base point, axis, radius and height.
951 # @param thePnt Central point of cylinder base.
952 # @param theAxis Cylinder axis.
953 # @param theR Cylinder radius.
954 # @param theH Cylinder height.
955 # @return New GEOM_Object, containing the created cylinder.
957 # @ref tui_creation_cylinder "Example"
958 def MakeCylinder(self,thePnt, theAxis, theR, theH):
959 # Example: see GEOM_TestAll.py
960 theR,theH,Parameters = ParseParameters(theR, theH)
961 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
962 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
963 anObj.SetParameters(Parameters)
966 ## Create a cylinder with given radius and height at
967 # the origin of coordinate system. Axis of the cylinder
968 # will be collinear to the OZ axis of the coordinate system.
969 # @param theR Cylinder radius.
970 # @param theH Cylinder height.
971 # @return New GEOM_Object, containing the created cylinder.
973 # @ref tui_creation_cylinder "Example"
974 def MakeCylinderRH(self,theR, theH):
975 # Example: see GEOM_TestAll.py
976 theR,theH,Parameters = ParseParameters(theR, theH)
977 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
978 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
979 anObj.SetParameters(Parameters)
982 ## Create a sphere with given center and radius.
983 # @param thePnt Sphere center.
984 # @param theR Sphere radius.
985 # @return New GEOM_Object, containing the created sphere.
987 # @ref tui_creation_sphere "Example"
988 def MakeSpherePntR(self, thePnt, theR):
989 # Example: see GEOM_TestAll.py
990 theR,Parameters = ParseParameters(theR)
991 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
992 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
993 anObj.SetParameters(Parameters)
996 ## Create a sphere with given center and radius.
997 # @param x,y,z Coordinates of sphere center.
998 # @param theR Sphere radius.
999 # @return New GEOM_Object, containing the created sphere.
1001 # @ref tui_creation_sphere "Example"
1002 def MakeSphere(self, x, y, z, theR):
1003 # Example: see GEOM_TestAll.py
1004 point = self.MakeVertex(x, y, z)
1005 anObj = self.MakeSpherePntR(point, theR)
1008 ## Create a sphere with given radius at the origin of coordinate system.
1009 # @param theR Sphere radius.
1010 # @return New GEOM_Object, containing the created sphere.
1012 # @ref tui_creation_sphere "Example"
1013 def MakeSphereR(self, theR):
1014 # Example: see GEOM_TestAll.py
1015 theR,Parameters = ParseParameters(theR)
1016 anObj = self.PrimOp.MakeSphereR(theR)
1017 RaiseIfFailed("MakeSphereR", self.PrimOp)
1018 anObj.SetParameters(Parameters)
1021 ## Create a cone with given base point, axis, height and radiuses.
1022 # @param thePnt Central point of the first cone base.
1023 # @param theAxis Cone axis.
1024 # @param theR1 Radius of the first cone base.
1025 # @param theR2 Radius of the second cone base.
1026 # \note If both radiuses are non-zero, the cone will be truncated.
1027 # \note If the radiuses are equal, a cylinder will be created instead.
1028 # @param theH Cone height.
1029 # @return New GEOM_Object, containing the created cone.
1031 # @ref tui_creation_cone "Example"
1032 def MakeCone(self,thePnt, theAxis, theR1, theR2, theH):
1033 # Example: see GEOM_TestAll.py
1034 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
1035 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
1036 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
1037 anObj.SetParameters(Parameters)
1040 ## Create a cone with given height and radiuses at
1041 # the origin of coordinate system. Axis of the cone will
1042 # be collinear to the OZ axis of the coordinate system.
1043 # @param theR1 Radius of the first cone base.
1044 # @param theR2 Radius of the second cone base.
1045 # \note If both radiuses are non-zero, the cone will be truncated.
1046 # \note If the radiuses are equal, a cylinder will be created instead.
1047 # @param theH Cone height.
1048 # @return New GEOM_Object, containing the created cone.
1050 # @ref tui_creation_cone "Example"
1051 def MakeConeR1R2H(self,theR1, theR2, theH):
1052 # Example: see GEOM_TestAll.py
1053 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
1054 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
1055 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
1056 anObj.SetParameters(Parameters)
1059 ## Create a torus with given center, normal vector and radiuses.
1060 # @param thePnt Torus central point.
1061 # @param theVec Torus axis of symmetry.
1062 # @param theRMajor Torus major radius.
1063 # @param theRMinor Torus minor radius.
1064 # @return New GEOM_Object, containing the created torus.
1066 # @ref tui_creation_torus "Example"
1067 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor):
1068 # Example: see GEOM_TestAll.py
1069 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
1070 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
1071 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
1072 anObj.SetParameters(Parameters)
1075 ## Create a torus with given radiuses at the origin of coordinate system.
1076 # @param theRMajor Torus major radius.
1077 # @param theRMinor Torus minor radius.
1078 # @return New GEOM_Object, containing the created torus.
1080 # @ref tui_creation_torus "Example"
1081 def MakeTorusRR(self, theRMajor, theRMinor):
1082 # Example: see GEOM_TestAll.py
1083 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
1084 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
1085 RaiseIfFailed("MakeTorusRR", self.PrimOp)
1086 anObj.SetParameters(Parameters)
1089 # end of l3_3d_primitives
1092 ## @addtogroup l3_complex
1095 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
1096 # @param theBase Base shape to be extruded.
1097 # @param thePoint1 First end of extrusion vector.
1098 # @param thePoint2 Second end of extrusion vector.
1099 # @return New GEOM_Object, containing the created prism.
1101 # @ref tui_creation_prism "Example"
1102 def MakePrism(self, theBase, thePoint1, thePoint2):
1103 # Example: see GEOM_TestAll.py
1104 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
1105 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
1108 ## Create a shape by extrusion of the base shape along the vector,
1109 # i.e. all the space, transfixed by the base shape during its translation
1110 # along the vector on the given distance.
1111 # @param theBase Base shape to be extruded.
1112 # @param theVec Direction of extrusion.
1113 # @param theH Prism dimension along theVec.
1114 # @return New GEOM_Object, containing the created prism.
1116 # @ref tui_creation_prism "Example"
1117 def MakePrismVecH(self, theBase, theVec, theH):
1118 # Example: see GEOM_TestAll.py
1119 theH,Parameters = ParseParameters(theH)
1120 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
1121 RaiseIfFailed("MakePrismVecH", self.PrimOp)
1122 anObj.SetParameters(Parameters)
1125 ## Create a shape by extrusion of the base shape along the vector,
1126 # i.e. all the space, transfixed by the base shape during its translation
1127 # along the vector on the given distance in 2 Ways (forward/backward) .
1128 # @param theBase Base shape to be extruded.
1129 # @param theVec Direction of extrusion.
1130 # @param theH Prism dimension along theVec in forward direction.
1131 # @return New GEOM_Object, containing the created prism.
1133 # @ref tui_creation_prism "Example"
1134 def MakePrismVecH2Ways(self, theBase, theVec, theH):
1135 # Example: see GEOM_TestAll.py
1136 theH,Parameters = ParseParameters(theH)
1137 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
1138 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
1139 anObj.SetParameters(Parameters)
1142 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
1143 # @param theBase Base shape to be extruded.
1144 # @param theDX, theDY, theDZ Directions of extrusion.
1145 # @return New GEOM_Object, containing the created prism.
1147 # @ref tui_creation_prism "Example"
1148 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ):
1149 # Example: see GEOM_TestAll.py
1150 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1151 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
1152 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
1153 anObj.SetParameters(Parameters)
1156 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
1157 # i.e. all the space, transfixed by the base shape during its translation
1158 # along the vector on the given distance in 2 Ways (forward/backward) .
1159 # @param theBase Base shape to be extruded.
1160 # @param theDX, theDY, theDZ Directions of extrusion.
1161 # @return New GEOM_Object, containing the created prism.
1163 # @ref tui_creation_prism "Example"
1164 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ):
1165 # Example: see GEOM_TestAll.py
1166 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1167 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
1168 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
1169 anObj.SetParameters(Parameters)
1172 ## Create a shape by revolution of the base shape around the axis
1173 # on the given angle, i.e. all the space, transfixed by the base
1174 # shape during its rotation around the axis on the given angle.
1175 # @param theBase Base shape to be rotated.
1176 # @param theAxis Rotation axis.
1177 # @param theAngle Rotation angle in radians.
1178 # @return New GEOM_Object, containing the created revolution.
1180 # @ref tui_creation_revolution "Example"
1181 def MakeRevolution(self, theBase, theAxis, theAngle):
1182 # Example: see GEOM_TestAll.py
1183 theAngle,Parameters = ParseParameters(theAngle)
1184 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
1185 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
1186 anObj.SetParameters(Parameters)
1189 ## The Same Revolution but in both ways forward&backward.
1190 def MakeRevolution2Ways(self, theBase, theAxis, theAngle):
1191 theAngle,Parameters = ParseParameters(theAngle)
1192 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
1193 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
1194 anObj.SetParameters(Parameters)
1197 ## Create a filling from the given compound of contours.
1198 # @param theShape the compound of contours
1199 # @param theMinDeg a minimal degree of BSpline surface to create
1200 # @param theMaxDeg a maximal degree of BSpline surface to create
1201 # @param theTol2D a 2d tolerance to be reached
1202 # @param theTol3D a 3d tolerance to be reached
1203 # @param theNbIter a number of iteration of approximation algorithm
1204 # @param isApprox if True, BSpline curves are generated in the process
1205 # of surface construction. By default it is False, that means
1206 # the surface is created using Besier curves. The usage of
1207 # Approximation makes the algorithm work slower, but allows
1208 # building the surface for rather complex cases
1209 # @return New GEOM_Object, containing the created filling surface.
1211 # @ref tui_creation_filling "Example"
1212 def MakeFilling(self, theShape, theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter, isApprox=0):
1213 # Example: see GEOM_TestAll.py
1214 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg,
1215 theTol2D, theTol3D, theNbIter)
1216 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
1217 theTol2D, theTol3D, theNbIter, isApprox)
1218 RaiseIfFailed("MakeFilling", self.PrimOp)
1219 anObj.SetParameters(Parameters)
1222 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
1223 # @param theSeqSections - set of specified sections.
1224 # @param theModeSolid - mode defining building solid or shell
1225 # @param thePreci - precision 3D used for smoothing by default 1.e-6
1226 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
1227 # @return New GEOM_Object, containing the created shell or solid.
1229 # @ref swig_todo "Example"
1230 def MakeThruSections(self,theSeqSections,theModeSolid,thePreci,theRuled):
1231 # Example: see GEOM_TestAll.py
1232 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
1233 RaiseIfFailed("MakeThruSections", self.PrimOp)
1236 ## Create a shape by extrusion of the base shape along
1237 # the path shape. The path shape can be a wire or an edge.
1238 # @param theBase Base shape to be extruded.
1239 # @param thePath Path shape to extrude the base shape along it.
1240 # @return New GEOM_Object, containing the created pipe.
1242 # @ref tui_creation_pipe "Example"
1243 def MakePipe(self,theBase, thePath):
1244 # Example: see GEOM_TestAll.py
1245 anObj = self.PrimOp.MakePipe(theBase, thePath)
1246 RaiseIfFailed("MakePipe", self.PrimOp)
1249 ## Create a shape by extrusion of the profile shape along
1250 # the path shape. The path shape can be a wire or an edge.
1251 # the several profiles can be specified in the several locations of path.
1252 # @param theSeqBases - list of Bases shape to be extruded.
1253 # @param theLocations - list of locations on the path corresponding
1254 # specified list of the Bases shapes. Number of locations
1255 # should be equal to number of bases or list of locations can be empty.
1256 # @param thePath - Path shape to extrude the base shape along it.
1257 # @param theWithContact - the mode defining that the section is translated to be in
1258 # contact with the spine.
1259 # @param theWithCorrection - defining that the section is rotated to be
1260 # orthogonal to the spine tangent in the correspondent point
1261 # @return New GEOM_Object, containing the created pipe.
1263 # @ref tui_creation_pipe_with_diff_sec "Example"
1264 def MakePipeWithDifferentSections(self, theSeqBases,
1265 theLocations, thePath,
1266 theWithContact, theWithCorrection):
1267 anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
1268 theLocations, thePath,
1269 theWithContact, theWithCorrection)
1270 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
1273 ## Create a shape by extrusion of the profile shape along
1274 # the path shape. The path shape can be a wire or a edge.
1275 # the several profiles can be specified in the several locations of path.
1276 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
1277 # shell or face. If number of faces in neighbour sections
1278 # aren't coincided result solid between such sections will
1279 # be created using external boundaries of this shells.
1280 # @param theSeqSubBases - list of corresponding subshapes of section shapes.
1281 # This list is used for searching correspondences between
1282 # faces in the sections. Size of this list must be equal
1283 # to size of list of base shapes.
1284 # @param theLocations - list of locations on the path corresponding
1285 # specified list of the Bases shapes. Number of locations
1286 # should be equal to number of bases. First and last
1287 # locations must be coincided with first and last vertexes
1288 # of path correspondingly.
1289 # @param thePath - Path shape to extrude the base shape along it.
1290 # @param theWithContact - the mode defining that the section is translated to be in
1291 # contact with the spine.
1292 # @param theWithCorrection - defining that the section is rotated to be
1293 # orthogonal to the spine tangent in the correspondent point
1294 # @return New GEOM_Object, containing the created solids.
1296 # @ref tui_creation_pipe_with_shell_sec "Example"
1297 def MakePipeWithShellSections(self,theSeqBases, theSeqSubBases,
1298 theLocations, thePath,
1299 theWithContact, theWithCorrection):
1300 anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
1301 theLocations, thePath,
1302 theWithContact, theWithCorrection)
1303 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
1306 ## Create a shape by extrusion of the profile shape along
1307 # the path shape. This function is used only for debug pipe
1308 # functionality - it is a version of previous function
1309 # (MakePipeWithShellSections(...)) which give a possibility to
1310 # recieve information about creating pipe between each pair of
1311 # sections step by step.
1312 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
1313 theLocations, thePath,
1314 theWithContact, theWithCorrection):
1316 nbsect = len(theSeqBases)
1317 nbsubsect = len(theSeqSubBases)
1318 #print "nbsect = ",nbsect
1319 for i in range(1,nbsect):
1321 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
1322 tmpLocations = [ theLocations[i-1], theLocations[i] ]
1324 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
1325 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
1326 tmpLocations, thePath,
1327 theWithContact, theWithCorrection)
1328 if self.PrimOp.IsDone() == 0:
1329 print "Problems with pipe creation between ",i," and ",i+1," sections"
1330 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
1333 print "Pipe between ",i," and ",i+1," sections is OK"
1338 resc = self.MakeCompound(res)
1339 #resc = self.MakeSewing(res, 0.001)
1340 #print "resc: ",resc
1343 ## Create solids between given sections
1344 # @param theSeqBases - list of sections (shell or face).
1345 # @param theLocations - list of corresponding vertexes
1346 # @return New GEOM_Object, containing the created solids.
1348 # @ref tui_creation_pipe_without_path "Example"
1349 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations):
1350 anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
1351 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
1354 ## Create a shape by extrusion of the base shape along
1355 # the path shape with constant bi-normal direction along the given vector.
1356 # The path shape can be a wire or an edge.
1357 # @param theBase Base shape to be extruded.
1358 # @param thePath Path shape to extrude the base shape along it.
1359 # @param theVec Vector defines a constant binormal direction to keep the
1360 # same angle beetween the direction and the sections
1361 # along the sweep surface.
1362 # @return New GEOM_Object, containing the created pipe.
1364 # @ref tui_creation_pipe "Example"
1365 def MakePipeBiNormalAlongVector(self,theBase, thePath, theVec):
1366 # Example: see GEOM_TestAll.py
1367 anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
1368 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
1374 ## @addtogroup l3_advanced
1377 ## Create a linear edge with specified ends.
1378 # @param thePnt1 Point for the first end of edge.
1379 # @param thePnt2 Point for the second end of edge.
1380 # @return New GEOM_Object, containing the created edge.
1382 # @ref tui_creation_edge "Example"
1383 def MakeEdge(self,thePnt1, thePnt2):
1384 # Example: see GEOM_TestAll.py
1385 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
1386 RaiseIfFailed("MakeEdge", self.ShapesOp)
1389 ## Create a wire from the set of edges and wires.
1390 # @param theEdgesAndWires List of edges and/or wires.
1391 # @param theTolerance Maximum distance between vertices, that will be merged.
1392 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
1393 # @return New GEOM_Object, containing the created wire.
1395 # @ref tui_creation_wire "Example"
1396 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07):
1397 # Example: see GEOM_TestAll.py
1398 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
1399 RaiseIfFailed("MakeWire", self.ShapesOp)
1402 ## Create a face on the given wire.
1403 # @param theWire closed Wire or Edge to build the face on.
1404 # @param isPlanarWanted If TRUE, only planar face will be built.
1405 # If impossible, NULL object will be returned.
1406 # @return New GEOM_Object, containing the created face.
1408 # @ref tui_creation_face "Example"
1409 def MakeFace(self,theWire, isPlanarWanted):
1410 # Example: see GEOM_TestAll.py
1411 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
1412 RaiseIfFailed("MakeFace", self.ShapesOp)
1415 ## Create a face on the given wires set.
1416 # @param theWires List of closed wires or edges to build the face on.
1417 # @param isPlanarWanted If TRUE, only planar face will be built.
1418 # If impossible, NULL object will be returned.
1419 # @return New GEOM_Object, containing the created face.
1421 # @ref tui_creation_face "Example"
1422 def MakeFaceWires(self,theWires, isPlanarWanted):
1423 # Example: see GEOM_TestAll.py
1424 anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
1425 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
1428 ## Shortcut to MakeFaceWires()
1430 # @ref tui_creation_face "Example 1"
1431 # \n @ref swig_MakeFaces "Example 2"
1432 def MakeFaces(self,theWires, isPlanarWanted):
1433 # Example: see GEOM_TestOthers.py
1434 anObj = self.MakeFaceWires(theWires, isPlanarWanted)
1437 ## Create a shell from the set of faces and shells.
1438 # @param theFacesAndShells List of faces and/or shells.
1439 # @return New GEOM_Object, containing the created shell.
1441 # @ref tui_creation_shell "Example"
1442 def MakeShell(self,theFacesAndShells):
1443 # Example: see GEOM_TestAll.py
1444 anObj = self.ShapesOp.MakeShell(theFacesAndShells)
1445 RaiseIfFailed("MakeShell", self.ShapesOp)
1448 ## Create a solid, bounded by the given shells.
1449 # @param theShells Sequence of bounding shells.
1450 # @return New GEOM_Object, containing the created solid.
1452 # @ref tui_creation_solid "Example"
1453 def MakeSolid(self,theShells):
1454 # Example: see GEOM_TestAll.py
1455 anObj = self.ShapesOp.MakeSolidShells(theShells)
1456 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
1459 ## Create a compound of the given shapes.
1460 # @param theShapes List of shapes to put in compound.
1461 # @return New GEOM_Object, containing the created compound.
1463 # @ref tui_creation_compound "Example"
1464 def MakeCompound(self,theShapes):
1465 # Example: see GEOM_TestAll.py
1466 anObj = self.ShapesOp.MakeCompound(theShapes)
1467 RaiseIfFailed("MakeCompound", self.ShapesOp)
1470 # end of l3_advanced
1473 ## @addtogroup l2_measure
1476 ## Gives quantity of faces in the given shape.
1477 # @param theShape Shape to count faces of.
1478 # @return Quantity of faces.
1480 # @ref swig_NumberOf "Example"
1481 def NumberOfFaces(self, theShape):
1482 # Example: see GEOM_TestOthers.py
1483 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
1484 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
1487 ## Gives quantity of edges in the given shape.
1488 # @param theShape Shape to count edges of.
1489 # @return Quantity of edges.
1491 # @ref swig_NumberOf "Example"
1492 def NumberOfEdges(self, theShape):
1493 # Example: see GEOM_TestOthers.py
1494 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
1495 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
1498 ## Gives quantity of subshapes of type theShapeType in the given shape.
1499 # @param theShape Shape to count subshapes of.
1500 # @param theShapeType Type of subshapes to count.
1501 # @return Quantity of subshapes of given type.
1503 # @ref swig_NumberOf "Example"
1504 def NumberOfSubShapes(self, theShape, theShapeType):
1505 # Example: see GEOM_TestOthers.py
1506 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
1507 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
1510 ## Gives quantity of solids in the given shape.
1511 # @param theShape Shape to count solids in.
1512 # @return Quantity of solids.
1514 # @ref swig_NumberOf "Example"
1515 def NumberOfSolids(self, theShape):
1516 # Example: see GEOM_TestOthers.py
1517 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, ShapeType["SOLID"])
1518 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
1524 ## @addtogroup l3_healing
1527 ## Reverses an orientation the given shape.
1528 # @param theShape Shape to be reversed.
1529 # @return The reversed copy of theShape.
1531 # @ref swig_ChangeOrientation "Example"
1532 def ChangeOrientation(self,theShape):
1533 # Example: see GEOM_TestAll.py
1534 anObj = self.ShapesOp.ChangeOrientation(theShape)
1535 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
1538 ## Shortcut to ChangeOrientation()
1540 # @ref swig_OrientationChange "Example"
1541 def OrientationChange(self,theShape):
1542 # Example: see GEOM_TestOthers.py
1543 anObj = self.ChangeOrientation(theShape)
1549 ## @addtogroup l4_obtain
1552 ## Retrieve all free faces from the given shape.
1553 # Free face is a face, which is not shared between two shells of the shape.
1554 # @param theShape Shape to find free faces in.
1555 # @return List of IDs of all free faces, contained in theShape.
1557 # @ref tui_measurement_tools_page "Example"
1558 def GetFreeFacesIDs(self,theShape):
1559 # Example: see GEOM_TestOthers.py
1560 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
1561 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
1564 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
1565 # @param theShape1 Shape to find sub-shapes in.
1566 # @param theShape2 Shape to find shared sub-shapes with.
1567 # @param theShapeType Type of sub-shapes to be retrieved.
1568 # @return List of sub-shapes of theShape1, shared with theShape2.
1570 # @ref swig_GetSharedShapes "Example"
1571 def GetSharedShapes(self,theShape1, theShape2, theShapeType):
1572 # Example: see GEOM_TestOthers.py
1573 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
1574 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
1577 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
1578 # situated relatively the specified plane by the certain way,
1579 # defined through <VAR>theState</VAR> parameter.
1580 # @param theShape Shape to find sub-shapes of.
1581 # @param theShapeType Type of sub-shapes to be retrieved.
1582 # @param theAx1 Vector (or line, or linear edge), specifying normal
1583 # direction and location of the plane to find shapes on.
1584 # @param theState The state of the subshapes to find. It can be one of
1585 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1586 # @return List of all found sub-shapes.
1588 # @ref swig_GetShapesOnPlane "Example"
1589 def GetShapesOnPlane(self,theShape, theShapeType, theAx1, theState):
1590 # Example: see GEOM_TestOthers.py
1591 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
1592 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
1595 ## Works like the above method, but returns list of sub-shapes indices
1597 # @ref swig_GetShapesOnPlaneIDs "Example"
1598 def GetShapesOnPlaneIDs(self,theShape, theShapeType, theAx1, theState):
1599 # Example: see GEOM_TestOthers.py
1600 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
1601 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
1604 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
1605 # situated relatively the specified plane by the certain way,
1606 # defined through <VAR>theState</VAR> parameter.
1607 # @param theShape Shape to find sub-shapes of.
1608 # @param theShapeType Type of sub-shapes to be retrieved.
1609 # @param theAx1 Vector (or line, or linear edge), specifying normal
1610 # direction of the plane to find shapes on.
1611 # @param thePnt Point specifying location of the plane to find shapes on.
1612 # @param theState The state of the subshapes to find. It can be one of
1613 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1614 # @return List of all found sub-shapes.
1616 # @ref swig_GetShapesOnPlaneWithLocation "Example"
1617 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState):
1618 # Example: see GEOM_TestOthers.py
1619 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
1620 theAx1, thePnt, theState)
1621 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
1624 ## Works like the above method, but returns list of sub-shapes indices
1626 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
1627 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
1628 # Example: see GEOM_TestOthers.py
1629 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
1630 theAx1, thePnt, theState)
1631 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
1634 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1635 # the specified cylinder by the certain way, defined through \a theState parameter.
1636 # @param theShape Shape to find sub-shapes of.
1637 # @param theShapeType Type of sub-shapes to be retrieved.
1638 # @param theAxis Vector (or line, or linear edge), specifying
1639 # axis of the cylinder to find shapes on.
1640 # @param theRadius Radius of the cylinder to find shapes on.
1641 # @param theState The state of the subshapes to find. It can be one of
1642 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1643 # @return List of all found sub-shapes.
1645 # @ref swig_GetShapesOnCylinder "Example"
1646 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState):
1647 # Example: see GEOM_TestOthers.py
1648 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
1649 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
1652 ## Works like the above method, but returns list of sub-shapes indices
1654 # @ref swig_GetShapesOnCylinderIDs "Example"
1655 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
1656 # Example: see GEOM_TestOthers.py
1657 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
1658 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
1661 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1662 # the specified sphere by the certain way, defined through \a theState parameter.
1663 # @param theShape Shape to find sub-shapes of.
1664 # @param theShapeType Type of sub-shapes to be retrieved.
1665 # @param theCenter Point, specifying center of the sphere to find shapes on.
1666 # @param theRadius Radius of the sphere to find shapes on.
1667 # @param theState The state of the subshapes to find. It can be one of
1668 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1669 # @return List of all found sub-shapes.
1671 # @ref swig_GetShapesOnSphere "Example"
1672 def GetShapesOnSphere(self,theShape, theShapeType, theCenter, theRadius, theState):
1673 # Example: see GEOM_TestOthers.py
1674 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
1675 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
1678 ## Works like the above method, but returns list of sub-shapes indices
1680 # @ref swig_GetShapesOnSphereIDs "Example"
1681 def GetShapesOnSphereIDs(self,theShape, theShapeType, theCenter, theRadius, theState):
1682 # Example: see GEOM_TestOthers.py
1683 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
1684 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
1687 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1688 # the specified quadrangle by the certain way, defined through \a theState parameter.
1689 # @param theShape Shape to find sub-shapes of.
1690 # @param theShapeType Type of sub-shapes to be retrieved.
1691 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
1692 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
1693 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
1694 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
1695 # @param theState The state of the subshapes to find. It can be one of
1696 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1697 # @return List of all found sub-shapes.
1699 # @ref swig_GetShapesOnQuadrangle "Example"
1700 def GetShapesOnQuadrangle(self, theShape, theShapeType,
1701 theTopLeftPoint, theTopRigthPoint,
1702 theBottomLeftPoint, theBottomRigthPoint, theState):
1703 # Example: see GEOM_TestOthers.py
1704 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
1705 theTopLeftPoint, theTopRigthPoint,
1706 theBottomLeftPoint, theBottomRigthPoint, theState)
1707 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
1710 ## Works like the above method, but returns list of sub-shapes indices
1712 # @ref swig_GetShapesOnQuadrangleIDs "Example"
1713 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
1714 theTopLeftPoint, theTopRigthPoint,
1715 theBottomLeftPoint, theBottomRigthPoint, theState):
1716 # Example: see GEOM_TestOthers.py
1717 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
1718 theTopLeftPoint, theTopRigthPoint,
1719 theBottomLeftPoint, theBottomRigthPoint, theState)
1720 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
1723 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1724 # the specified \a theBox by the certain way, defined through \a theState parameter.
1725 # @param theBox Shape for relative comparing.
1726 # @param theShape Shape to find sub-shapes of.
1727 # @param theShapeType Type of sub-shapes to be retrieved.
1728 # @param theState The state of the subshapes to find. It can be one of
1729 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1730 # @return List of all found sub-shapes.
1732 # @ref swig_GetShapesOnBox "Example"
1733 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState):
1734 # Example: see GEOM_TestOthers.py
1735 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
1736 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
1739 ## Works like the above method, but returns list of sub-shapes indices
1741 # @ref swig_GetShapesOnBoxIDs "Example"
1742 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
1743 # Example: see GEOM_TestOthers.py
1744 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
1745 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
1748 ## Find in \a theShape all sub-shapes of type \a theShapeType,
1749 # situated relatively the specified \a theCheckShape by the
1750 # certain way, defined through \a theState parameter.
1751 # @param theCheckShape Shape for relative comparing.
1752 # @param theShape Shape to find sub-shapes of.
1753 # @param theShapeType Type of sub-shapes to be retrieved.
1754 # @param theState The state of the subshapes to find. It can be one of
1755 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1756 # @return List of all found sub-shapes.
1758 # @ref swig_GetShapesOnShape "Example"
1759 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState):
1760 # Example: see GEOM_TestOthers.py
1761 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
1762 theShapeType, theState)
1763 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
1766 ## Works like the above method, but returns result as compound
1768 # @ref swig_GetShapesOnShapeAsCompound "Example"
1769 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState):
1770 # Example: see GEOM_TestOthers.py
1771 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
1772 theShapeType, theState)
1773 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
1776 ## Works like the above method, but returns list of sub-shapes indices
1778 # @ref swig_GetShapesOnShapeIDs "Example"
1779 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
1780 # Example: see GEOM_TestOthers.py
1781 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
1782 theShapeType, theState)
1783 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
1786 ## Get sub-shape(s) of theShapeWhere, which are
1787 # coincident with \a theShapeWhat or could be a part of it.
1788 # @param theShapeWhere Shape to find sub-shapes of.
1789 # @param theShapeWhat Shape, specifying what to find.
1790 # @return Group of all found sub-shapes or a single found sub-shape.
1792 # @ref swig_GetInPlace "Example"
1793 def GetInPlace(self,theShapeWhere, theShapeWhat):
1794 # Example: see GEOM_TestOthers.py
1795 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
1796 RaiseIfFailed("GetInPlace", self.ShapesOp)
1799 ## Get sub-shape(s) of \a theShapeWhere, which are
1800 # coincident with \a theShapeWhat or could be a part of it.
1802 # Implementation of this method is based on a saved history of an operation,
1803 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
1804 # arguments (an argument shape or a sub-shape of an argument shape).
1805 # The operation could be the Partition or one of boolean operations,
1806 # performed on simple shapes (not on compounds).
1808 # @param theShapeWhere Shape to find sub-shapes of.
1809 # @param theShapeWhat Shape, specifying what to find (must be in the
1810 # building history of the ShapeWhere).
1811 # @return Group of all found sub-shapes or a single found sub-shape.
1813 # @ref swig_GetInPlace "Example"
1814 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat):
1815 # Example: see GEOM_TestOthers.py
1816 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
1817 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
1820 ## Get sub-shape of theShapeWhere, which is
1821 # equal to \a theShapeWhat.
1822 # @param theShapeWhere Shape to find sub-shape of.
1823 # @param theShapeWhat Shape, specifying what to find.
1824 # @return New GEOM_Object for found sub-shape.
1826 # @ref swig_GetSame "Example"
1827 def GetSame(self,theShapeWhere, theShapeWhat):
1828 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
1829 RaiseIfFailed("GetSame", self.ShapesOp)
1835 ## @addtogroup l4_access
1838 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
1839 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
1841 # @ref swig_all_decompose "Example"
1842 def GetSubShape(self, aShape, ListOfID):
1843 # Example: see GEOM_TestAll.py
1844 anObj = self.AddSubShape(aShape,ListOfID)
1847 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
1849 # @ref swig_all_decompose "Example"
1850 def GetSubShapeID(self, aShape, aSubShape):
1851 # Example: see GEOM_TestAll.py
1852 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
1853 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
1859 ## @addtogroup l4_decompose
1862 ## Explode a shape on subshapes of a given type.
1863 # @param aShape Shape to be exploded.
1864 # @param aType Type of sub-shapes to be retrieved.
1865 # @return List of sub-shapes of type theShapeType, contained in theShape.
1867 # @ref swig_all_decompose "Example"
1868 def SubShapeAll(self, aShape, aType):
1869 # Example: see GEOM_TestAll.py
1870 ListObj = self.ShapesOp.MakeExplode(aShape,aType,0)
1871 RaiseIfFailed("MakeExplode", self.ShapesOp)
1874 ## Explode a shape on subshapes of a given type.
1875 # @param aShape Shape to be exploded.
1876 # @param aType Type of sub-shapes to be retrieved.
1877 # @return List of IDs of sub-shapes.
1879 # @ref swig_all_decompose "Example"
1880 def SubShapeAllIDs(self, aShape, aType):
1881 ListObj = self.ShapesOp.SubShapeAllIDs(aShape,aType,0)
1882 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
1885 ## Explode a shape on subshapes of a given type.
1886 # Sub-shapes will be sorted by coordinates of their gravity centers.
1887 # @param aShape Shape to be exploded.
1888 # @param aType Type of sub-shapes to be retrieved.
1889 # @return List of sub-shapes of type theShapeType, contained in theShape.
1891 # @ref swig_SubShapeAllSorted "Example"
1892 def SubShapeAllSorted(self, aShape, aType):
1893 # Example: see GEOM_TestAll.py
1894 ListObj = self.ShapesOp.MakeExplode(aShape,aType,1)
1895 RaiseIfFailed("MakeExplode", self.ShapesOp)
1898 ## Explode a shape on subshapes of a given type.
1899 # Sub-shapes will be sorted by coordinates of their gravity centers.
1900 # @param aShape Shape to be exploded.
1901 # @param aType Type of sub-shapes to be retrieved.
1902 # @return List of IDs of sub-shapes.
1904 # @ref swig_all_decompose "Example"
1905 def SubShapeAllSortedIDs(self, aShape, aType):
1906 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape,aType,1)
1907 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
1910 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
1911 # selected by they indices in list of all sub-shapes of type <VAR>aType</VAR>.
1912 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
1914 # @ref swig_all_decompose "Example"
1915 def SubShape(self, aShape, aType, ListOfInd):
1916 # Example: see GEOM_TestAll.py
1918 AllShapeList = self.SubShapeAll(aShape, aType)
1919 for ind in ListOfInd:
1920 ListOfIDs.append(self.GetSubShapeID(aShape, AllShapeList[ind - 1]))
1921 anObj = self.GetSubShape(aShape, ListOfIDs)
1924 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
1925 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
1926 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
1928 # @ref swig_all_decompose "Example"
1929 def SubShapeSorted(self,aShape, aType, ListOfInd):
1930 # Example: see GEOM_TestAll.py
1932 AllShapeList = self.SubShapeAllSorted(aShape, aType)
1933 for ind in ListOfInd:
1934 ListOfIDs.append(self.GetSubShapeID(aShape, AllShapeList[ind - 1]))
1935 anObj = self.GetSubShape(aShape, ListOfIDs)
1938 # end of l4_decompose
1941 ## @addtogroup l3_healing
1944 ## Apply a sequence of Shape Healing operators to the given object.
1945 # @param theShape Shape to be processed.
1946 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
1947 # @param theParameters List of names of parameters
1948 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
1949 # @param theValues List of values of parameters, in the same order
1950 # as parameters are listed in <VAR>theParameters</VAR> list.
1951 # @return New GEOM_Object, containing processed shape.
1953 # @ref tui_shape_processing "Example"
1954 def ProcessShape(self,theShape, theOperators, theParameters, theValues):
1955 # Example: see GEOM_TestHealing.py
1956 theValues,Parameters = ParseList(theValues)
1957 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
1958 RaiseIfFailed("ProcessShape", self.HealOp)
1959 for string in (theOperators + theParameters):
1960 Parameters = ":" + Parameters
1962 anObj.SetParameters(Parameters)
1965 ## Remove faces from the given object (shape).
1966 # @param theObject Shape to be processed.
1967 # @param theFaces Indices of faces to be removed, if EMPTY then the method
1968 # removes ALL faces of the given object.
1969 # @return New GEOM_Object, containing processed shape.
1971 # @ref tui_suppress_faces "Example"
1972 def SuppressFaces(self,theObject, theFaces):
1973 # Example: see GEOM_TestHealing.py
1974 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
1975 RaiseIfFailed("SuppressFaces", self.HealOp)
1978 ## Sewing of some shapes into single shape.
1980 # @ref tui_sewing "Example"
1981 def MakeSewing(self, ListShape, theTolerance):
1982 # Example: see GEOM_TestHealing.py
1983 comp = self.MakeCompound(ListShape)
1984 anObj = self.Sew(comp, theTolerance)
1987 ## Sewing of the given object.
1988 # @param theObject Shape to be processed.
1989 # @param theTolerance Required tolerance value.
1990 # @return New GEOM_Object, containing processed shape.
1991 def Sew(self, theObject, theTolerance):
1992 # Example: see MakeSewing() above
1993 theTolerance,Parameters = ParseParameters(theTolerance)
1994 anObj = self.HealOp.Sew(theObject, theTolerance)
1995 RaiseIfFailed("Sew", self.HealOp)
1996 anObj.SetParameters(Parameters)
1999 ## Remove internal wires and edges from the given object (face).
2000 # @param theObject Shape to be processed.
2001 # @param theWires Indices of wires to be removed, if EMPTY then the method
2002 # removes ALL internal wires of the given object.
2003 # @return New GEOM_Object, containing processed shape.
2005 # @ref tui_suppress_internal_wires "Example"
2006 def SuppressInternalWires(self,theObject, theWires):
2007 # Example: see GEOM_TestHealing.py
2008 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
2009 RaiseIfFailed("RemoveIntWires", self.HealOp)
2012 ## Remove internal closed contours (holes) from the given object.
2013 # @param theObject Shape to be processed.
2014 # @param theWires Indices of wires to be removed, if EMPTY then the method
2015 # removes ALL internal holes of the given object
2016 # @return New GEOM_Object, containing processed shape.
2018 # @ref tui_suppress_holes "Example"
2019 def SuppressHoles(self,theObject, theWires):
2020 # Example: see GEOM_TestHealing.py
2021 anObj = self.HealOp.FillHoles(theObject, theWires)
2022 RaiseIfFailed("FillHoles", self.HealOp)
2025 ## Close an open wire.
2026 # @param theObject Shape to be processed.
2027 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
2028 # if -1, then <VAR>theObject</VAR> itself is a wire.
2029 # @param isCommonVertex If TRUE : closure by creation of a common vertex,
2030 # If FALS : closure by creation of an edge between ends.
2031 # @return New GEOM_Object, containing processed shape.
2033 # @ref tui_close_contour "Example"
2034 def CloseContour(self,theObject, theWires, isCommonVertex):
2035 # Example: see GEOM_TestHealing.py
2036 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
2037 RaiseIfFailed("CloseContour", self.HealOp)
2040 ## Addition of a point to a given edge object.
2041 # @param theObject Shape to be processed.
2042 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
2043 # if -1, then theObject itself is the edge.
2044 # @param theValue Value of parameter on edge or length parameter,
2045 # depending on \a isByParameter.
2046 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1],
2047 # if FALSE : \a theValue is treated as a length parameter [0..1]
2048 # @return New GEOM_Object, containing processed shape.
2050 # @ref tui_add_point_on_edge "Example"
2051 def DivideEdge(self,theObject, theEdgeIndex, theValue, isByParameter):
2052 # Example: see GEOM_TestHealing.py
2053 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
2054 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
2055 RaiseIfFailed("DivideEdge", self.HealOp)
2056 anObj.SetParameters(Parameters)
2059 ## Change orientation of the given object. Updates given shape.
2060 # @param theObject Shape to be processed.
2062 # @ref swig_todo "Example"
2063 def ChangeOrientationShell(self,theObject):
2064 theObject = self.HealOp.ChangeOrientation(theObject)
2065 RaiseIfFailed("ChangeOrientation", self.HealOp)
2068 ## Change orientation of the given object.
2069 # @param theObject Shape to be processed.
2070 # @return New GEOM_Object, containing processed shape.
2072 # @ref swig_todo "Example"
2073 def ChangeOrientationShellCopy(self,theObject):
2074 anObj = self.HealOp.ChangeOrientationCopy(theObject)
2075 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
2078 ## Get a list of wires (wrapped in GEOM_Object-s),
2079 # that constitute a free boundary of the given shape.
2080 # @param theObject Shape to get free boundary of.
2081 # @return [status, theClosedWires, theOpenWires]
2082 # status: FALSE, if an error(s) occured during the method execution.
2083 # theClosedWires: Closed wires on the free boundary of the given shape.
2084 # theOpenWires: Open wires on the free boundary of the given shape.
2086 # @ref tui_measurement_tools_page "Example"
2087 def GetFreeBoundary(self,theObject):
2088 # Example: see GEOM_TestHealing.py
2089 anObj = self.HealOp.GetFreeBoundary(theObject)
2090 RaiseIfFailed("GetFreeBoundary", self.HealOp)
2093 ## Replace coincident faces in theShape by one face.
2094 # @param theShape Initial shape.
2095 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
2096 # @param doKeepNonSolids If FALSE, only solids will present in the result,
2097 # otherwise all initial shapes.
2098 # @return New GEOM_Object, containing a copy of theShape without coincident faces.
2100 # @ref tui_glue_faces "Example"
2101 def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True):
2102 # Example: see GEOM_Spanner.py
2103 theTolerance,Parameters = ParseParameters(theTolerance)
2104 anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
2106 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
2107 anObj.SetParameters(Parameters)
2110 ## Find coincident faces in theShape for possible gluing.
2111 # @param theShape Initial shape.
2112 # @param theTolerance Maximum distance between faces,
2113 # which can be considered as coincident.
2116 # @ref swig_todo "Example"
2117 def GetGlueFaces(self, theShape, theTolerance):
2118 # Example: see GEOM_Spanner.py
2119 anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
2120 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
2123 ## Replace coincident faces in theShape by one face
2124 # in compliance with given list of faces
2125 # @param theShape Initial shape.
2126 # @param theTolerance Maximum distance between faces,
2127 # which can be considered as coincident.
2128 # @param theFaces List of faces for gluing.
2129 # @param doKeepNonSolids If FALSE, only solids will present in the result,
2130 # otherwise all initial shapes.
2131 # @return New GEOM_Object, containing a copy of theShape
2132 # without some faces.
2134 # @ref swig_todo "Example"
2135 def MakeGlueFacesByList(self, theShape, theTolerance, theFaces, doKeepNonSolids=True):
2136 # Example: see GEOM_Spanner.py
2137 anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces, doKeepNonSolids)
2139 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
2145 ## @addtogroup l3_boolean Boolean Operations
2148 # -----------------------------------------------------------------------------
2149 # Boolean (Common, Cut, Fuse, Section)
2150 # -----------------------------------------------------------------------------
2152 ## Perform one of boolean operations on two given shapes.
2153 # @param theShape1 First argument for boolean operation.
2154 # @param theShape2 Second argument for boolean operation.
2155 # @param theOperation Indicates the operation to be done:
2156 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
2157 # @return New GEOM_Object, containing the result shape.
2159 # @ref tui_fuse "Example"
2160 def MakeBoolean(self,theShape1, theShape2, theOperation):
2161 # Example: see GEOM_TestAll.py
2162 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation)
2163 RaiseIfFailed("MakeBoolean", self.BoolOp)
2166 ## Shortcut to MakeBoolean(s1, s2, 1)
2168 # @ref tui_common "Example 1"
2169 # \n @ref swig_MakeCommon "Example 2"
2170 def MakeCommon(self, s1, s2):
2171 # Example: see GEOM_TestOthers.py
2172 return self.MakeBoolean(s1, s2, 1)
2174 ## Shortcut to MakeBoolean(s1, s2, 2)
2176 # @ref tui_cut "Example 1"
2177 # \n @ref swig_MakeCommon "Example 2"
2178 def MakeCut(self, s1, s2):
2179 # Example: see GEOM_TestOthers.py
2180 return self.MakeBoolean(s1, s2, 2)
2182 ## Shortcut to MakeBoolean(s1, s2, 3)
2184 # @ref tui_fuse "Example 1"
2185 # \n @ref swig_MakeCommon "Example 2"
2186 def MakeFuse(self, s1, s2):
2187 # Example: see GEOM_TestOthers.py
2188 return self.MakeBoolean(s1, s2, 3)
2190 ## Shortcut to MakeBoolean(s1, s2, 4)
2192 # @ref tui_section "Example 1"
2193 # \n @ref swig_MakeCommon "Example 2"
2194 def MakeSection(self, s1, s2):
2195 # Example: see GEOM_TestOthers.py
2196 return self.MakeBoolean(s1, s2, 4)
2201 ## @addtogroup l3_basic_op
2204 ## Perform partition operation.
2205 # @param ListShapes Shapes to be intersected.
2206 # @param ListTools Shapes to intersect theShapes.
2207 # !!!NOTE: Each compound from ListShapes and ListTools will be exploded
2208 # in order to avoid possible intersection between shapes from
2210 # @param Limit Type of resulting shapes (corresponding to TopAbs_ShapeEnum).
2211 # @param KeepNonlimitShapes: if this parameter == 0 - only shapes with
2212 # type <= Limit are kept in the result,
2213 # else - shapes with type > Limit are kept
2214 # also (if they exist)
2216 # After implementation new version of PartitionAlgo (October 2006)
2217 # other parameters are ignored by current functionality. They are kept
2218 # in this function only for support old versions.
2219 # Ignored parameters:
2220 # @param ListKeepInside Shapes, outside which the results will be deleted.
2221 # Each shape from theKeepInside must belong to theShapes also.
2222 # @param ListRemoveInside Shapes, inside which the results will be deleted.
2223 # Each shape from theRemoveInside must belong to theShapes also.
2224 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
2225 # @param ListMaterials Material indices for each shape. Make sence,
2226 # only if theRemoveWebs is TRUE.
2228 # @return New GEOM_Object, containing the result shapes.
2230 # @ref tui_partition "Example"
2231 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
2232 Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
2233 KeepNonlimitShapes=0):
2234 # Example: see GEOM_TestAll.py
2235 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
2236 ListKeepInside, ListRemoveInside,
2237 Limit, RemoveWebs, ListMaterials,
2238 KeepNonlimitShapes);
2239 RaiseIfFailed("MakePartition", self.BoolOp)
2242 ## Perform partition operation.
2243 # This method may be useful if it is needed to make a partition for
2244 # compound contains nonintersected shapes. Performance will be better
2245 # since intersection between shapes from compound is not performed.
2247 # Description of all parameters as in previous method MakePartition()
2249 # !!!NOTE: Passed compounds (via ListShapes or via ListTools)
2250 # have to consist of nonintersecting shapes.
2252 # @return New GEOM_Object, containing the result shapes.
2254 # @ref swig_todo "Example"
2255 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
2256 ListKeepInside=[], ListRemoveInside=[],
2257 Limit=ShapeType["SHAPE"], RemoveWebs=0,
2258 ListMaterials=[], KeepNonlimitShapes=0):
2259 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
2260 ListKeepInside, ListRemoveInside,
2261 Limit, RemoveWebs, ListMaterials,
2262 KeepNonlimitShapes);
2263 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
2266 ## Shortcut to MakePartition()
2268 # @ref tui_partition "Example 1"
2269 # \n @ref swig_Partition "Example 2"
2270 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
2271 Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
2272 KeepNonlimitShapes=0):
2273 # Example: see GEOM_TestOthers.py
2274 anObj = self.MakePartition(ListShapes, ListTools,
2275 ListKeepInside, ListRemoveInside,
2276 Limit, RemoveWebs, ListMaterials,
2277 KeepNonlimitShapes);
2280 ## Perform partition of the Shape with the Plane
2281 # @param theShape Shape to be intersected.
2282 # @param thePlane Tool shape, to intersect theShape.
2283 # @return New GEOM_Object, containing the result shape.
2285 # @ref tui_partition "Example"
2286 def MakeHalfPartition(self,theShape, thePlane):
2287 # Example: see GEOM_TestAll.py
2288 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
2289 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
2292 # end of l3_basic_op
2295 ## @addtogroup l3_transform
2298 ## Translate the given object along the vector, specified
2299 # by its end points, creating its copy before the translation.
2300 # @param theObject The object to be translated.
2301 # @param thePoint1 Start point of translation vector.
2302 # @param thePoint2 End point of translation vector.
2303 # @return New GEOM_Object, containing the translated object.
2305 # @ref tui_translation "Example 1"
2306 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
2307 def MakeTranslationTwoPoints(self,theObject, thePoint1, thePoint2):
2308 # Example: see GEOM_TestAll.py
2309 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
2310 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
2313 ## Translate the given object along the vector, specified by its components.
2314 # @param theObject The object to be translated.
2315 # @param theDX,theDY,theDZ Components of translation vector.
2316 # @return Translated GEOM_Object.
2318 # @ref tui_translation "Example"
2319 def TranslateDXDYDZ(self,theObject, theDX, theDY, theDZ):
2320 # Example: see GEOM_TestAll.py
2321 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
2322 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
2323 anObj.SetParameters(Parameters)
2324 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
2327 ## Translate the given object along the vector, specified
2328 # by its components, creating its copy before the translation.
2329 # @param theObject The object to be translated.
2330 # @param theDX,theDY,theDZ Components of translation vector.
2331 # @return New GEOM_Object, containing the translated object.
2333 # @ref tui_translation "Example"
2334 def MakeTranslation(self,theObject, theDX, theDY, theDZ):
2335 # Example: see GEOM_TestAll.py
2336 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
2337 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
2338 anObj.SetParameters(Parameters)
2339 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
2342 ## Translate the given object along the given vector,
2343 # creating its copy before the translation.
2344 # @param theObject The object to be translated.
2345 # @param theVector The translation vector.
2346 # @return New GEOM_Object, containing the translated object.
2348 # @ref tui_translation "Example"
2349 def MakeTranslationVector(self,theObject, theVector):
2350 # Example: see GEOM_TestAll.py
2351 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
2352 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
2355 ## Translate the given object along the given vector on given distance.
2356 # @param theObject The object to be translated.
2357 # @param theVector The translation vector.
2358 # @param theDistance The translation distance.
2359 # @param theCopy Flag used to translate object itself or create a copy.
2360 # @return Translated GEOM_Object.
2362 # @ref tui_translation "Example"
2363 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy):
2364 # Example: see GEOM_TestAll.py
2365 theDistance,Parameters = ParseParameters(theDistance)
2366 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
2367 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
2368 anObj.SetParameters(Parameters)
2371 ## Translate the given object along the given vector on given distance,
2372 # creating its copy before the translation.
2373 # @param theObject The object to be translated.
2374 # @param theVector The translation vector.
2375 # @param theDistance The translation distance.
2376 # @return New GEOM_Object, containing the translated object.
2378 # @ref tui_translation "Example"
2379 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance):
2380 # Example: see GEOM_TestAll.py
2381 theDistance,Parameters = ParseParameters(theDistance)
2382 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
2383 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
2384 anObj.SetParameters(Parameters)
2387 ## Rotate the given object around the given axis on the given angle.
2388 # @param theObject The object to be rotated.
2389 # @param theAxis Rotation axis.
2390 # @param theAngle Rotation angle in radians.
2391 # @return Rotated GEOM_Object.
2393 # @ref tui_rotation "Example"
2394 def Rotate(self,theObject, theAxis, theAngle):
2395 # Example: see GEOM_TestAll.py
2397 if isinstance(theAngle,str):
2399 theAngle, Parameters = ParseParameters(theAngle)
2401 theAngle = theAngle*math.pi/180.0
2402 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
2403 RaiseIfFailed("RotateCopy", self.TrsfOp)
2404 anObj.SetParameters(Parameters)
2407 ## Rotate the given object around the given axis
2408 # on the given angle, creating its copy before the rotatation.
2409 # @param theObject The object to be rotated.
2410 # @param theAxis Rotation axis.
2411 # @param theAngle Rotation angle in radians.
2412 # @return New GEOM_Object, containing the rotated object.
2414 # @ref tui_rotation "Example"
2415 def MakeRotation(self,theObject, theAxis, theAngle):
2416 # Example: see GEOM_TestAll.py
2418 if isinstance(theAngle,str):
2420 theAngle, Parameters = ParseParameters(theAngle)
2422 theAngle = theAngle*math.pi/180.0
2423 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
2424 RaiseIfFailed("RotateCopy", self.TrsfOp)
2425 anObj.SetParameters(Parameters)
2428 ## Rotate given object around vector perpendicular to plane
2429 # containing three points, creating its copy before the rotatation.
2430 # @param theObject The object to be rotated.
2431 # @param theCentPoint central point - the axis is the vector perpendicular to the plane
2432 # containing the three points.
2433 # @param thePoint1,thePoint2 - in a perpendicular plane of the axis.
2434 # @return New GEOM_Object, containing the rotated object.
2436 # @ref tui_rotation "Example"
2437 def MakeRotationThreePoints(self,theObject, theCentPoint, thePoint1, thePoint2):
2438 # Example: see GEOM_TestAll.py
2439 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
2440 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
2443 ## Scale the given object by the factor, creating its copy before the scaling.
2444 # @param theObject The object to be scaled.
2445 # @param thePoint Center point for scaling.
2446 # Passing None for it means scaling relatively the origin of global CS.
2447 # @param theFactor Scaling factor value.
2448 # @return New GEOM_Object, containing the scaled shape.
2450 # @ref tui_scale "Example"
2451 def MakeScaleTransform(self, theObject, thePoint, theFactor):
2452 # Example: see GEOM_TestAll.py
2453 theFactor, Parameters = ParseParameters(theFactor)
2454 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
2455 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
2456 anObj.SetParameters(Parameters)
2459 ## Scale the given object by different factors along coordinate axes,
2460 # creating its copy before the scaling.
2461 # @param theObject The object to be scaled.
2462 # @param thePoint Center point for scaling.
2463 # Passing None for it means scaling relatively the origin of global CS.
2464 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
2465 # @return New GEOM_Object, containing the scaled shape.
2467 # @ref swig_scale "Example"
2468 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ):
2469 # Example: see GEOM_TestAll.py
2470 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
2471 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
2472 theFactorX, theFactorY, theFactorZ)
2473 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
2474 anObj.SetParameters(Parameters)
2477 ## Create an object, symmetrical
2478 # to the given one relatively the given plane.
2479 # @param theObject The object to be mirrored.
2480 # @param thePlane Plane of symmetry.
2481 # @return New GEOM_Object, containing the mirrored shape.
2483 # @ref tui_mirror "Example"
2484 def MakeMirrorByPlane(self,theObject, thePlane):
2485 # Example: see GEOM_TestAll.py
2486 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
2487 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
2490 ## Create an object, symmetrical
2491 # to the given one relatively the given axis.
2492 # @param theObject The object to be mirrored.
2493 # @param theAxis Axis of symmetry.
2494 # @return New GEOM_Object, containing the mirrored shape.
2496 # @ref tui_mirror "Example"
2497 def MakeMirrorByAxis(self,theObject, theAxis):
2498 # Example: see GEOM_TestAll.py
2499 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
2500 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
2503 ## Create an object, symmetrical
2504 # to the given one relatively the given point.
2505 # @param theObject The object to be mirrored.
2506 # @param thePoint Point of symmetry.
2507 # @return New GEOM_Object, containing the mirrored shape.
2509 # @ref tui_mirror "Example"
2510 def MakeMirrorByPoint(self,theObject, thePoint):
2511 # Example: see GEOM_TestAll.py
2512 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
2513 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
2516 ## Modify the Location of the given object by LCS,
2517 # creating its copy before the setting.
2518 # @param theObject The object to be displaced.
2519 # @param theStartLCS Coordinate system to perform displacement from it.
2520 # If \a theStartLCS is NULL, displacement
2521 # will be performed from global CS.
2522 # If \a theObject itself is used as \a theStartLCS,
2523 # its location will be changed to \a theEndLCS.
2524 # @param theEndLCS Coordinate system to perform displacement to it.
2525 # @return New GEOM_Object, containing the displaced shape.
2527 # @ref tui_modify_location "Example"
2528 def MakePosition(self,theObject, theStartLCS, theEndLCS):
2529 # Example: see GEOM_TestAll.py
2530 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
2531 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
2534 ## Modify the Location of the given object by Path,
2535 # @param theObject The object to be displaced.
2536 # @param thePath Wire or Edge along that the object will be translated.
2537 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
2538 # @param theCopy is to create a copy objects if true.
2539 # @param theReverse - 0 for usual direction, 1 to reverse path direction.
2540 # @return New GEOM_Object, containing the displaced shape.
2542 # @ref tui_modify_location "Example"
2543 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
2544 # Example: see GEOM_TestAll.py
2545 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
2546 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
2549 ## Create new object as offset of the given one.
2550 # @param theObject The base object for the offset.
2551 # @param theOffset Offset value.
2552 # @return New GEOM_Object, containing the offset object.
2554 # @ref tui_offset "Example"
2555 def MakeOffset(self,theObject, theOffset):
2556 # Example: see GEOM_TestAll.py
2557 theOffset, Parameters = ParseParameters(theOffset)
2558 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
2559 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
2560 anObj.SetParameters(Parameters)
2563 # -----------------------------------------------------------------------------
2565 # -----------------------------------------------------------------------------
2567 ## Translate the given object along the given vector a given number times
2568 # @param theObject The object to be translated.
2569 # @param theVector Direction of the translation.
2570 # @param theStep Distance to translate on.
2571 # @param theNbTimes Quantity of translations to be done.
2572 # @return New GEOM_Object, containing compound of all
2573 # the shapes, obtained after each translation.
2575 # @ref tui_multi_translation "Example"
2576 def MakeMultiTranslation1D(self,theObject, theVector, theStep, theNbTimes):
2577 # Example: see GEOM_TestAll.py
2578 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
2579 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
2580 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
2581 anObj.SetParameters(Parameters)
2584 ## Conseqently apply two specified translations to theObject specified number of times.
2585 # @param theObject The object to be translated.
2586 # @param theVector1 Direction of the first translation.
2587 # @param theStep1 Step of the first translation.
2588 # @param theNbTimes1 Quantity of translations to be done along theVector1.
2589 # @param theVector2 Direction of the second translation.
2590 # @param theStep2 Step of the second translation.
2591 # @param theNbTimes2 Quantity of translations to be done along theVector2.
2592 # @return New GEOM_Object, containing compound of all
2593 # the shapes, obtained after each translation.
2595 # @ref tui_multi_translation "Example"
2596 def MakeMultiTranslation2D(self,theObject, theVector1, theStep1, theNbTimes1,
2597 theVector2, theStep2, theNbTimes2):
2598 # Example: see GEOM_TestAll.py
2599 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
2600 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
2601 theVector2, theStep2, theNbTimes2)
2602 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
2603 anObj.SetParameters(Parameters)
2606 ## Rotate the given object around the given axis a given number times.
2607 # Rotation angle will be 2*PI/theNbTimes.
2608 # @param theObject The object to be rotated.
2609 # @param theAxis The rotation axis.
2610 # @param theNbTimes Quantity of rotations to be done.
2611 # @return New GEOM_Object, containing compound of all the
2612 # shapes, obtained after each rotation.
2614 # @ref tui_multi_rotation "Example"
2615 def MultiRotate1D(self,theObject, theAxis, theNbTimes):
2616 # Example: see GEOM_TestAll.py
2617 theAxis, theNbTimes, Parameters = ParseParameters(theAxis, theNbTimes)
2618 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
2619 RaiseIfFailed("MultiRotate1D", self.TrsfOp)
2620 anObj.SetParameters(Parameters)
2623 ## Rotate the given object around the
2624 # given axis on the given angle a given number
2625 # times and multi-translate each rotation result.
2626 # Translation direction passes through center of gravity
2627 # of rotated shape and its projection on the rotation axis.
2628 # @param theObject The object to be rotated.
2629 # @param theAxis Rotation axis.
2630 # @param theAngle Rotation angle in graduces.
2631 # @param theNbTimes1 Quantity of rotations to be done.
2632 # @param theStep Translation distance.
2633 # @param theNbTimes2 Quantity of translations to be done.
2634 # @return New GEOM_Object, containing compound of all the
2635 # shapes, obtained after each transformation.
2637 # @ref tui_multi_rotation "Example"
2638 def MultiRotate2D(self,theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2):
2639 # Example: see GEOM_TestAll.py
2640 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
2641 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
2642 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
2643 anObj.SetParameters(Parameters)
2646 ## The same, as MultiRotate1D(), but axis is given by direction and point
2647 # @ref swig_MakeMultiRotation "Example"
2648 def MakeMultiRotation1D(self,aShape,aDir,aPoint,aNbTimes):
2649 # Example: see GEOM_TestOthers.py
2650 aVec = self.MakeLine(aPoint,aDir)
2651 anObj = self.MultiRotate1D(aShape,aVec,aNbTimes)
2654 ## The same, as MultiRotate2D(), but axis is given by direction and point
2655 # @ref swig_MakeMultiRotation "Example"
2656 def MakeMultiRotation2D(self,aShape,aDir,aPoint,anAngle,nbtimes1,aStep,nbtimes2):
2657 # Example: see GEOM_TestOthers.py
2658 aVec = self.MakeLine(aPoint,aDir)
2659 anObj = self.MultiRotate2D(aShape,aVec,anAngle,nbtimes1,aStep,nbtimes2)
2662 # end of l3_transform
2665 ## @addtogroup l3_local
2668 ## Perform a fillet on all edges of the given shape.
2669 # @param theShape Shape, to perform fillet on.
2670 # @param theR Fillet radius.
2671 # @return New GEOM_Object, containing the result shape.
2673 # @ref tui_fillet "Example 1"
2674 # \n @ref swig_MakeFilletAll "Example 2"
2675 def MakeFilletAll(self,theShape, theR):
2676 # Example: see GEOM_TestOthers.py
2677 theR,Parameters = ParseParameters(theR)
2678 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
2679 RaiseIfFailed("MakeFilletAll", self.LocalOp)
2680 anObj.SetParameters(Parameters)
2683 ## Perform a fillet on the specified edges/faces of the given shape
2684 # @param theShape Shape, to perform fillet on.
2685 # @param theR Fillet radius.
2686 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR>.
2687 # @param theListShapes Global indices of edges/faces to perform fillet on.
2688 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2689 # @return New GEOM_Object, containing the result shape.
2691 # @ref tui_fillet "Example"
2692 def MakeFillet(self,theShape, theR, theShapeType, theListShapes):
2693 # Example: see GEOM_TestAll.py
2694 theR,Parameters = ParseParameters(theR)
2696 if theShapeType == ShapeType["EDGE"]:
2697 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
2698 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
2700 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
2701 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
2702 anObj.SetParameters(Parameters)
2705 ## The same that MakeFillet but with two Fillet Radius R1 and R2
2706 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes):
2707 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
2709 if theShapeType == ShapeType["EDGE"]:
2710 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
2711 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
2713 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
2714 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
2715 anObj.SetParameters(Parameters)
2718 ## Perform a fillet on the specified edges/faces of the given shape
2719 # @param theShape - Face Shape to perform fillet on.
2720 # @param theR - Fillet radius.
2721 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
2722 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2723 # @return New GEOM_Object, containing the result shape.
2725 # @ref tui_fillet2d "Example"
2726 def MakeFillet2D(self,theShape, theR, theListOfVertexes):
2727 # Example: see GEOM_TestAll.py
2728 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
2729 RaiseIfFailed("MakeFillet2D", self.LocalOp)
2732 ## Perform a symmetric chamfer on all edges of the given shape.
2733 # @param theShape Shape, to perform chamfer on.
2734 # @param theD Chamfer size along each face.
2735 # @return New GEOM_Object, containing the result shape.
2737 # @ref tui_chamfer "Example 1"
2738 # \n @ref swig_MakeChamferAll "Example 2"
2739 def MakeChamferAll(self,theShape, theD):
2740 # Example: see GEOM_TestOthers.py
2741 theD,Parameters = ParseParameters(theD)
2742 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
2743 RaiseIfFailed("MakeChamferAll", self.LocalOp)
2744 anObj.SetParameters(Parameters)
2747 ## Perform a chamfer on edges, common to the specified faces,
2748 # with distance D1 on the Face1
2749 # @param theShape Shape, to perform chamfer on.
2750 # @param theD1 Chamfer size along \a theFace1.
2751 # @param theD2 Chamfer size along \a theFace2.
2752 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
2753 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2754 # @return New GEOM_Object, containing the result shape.
2756 # @ref tui_chamfer "Example"
2757 def MakeChamferEdge(self,theShape, theD1, theD2, theFace1, theFace2):
2758 # Example: see GEOM_TestAll.py
2759 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
2760 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
2761 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
2762 anObj.SetParameters(Parameters)
2765 ## The Same that MakeChamferEdge but with params theD is chamfer length and
2766 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
2767 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2):
2769 if isinstance(theAngle,str):
2771 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
2773 theAngle = theAngle*math.pi/180.0
2774 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
2775 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
2776 anObj.SetParameters(Parameters)
2779 ## Perform a chamfer on all edges of the specified faces,
2780 # with distance D1 on the first specified face (if several for one edge)
2781 # @param theShape Shape, to perform chamfer on.
2782 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
2783 # connected to the edge, are in \a theFaces, \a theD1
2784 # will be get along face, which is nearer to \a theFaces beginning.
2785 # @param theD2 Chamfer size along another of two faces, connected to the edge.
2786 # @param theFaces Sequence of global indices of faces of \a theShape.
2787 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2788 # @return New GEOM_Object, containing the result shape.
2790 # @ref tui_chamfer "Example"
2791 def MakeChamferFaces(self,theShape, theD1, theD2, theFaces):
2792 # Example: see GEOM_TestAll.py
2793 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
2794 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
2795 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
2796 anObj.SetParameters(Parameters)
2799 ## The Same that MakeChamferFaces but with params theD is chamfer lenght and
2800 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
2802 # @ref swig_FilletChamfer "Example"
2803 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces):
2805 if isinstance(theAngle,str):
2807 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
2809 theAngle = theAngle*math.pi/180.0
2810 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
2811 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
2812 anObj.SetParameters(Parameters)
2815 ## Perform a chamfer on edges,
2816 # with distance D1 on the first specified face (if several for one edge)
2817 # @param theShape Shape, to perform chamfer on.
2818 # @param theD1,theD2 Chamfer size
2819 # @param theEdges Sequence of edges of \a theShape.
2820 # @return New GEOM_Object, containing the result shape.
2822 # @ref swig_FilletChamfer "Example"
2823 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges):
2824 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
2825 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
2826 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
2827 anObj.SetParameters(Parameters)
2830 ## The Same that MakeChamferEdges but with params theD is chamfer lenght and
2831 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
2832 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges):
2834 if isinstance(theAngle,str):
2836 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
2838 theAngle = theAngle*math.pi/180.0
2839 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
2840 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
2841 anObj.SetParameters(Parameters)
2844 ## Shortcut to MakeChamferEdge() and MakeChamferFaces()
2846 # @ref swig_MakeChamfer "Example"
2847 def MakeChamfer(self,aShape,d1,d2,aShapeType,ListShape):
2848 # Example: see GEOM_TestOthers.py
2850 if aShapeType == ShapeType["EDGE"]:
2851 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1])
2853 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape)
2859 ## @addtogroup l3_basic_op
2862 ## Perform an Archimde operation on the given shape with given parameters.
2863 # The object presenting the resulting face is returned.
2864 # @param theShape Shape to be put in water.
2865 # @param theWeight Weight og the shape.
2866 # @param theWaterDensity Density of the water.
2867 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
2868 # @return New GEOM_Object, containing a section of \a theShape
2869 # by a plane, corresponding to water level.
2871 # @ref tui_archimede "Example"
2872 def Archimede(self,theShape, theWeight, theWaterDensity, theMeshDeflection):
2873 # Example: see GEOM_TestAll.py
2874 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
2875 theWeight,theWaterDensity,theMeshDeflection)
2876 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
2877 RaiseIfFailed("MakeArchimede", self.LocalOp)
2878 anObj.SetParameters(Parameters)
2881 # end of l3_basic_op
2884 ## @addtogroup l2_measure
2887 ## Get point coordinates
2890 # @ref tui_measurement_tools_page "Example"
2891 def PointCoordinates(self,Point):
2892 # Example: see GEOM_TestMeasures.py
2893 aTuple = self.MeasuOp.PointCoordinates(Point)
2894 RaiseIfFailed("PointCoordinates", self.MeasuOp)
2897 ## Get summarized length of all wires,
2898 # area of surface and volume of the given shape.
2899 # @param theShape Shape to define properties of.
2900 # @return [theLength, theSurfArea, theVolume]
2901 # theLength: Summarized length of all wires of the given shape.
2902 # theSurfArea: Area of surface of the given shape.
2903 # theVolume: Volume of the given shape.
2905 # @ref tui_measurement_tools_page "Example"
2906 def BasicProperties(self,theShape):
2907 # Example: see GEOM_TestMeasures.py
2908 aTuple = self.MeasuOp.GetBasicProperties(theShape)
2909 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
2912 ## Get parameters of bounding box of the given shape
2913 # @param theShape Shape to obtain bounding box of.
2914 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
2915 # Xmin,Xmax: Limits of shape along OX axis.
2916 # Ymin,Ymax: Limits of shape along OY axis.
2917 # Zmin,Zmax: Limits of shape along OZ axis.
2919 # @ref tui_measurement_tools_page "Example"
2920 def BoundingBox(self,theShape):
2921 # Example: see GEOM_TestMeasures.py
2922 aTuple = self.MeasuOp.GetBoundingBox(theShape)
2923 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
2926 ## Get inertia matrix and moments of inertia of theShape.
2927 # @param theShape Shape to calculate inertia of.
2928 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
2929 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
2930 # Ix,Iy,Iz: Moments of inertia of the given shape.
2932 # @ref tui_measurement_tools_page "Example"
2933 def Inertia(self,theShape):
2934 # Example: see GEOM_TestMeasures.py
2935 aTuple = self.MeasuOp.GetInertia(theShape)
2936 RaiseIfFailed("GetInertia", self.MeasuOp)
2939 ## Get minimal distance between the given shapes.
2940 # @param theShape1,theShape2 Shapes to find minimal distance between.
2941 # @return Value of the minimal distance between the given shapes.
2943 # @ref tui_measurement_tools_page "Example"
2944 def MinDistance(self, theShape1, theShape2):
2945 # Example: see GEOM_TestMeasures.py
2946 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
2947 RaiseIfFailed("GetMinDistance", self.MeasuOp)
2950 ## Get minimal distance between the given shapes.
2951 # @param theShape1,theShape2 Shapes to find minimal distance between.
2952 # @return Value of the minimal distance between the given shapes.
2954 # @ref swig_all_measure "Example"
2955 def MinDistanceComponents(self, theShape1, theShape2):
2956 # Example: see GEOM_TestMeasures.py
2957 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
2958 RaiseIfFailed("GetMinDistance", self.MeasuOp)
2959 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
2962 ## Get angle between the given shapes in degrees.
2963 # @param theShape1,theShape2 Lines or linear edges to find angle between.
2964 # @return Value of the angle between the given shapes in degrees.
2966 # @ref tui_measurement_tools_page "Example"
2967 def GetAngle(self, theShape1, theShape2):
2968 # Example: see GEOM_TestMeasures.py
2969 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
2970 RaiseIfFailed("GetAngle", self.MeasuOp)
2972 ## Get angle between the given shapes in radians.
2973 # @param theShape1,theShape2 Lines or linear edges to find angle between.
2974 # @return Value of the angle between the given shapes in radians.
2976 # @ref tui_measurement_tools_page "Example"
2977 def GetAngleRadians(self, theShape1, theShape2):
2978 # Example: see GEOM_TestMeasures.py
2979 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
2980 RaiseIfFailed("GetAngle", self.MeasuOp)
2983 ## @name Curve Curvature Measurement
2984 # Methods for receiving radius of curvature of curves
2985 # in the given point
2988 ## Measure curvature of a curve at a point, set by parameter.
2989 # @ref swig_todo "Example"
2990 def CurveCurvatureByParam(self, theCurve, theParam):
2991 # Example: see GEOM_TestMeasures.py
2992 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
2993 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
2997 # @ref swig_todo "Example"
2998 def CurveCurvatureByPoint(self, theCurve, thePoint):
2999 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
3000 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
3004 ## @name Surface Curvature Measurement
3005 # Methods for receiving max and min radius of curvature of surfaces
3006 # in the given point
3010 ## @ref swig_todo "Example"
3011 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
3012 # Example: see GEOM_TestMeasures.py
3013 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
3014 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
3018 ## @ref swig_todo "Example"
3019 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
3020 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
3021 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
3025 ## @ref swig_todo "Example"
3026 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
3027 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
3028 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
3032 ## @ref swig_todo "Example"
3033 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
3034 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
3035 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
3039 ## Get min and max tolerances of sub-shapes of theShape
3040 # @param theShape Shape, to get tolerances of.
3041 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
3042 # FaceMin,FaceMax: Min and max tolerances of the faces.
3043 # EdgeMin,EdgeMax: Min and max tolerances of the edges.
3044 # VertMin,VertMax: Min and max tolerances of the vertices.
3046 # @ref tui_measurement_tools_page "Example"
3047 def Tolerance(self,theShape):
3048 # Example: see GEOM_TestMeasures.py
3049 aTuple = self.MeasuOp.GetTolerance(theShape)
3050 RaiseIfFailed("GetTolerance", self.MeasuOp)
3053 ## Obtain description of the given shape (number of sub-shapes of each type)
3054 # @param theShape Shape to be described.
3055 # @return Description of the given shape.
3057 # @ref tui_measurement_tools_page "Example"
3058 def WhatIs(self,theShape):
3059 # Example: see GEOM_TestMeasures.py
3060 aDescr = self.MeasuOp.WhatIs(theShape)
3061 RaiseIfFailed("WhatIs", self.MeasuOp)
3064 ## Get a point, situated at the centre of mass of theShape.
3065 # @param theShape Shape to define centre of mass of.
3066 # @return New GEOM_Object, containing the created point.
3068 # @ref tui_measurement_tools_page "Example"
3069 def MakeCDG(self,theShape):
3070 # Example: see GEOM_TestMeasures.py
3071 anObj = self.MeasuOp.GetCentreOfMass(theShape)
3072 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
3075 ## Get a normale to the given face. If the point is not given,
3076 # the normale is calculated at the center of mass.
3077 # @param theFace Face to define normale of.
3078 # @param theOptionalPoint Point to compute the normale at.
3079 # @return New GEOM_Object, containing the created vector.
3081 # @ref swig_todo "Example"
3082 def GetNormal(self, theFace, theOptionalPoint = None):
3083 # Example: see GEOM_TestMeasures.py
3084 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
3085 RaiseIfFailed("GetNormal", self.MeasuOp)
3088 ## Check a topology of the given shape.
3089 # @param theShape Shape to check validity of.
3090 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked,
3091 # if TRUE, the shape's geometry will be checked also.
3092 # @return TRUE, if the shape "seems to be valid".
3093 # If theShape is invalid, prints a description of problem.
3095 # @ref tui_measurement_tools_page "Example"
3096 def CheckShape(self,theShape, theIsCheckGeom = 0):
3097 # Example: see GEOM_TestMeasures.py
3099 (IsValid, Status) = self.MeasuOp.CheckShapeWithGeometry(theShape)
3100 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
3102 (IsValid, Status) = self.MeasuOp.CheckShape(theShape)
3103 RaiseIfFailed("CheckShape", self.MeasuOp)
3108 ## Get position (LCS) of theShape.
3110 # Origin of the LCS is situated at the shape's center of mass.
3111 # Axes of the LCS are obtained from shape's location or,
3112 # if the shape is a planar face, from position of its plane.
3114 # @param theShape Shape to calculate position of.
3115 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
3116 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
3117 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
3118 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
3120 # @ref swig_todo "Example"
3121 def GetPosition(self,theShape):
3122 # Example: see GEOM_TestMeasures.py
3123 aTuple = self.MeasuOp.GetPosition(theShape)
3124 RaiseIfFailed("GetPosition", self.MeasuOp)
3127 ## Get kind of theShape.
3129 # @param theShape Shape to get a kind of.
3130 # @return Returns a kind of shape in terms of <VAR>GEOM_IKindOfShape.shape_kind</VAR> enumeration
3131 # and a list of parameters, describing the shape.
3132 # @note Concrete meaning of each value, returned via \a theIntegers
3133 # or \a theDoubles list depends on the kind of the shape.
3134 # The full list of possible outputs is:
3136 # - geompy.kind.COMPOUND nb_solids nb_faces nb_edges nb_vertices
3137 # - geompy.kind.COMPSOLID nb_solids nb_faces nb_edges nb_vertices
3139 # - geompy.kind.SHELL geompy.info.CLOSED nb_faces nb_edges nb_vertices
3140 # - geompy.kind.SHELL geompy.info.UNCLOSED nb_faces nb_edges nb_vertices
3142 # - geompy.kind.WIRE geompy.info.CLOSED nb_edges nb_vertices
3143 # - geompy.kind.WIRE geompy.info.UNCLOSED nb_edges nb_vertices
3145 # - geompy.kind.SPHERE xc yc zc R
3146 # - geompy.kind.CYLINDER xb yb zb dx dy dz R H
3147 # - geompy.kind.BOX xc yc zc ax ay az
3148 # - geompy.kind.ROTATED_BOX xc yc zc zx zy zz xx xy xz ax ay az
3149 # - geompy.kind.TORUS xc yc zc dx dy dz R_1 R_2
3150 # - geompy.kind.CONE xb yb zb dx dy dz R_1 R_2 H
3151 # - geompy.kind.POLYHEDRON nb_faces nb_edges nb_vertices
3152 # - geompy.kind.SOLID nb_faces nb_edges nb_vertices
3154 # - geompy.kind.SPHERE2D xc yc zc R
3155 # - geompy.kind.CYLINDER2D xb yb zb dx dy dz R H
3156 # - geompy.kind.TORUS2D xc yc zc dx dy dz R_1 R_2
3157 # - geompy.kind.CONE2D xc yc zc dx dy dz R_1 R_2 H
3158 # - geompy.kind.DISK_CIRCLE xc yc zc dx dy dz R
3159 # - geompy.kind.DISK_ELLIPSE xc yc zc dx dy dz R_1 R_2
3160 # - geompy.kind.POLYGON xo yo zo dx dy dz nb_edges nb_vertices
3161 # - geompy.kind.PLANE xo yo zo dx dy dz
3162 # - geompy.kind.PLANAR xo yo zo dx dy dz nb_edges nb_vertices
3163 # - geompy.kind.FACE nb_edges nb_vertices
3165 # - geompy.kind.CIRCLE xc yc zc dx dy dz R
3166 # - geompy.kind.ARC_CIRCLE xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2
3167 # - geompy.kind.ELLIPSE xc yc zc dx dy dz R_1 R_2
3168 # - geompy.kind.ARC_ELLIPSE xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2
3169 # - geompy.kind.LINE xo yo zo dx dy dz
3170 # - geompy.kind.SEGMENT x1 y1 z1 x2 y2 z2
3171 # - geompy.kind.EDGE nb_vertices
3173 # - geompy.kind.VERTEX x y z
3175 # @ref swig_todo "Example"
3176 def KindOfShape(self,theShape):
3177 # Example: see GEOM_TestMeasures.py
3178 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
3179 RaiseIfFailed("KindOfShape", self.MeasuOp)
3181 aKind = aRoughTuple[0]
3182 anInts = aRoughTuple[1]
3183 aDbls = aRoughTuple[2]
3185 # Now there is no exception from this rule:
3186 aKindTuple = [aKind] + aDbls + anInts
3188 # If they are we will regroup parameters for such kind of shape.
3190 #if aKind == kind.SOME_KIND:
3191 # # SOME_KIND int int double int double double
3192 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
3199 ## @addtogroup l2_import_export
3202 ## Import a shape from the BREP or IGES or STEP file
3203 # (depends on given format) with given name.
3204 # @param theFileName The file, containing the shape.
3205 # @param theFormatName Specify format for the file reading.
3206 # Available formats can be obtained with InsertOp.ImportTranslators() method.
3207 # If format 'IGES_SCALE' is used instead 'IGES' length unit will be
3208 # set to 'meter' and result model will be scaled.
3209 # @return New GEOM_Object, containing the imported shape.
3211 # @ref swig_Import_Export "Example"
3212 def Import(self,theFileName, theFormatName):
3213 # Example: see GEOM_TestOthers.py
3214 anObj = self.InsertOp.Import(theFileName, theFormatName)
3215 RaiseIfFailed("Import", self.InsertOp)
3218 ## Shortcut to Import() for BREP format
3220 # @ref swig_Import_Export "Example"
3221 def ImportBREP(self,theFileName):
3222 # Example: see GEOM_TestOthers.py
3223 return self.Import(theFileName, "BREP")
3225 ## Shortcut to Import() for IGES format
3227 # @ref swig_Import_Export "Example"
3228 def ImportIGES(self,theFileName):
3229 # Example: see GEOM_TestOthers.py
3230 return self.Import(theFileName, "IGES")
3232 ## Return length unit from given IGES file
3234 # @ref swig_Import_Export "Example"
3235 def GetIGESUnit(self,theFileName):
3236 # Example: see GEOM_TestOthers.py
3237 anObj = self.InsertOp.Import(theFileName, "IGES_UNIT")
3238 #RaiseIfFailed("Import", self.InsertOp)
3239 # recieve name using returned vertex
3241 vertices = self.SubShapeAll(anObj,ShapeType["VERTEX"])
3243 p = self.PointCoordinates(vertices[0])
3244 if abs(p[0]-0.01) < 1.e-6:
3246 elif abs(p[0]-0.001) < 1.e-6:
3250 ## Shortcut to Import() for STEP format
3252 # @ref swig_Import_Export "Example"
3253 def ImportSTEP(self,theFileName):
3254 # Example: see GEOM_TestOthers.py
3255 return self.Import(theFileName, "STEP")
3257 ## Export the given shape into a file with given name.
3258 # @param theObject Shape to be stored in the file.
3259 # @param theFileName Name of the file to store the given shape in.
3260 # @param theFormatName Specify format for the shape storage.
3261 # Available formats can be obtained with InsertOp.ImportTranslators() method.
3263 # @ref swig_Import_Export "Example"
3264 def Export(self,theObject, theFileName, theFormatName):
3265 # Example: see GEOM_TestOthers.py
3266 self.InsertOp.Export(theObject, theFileName, theFormatName)
3267 if self.InsertOp.IsDone() == 0:
3268 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
3272 ## Shortcut to Export() for BREP format
3274 # @ref swig_Import_Export "Example"
3275 def ExportBREP(self,theObject, theFileName):
3276 # Example: see GEOM_TestOthers.py
3277 return self.Export(theObject, theFileName, "BREP")
3279 ## Shortcut to Export() for IGES format
3281 # @ref swig_Import_Export "Example"
3282 def ExportIGES(self,theObject, theFileName):
3283 # Example: see GEOM_TestOthers.py
3284 return self.Export(theObject, theFileName, "IGES")
3286 ## Shortcut to Export() for STEP format
3288 # @ref swig_Import_Export "Example"
3289 def ExportSTEP(self,theObject, theFileName):
3290 # Example: see GEOM_TestOthers.py
3291 return self.Export(theObject, theFileName, "STEP")
3293 # end of l2_import_export
3296 ## @addtogroup l3_blocks
3299 ## Create a quadrangle face from four edges. Order of Edges is not
3300 # important. It is not necessary that edges share the same vertex.
3301 # @param E1,E2,E3,E4 Edges for the face bound.
3302 # @return New GEOM_Object, containing the created face.
3304 # @ref tui_building_by_blocks_page "Example"
3305 def MakeQuad(self,E1, E2, E3, E4):
3306 # Example: see GEOM_Spanner.py
3307 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
3308 RaiseIfFailed("MakeQuad", self.BlocksOp)
3311 ## Create a quadrangle face on two edges.
3312 # The missing edges will be built by creating the shortest ones.
3313 # @param E1,E2 Two opposite edges for the face.
3314 # @return New GEOM_Object, containing the created face.
3316 # @ref tui_building_by_blocks_page "Example"
3317 def MakeQuad2Edges(self,E1, E2):
3318 # Example: see GEOM_Spanner.py
3319 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
3320 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
3323 ## Create a quadrangle face with specified corners.
3324 # The missing edges will be built by creating the shortest ones.
3325 # @param V1,V2,V3,V4 Corner vertices for the face.
3326 # @return New GEOM_Object, containing the created face.
3328 # @ref tui_building_by_blocks_page "Example 1"
3329 # \n @ref swig_MakeQuad4Vertices "Example 2"
3330 def MakeQuad4Vertices(self,V1, V2, V3, V4):
3331 # Example: see GEOM_Spanner.py
3332 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
3333 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
3336 ## Create a hexahedral solid, bounded by the six given faces. Order of
3337 # faces is not important. It is not necessary that Faces share the same edge.
3338 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
3339 # @return New GEOM_Object, containing the created solid.
3341 # @ref tui_building_by_blocks_page "Example 1"
3342 # \n @ref swig_MakeHexa "Example 2"
3343 def MakeHexa(self,F1, F2, F3, F4, F5, F6):
3344 # Example: see GEOM_Spanner.py
3345 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
3346 RaiseIfFailed("MakeHexa", self.BlocksOp)
3349 ## Create a hexahedral solid between two given faces.
3350 # The missing faces will be built by creating the smallest ones.
3351 # @param F1,F2 Two opposite faces for the hexahedral solid.
3352 # @return New GEOM_Object, containing the created solid.
3354 # @ref tui_building_by_blocks_page "Example 1"
3355 # \n @ref swig_MakeHexa2Faces "Example 2"
3356 def MakeHexa2Faces(self,F1, F2):
3357 # Example: see GEOM_Spanner.py
3358 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
3359 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
3365 ## @addtogroup l3_blocks_op
3368 ## Get a vertex, found in the given shape by its coordinates.
3369 # @param theShape Block or a compound of blocks.
3370 # @param theX,theY,theZ Coordinates of the sought vertex.
3371 # @param theEpsilon Maximum allowed distance between the resulting
3372 # vertex and point with the given coordinates.
3373 # @return New GEOM_Object, containing the found vertex.
3375 # @ref swig_GetPoint "Example"
3376 def GetPoint(self,theShape, theX, theY, theZ, theEpsilon):
3377 # Example: see GEOM_TestOthers.py
3378 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
3379 RaiseIfFailed("GetPoint", self.BlocksOp)
3382 ## Get an edge, found in the given shape by two given vertices.
3383 # @param theShape Block or a compound of blocks.
3384 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
3385 # @return New GEOM_Object, containing the found edge.
3387 # @ref swig_todo "Example"
3388 def GetEdge(self,theShape, thePoint1, thePoint2):
3389 # Example: see GEOM_Spanner.py
3390 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
3391 RaiseIfFailed("GetEdge", self.BlocksOp)
3394 ## Find an edge of the given shape, which has minimal distance to the given point.
3395 # @param theShape Block or a compound of blocks.
3396 # @param thePoint Point, close to the desired edge.
3397 # @return New GEOM_Object, containing the found edge.
3399 # @ref swig_GetEdgeNearPoint "Example"
3400 def GetEdgeNearPoint(self,theShape, thePoint):
3401 # Example: see GEOM_TestOthers.py
3402 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
3403 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
3406 ## Returns a face, found in the given shape by four given corner vertices.
3407 # @param theShape Block or a compound of blocks.
3408 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
3409 # @return New GEOM_Object, containing the found face.
3411 # @ref swig_todo "Example"
3412 def GetFaceByPoints(self,theShape, thePoint1, thePoint2, thePoint3, thePoint4):
3413 # Example: see GEOM_Spanner.py
3414 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
3415 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
3418 ## Get a face of block, found in the given shape by two given edges.
3419 # @param theShape Block or a compound of blocks.
3420 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
3421 # @return New GEOM_Object, containing the found face.
3423 # @ref swig_todo "Example"
3424 def GetFaceByEdges(self,theShape, theEdge1, theEdge2):
3425 # Example: see GEOM_Spanner.py
3426 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
3427 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
3430 ## Find a face, opposite to the given one in the given block.
3431 # @param theBlock Must be a hexahedral solid.
3432 # @param theFace Face of \a theBlock, opposite to the desired face.
3433 # @return New GEOM_Object, containing the found face.
3435 # @ref swig_GetOppositeFace "Example"
3436 def GetOppositeFace(self,theBlock, theFace):
3437 # Example: see GEOM_Spanner.py
3438 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
3439 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
3442 ## Find a face of the given shape, which has minimal distance to the given point.
3443 # @param theShape Block or a compound of blocks.
3444 # @param thePoint Point, close to the desired face.
3445 # @return New GEOM_Object, containing the found face.
3447 # @ref swig_GetFaceNearPoint "Example"
3448 def GetFaceNearPoint(self,theShape, thePoint):
3449 # Example: see GEOM_Spanner.py
3450 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
3451 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
3454 ## Find a face of block, whose outside normale has minimal angle with the given vector.
3455 # @param theBlock Block or a compound of blocks.
3456 # @param theVector Vector, close to the normale of the desired face.
3457 # @return New GEOM_Object, containing the found face.
3459 # @ref swig_todo "Example"
3460 def GetFaceByNormale(self, theBlock, theVector):
3461 # Example: see GEOM_Spanner.py
3462 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
3463 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
3466 # end of l3_blocks_op
3469 ## @addtogroup l4_blocks_measure
3472 ## Check, if the compound of blocks is given.
3473 # To be considered as a compound of blocks, the
3474 # given shape must satisfy the following conditions:
3475 # - Each element of the compound should be a Block (6 faces and 12 edges).
3476 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
3477 # - The compound should be connexe.
3478 # - The glue between two quadrangle faces should be applied.
3479 # @param theCompound The compound to check.
3480 # @return TRUE, if the given shape is a compound of blocks.
3481 # If theCompound is not valid, prints all discovered errors.
3483 # @ref tui_measurement_tools_page "Example 1"
3484 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
3485 def CheckCompoundOfBlocks(self,theCompound):
3486 # Example: see GEOM_Spanner.py
3487 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
3488 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
3490 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
3494 ## Remove all seam and degenerated edges from \a theShape.
3495 # Unite faces and edges, sharing one surface. It means that
3496 # this faces must have references to one C++ surface object (handle).
3497 # @param theShape The compound or single solid to remove irregular edges from.
3498 # @param theOptimumNbFaces If more than zero, unite faces only for those solids,
3499 # that have more than theOptimumNbFaces faces. If zero, unite faces always,
3500 # regardsless their quantity in the solid. If negative (the default value),
3501 # do not unite faces at all. For blocks repairing recommended value is 6.
3502 # @return Improved shape.
3504 # @ref swig_RemoveExtraEdges "Example"
3505 def RemoveExtraEdges(self,theShape,theOptimumNbFaces=-1):
3506 # Example: see GEOM_TestOthers.py
3507 anObj = self.BlocksOp.RemoveExtraEdges(theShape,theOptimumNbFaces)
3508 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
3511 ## Check, if the given shape is a blocks compound.
3512 # Fix all detected errors.
3513 # \note Single block can be also fixed by this method.
3514 # @param theShape The compound to check and improve.
3515 # @return Improved compound.
3517 # @ref swig_CheckAndImprove "Example"
3518 def CheckAndImprove(self,theShape):
3519 # Example: see GEOM_TestOthers.py
3520 anObj = self.BlocksOp.CheckAndImprove(theShape)
3521 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
3524 # end of l4_blocks_measure
3527 ## @addtogroup l3_blocks_op
3530 ## Get all the blocks, contained in the given compound.
3531 # @param theCompound The compound to explode.
3532 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
3533 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
3534 # \note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
3535 # @return List of GEOM_Objects, containing the retrieved blocks.
3537 # @ref tui_explode_on_blocks "Example 1"
3538 # \n @ref swig_MakeBlockExplode "Example 2"
3539 def MakeBlockExplode(self,theCompound, theMinNbFaces, theMaxNbFaces):
3540 # Example: see GEOM_TestOthers.py
3541 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
3542 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
3543 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
3545 anObj.SetParameters(Parameters)
3549 ## Find block, containing the given point inside its volume or on boundary.
3550 # @param theCompound Compound, to find block in.
3551 # @param thePoint Point, close to the desired block. If the point lays on
3552 # boundary between some blocks, we return block with nearest center.
3553 # @return New GEOM_Object, containing the found block.
3555 # @ref swig_todo "Example"
3556 def GetBlockNearPoint(self,theCompound, thePoint):
3557 # Example: see GEOM_Spanner.py
3558 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
3559 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
3562 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
3563 # @param theCompound Compound, to find block in.
3564 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
3565 # @return New GEOM_Object, containing the found block.
3567 # @ref swig_GetBlockByParts "Example"
3568 def GetBlockByParts(self,theCompound, theParts):
3569 # Example: see GEOM_TestOthers.py
3570 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
3571 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
3574 ## Return all blocks, containing all the elements, passed as the parts.
3575 # @param theCompound Compound, to find blocks in.
3576 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
3577 # @return List of GEOM_Objects, containing the found blocks.
3579 # @ref swig_todo "Example"
3580 def GetBlocksByParts(self,theCompound, theParts):
3581 # Example: see GEOM_Spanner.py
3582 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
3583 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
3586 ## Multi-transformate block and glue the result.
3587 # Transformation is defined so, as to superpose direction faces.
3588 # @param Block Hexahedral solid to be multi-transformed.
3589 # @param DirFace1 ID of First direction face.
3590 # @param DirFace2 ID of Second direction face.
3591 # @param NbTimes Quantity of transformations to be done.
3592 # \note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
3593 # @return New GEOM_Object, containing the result shape.
3595 # @ref tui_multi_transformation "Example"
3596 def MakeMultiTransformation1D(self,Block, DirFace1, DirFace2, NbTimes):
3597 # Example: see GEOM_Spanner.py
3598 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
3599 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
3600 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
3601 anObj.SetParameters(Parameters)
3604 ## Multi-transformate block and glue the result.
3605 # @param Block Hexahedral solid to be multi-transformed.
3606 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
3607 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
3608 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
3609 # @return New GEOM_Object, containing the result shape.
3611 # @ref tui_multi_transformation "Example"
3612 def MakeMultiTransformation2D(self,Block, DirFace1U, DirFace2U, NbTimesU,
3613 DirFace1V, DirFace2V, NbTimesV):
3614 # Example: see GEOM_Spanner.py
3615 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
3616 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
3617 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
3618 DirFace1V, DirFace2V, NbTimesV)
3619 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
3620 anObj.SetParameters(Parameters)
3623 ## Build all possible propagation groups.
3624 # Propagation group is a set of all edges, opposite to one (main)
3625 # edge of this group directly or through other opposite edges.
3626 # Notion of Opposite Edge make sence only on quadrangle face.
3627 # @param theShape Shape to build propagation groups on.
3628 # @return List of GEOM_Objects, each of them is a propagation group.
3630 # @ref swig_Propagate "Example"
3631 def Propagate(self,theShape):
3632 # Example: see GEOM_TestOthers.py
3633 listChains = self.BlocksOp.Propagate(theShape)
3634 RaiseIfFailed("Propagate", self.BlocksOp)
3637 # end of l3_blocks_op
3640 ## @addtogroup l3_groups
3643 ## Creates a new group which will store sub shapes of theMainShape
3644 # @param theMainShape is a GEOM object on which the group is selected
3645 # @param theShapeType defines a shape type of the group
3646 # @return a newly created GEOM group
3648 # @ref tui_working_with_groups_page "Example 1"
3649 # \n @ref swig_CreateGroup "Example 2"
3650 def CreateGroup(self,theMainShape, theShapeType):
3651 # Example: see GEOM_TestOthers.py
3652 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
3653 RaiseIfFailed("CreateGroup", self.GroupOp)
3656 ## Adds a sub object with ID theSubShapeId to the group
3657 # @param theGroup is a GEOM group to which the new sub shape is added
3658 # @param theSubShapeID is a sub shape ID in the main object.
3659 # \note Use method GetSubShapeID() to get an unique ID of the sub shape
3661 # @ref tui_working_with_groups_page "Example"
3662 def AddObject(self,theGroup, theSubShapeID):
3663 # Example: see GEOM_TestOthers.py
3664 self.GroupOp.AddObject(theGroup, theSubShapeID)
3665 RaiseIfFailed("AddObject", self.GroupOp)
3668 ## Removes a sub object with ID \a theSubShapeId from the group
3669 # @param theGroup is a GEOM group from which the new sub shape is removed
3670 # @param theSubShapeID is a sub shape ID in the main object.
3671 # \note Use method GetSubShapeID() to get an unique ID of the sub shape
3673 # @ref tui_working_with_groups_page "Example"
3674 def RemoveObject(self,theGroup, theSubShapeID):
3675 # Example: see GEOM_TestOthers.py
3676 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
3677 RaiseIfFailed("RemoveObject", self.GroupOp)
3680 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
3681 # @param theGroup is a GEOM group to which the new sub shapes are added.
3682 # @param theSubShapes is a list of sub shapes to be added.
3684 # @ref tui_working_with_groups_page "Example"
3685 def UnionList (self,theGroup, theSubShapes):
3686 # Example: see GEOM_TestOthers.py
3687 self.GroupOp.UnionList(theGroup, theSubShapes)
3688 RaiseIfFailed("UnionList", self.GroupOp)
3691 ## Works like the above method, but argument
3692 # theSubShapes here is a list of sub-shapes indices
3694 # @ref swig_UnionIDs "Example"
3695 def UnionIDs(self,theGroup, theSubShapes):
3696 # Example: see GEOM_TestOthers.py
3697 self.GroupOp.UnionIDs(theGroup, theSubShapes)
3698 RaiseIfFailed("UnionIDs", self.GroupOp)
3701 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
3702 # @param theGroup is a GEOM group from which the sub-shapes are removed.
3703 # @param theSubShapes is a list of sub-shapes to be removed.
3705 # @ref tui_working_with_groups_page "Example"
3706 def DifferenceList (self,theGroup, theSubShapes):
3707 # Example: see GEOM_TestOthers.py
3708 self.GroupOp.DifferenceList(theGroup, theSubShapes)
3709 RaiseIfFailed("DifferenceList", self.GroupOp)
3712 ## Works like the above method, but argument
3713 # theSubShapes here is a list of sub-shapes indices
3715 # @ref swig_DifferenceIDs "Example"
3716 def DifferenceIDs(self,theGroup, theSubShapes):
3717 # Example: see GEOM_TestOthers.py
3718 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
3719 RaiseIfFailed("DifferenceIDs", self.GroupOp)
3722 ## Returns a list of sub objects ID stored in the group
3723 # @param theGroup is a GEOM group for which a list of IDs is requested
3725 # @ref swig_GetObjectIDs "Example"
3726 def GetObjectIDs(self,theGroup):
3727 # Example: see GEOM_TestOthers.py
3728 ListIDs = self.GroupOp.GetObjects(theGroup)
3729 RaiseIfFailed("GetObjects", self.GroupOp)
3732 ## Returns a type of sub objects stored in the group
3733 # @param theGroup is a GEOM group which type is returned.
3735 # @ref swig_GetType "Example"
3736 def GetType(self,theGroup):
3737 # Example: see GEOM_TestOthers.py
3738 aType = self.GroupOp.GetType(theGroup)
3739 RaiseIfFailed("GetType", self.GroupOp)
3742 ## Returns a main shape associated with the group
3743 # @param theGroup is a GEOM group for which a main shape object is requested
3744 # @return a GEOM object which is a main shape for theGroup
3746 # @ref swig_GetMainShape "Example"
3747 def GetMainShape(self,theGroup):
3748 # Example: see GEOM_TestOthers.py
3749 anObj = self.GroupOp.GetMainShape(theGroup)
3750 RaiseIfFailed("GetMainShape", self.GroupOp)
3753 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
3754 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
3756 # @ref swig_todo "Example"
3757 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1):
3758 edges = self.SubShapeAll(theShape, ShapeType["EDGE"])
3761 Props = self.BasicProperties(edge)
3762 if min_length <= Props[0] and Props[0] <= max_length:
3763 if (not include_min) and (min_length == Props[0]):
3766 if (not include_max) and (Props[0] == max_length):
3769 edges_in_range.append(edge)
3771 if len(edges_in_range) <= 0:
3772 print "No edges found by given criteria"
3775 group_edges = self.CreateGroup(theShape, ShapeType["EDGE"])
3776 self.UnionList(group_edges, edges_in_range)
3780 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
3781 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
3783 # @ref swig_todo "Example"
3784 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
3785 nb_selected = sg.SelectedCount()
3787 print "Select a shape before calling this function, please."
3790 print "Only one shape must be selected"
3793 id_shape = sg.getSelected(0)
3794 shape = IDToObject( id_shape )
3796 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
3800 if include_min: left_str = " <= "
3801 if include_max: right_str = " <= "
3803 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
3804 + left_str + "length" + right_str + `max_length`)
3806 sg.updateObjBrowser(1)
3813 ## Create a copy of the given object
3814 # @ingroup l1_geompy_auxiliary
3816 # @ref swig_all_advanced "Example"
3817 def MakeCopy(self,theOriginal):
3818 # Example: see GEOM_TestAll.py
3819 anObj = self.InsertOp.MakeCopy(theOriginal)
3820 RaiseIfFailed("MakeCopy", self.InsertOp)
3823 ## Add Path to load python scripts from
3824 # @ingroup l1_geompy_auxiliary
3825 def addPath(self,Path):
3826 if (sys.path.count(Path) < 1):
3827 sys.path.append(Path)
3830 #Register the new proxy for GEOM_Gen
3831 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geompyDC)