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 list of published sub-shapes
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, corresponding to the given parameter on the given face.
408 # @param theFace The face for which tangent plane should be built.
409 # @param theParameterV vertical value of the center point (0.0 - 1.0).
410 # @param theParameterU horisontal value of the center point (0.0 - 1.0).
411 # @param theTrimSize the size of plane.
412 # @return New GEOM_Object, containing the created tangent.
414 # @ref swig_MakeTangentPlaneOnFace "Example"
415 def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize):
416 anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
417 RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
420 ## Create a vector with the given components.
421 # @param theDX X component of the vector.
422 # @param theDY Y component of the vector.
423 # @param theDZ Z component of the vector.
424 # @return New GEOM_Object, containing the created vector.
426 # @ref tui_creation_vector "Example"
427 def MakeVectorDXDYDZ(self,theDX, theDY, theDZ):
428 # Example: see GEOM_TestAll.py
429 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
430 anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
431 RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
432 anObj.SetParameters(Parameters)
435 ## Create a vector between two points.
436 # @param thePnt1 Start point for the vector.
437 # @param thePnt2 End point for the vector.
438 # @return New GEOM_Object, containing the created vector.
440 # @ref tui_creation_vector "Example"
441 def MakeVector(self,thePnt1, thePnt2):
442 # Example: see GEOM_TestAll.py
443 anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
444 RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
447 ## Create a line, passing through the given point
448 # and parrallel to the given direction
449 # @param thePnt Point. The resulting line will pass through it.
450 # @param theDir Direction. The resulting line will be parallel to it.
451 # @return New GEOM_Object, containing the created line.
453 # @ref tui_creation_line "Example"
454 def MakeLine(self,thePnt, theDir):
455 # Example: see GEOM_TestAll.py
456 anObj = self.BasicOp.MakeLine(thePnt, theDir)
457 RaiseIfFailed("MakeLine", self.BasicOp)
460 ## Create a line, passing through the given points
461 # @param thePnt1 First of two points, defining the line.
462 # @param thePnt2 Second of two points, defining the line.
463 # @return New GEOM_Object, containing the created line.
465 # @ref tui_creation_line "Example"
466 def MakeLineTwoPnt(self,thePnt1, thePnt2):
467 # Example: see GEOM_TestAll.py
468 anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
469 RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
472 ## Create a line on two faces intersection.
473 # @param theFace1 First of two faces, defining the line.
474 # @param theFace2 Second of two faces, defining the line.
475 # @return New GEOM_Object, containing the created line.
477 # @ref swig_MakeLineTwoFaces "Example"
478 def MakeLineTwoFaces(self, theFace1, theFace2):
479 # Example: see GEOM_TestAll.py
480 anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
481 RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
484 ## Create a plane, passing through the given point
485 # and normal to the given vector.
486 # @param thePnt Point, the plane has to pass through.
487 # @param theVec Vector, defining the plane normal direction.
488 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
489 # @return New GEOM_Object, containing the created plane.
491 # @ref tui_creation_plane "Example"
492 def MakePlane(self,thePnt, theVec, theTrimSize):
493 # Example: see GEOM_TestAll.py
494 theTrimSize, Parameters = ParseParameters(theTrimSize);
495 anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
496 RaiseIfFailed("MakePlanePntVec", self.BasicOp)
497 anObj.SetParameters(Parameters)
500 ## Create a plane, passing through the three given points
501 # @param thePnt1 First of three points, defining the plane.
502 # @param thePnt2 Second of three points, defining the plane.
503 # @param thePnt3 Fird of three points, defining the plane.
504 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
505 # @return New GEOM_Object, containing the created plane.
507 # @ref tui_creation_plane "Example"
508 def MakePlaneThreePnt(self,thePnt1, thePnt2, thePnt3, theTrimSize):
509 # Example: see GEOM_TestAll.py
510 theTrimSize, Parameters = ParseParameters(theTrimSize);
511 anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
512 RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
513 anObj.SetParameters(Parameters)
516 ## Create a plane, similar to the existing one, but with another size of representing face.
517 # @param theFace Referenced plane or LCS(Marker).
518 # @param theTrimSize New half size of a side of quadrangle face, representing the plane.
519 # @return New GEOM_Object, containing the created plane.
521 # @ref tui_creation_plane "Example"
522 def MakePlaneFace(self,theFace, theTrimSize):
523 # Example: see GEOM_TestAll.py
524 theTrimSize, Parameters = ParseParameters(theTrimSize);
525 anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
526 RaiseIfFailed("MakePlaneFace", self.BasicOp)
527 anObj.SetParameters(Parameters)
530 ## Create a plane, passing through the 2 vectors
531 # with center in a start point of the first vector.
532 # @param theVec1 Vector, defining center point and plane direction.
533 # @param theVec2 Vector, defining the plane normal direction.
534 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
535 # @return New GEOM_Object, containing the created plane.
537 # @ref tui_creation_plane "Example"
538 def MakePlane2Vec(self,theVec1, theVec2, theTrimSize):
539 # Example: see GEOM_TestAll.py
540 theTrimSize, Parameters = ParseParameters(theTrimSize);
541 anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
542 RaiseIfFailed("MakePlane2Vec", self.BasicOp)
543 anObj.SetParameters(Parameters)
546 ## Create a plane, based on a Local coordinate system.
547 # @param theLCS coordinate system, defining plane.
548 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
549 # @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
550 # @return New GEOM_Object, containing the created plane.
552 # @ref tui_creation_plane "Example"
553 def MakePlaneLCS(self,theLCS, theTrimSize, theOrientation):
554 # Example: see GEOM_TestAll.py
555 theTrimSize, Parameters = ParseParameters(theTrimSize);
556 anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
557 RaiseIfFailed("MakePlaneLCS", self.BasicOp)
558 anObj.SetParameters(Parameters)
561 ## Create a local coordinate system.
562 # @param OX,OY,OZ Three coordinates of coordinate system origin.
563 # @param XDX,XDY,XDZ Three components of OX direction
564 # @param YDX,YDY,YDZ Three components of OY direction
565 # @return New GEOM_Object, containing the created coordinate system.
567 # @ref swig_MakeMarker "Example"
568 def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ):
569 # Example: see GEOM_TestAll.py
570 OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
571 anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
572 RaiseIfFailed("MakeMarker", self.BasicOp)
573 anObj.SetParameters(Parameters)
576 ## Create a local coordinate system.
577 # @param theOrigin Point of coordinate system origin.
578 # @param theXVec Vector of X direction
579 # @param theYVec Vector of Y direction
580 # @return New GEOM_Object, containing the created coordinate system.
582 # @ref swig_MakeMarker "Example"
583 def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec):
584 O = self.PointCoordinates( theOrigin )
586 for vec in [ theXVec, theYVec ]:
587 v1, v2 = self.SubShapeAll( vec, ShapeType["VERTEX"] )
588 p1 = self.PointCoordinates( v1 )
589 p2 = self.PointCoordinates( v2 )
590 for i in range( 0, 3 ):
591 OXOY.append( p2[i] - p1[i] )
593 anObj = self.BasicOp.MakeMarker( O[0], O[1], O[2],
594 OXOY[0], OXOY[1], OXOY[2],
595 OXOY[3], OXOY[4], OXOY[5], )
596 RaiseIfFailed("MakeMarker", self.BasicOp)
602 ## @addtogroup l4_curves
605 ## Create an arc of circle, passing through three given points.
606 # @param thePnt1 Start point of the arc.
607 # @param thePnt2 Middle point of the arc.
608 # @param thePnt3 End point of the arc.
609 # @return New GEOM_Object, containing the created arc.
611 # @ref swig_MakeArc "Example"
612 def MakeArc(self,thePnt1, thePnt2, thePnt3):
613 # Example: see GEOM_TestAll.py
614 anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
615 RaiseIfFailed("MakeArc", self.CurvesOp)
618 ## Create an arc of circle from a center and 2 points.
619 # @param thePnt1 Center of the arc
620 # @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
621 # @param thePnt3 End point of the arc (Gives also a direction)
622 # @param theSense Orientation of the arc
623 # @return New GEOM_Object, containing the created arc.
625 # @ref swig_MakeArc "Example"
626 def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False):
627 # Example: see GEOM_TestAll.py
628 anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
629 RaiseIfFailed("MakeArcCenter", self.CurvesOp)
632 ## Create an arc of ellipse, of center and two points.
633 # @param theCenter Center of the arc.
634 # @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
635 # @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
636 # @return New GEOM_Object, containing the created arc.
638 # @ref swig_MakeArc "Example"
639 def MakeArcOfEllipse(self,theCenter, thePnt1, thePnt2):
640 # Example: see GEOM_TestAll.py
641 anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
642 RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
645 ## Create a circle with given center, normal vector and radius.
646 # @param thePnt Circle center.
647 # @param theVec Vector, normal to the plane of the circle.
648 # @param theR Circle radius.
649 # @return New GEOM_Object, containing the created circle.
651 # @ref tui_creation_circle "Example"
652 def MakeCircle(self, thePnt, theVec, theR):
653 # Example: see GEOM_TestAll.py
654 theR, Parameters = ParseParameters(theR)
655 anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
656 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
657 anObj.SetParameters(Parameters)
660 ## Create a circle with given radius.
661 # Center of the circle will be in the origin of global
662 # coordinate system and normal vector will be codirected with Z axis
663 # @param theR Circle radius.
664 # @return New GEOM_Object, containing the created circle.
665 def MakeCircleR(self, theR):
666 anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
667 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
670 ## Create a circle, passing through three given points
671 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
672 # @return New GEOM_Object, containing the created circle.
674 # @ref tui_creation_circle "Example"
675 def MakeCircleThreePnt(self,thePnt1, thePnt2, thePnt3):
676 # Example: see GEOM_TestAll.py
677 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
678 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
681 ## Create a circle, with given point1 as center,
682 # passing through the point2 as radius and laying in the plane,
683 # defined by all three given points.
684 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
685 # @return New GEOM_Object, containing the created circle.
687 # @ref swig_MakeCircle "Example"
688 def MakeCircleCenter2Pnt(self,thePnt1, thePnt2, thePnt3):
689 # Example: see GEOM_example6.py
690 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
691 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
694 ## Create an ellipse with given center, normal vector and radiuses.
695 # @param thePnt Ellipse center.
696 # @param theVec Vector, normal to the plane of the ellipse.
697 # @param theRMajor Major ellipse radius.
698 # @param theRMinor Minor ellipse radius.
699 # @param theVecMaj Vector, direction of the ellipse's main axis.
700 # @return New GEOM_Object, containing the created ellipse.
702 # @ref tui_creation_ellipse "Example"
703 def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None):
704 # Example: see GEOM_TestAll.py
705 theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
706 if theVecMaj is not None:
707 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
709 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
711 RaiseIfFailed("MakeEllipse", self.CurvesOp)
712 anObj.SetParameters(Parameters)
715 ## Create an ellipse with given radiuses.
716 # Center of the ellipse will be in the origin of global
717 # coordinate system and normal vector will be codirected with Z axis
718 # @param theRMajor Major ellipse radius.
719 # @param theRMinor Minor ellipse radius.
720 # @return New GEOM_Object, containing the created ellipse.
721 def MakeEllipseRR(self, theRMajor, theRMinor):
722 anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
723 RaiseIfFailed("MakeEllipse", self.CurvesOp)
726 ## Create a polyline on the set of points.
727 # @param thePoints Sequence of points for the polyline.
728 # @return New GEOM_Object, containing the created polyline.
730 # @ref tui_creation_curve "Example"
731 def MakePolyline(self,thePoints):
732 # Example: see GEOM_TestAll.py
733 anObj = self.CurvesOp.MakePolyline(thePoints)
734 RaiseIfFailed("MakePolyline", self.CurvesOp)
737 ## Create bezier curve on the set of points.
738 # @param thePoints Sequence of points for the bezier curve.
739 # @return New GEOM_Object, containing the created bezier curve.
741 # @ref tui_creation_curve "Example"
742 def MakeBezier(self,thePoints):
743 # Example: see GEOM_TestAll.py
744 anObj = self.CurvesOp.MakeSplineBezier(thePoints)
745 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
748 ## Create B-Spline curve on the set of points.
749 # @param thePoints Sequence of points for the B-Spline curve.
750 # @param theIsClosed If True, build a closed curve.
751 # @return New GEOM_Object, containing the created B-Spline curve.
753 # @ref tui_creation_curve "Example"
754 def MakeInterpol(self, thePoints, theIsClosed=False):
755 # Example: see GEOM_TestAll.py
756 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed)
757 RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
763 ## @addtogroup l3_sketcher
766 ## Create a sketcher (wire or face), following the textual description,
767 # passed through <VAR>theCommand</VAR> argument. \n
768 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
769 # Format of the description string have to be the following:
771 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
774 # - x1, y1 are coordinates of the first sketcher point (zero by default),
776 # - "R angle" : Set the direction by angle
777 # - "D dx dy" : Set the direction by DX & DY
780 # - "TT x y" : Create segment by point at X & Y
781 # - "T dx dy" : Create segment by point with DX & DY
782 # - "L length" : Create segment by direction & Length
783 # - "IX x" : Create segment by direction & Intersect. X
784 # - "IY y" : Create segment by direction & Intersect. Y
787 # - "C radius length" : Create arc by direction, radius and length(in degree)
790 # - "WW" : Close Wire (to finish)
791 # - "WF" : Close Wire and build face (to finish)
793 # @param theCommand String, defining the sketcher in local
794 # coordinates of the working plane.
795 # @param theWorkingPlane Nine double values, defining origin,
796 # OZ and OX directions of the working plane.
797 # @return New GEOM_Object, containing the created wire.
799 # @ref tui_sketcher_page "Example"
800 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0]):
801 # Example: see GEOM_TestAll.py
802 theCommand,Parameters = ParseSketcherCommand(theCommand)
803 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
804 RaiseIfFailed("MakeSketcher", self.CurvesOp)
805 anObj.SetParameters(Parameters)
808 ## Create a sketcher (wire or face), following the textual description,
809 # passed through <VAR>theCommand</VAR> argument. \n
810 # For format of the description string see the previous method.\n
811 # @param theCommand String, defining the sketcher in local
812 # coordinates of the working plane.
813 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
814 # @return New GEOM_Object, containing the created wire.
816 # @ref tui_sketcher_page "Example"
817 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane):
818 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
819 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
822 ## Create a sketcher wire, following the numerical description,
823 # passed through <VAR>theCoordinates</VAR> argument. \n
824 # @param theCoordinates double values, defining points to create a wire,
826 # @return New GEOM_Object, containing the created wire.
828 # @ref tui_sketcher_page "Example"
829 def Make3DSketcher(self, theCoordinates):
830 anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
831 RaiseIfFailed("Make3DSketcher", self.CurvesOp)
837 ## @addtogroup l3_3d_primitives
840 ## Create a box by coordinates of two opposite vertices.
842 # @ref tui_creation_box "Example"
843 def MakeBox(self,x1,y1,z1,x2,y2,z2):
844 # Example: see GEOM_TestAll.py
845 pnt1 = self.MakeVertex(x1,y1,z1)
846 pnt2 = self.MakeVertex(x2,y2,z2)
847 return self.MakeBoxTwoPnt(pnt1,pnt2)
849 ## Create a box with specified dimensions along the coordinate axes
850 # and with edges, parallel to the coordinate axes.
851 # Center of the box will be at point (DX/2, DY/2, DZ/2).
852 # @param theDX Length of Box edges, parallel to OX axis.
853 # @param theDY Length of Box edges, parallel to OY axis.
854 # @param theDZ Length of Box edges, parallel to OZ axis.
855 # @return New GEOM_Object, containing the created box.
857 # @ref tui_creation_box "Example"
858 def MakeBoxDXDYDZ(self,theDX, theDY, theDZ):
859 # Example: see GEOM_TestAll.py
860 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
861 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
862 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
863 anObj.SetParameters(Parameters)
866 ## Create a box with two specified opposite vertices,
867 # and with edges, parallel to the coordinate axes
868 # @param thePnt1 First of two opposite vertices.
869 # @param thePnt2 Second of two opposite vertices.
870 # @return New GEOM_Object, containing the created box.
872 # @ref tui_creation_box "Example"
873 def MakeBoxTwoPnt(self,thePnt1, thePnt2):
874 # Example: see GEOM_TestAll.py
875 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
876 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
879 ## Create a face with specified dimensions along OX-OY coordinate axes,
880 # with edges, parallel to this coordinate axes.
881 # @param theH height of Face.
882 # @param theW width of Face.
883 # @param theOrientation orientation belong axis OXY OYZ OZX
884 # @return New GEOM_Object, containing the created face.
886 # @ref tui_creation_face "Example"
887 def MakeFaceHW(self,theH, theW, theOrientation):
888 # Example: see GEOM_TestAll.py
889 theH,theW,Parameters = ParseParameters(theH, theW)
890 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
891 RaiseIfFailed("MakeFaceHW", self.PrimOp)
892 anObj.SetParameters(Parameters)
895 ## Create a face from another plane and two sizes,
896 # vertical size and horisontal size.
897 # @param theObj Normale vector to the creating face or
899 # @param theH Height (vertical size).
900 # @param theW Width (horisontal size).
901 # @return New GEOM_Object, containing the created face.
903 # @ref tui_creation_face "Example"
904 def MakeFaceObjHW(self, theObj, theH, theW):
905 # Example: see GEOM_TestAll.py
906 theH,theW,Parameters = ParseParameters(theH, theW)
907 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
908 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
909 anObj.SetParameters(Parameters)
912 ## Create a disk with given center, normal vector and radius.
913 # @param thePnt Disk center.
914 # @param theVec Vector, normal to the plane of the disk.
915 # @param theR Disk radius.
916 # @return New GEOM_Object, containing the created disk.
918 # @ref tui_creation_disk "Example"
919 def MakeDiskPntVecR(self,thePnt, theVec, theR):
920 # Example: see GEOM_TestAll.py
921 theR,Parameters = ParseParameters(theR)
922 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
923 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
924 anObj.SetParameters(Parameters)
927 ## Create a disk, passing through three given points
928 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
929 # @return New GEOM_Object, containing the created disk.
931 # @ref tui_creation_disk "Example"
932 def MakeDiskThreePnt(self,thePnt1, thePnt2, thePnt3):
933 # Example: see GEOM_TestAll.py
934 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
935 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
938 ## Create a disk with specified dimensions along OX-OY coordinate axes.
939 # @param theR Radius of Face.
940 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
941 # @return New GEOM_Object, containing the created disk.
943 # @ref tui_creation_face "Example"
944 def MakeDiskR(self,theR, theOrientation):
945 # Example: see GEOM_TestAll.py
946 theR,Parameters = ParseParameters(theR)
947 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
948 RaiseIfFailed("MakeDiskR", self.PrimOp)
949 anObj.SetParameters(Parameters)
952 ## Create a cylinder with given base point, axis, radius and height.
953 # @param thePnt Central point of cylinder base.
954 # @param theAxis Cylinder axis.
955 # @param theR Cylinder radius.
956 # @param theH Cylinder height.
957 # @return New GEOM_Object, containing the created cylinder.
959 # @ref tui_creation_cylinder "Example"
960 def MakeCylinder(self,thePnt, theAxis, theR, theH):
961 # Example: see GEOM_TestAll.py
962 theR,theH,Parameters = ParseParameters(theR, theH)
963 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
964 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
965 anObj.SetParameters(Parameters)
968 ## Create a cylinder with given radius and height at
969 # the origin of coordinate system. Axis of the cylinder
970 # will be collinear to the OZ axis of the coordinate system.
971 # @param theR Cylinder radius.
972 # @param theH Cylinder height.
973 # @return New GEOM_Object, containing the created cylinder.
975 # @ref tui_creation_cylinder "Example"
976 def MakeCylinderRH(self,theR, theH):
977 # Example: see GEOM_TestAll.py
978 theR,theH,Parameters = ParseParameters(theR, theH)
979 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
980 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
981 anObj.SetParameters(Parameters)
984 ## Create a sphere with given center and radius.
985 # @param thePnt Sphere center.
986 # @param theR Sphere radius.
987 # @return New GEOM_Object, containing the created sphere.
989 # @ref tui_creation_sphere "Example"
990 def MakeSpherePntR(self, thePnt, theR):
991 # Example: see GEOM_TestAll.py
992 theR,Parameters = ParseParameters(theR)
993 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
994 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
995 anObj.SetParameters(Parameters)
998 ## Create a sphere with given center and radius.
999 # @param x,y,z Coordinates of sphere center.
1000 # @param theR Sphere radius.
1001 # @return New GEOM_Object, containing the created sphere.
1003 # @ref tui_creation_sphere "Example"
1004 def MakeSphere(self, x, y, z, theR):
1005 # Example: see GEOM_TestAll.py
1006 point = self.MakeVertex(x, y, z)
1007 anObj = self.MakeSpherePntR(point, theR)
1010 ## Create a sphere with given radius at the origin of coordinate system.
1011 # @param theR Sphere radius.
1012 # @return New GEOM_Object, containing the created sphere.
1014 # @ref tui_creation_sphere "Example"
1015 def MakeSphereR(self, theR):
1016 # Example: see GEOM_TestAll.py
1017 theR,Parameters = ParseParameters(theR)
1018 anObj = self.PrimOp.MakeSphereR(theR)
1019 RaiseIfFailed("MakeSphereR", self.PrimOp)
1020 anObj.SetParameters(Parameters)
1023 ## Create a cone with given base point, axis, height and radiuses.
1024 # @param thePnt Central point of the first cone base.
1025 # @param theAxis Cone axis.
1026 # @param theR1 Radius of the first cone base.
1027 # @param theR2 Radius of the second cone base.
1028 # \note If both radiuses are non-zero, the cone will be truncated.
1029 # \note If the radiuses are equal, a cylinder will be created instead.
1030 # @param theH Cone height.
1031 # @return New GEOM_Object, containing the created cone.
1033 # @ref tui_creation_cone "Example"
1034 def MakeCone(self,thePnt, theAxis, theR1, theR2, theH):
1035 # Example: see GEOM_TestAll.py
1036 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
1037 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
1038 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
1039 anObj.SetParameters(Parameters)
1042 ## Create a cone with given height and radiuses at
1043 # the origin of coordinate system. Axis of the cone will
1044 # be collinear to the OZ axis of the coordinate system.
1045 # @param theR1 Radius of the first cone base.
1046 # @param theR2 Radius of the second cone base.
1047 # \note If both radiuses are non-zero, the cone will be truncated.
1048 # \note If the radiuses are equal, a cylinder will be created instead.
1049 # @param theH Cone height.
1050 # @return New GEOM_Object, containing the created cone.
1052 # @ref tui_creation_cone "Example"
1053 def MakeConeR1R2H(self,theR1, theR2, theH):
1054 # Example: see GEOM_TestAll.py
1055 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
1056 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
1057 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
1058 anObj.SetParameters(Parameters)
1061 ## Create a torus with given center, normal vector and radiuses.
1062 # @param thePnt Torus central point.
1063 # @param theVec Torus axis of symmetry.
1064 # @param theRMajor Torus major radius.
1065 # @param theRMinor Torus minor radius.
1066 # @return New GEOM_Object, containing the created torus.
1068 # @ref tui_creation_torus "Example"
1069 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor):
1070 # Example: see GEOM_TestAll.py
1071 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
1072 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
1073 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
1074 anObj.SetParameters(Parameters)
1077 ## Create a torus with given radiuses at the origin of coordinate system.
1078 # @param theRMajor Torus major radius.
1079 # @param theRMinor Torus minor radius.
1080 # @return New GEOM_Object, containing the created torus.
1082 # @ref tui_creation_torus "Example"
1083 def MakeTorusRR(self, theRMajor, theRMinor):
1084 # Example: see GEOM_TestAll.py
1085 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
1086 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
1087 RaiseIfFailed("MakeTorusRR", self.PrimOp)
1088 anObj.SetParameters(Parameters)
1091 # end of l3_3d_primitives
1094 ## @addtogroup l3_complex
1097 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
1098 # @param theBase Base shape to be extruded.
1099 # @param thePoint1 First end of extrusion vector.
1100 # @param thePoint2 Second end of extrusion vector.
1101 # @return New GEOM_Object, containing the created prism.
1103 # @ref tui_creation_prism "Example"
1104 def MakePrism(self, theBase, thePoint1, thePoint2):
1105 # Example: see GEOM_TestAll.py
1106 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
1107 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
1110 ## Create a shape by extrusion of the base shape along the vector,
1111 # i.e. all the space, transfixed by the base shape during its translation
1112 # along the vector on the given distance.
1113 # @param theBase Base shape to be extruded.
1114 # @param theVec Direction of extrusion.
1115 # @param theH Prism dimension along theVec.
1116 # @return New GEOM_Object, containing the created prism.
1118 # @ref tui_creation_prism "Example"
1119 def MakePrismVecH(self, theBase, theVec, theH):
1120 # Example: see GEOM_TestAll.py
1121 theH,Parameters = ParseParameters(theH)
1122 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
1123 RaiseIfFailed("MakePrismVecH", self.PrimOp)
1124 anObj.SetParameters(Parameters)
1127 ## Create a shape by extrusion of the base shape along the vector,
1128 # i.e. all the space, transfixed by the base shape during its translation
1129 # along the vector on the given distance in 2 Ways (forward/backward) .
1130 # @param theBase Base shape to be extruded.
1131 # @param theVec Direction of extrusion.
1132 # @param theH Prism dimension along theVec in forward direction.
1133 # @return New GEOM_Object, containing the created prism.
1135 # @ref tui_creation_prism "Example"
1136 def MakePrismVecH2Ways(self, theBase, theVec, theH):
1137 # Example: see GEOM_TestAll.py
1138 theH,Parameters = ParseParameters(theH)
1139 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
1140 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
1141 anObj.SetParameters(Parameters)
1144 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
1145 # @param theBase Base shape to be extruded.
1146 # @param theDX, theDY, theDZ Directions of extrusion.
1147 # @return New GEOM_Object, containing the created prism.
1149 # @ref tui_creation_prism "Example"
1150 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ):
1151 # Example: see GEOM_TestAll.py
1152 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1153 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
1154 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
1155 anObj.SetParameters(Parameters)
1158 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
1159 # i.e. all the space, transfixed by the base shape during its translation
1160 # along the vector on the given distance in 2 Ways (forward/backward) .
1161 # @param theBase Base shape to be extruded.
1162 # @param theDX, theDY, theDZ Directions of extrusion.
1163 # @return New GEOM_Object, containing the created prism.
1165 # @ref tui_creation_prism "Example"
1166 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ):
1167 # Example: see GEOM_TestAll.py
1168 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1169 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
1170 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
1171 anObj.SetParameters(Parameters)
1174 ## Create a shape by revolution of the base shape around the axis
1175 # on the given angle, i.e. all the space, transfixed by the base
1176 # shape during its rotation around the axis on the given angle.
1177 # @param theBase Base shape to be rotated.
1178 # @param theAxis Rotation axis.
1179 # @param theAngle Rotation angle in radians.
1180 # @return New GEOM_Object, containing the created revolution.
1182 # @ref tui_creation_revolution "Example"
1183 def MakeRevolution(self, theBase, theAxis, theAngle):
1184 # Example: see GEOM_TestAll.py
1185 theAngle,Parameters = ParseParameters(theAngle)
1186 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
1187 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
1188 anObj.SetParameters(Parameters)
1191 ## The Same Revolution but in both ways forward&backward.
1192 def MakeRevolution2Ways(self, theBase, theAxis, theAngle):
1193 theAngle,Parameters = ParseParameters(theAngle)
1194 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
1195 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
1196 anObj.SetParameters(Parameters)
1199 ## Create a filling from the given compound of contours.
1200 # @param theShape the compound of contours
1201 # @param theMinDeg a minimal degree of BSpline surface to create
1202 # @param theMaxDeg a maximal degree of BSpline surface to create
1203 # @param theTol2D a 2d tolerance to be reached
1204 # @param theTol3D a 3d tolerance to be reached
1205 # @param theNbIter a number of iteration of approximation algorithm
1206 # @param isApprox if True, BSpline curves are generated in the process
1207 # of surface construction. By default it is False, that means
1208 # the surface is created using Besier curves. The usage of
1209 # Approximation makes the algorithm work slower, but allows
1210 # building the surface for rather complex cases
1211 # @return New GEOM_Object, containing the created filling surface.
1213 # @ref tui_creation_filling "Example"
1214 def MakeFilling(self, theShape, theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter, isApprox=0):
1215 # Example: see GEOM_TestAll.py
1216 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg,
1217 theTol2D, theTol3D, theNbIter)
1218 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
1219 theTol2D, theTol3D, theNbIter, isApprox)
1220 RaiseIfFailed("MakeFilling", self.PrimOp)
1221 anObj.SetParameters(Parameters)
1224 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
1225 # @param theSeqSections - set of specified sections.
1226 # @param theModeSolid - mode defining building solid or shell
1227 # @param thePreci - precision 3D used for smoothing by default 1.e-6
1228 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
1229 # @return New GEOM_Object, containing the created shell or solid.
1231 # @ref swig_todo "Example"
1232 def MakeThruSections(self,theSeqSections,theModeSolid,thePreci,theRuled):
1233 # Example: see GEOM_TestAll.py
1234 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
1235 RaiseIfFailed("MakeThruSections", self.PrimOp)
1238 ## Create a shape by extrusion of the base shape along
1239 # the path shape. The path shape can be a wire or an edge.
1240 # @param theBase Base shape to be extruded.
1241 # @param thePath Path shape to extrude the base shape along it.
1242 # @return New GEOM_Object, containing the created pipe.
1244 # @ref tui_creation_pipe "Example"
1245 def MakePipe(self,theBase, thePath):
1246 # Example: see GEOM_TestAll.py
1247 anObj = self.PrimOp.MakePipe(theBase, thePath)
1248 RaiseIfFailed("MakePipe", self.PrimOp)
1251 ## Create a shape by extrusion of the profile shape along
1252 # the path shape. The path shape can be a wire or an edge.
1253 # the several profiles can be specified in the several locations of path.
1254 # @param theSeqBases - list of Bases shape to be extruded.
1255 # @param theLocations - list of locations on the path corresponding
1256 # specified list of the Bases shapes. Number of locations
1257 # should be equal to number of bases or list of locations can be empty.
1258 # @param thePath - Path shape to extrude the base shape along it.
1259 # @param theWithContact - the mode defining that the section is translated to be in
1260 # contact with the spine.
1261 # @param theWithCorrection - defining that the section is rotated to be
1262 # orthogonal to the spine tangent in the correspondent point
1263 # @return New GEOM_Object, containing the created pipe.
1265 # @ref tui_creation_pipe_with_diff_sec "Example"
1266 def MakePipeWithDifferentSections(self, theSeqBases,
1267 theLocations, thePath,
1268 theWithContact, theWithCorrection):
1269 anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
1270 theLocations, thePath,
1271 theWithContact, theWithCorrection)
1272 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
1275 ## Create a shape by extrusion of the profile shape along
1276 # the path shape. The path shape can be a wire or a edge.
1277 # the several profiles can be specified in the several locations of path.
1278 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
1279 # shell or face. If number of faces in neighbour sections
1280 # aren't coincided result solid between such sections will
1281 # be created using external boundaries of this shells.
1282 # @param theSeqSubBases - list of corresponding subshapes of section shapes.
1283 # This list is used for searching correspondences between
1284 # faces in the sections. Size of this list must be equal
1285 # to size of list of base shapes.
1286 # @param theLocations - list of locations on the path corresponding
1287 # specified list of the Bases shapes. Number of locations
1288 # should be equal to number of bases. First and last
1289 # locations must be coincided with first and last vertexes
1290 # of path correspondingly.
1291 # @param thePath - Path shape to extrude the base shape along it.
1292 # @param theWithContact - the mode defining that the section is translated to be in
1293 # contact with the spine.
1294 # @param theWithCorrection - defining that the section is rotated to be
1295 # orthogonal to the spine tangent in the correspondent point
1296 # @return New GEOM_Object, containing the created solids.
1298 # @ref tui_creation_pipe_with_shell_sec "Example"
1299 def MakePipeWithShellSections(self,theSeqBases, theSeqSubBases,
1300 theLocations, thePath,
1301 theWithContact, theWithCorrection):
1302 anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
1303 theLocations, thePath,
1304 theWithContact, theWithCorrection)
1305 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
1308 ## Create a shape by extrusion of the profile shape along
1309 # the path shape. This function is used only for debug pipe
1310 # functionality - it is a version of previous function
1311 # (MakePipeWithShellSections(...)) which give a possibility to
1312 # recieve information about creating pipe between each pair of
1313 # sections step by step.
1314 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
1315 theLocations, thePath,
1316 theWithContact, theWithCorrection):
1318 nbsect = len(theSeqBases)
1319 nbsubsect = len(theSeqSubBases)
1320 #print "nbsect = ",nbsect
1321 for i in range(1,nbsect):
1323 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
1324 tmpLocations = [ theLocations[i-1], theLocations[i] ]
1326 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
1327 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
1328 tmpLocations, thePath,
1329 theWithContact, theWithCorrection)
1330 if self.PrimOp.IsDone() == 0:
1331 print "Problems with pipe creation between ",i," and ",i+1," sections"
1332 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
1335 print "Pipe between ",i," and ",i+1," sections is OK"
1340 resc = self.MakeCompound(res)
1341 #resc = self.MakeSewing(res, 0.001)
1342 #print "resc: ",resc
1345 ## Create solids between given sections
1346 # @param theSeqBases - list of sections (shell or face).
1347 # @param theLocations - list of corresponding vertexes
1348 # @return New GEOM_Object, containing the created solids.
1350 # @ref tui_creation_pipe_without_path "Example"
1351 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations):
1352 anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
1353 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
1356 ## Create a shape by extrusion of the base shape along
1357 # the path shape with constant bi-normal direction along the given vector.
1358 # The path shape can be a wire or an edge.
1359 # @param theBase Base shape to be extruded.
1360 # @param thePath Path shape to extrude the base shape along it.
1361 # @param theVec Vector defines a constant binormal direction to keep the
1362 # same angle beetween the direction and the sections
1363 # along the sweep surface.
1364 # @return New GEOM_Object, containing the created pipe.
1366 # @ref tui_creation_pipe "Example"
1367 def MakePipeBiNormalAlongVector(self,theBase, thePath, theVec):
1368 # Example: see GEOM_TestAll.py
1369 anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
1370 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
1376 ## @addtogroup l3_advanced
1379 ## Create a linear edge with specified ends.
1380 # @param thePnt1 Point for the first end of edge.
1381 # @param thePnt2 Point for the second end of edge.
1382 # @return New GEOM_Object, containing the created edge.
1384 # @ref tui_creation_edge "Example"
1385 def MakeEdge(self,thePnt1, thePnt2):
1386 # Example: see GEOM_TestAll.py
1387 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
1388 RaiseIfFailed("MakeEdge", self.ShapesOp)
1391 ## Create a wire from the set of edges and wires.
1392 # @param theEdgesAndWires List of edges and/or wires.
1393 # @param theTolerance Maximum distance between vertices, that will be merged.
1394 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
1395 # @return New GEOM_Object, containing the created wire.
1397 # @ref tui_creation_wire "Example"
1398 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07):
1399 # Example: see GEOM_TestAll.py
1400 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
1401 RaiseIfFailed("MakeWire", self.ShapesOp)
1404 ## Create a face on the given wire.
1405 # @param theWire closed Wire or Edge to build the face on.
1406 # @param isPlanarWanted If TRUE, only planar face will be built.
1407 # If impossible, NULL object will be returned.
1408 # @return New GEOM_Object, containing the created face.
1410 # @ref tui_creation_face "Example"
1411 def MakeFace(self,theWire, isPlanarWanted):
1412 # Example: see GEOM_TestAll.py
1413 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
1414 RaiseIfFailed("MakeFace", self.ShapesOp)
1417 ## Create a face on the given wires set.
1418 # @param theWires List of closed wires or edges to build the face on.
1419 # @param isPlanarWanted If TRUE, only planar face will be built.
1420 # If impossible, NULL object will be returned.
1421 # @return New GEOM_Object, containing the created face.
1423 # @ref tui_creation_face "Example"
1424 def MakeFaceWires(self,theWires, isPlanarWanted):
1425 # Example: see GEOM_TestAll.py
1426 anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
1427 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
1430 ## Shortcut to MakeFaceWires()
1432 # @ref tui_creation_face "Example 1"
1433 # \n @ref swig_MakeFaces "Example 2"
1434 def MakeFaces(self,theWires, isPlanarWanted):
1435 # Example: see GEOM_TestOthers.py
1436 anObj = self.MakeFaceWires(theWires, isPlanarWanted)
1439 ## Create a shell from the set of faces and shells.
1440 # @param theFacesAndShells List of faces and/or shells.
1441 # @return New GEOM_Object, containing the created shell.
1443 # @ref tui_creation_shell "Example"
1444 def MakeShell(self,theFacesAndShells):
1445 # Example: see GEOM_TestAll.py
1446 anObj = self.ShapesOp.MakeShell(theFacesAndShells)
1447 RaiseIfFailed("MakeShell", self.ShapesOp)
1450 ## Create a solid, bounded by the given shells.
1451 # @param theShells Sequence of bounding shells.
1452 # @return New GEOM_Object, containing the created solid.
1454 # @ref tui_creation_solid "Example"
1455 def MakeSolid(self,theShells):
1456 # Example: see GEOM_TestAll.py
1457 anObj = self.ShapesOp.MakeSolidShells(theShells)
1458 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
1461 ## Create a compound of the given shapes.
1462 # @param theShapes List of shapes to put in compound.
1463 # @return New GEOM_Object, containing the created compound.
1465 # @ref tui_creation_compound "Example"
1466 def MakeCompound(self,theShapes):
1467 # Example: see GEOM_TestAll.py
1468 anObj = self.ShapesOp.MakeCompound(theShapes)
1469 RaiseIfFailed("MakeCompound", self.ShapesOp)
1472 # end of l3_advanced
1475 ## @addtogroup l2_measure
1478 ## Gives quantity of faces in the given shape.
1479 # @param theShape Shape to count faces of.
1480 # @return Quantity of faces.
1482 # @ref swig_NumberOf "Example"
1483 def NumberOfFaces(self, theShape):
1484 # Example: see GEOM_TestOthers.py
1485 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
1486 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
1489 ## Gives quantity of edges in the given shape.
1490 # @param theShape Shape to count edges of.
1491 # @return Quantity of edges.
1493 # @ref swig_NumberOf "Example"
1494 def NumberOfEdges(self, theShape):
1495 # Example: see GEOM_TestOthers.py
1496 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
1497 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
1500 ## Gives quantity of subshapes of type theShapeType in the given shape.
1501 # @param theShape Shape to count subshapes of.
1502 # @param theShapeType Type of subshapes to count.
1503 # @return Quantity of subshapes of given type.
1505 # @ref swig_NumberOf "Example"
1506 def NumberOfSubShapes(self, theShape, theShapeType):
1507 # Example: see GEOM_TestOthers.py
1508 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
1509 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
1512 ## Gives quantity of solids in the given shape.
1513 # @param theShape Shape to count solids in.
1514 # @return Quantity of solids.
1516 # @ref swig_NumberOf "Example"
1517 def NumberOfSolids(self, theShape):
1518 # Example: see GEOM_TestOthers.py
1519 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, ShapeType["SOLID"])
1520 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
1526 ## @addtogroup l3_healing
1529 ## Reverses an orientation the given shape.
1530 # @param theShape Shape to be reversed.
1531 # @return The reversed copy of theShape.
1533 # @ref swig_ChangeOrientation "Example"
1534 def ChangeOrientation(self,theShape):
1535 # Example: see GEOM_TestAll.py
1536 anObj = self.ShapesOp.ChangeOrientation(theShape)
1537 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
1540 ## Shortcut to ChangeOrientation()
1542 # @ref swig_OrientationChange "Example"
1543 def OrientationChange(self,theShape):
1544 # Example: see GEOM_TestOthers.py
1545 anObj = self.ChangeOrientation(theShape)
1551 ## @addtogroup l4_obtain
1554 ## Retrieve all free faces from the given shape.
1555 # Free face is a face, which is not shared between two shells of the shape.
1556 # @param theShape Shape to find free faces in.
1557 # @return List of IDs of all free faces, contained in theShape.
1559 # @ref tui_measurement_tools_page "Example"
1560 def GetFreeFacesIDs(self,theShape):
1561 # Example: see GEOM_TestOthers.py
1562 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
1563 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
1566 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
1567 # @param theShape1 Shape to find sub-shapes in.
1568 # @param theShape2 Shape to find shared sub-shapes with.
1569 # @param theShapeType Type of sub-shapes to be retrieved.
1570 # @return List of sub-shapes of theShape1, shared with theShape2.
1572 # @ref swig_GetSharedShapes "Example"
1573 def GetSharedShapes(self,theShape1, theShape2, theShapeType):
1574 # Example: see GEOM_TestOthers.py
1575 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
1576 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
1579 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
1580 # situated relatively the specified plane by the certain way,
1581 # defined through <VAR>theState</VAR> parameter.
1582 # @param theShape Shape to find sub-shapes of.
1583 # @param theShapeType Type of sub-shapes to be retrieved.
1584 # @param theAx1 Vector (or line, or linear edge), specifying normal
1585 # direction and location of the plane to find shapes on.
1586 # @param theState The state of the subshapes to find. It can be one of
1587 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1588 # @return List of all found sub-shapes.
1590 # @ref swig_GetShapesOnPlane "Example"
1591 def GetShapesOnPlane(self,theShape, theShapeType, theAx1, theState):
1592 # Example: see GEOM_TestOthers.py
1593 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
1594 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
1597 ## Works like the above method, but returns list of sub-shapes indices
1599 # @ref swig_GetShapesOnPlaneIDs "Example"
1600 def GetShapesOnPlaneIDs(self,theShape, theShapeType, theAx1, theState):
1601 # Example: see GEOM_TestOthers.py
1602 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
1603 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
1606 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
1607 # situated relatively the specified plane by the certain way,
1608 # defined through <VAR>theState</VAR> parameter.
1609 # @param theShape Shape to find sub-shapes of.
1610 # @param theShapeType Type of sub-shapes to be retrieved.
1611 # @param theAx1 Vector (or line, or linear edge), specifying normal
1612 # direction of the plane to find shapes on.
1613 # @param thePnt Point specifying location of the plane to find shapes on.
1614 # @param theState The state of the subshapes to find. It can be one of
1615 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1616 # @return List of all found sub-shapes.
1618 # @ref swig_GetShapesOnPlaneWithLocation "Example"
1619 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState):
1620 # Example: see GEOM_TestOthers.py
1621 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
1622 theAx1, thePnt, theState)
1623 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
1626 ## Works like the above method, but returns list of sub-shapes indices
1628 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
1629 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
1630 # Example: see GEOM_TestOthers.py
1631 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
1632 theAx1, thePnt, theState)
1633 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
1636 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1637 # the specified cylinder by the certain way, defined through \a theState parameter.
1638 # @param theShape Shape to find sub-shapes of.
1639 # @param theShapeType Type of sub-shapes to be retrieved.
1640 # @param theAxis Vector (or line, or linear edge), specifying
1641 # axis of the cylinder to find shapes on.
1642 # @param theRadius Radius of the cylinder to find shapes on.
1643 # @param theState The state of the subshapes to find. It can be one of
1644 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1645 # @return List of all found sub-shapes.
1647 # @ref swig_GetShapesOnCylinder "Example"
1648 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState):
1649 # Example: see GEOM_TestOthers.py
1650 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
1651 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
1654 ## Works like the above method, but returns list of sub-shapes indices
1656 # @ref swig_GetShapesOnCylinderIDs "Example"
1657 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
1658 # Example: see GEOM_TestOthers.py
1659 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
1660 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
1663 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1664 # the specified sphere by the certain way, defined through \a theState parameter.
1665 # @param theShape Shape to find sub-shapes of.
1666 # @param theShapeType Type of sub-shapes to be retrieved.
1667 # @param theCenter Point, specifying center of the sphere to find shapes on.
1668 # @param theRadius Radius of the sphere to find shapes on.
1669 # @param theState The state of the subshapes to find. It can be one of
1670 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1671 # @return List of all found sub-shapes.
1673 # @ref swig_GetShapesOnSphere "Example"
1674 def GetShapesOnSphere(self,theShape, theShapeType, theCenter, theRadius, theState):
1675 # Example: see GEOM_TestOthers.py
1676 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
1677 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
1680 ## Works like the above method, but returns list of sub-shapes indices
1682 # @ref swig_GetShapesOnSphereIDs "Example"
1683 def GetShapesOnSphereIDs(self,theShape, theShapeType, theCenter, theRadius, theState):
1684 # Example: see GEOM_TestOthers.py
1685 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
1686 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
1689 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1690 # the specified quadrangle by the certain way, defined through \a theState parameter.
1691 # @param theShape Shape to find sub-shapes of.
1692 # @param theShapeType Type of sub-shapes to be retrieved.
1693 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
1694 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
1695 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
1696 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
1697 # @param theState The state of the subshapes to find. It can be one of
1698 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1699 # @return List of all found sub-shapes.
1701 # @ref swig_GetShapesOnQuadrangle "Example"
1702 def GetShapesOnQuadrangle(self, theShape, theShapeType,
1703 theTopLeftPoint, theTopRigthPoint,
1704 theBottomLeftPoint, theBottomRigthPoint, theState):
1705 # Example: see GEOM_TestOthers.py
1706 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
1707 theTopLeftPoint, theTopRigthPoint,
1708 theBottomLeftPoint, theBottomRigthPoint, theState)
1709 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
1712 ## Works like the above method, but returns list of sub-shapes indices
1714 # @ref swig_GetShapesOnQuadrangleIDs "Example"
1715 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
1716 theTopLeftPoint, theTopRigthPoint,
1717 theBottomLeftPoint, theBottomRigthPoint, theState):
1718 # Example: see GEOM_TestOthers.py
1719 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
1720 theTopLeftPoint, theTopRigthPoint,
1721 theBottomLeftPoint, theBottomRigthPoint, theState)
1722 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
1725 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1726 # the specified \a theBox by the certain way, defined through \a theState parameter.
1727 # @param theBox Shape for relative comparing.
1728 # @param theShape Shape to find sub-shapes of.
1729 # @param theShapeType Type of sub-shapes to be retrieved.
1730 # @param theState The state of the subshapes to find. It can be one of
1731 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1732 # @return List of all found sub-shapes.
1734 # @ref swig_GetShapesOnBox "Example"
1735 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState):
1736 # Example: see GEOM_TestOthers.py
1737 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
1738 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
1741 ## Works like the above method, but returns list of sub-shapes indices
1743 # @ref swig_GetShapesOnBoxIDs "Example"
1744 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
1745 # Example: see GEOM_TestOthers.py
1746 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
1747 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
1750 ## Find in \a theShape all sub-shapes of type \a theShapeType,
1751 # situated relatively the specified \a theCheckShape by the
1752 # certain way, defined through \a theState parameter.
1753 # @param theCheckShape Shape for relative comparing.
1754 # @param theShape Shape to find sub-shapes of.
1755 # @param theShapeType Type of sub-shapes to be retrieved.
1756 # @param theState The state of the subshapes to find. It can be one of
1757 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1758 # @return List of all found sub-shapes.
1760 # @ref swig_GetShapesOnShape "Example"
1761 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState):
1762 # Example: see GEOM_TestOthers.py
1763 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
1764 theShapeType, theState)
1765 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
1768 ## Works like the above method, but returns result as compound
1770 # @ref swig_GetShapesOnShapeAsCompound "Example"
1771 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState):
1772 # Example: see GEOM_TestOthers.py
1773 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
1774 theShapeType, theState)
1775 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
1778 ## Works like the above method, but returns list of sub-shapes indices
1780 # @ref swig_GetShapesOnShapeIDs "Example"
1781 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
1782 # Example: see GEOM_TestOthers.py
1783 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
1784 theShapeType, theState)
1785 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
1788 ## Get sub-shape(s) of theShapeWhere, which are
1789 # coincident with \a theShapeWhat or could be a part of it.
1790 # @param theShapeWhere Shape to find sub-shapes of.
1791 # @param theShapeWhat Shape, specifying what to find.
1792 # @return Group of all found sub-shapes or a single found sub-shape.
1794 # @ref swig_GetInPlace "Example"
1795 def GetInPlace(self,theShapeWhere, theShapeWhat):
1796 # Example: see GEOM_TestOthers.py
1797 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
1798 RaiseIfFailed("GetInPlace", self.ShapesOp)
1801 ## Get sub-shape(s) of \a theShapeWhere, which are
1802 # coincident with \a theShapeWhat or could be a part of it.
1804 # Implementation of this method is based on a saved history of an operation,
1805 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
1806 # arguments (an argument shape or a sub-shape of an argument shape).
1807 # The operation could be the Partition or one of boolean operations,
1808 # performed on simple shapes (not on compounds).
1810 # @param theShapeWhere Shape to find sub-shapes of.
1811 # @param theShapeWhat Shape, specifying what to find (must be in the
1812 # building history of the ShapeWhere).
1813 # @return Group of all found sub-shapes or a single found sub-shape.
1815 # @ref swig_GetInPlace "Example"
1816 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat):
1817 # Example: see GEOM_TestOthers.py
1818 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
1819 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
1822 ## Get sub-shape of theShapeWhere, which is
1823 # equal to \a theShapeWhat.
1824 # @param theShapeWhere Shape to find sub-shape of.
1825 # @param theShapeWhat Shape, specifying what to find.
1826 # @return New GEOM_Object for found sub-shape.
1828 # @ref swig_GetSame "Example"
1829 def GetSame(self,theShapeWhere, theShapeWhat):
1830 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
1831 RaiseIfFailed("GetSame", self.ShapesOp)
1837 ## @addtogroup l4_access
1840 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
1841 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
1843 # @ref swig_all_decompose "Example"
1844 def GetSubShape(self, aShape, ListOfID):
1845 # Example: see GEOM_TestAll.py
1846 anObj = self.AddSubShape(aShape,ListOfID)
1849 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
1851 # @ref swig_all_decompose "Example"
1852 def GetSubShapeID(self, aShape, aSubShape):
1853 # Example: see GEOM_TestAll.py
1854 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
1855 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
1861 ## @addtogroup l4_decompose
1864 ## Explode a shape on subshapes of a given type.
1865 # @param aShape Shape to be exploded.
1866 # @param aType Type of sub-shapes to be retrieved.
1867 # @return List of sub-shapes of type theShapeType, contained in theShape.
1869 # @ref swig_all_decompose "Example"
1870 def SubShapeAll(self, aShape, aType):
1871 # Example: see GEOM_TestAll.py
1872 ListObj = self.ShapesOp.MakeExplode(aShape,aType,0)
1873 RaiseIfFailed("MakeExplode", self.ShapesOp)
1876 ## Explode a shape on subshapes of a given type.
1877 # @param aShape Shape to be exploded.
1878 # @param aType Type of sub-shapes to be retrieved.
1879 # @return List of IDs of sub-shapes.
1881 # @ref swig_all_decompose "Example"
1882 def SubShapeAllIDs(self, aShape, aType):
1883 ListObj = self.ShapesOp.SubShapeAllIDs(aShape,aType,0)
1884 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
1887 ## Explode a shape on subshapes of a given type.
1888 # Sub-shapes will be sorted by coordinates of their gravity centers.
1889 # @param aShape Shape to be exploded.
1890 # @param aType Type of sub-shapes to be retrieved.
1891 # @return List of sub-shapes of type theShapeType, contained in theShape.
1893 # @ref swig_SubShapeAllSorted "Example"
1894 def SubShapeAllSorted(self, aShape, aType):
1895 # Example: see GEOM_TestAll.py
1896 ListObj = self.ShapesOp.MakeExplode(aShape,aType,1)
1897 RaiseIfFailed("MakeExplode", self.ShapesOp)
1900 ## Explode a shape on subshapes of a given type.
1901 # Sub-shapes will be sorted by coordinates of their gravity centers.
1902 # @param aShape Shape to be exploded.
1903 # @param aType Type of sub-shapes to be retrieved.
1904 # @return List of IDs of sub-shapes.
1906 # @ref swig_all_decompose "Example"
1907 def SubShapeAllSortedIDs(self, aShape, aType):
1908 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape,aType,1)
1909 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
1912 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
1913 # selected by they indices in list of all sub-shapes of type <VAR>aType</VAR>.
1914 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
1916 # @ref swig_all_decompose "Example"
1917 def SubShape(self, aShape, aType, ListOfInd):
1918 # Example: see GEOM_TestAll.py
1920 AllShapeList = self.SubShapeAll(aShape, aType)
1921 for ind in ListOfInd:
1922 ListOfIDs.append(self.GetSubShapeID(aShape, AllShapeList[ind - 1]))
1923 anObj = self.GetSubShape(aShape, ListOfIDs)
1926 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
1927 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
1928 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
1930 # @ref swig_all_decompose "Example"
1931 def SubShapeSorted(self,aShape, aType, ListOfInd):
1932 # Example: see GEOM_TestAll.py
1934 AllShapeList = self.SubShapeAllSorted(aShape, aType)
1935 for ind in ListOfInd:
1936 ListOfIDs.append(self.GetSubShapeID(aShape, AllShapeList[ind - 1]))
1937 anObj = self.GetSubShape(aShape, ListOfIDs)
1940 # end of l4_decompose
1943 ## @addtogroup l3_healing
1946 ## Apply a sequence of Shape Healing operators to the given object.
1947 # @param theShape Shape to be processed.
1948 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
1949 # @param theParameters List of names of parameters
1950 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
1951 # @param theValues List of values of parameters, in the same order
1952 # as parameters are listed in <VAR>theParameters</VAR> list.
1953 # @return New GEOM_Object, containing processed shape.
1955 # @ref tui_shape_processing "Example"
1956 def ProcessShape(self,theShape, theOperators, theParameters, theValues):
1957 # Example: see GEOM_TestHealing.py
1958 theValues,Parameters = ParseList(theValues)
1959 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
1960 RaiseIfFailed("ProcessShape", self.HealOp)
1961 for string in (theOperators + theParameters):
1962 Parameters = ":" + Parameters
1964 anObj.SetParameters(Parameters)
1967 ## Remove faces from the given object (shape).
1968 # @param theObject Shape to be processed.
1969 # @param theFaces Indices of faces to be removed, if EMPTY then the method
1970 # removes ALL faces of the given object.
1971 # @return New GEOM_Object, containing processed shape.
1973 # @ref tui_suppress_faces "Example"
1974 def SuppressFaces(self,theObject, theFaces):
1975 # Example: see GEOM_TestHealing.py
1976 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
1977 RaiseIfFailed("SuppressFaces", self.HealOp)
1980 ## Sewing of some shapes into single shape.
1982 # @ref tui_sewing "Example"
1983 def MakeSewing(self, ListShape, theTolerance):
1984 # Example: see GEOM_TestHealing.py
1985 comp = self.MakeCompound(ListShape)
1986 anObj = self.Sew(comp, theTolerance)
1989 ## Sewing of the given object.
1990 # @param theObject Shape to be processed.
1991 # @param theTolerance Required tolerance value.
1992 # @return New GEOM_Object, containing processed shape.
1993 def Sew(self, theObject, theTolerance):
1994 # Example: see MakeSewing() above
1995 theTolerance,Parameters = ParseParameters(theTolerance)
1996 anObj = self.HealOp.Sew(theObject, theTolerance)
1997 RaiseIfFailed("Sew", self.HealOp)
1998 anObj.SetParameters(Parameters)
2001 ## Remove internal wires and edges from the given object (face).
2002 # @param theObject Shape to be processed.
2003 # @param theWires Indices of wires to be removed, if EMPTY then the method
2004 # removes ALL internal wires of the given object.
2005 # @return New GEOM_Object, containing processed shape.
2007 # @ref tui_suppress_internal_wires "Example"
2008 def SuppressInternalWires(self,theObject, theWires):
2009 # Example: see GEOM_TestHealing.py
2010 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
2011 RaiseIfFailed("RemoveIntWires", self.HealOp)
2014 ## Remove internal closed contours (holes) from the given object.
2015 # @param theObject Shape to be processed.
2016 # @param theWires Indices of wires to be removed, if EMPTY then the method
2017 # removes ALL internal holes of the given object
2018 # @return New GEOM_Object, containing processed shape.
2020 # @ref tui_suppress_holes "Example"
2021 def SuppressHoles(self,theObject, theWires):
2022 # Example: see GEOM_TestHealing.py
2023 anObj = self.HealOp.FillHoles(theObject, theWires)
2024 RaiseIfFailed("FillHoles", self.HealOp)
2027 ## Close an open wire.
2028 # @param theObject Shape to be processed.
2029 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
2030 # if -1, then <VAR>theObject</VAR> itself is a wire.
2031 # @param isCommonVertex If TRUE : closure by creation of a common vertex,
2032 # If FALS : closure by creation of an edge between ends.
2033 # @return New GEOM_Object, containing processed shape.
2035 # @ref tui_close_contour "Example"
2036 def CloseContour(self,theObject, theWires, isCommonVertex):
2037 # Example: see GEOM_TestHealing.py
2038 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
2039 RaiseIfFailed("CloseContour", self.HealOp)
2042 ## Addition of a point to a given edge object.
2043 # @param theObject Shape to be processed.
2044 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
2045 # if -1, then theObject itself is the edge.
2046 # @param theValue Value of parameter on edge or length parameter,
2047 # depending on \a isByParameter.
2048 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1],
2049 # if FALSE : \a theValue is treated as a length parameter [0..1]
2050 # @return New GEOM_Object, containing processed shape.
2052 # @ref tui_add_point_on_edge "Example"
2053 def DivideEdge(self,theObject, theEdgeIndex, theValue, isByParameter):
2054 # Example: see GEOM_TestHealing.py
2055 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
2056 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
2057 RaiseIfFailed("DivideEdge", self.HealOp)
2058 anObj.SetParameters(Parameters)
2061 ## Change orientation of the given object. Updates given shape.
2062 # @param theObject Shape to be processed.
2064 # @ref swig_todo "Example"
2065 def ChangeOrientationShell(self,theObject):
2066 theObject = self.HealOp.ChangeOrientation(theObject)
2067 RaiseIfFailed("ChangeOrientation", self.HealOp)
2070 ## Change orientation of the given object.
2071 # @param theObject Shape to be processed.
2072 # @return New GEOM_Object, containing processed shape.
2074 # @ref swig_todo "Example"
2075 def ChangeOrientationShellCopy(self,theObject):
2076 anObj = self.HealOp.ChangeOrientationCopy(theObject)
2077 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
2080 ## Get a list of wires (wrapped in GEOM_Object-s),
2081 # that constitute a free boundary of the given shape.
2082 # @param theObject Shape to get free boundary of.
2083 # @return [status, theClosedWires, theOpenWires]
2084 # status: FALSE, if an error(s) occured during the method execution.
2085 # theClosedWires: Closed wires on the free boundary of the given shape.
2086 # theOpenWires: Open wires on the free boundary of the given shape.
2088 # @ref tui_measurement_tools_page "Example"
2089 def GetFreeBoundary(self,theObject):
2090 # Example: see GEOM_TestHealing.py
2091 anObj = self.HealOp.GetFreeBoundary(theObject)
2092 RaiseIfFailed("GetFreeBoundary", self.HealOp)
2095 ## Replace coincident faces in theShape by one face.
2096 # @param theShape Initial shape.
2097 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
2098 # @param doKeepNonSolids If FALSE, only solids will present in the result,
2099 # otherwise all initial shapes.
2100 # @return New GEOM_Object, containing a copy of theShape without coincident faces.
2102 # @ref tui_glue_faces "Example"
2103 def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True):
2104 # Example: see GEOM_Spanner.py
2105 theTolerance,Parameters = ParseParameters(theTolerance)
2106 anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
2108 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
2109 anObj.SetParameters(Parameters)
2112 ## Find coincident faces in theShape for possible gluing.
2113 # @param theShape Initial shape.
2114 # @param theTolerance Maximum distance between faces,
2115 # which can be considered as coincident.
2118 # @ref swig_todo "Example"
2119 def GetGlueFaces(self, theShape, theTolerance):
2120 # Example: see GEOM_Spanner.py
2121 anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
2122 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
2125 ## Replace coincident faces in theShape by one face
2126 # in compliance with given list of faces
2127 # @param theShape Initial shape.
2128 # @param theTolerance Maximum distance between faces,
2129 # which can be considered as coincident.
2130 # @param theFaces List of faces for gluing.
2131 # @param doKeepNonSolids If FALSE, only solids will present in the result,
2132 # otherwise all initial shapes.
2133 # @return New GEOM_Object, containing a copy of theShape
2134 # without some faces.
2136 # @ref swig_todo "Example"
2137 def MakeGlueFacesByList(self, theShape, theTolerance, theFaces, doKeepNonSolids=True):
2138 # Example: see GEOM_Spanner.py
2139 anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces, doKeepNonSolids)
2141 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
2147 ## @addtogroup l3_boolean Boolean Operations
2150 # -----------------------------------------------------------------------------
2151 # Boolean (Common, Cut, Fuse, Section)
2152 # -----------------------------------------------------------------------------
2154 ## Perform one of boolean operations on two given shapes.
2155 # @param theShape1 First argument for boolean operation.
2156 # @param theShape2 Second argument for boolean operation.
2157 # @param theOperation Indicates the operation to be done:
2158 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
2159 # @return New GEOM_Object, containing the result shape.
2161 # @ref tui_fuse "Example"
2162 def MakeBoolean(self,theShape1, theShape2, theOperation):
2163 # Example: see GEOM_TestAll.py
2164 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation)
2165 RaiseIfFailed("MakeBoolean", self.BoolOp)
2168 ## Shortcut to MakeBoolean(s1, s2, 1)
2170 # @ref tui_common "Example 1"
2171 # \n @ref swig_MakeCommon "Example 2"
2172 def MakeCommon(self, s1, s2):
2173 # Example: see GEOM_TestOthers.py
2174 return self.MakeBoolean(s1, s2, 1)
2176 ## Shortcut to MakeBoolean(s1, s2, 2)
2178 # @ref tui_cut "Example 1"
2179 # \n @ref swig_MakeCommon "Example 2"
2180 def MakeCut(self, s1, s2):
2181 # Example: see GEOM_TestOthers.py
2182 return self.MakeBoolean(s1, s2, 2)
2184 ## Shortcut to MakeBoolean(s1, s2, 3)
2186 # @ref tui_fuse "Example 1"
2187 # \n @ref swig_MakeCommon "Example 2"
2188 def MakeFuse(self, s1, s2):
2189 # Example: see GEOM_TestOthers.py
2190 return self.MakeBoolean(s1, s2, 3)
2192 ## Shortcut to MakeBoolean(s1, s2, 4)
2194 # @ref tui_section "Example 1"
2195 # \n @ref swig_MakeCommon "Example 2"
2196 def MakeSection(self, s1, s2):
2197 # Example: see GEOM_TestOthers.py
2198 return self.MakeBoolean(s1, s2, 4)
2203 ## @addtogroup l3_basic_op
2206 ## Perform partition operation.
2207 # @param ListShapes Shapes to be intersected.
2208 # @param ListTools Shapes to intersect theShapes.
2209 # !!!NOTE: Each compound from ListShapes and ListTools will be exploded
2210 # in order to avoid possible intersection between shapes from
2212 # @param Limit Type of resulting shapes (corresponding to TopAbs_ShapeEnum).
2213 # @param KeepNonlimitShapes: if this parameter == 0 - only shapes with
2214 # type <= Limit are kept in the result,
2215 # else - shapes with type > Limit are kept
2216 # also (if they exist)
2218 # After implementation new version of PartitionAlgo (October 2006)
2219 # other parameters are ignored by current functionality. They are kept
2220 # in this function only for support old versions.
2221 # Ignored parameters:
2222 # @param ListKeepInside Shapes, outside which the results will be deleted.
2223 # Each shape from theKeepInside must belong to theShapes also.
2224 # @param ListRemoveInside Shapes, inside which the results will be deleted.
2225 # Each shape from theRemoveInside must belong to theShapes also.
2226 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
2227 # @param ListMaterials Material indices for each shape. Make sence,
2228 # only if theRemoveWebs is TRUE.
2230 # @return New GEOM_Object, containing the result shapes.
2232 # @ref tui_partition "Example"
2233 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
2234 Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
2235 KeepNonlimitShapes=0):
2236 # Example: see GEOM_TestAll.py
2237 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
2238 ListKeepInside, ListRemoveInside,
2239 Limit, RemoveWebs, ListMaterials,
2240 KeepNonlimitShapes);
2241 RaiseIfFailed("MakePartition", self.BoolOp)
2244 ## Perform partition operation.
2245 # This method may be useful if it is needed to make a partition for
2246 # compound contains nonintersected shapes. Performance will be better
2247 # since intersection between shapes from compound is not performed.
2249 # Description of all parameters as in previous method MakePartition()
2251 # !!!NOTE: Passed compounds (via ListShapes or via ListTools)
2252 # have to consist of nonintersecting shapes.
2254 # @return New GEOM_Object, containing the result shapes.
2256 # @ref swig_todo "Example"
2257 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
2258 ListKeepInside=[], ListRemoveInside=[],
2259 Limit=ShapeType["SHAPE"], RemoveWebs=0,
2260 ListMaterials=[], KeepNonlimitShapes=0):
2261 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
2262 ListKeepInside, ListRemoveInside,
2263 Limit, RemoveWebs, ListMaterials,
2264 KeepNonlimitShapes);
2265 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
2268 ## Shortcut to MakePartition()
2270 # @ref tui_partition "Example 1"
2271 # \n @ref swig_Partition "Example 2"
2272 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
2273 Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
2274 KeepNonlimitShapes=0):
2275 # Example: see GEOM_TestOthers.py
2276 anObj = self.MakePartition(ListShapes, ListTools,
2277 ListKeepInside, ListRemoveInside,
2278 Limit, RemoveWebs, ListMaterials,
2279 KeepNonlimitShapes);
2282 ## Perform partition of the Shape with the Plane
2283 # @param theShape Shape to be intersected.
2284 # @param thePlane Tool shape, to intersect theShape.
2285 # @return New GEOM_Object, containing the result shape.
2287 # @ref tui_partition "Example"
2288 def MakeHalfPartition(self,theShape, thePlane):
2289 # Example: see GEOM_TestAll.py
2290 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
2291 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
2294 # end of l3_basic_op
2297 ## @addtogroup l3_transform
2300 ## Translate the given object along the vector, specified
2301 # by its end points, creating its copy before the translation.
2302 # @param theObject The object to be translated.
2303 # @param thePoint1 Start point of translation vector.
2304 # @param thePoint2 End point of translation vector.
2305 # @return New GEOM_Object, containing the translated object.
2307 # @ref tui_translation "Example 1"
2308 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
2309 def MakeTranslationTwoPoints(self,theObject, thePoint1, thePoint2):
2310 # Example: see GEOM_TestAll.py
2311 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
2312 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
2315 ## Translate the given object along the vector, specified by its components.
2316 # @param theObject The object to be translated.
2317 # @param theDX,theDY,theDZ Components of translation vector.
2318 # @return Translated GEOM_Object.
2320 # @ref tui_translation "Example"
2321 def TranslateDXDYDZ(self,theObject, theDX, theDY, theDZ):
2322 # Example: see GEOM_TestAll.py
2323 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
2324 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
2325 anObj.SetParameters(Parameters)
2326 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
2329 ## Translate the given object along the vector, specified
2330 # by its components, creating its copy before the translation.
2331 # @param theObject The object to be translated.
2332 # @param theDX,theDY,theDZ Components of translation vector.
2333 # @return New GEOM_Object, containing the translated object.
2335 # @ref tui_translation "Example"
2336 def MakeTranslation(self,theObject, theDX, theDY, theDZ):
2337 # Example: see GEOM_TestAll.py
2338 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
2339 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
2340 anObj.SetParameters(Parameters)
2341 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
2344 ## Translate the given object along the given vector,
2345 # creating its copy before the translation.
2346 # @param theObject The object to be translated.
2347 # @param theVector The translation vector.
2348 # @return New GEOM_Object, containing the translated object.
2350 # @ref tui_translation "Example"
2351 def MakeTranslationVector(self,theObject, theVector):
2352 # Example: see GEOM_TestAll.py
2353 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
2354 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
2357 ## Translate the given object along the given vector on given distance.
2358 # @param theObject The object to be translated.
2359 # @param theVector The translation vector.
2360 # @param theDistance The translation distance.
2361 # @param theCopy Flag used to translate object itself or create a copy.
2362 # @return Translated GEOM_Object.
2364 # @ref tui_translation "Example"
2365 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy):
2366 # Example: see GEOM_TestAll.py
2367 theDistance,Parameters = ParseParameters(theDistance)
2368 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
2369 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
2370 anObj.SetParameters(Parameters)
2373 ## Translate the given object along the given vector on given distance,
2374 # creating its copy before the translation.
2375 # @param theObject The object to be translated.
2376 # @param theVector The translation vector.
2377 # @param theDistance The translation distance.
2378 # @return New GEOM_Object, containing the translated object.
2380 # @ref tui_translation "Example"
2381 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance):
2382 # Example: see GEOM_TestAll.py
2383 theDistance,Parameters = ParseParameters(theDistance)
2384 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
2385 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
2386 anObj.SetParameters(Parameters)
2389 ## Rotate the given object around the given axis on the given angle.
2390 # @param theObject The object to be rotated.
2391 # @param theAxis Rotation axis.
2392 # @param theAngle Rotation angle in radians.
2393 # @return Rotated GEOM_Object.
2395 # @ref tui_rotation "Example"
2396 def Rotate(self,theObject, theAxis, theAngle):
2397 # Example: see GEOM_TestAll.py
2399 if isinstance(theAngle,str):
2401 theAngle, Parameters = ParseParameters(theAngle)
2403 theAngle = theAngle*math.pi/180.0
2404 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
2405 RaiseIfFailed("RotateCopy", self.TrsfOp)
2406 anObj.SetParameters(Parameters)
2409 ## Rotate the given object around the given axis
2410 # on the given angle, creating its copy before the rotatation.
2411 # @param theObject The object to be rotated.
2412 # @param theAxis Rotation axis.
2413 # @param theAngle Rotation angle in radians.
2414 # @return New GEOM_Object, containing the rotated object.
2416 # @ref tui_rotation "Example"
2417 def MakeRotation(self,theObject, theAxis, theAngle):
2418 # Example: see GEOM_TestAll.py
2420 if isinstance(theAngle,str):
2422 theAngle, Parameters = ParseParameters(theAngle)
2424 theAngle = theAngle*math.pi/180.0
2425 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
2426 RaiseIfFailed("RotateCopy", self.TrsfOp)
2427 anObj.SetParameters(Parameters)
2430 ## Rotate given object around vector perpendicular to plane
2431 # containing three points, creating its copy before the rotatation.
2432 # @param theObject The object to be rotated.
2433 # @param theCentPoint central point - the axis is the vector perpendicular to the plane
2434 # containing the three points.
2435 # @param thePoint1,thePoint2 - in a perpendicular plane of the axis.
2436 # @return New GEOM_Object, containing the rotated object.
2438 # @ref tui_rotation "Example"
2439 def MakeRotationThreePoints(self,theObject, theCentPoint, thePoint1, thePoint2):
2440 # Example: see GEOM_TestAll.py
2441 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
2442 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
2445 ## Scale the given object by the factor, creating its copy before the scaling.
2446 # @param theObject The object to be scaled.
2447 # @param thePoint Center point for scaling.
2448 # Passing None for it means scaling relatively the origin of global CS.
2449 # @param theFactor Scaling factor value.
2450 # @return New GEOM_Object, containing the scaled shape.
2452 # @ref tui_scale "Example"
2453 def MakeScaleTransform(self, theObject, thePoint, theFactor):
2454 # Example: see GEOM_TestAll.py
2455 theFactor, Parameters = ParseParameters(theFactor)
2456 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
2457 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
2458 anObj.SetParameters(Parameters)
2461 ## Scale the given object by different factors along coordinate axes,
2462 # creating its copy before the scaling.
2463 # @param theObject The object to be scaled.
2464 # @param thePoint Center point for scaling.
2465 # Passing None for it means scaling relatively the origin of global CS.
2466 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
2467 # @return New GEOM_Object, containing the scaled shape.
2469 # @ref swig_scale "Example"
2470 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ):
2471 # Example: see GEOM_TestAll.py
2472 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
2473 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
2474 theFactorX, theFactorY, theFactorZ)
2475 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
2476 anObj.SetParameters(Parameters)
2479 ## Create an object, symmetrical
2480 # to the given one relatively the given plane.
2481 # @param theObject The object to be mirrored.
2482 # @param thePlane Plane of symmetry.
2483 # @return New GEOM_Object, containing the mirrored shape.
2485 # @ref tui_mirror "Example"
2486 def MakeMirrorByPlane(self,theObject, thePlane):
2487 # Example: see GEOM_TestAll.py
2488 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
2489 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
2492 ## Create an object, symmetrical
2493 # to the given one relatively the given axis.
2494 # @param theObject The object to be mirrored.
2495 # @param theAxis Axis of symmetry.
2496 # @return New GEOM_Object, containing the mirrored shape.
2498 # @ref tui_mirror "Example"
2499 def MakeMirrorByAxis(self,theObject, theAxis):
2500 # Example: see GEOM_TestAll.py
2501 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
2502 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
2505 ## Create an object, symmetrical
2506 # to the given one relatively the given point.
2507 # @param theObject The object to be mirrored.
2508 # @param thePoint Point of symmetry.
2509 # @return New GEOM_Object, containing the mirrored shape.
2511 # @ref tui_mirror "Example"
2512 def MakeMirrorByPoint(self,theObject, thePoint):
2513 # Example: see GEOM_TestAll.py
2514 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
2515 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
2518 ## Modify the Location of the given object by LCS,
2519 # creating its copy before the setting.
2520 # @param theObject The object to be displaced.
2521 # @param theStartLCS Coordinate system to perform displacement from it.
2522 # If \a theStartLCS is NULL, displacement
2523 # will be performed from global CS.
2524 # If \a theObject itself is used as \a theStartLCS,
2525 # its location will be changed to \a theEndLCS.
2526 # @param theEndLCS Coordinate system to perform displacement to it.
2527 # @return New GEOM_Object, containing the displaced shape.
2529 # @ref tui_modify_location "Example"
2530 def MakePosition(self,theObject, theStartLCS, theEndLCS):
2531 # Example: see GEOM_TestAll.py
2532 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
2533 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
2536 ## Modify the Location of the given object by Path,
2537 # @param theObject The object to be displaced.
2538 # @param thePath Wire or Edge along that the object will be translated.
2539 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
2540 # @param theCopy is to create a copy objects if true.
2541 # @param theReverse - 0 for usual direction, 1 to reverse path direction.
2542 # @return New GEOM_Object, containing the displaced shape.
2544 # @ref tui_modify_location "Example"
2545 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
2546 # Example: see GEOM_TestAll.py
2547 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
2548 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
2551 ## Create new object as offset of the given one.
2552 # @param theObject The base object for the offset.
2553 # @param theOffset Offset value.
2554 # @return New GEOM_Object, containing the offset object.
2556 # @ref tui_offset "Example"
2557 def MakeOffset(self,theObject, theOffset):
2558 # Example: see GEOM_TestAll.py
2559 theOffset, Parameters = ParseParameters(theOffset)
2560 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
2561 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
2562 anObj.SetParameters(Parameters)
2565 # -----------------------------------------------------------------------------
2567 # -----------------------------------------------------------------------------
2569 ## Translate the given object along the given vector a given number times
2570 # @param theObject The object to be translated.
2571 # @param theVector Direction of the translation.
2572 # @param theStep Distance to translate on.
2573 # @param theNbTimes Quantity of translations to be done.
2574 # @return New GEOM_Object, containing compound of all
2575 # the shapes, obtained after each translation.
2577 # @ref tui_multi_translation "Example"
2578 def MakeMultiTranslation1D(self,theObject, theVector, theStep, theNbTimes):
2579 # Example: see GEOM_TestAll.py
2580 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
2581 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
2582 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
2583 anObj.SetParameters(Parameters)
2586 ## Conseqently apply two specified translations to theObject specified number of times.
2587 # @param theObject The object to be translated.
2588 # @param theVector1 Direction of the first translation.
2589 # @param theStep1 Step of the first translation.
2590 # @param theNbTimes1 Quantity of translations to be done along theVector1.
2591 # @param theVector2 Direction of the second translation.
2592 # @param theStep2 Step of the second translation.
2593 # @param theNbTimes2 Quantity of translations to be done along theVector2.
2594 # @return New GEOM_Object, containing compound of all
2595 # the shapes, obtained after each translation.
2597 # @ref tui_multi_translation "Example"
2598 def MakeMultiTranslation2D(self,theObject, theVector1, theStep1, theNbTimes1,
2599 theVector2, theStep2, theNbTimes2):
2600 # Example: see GEOM_TestAll.py
2601 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
2602 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
2603 theVector2, theStep2, theNbTimes2)
2604 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
2605 anObj.SetParameters(Parameters)
2608 ## Rotate the given object around the given axis a given number times.
2609 # Rotation angle will be 2*PI/theNbTimes.
2610 # @param theObject The object to be rotated.
2611 # @param theAxis The rotation axis.
2612 # @param theNbTimes Quantity of rotations to be done.
2613 # @return New GEOM_Object, containing compound of all the
2614 # shapes, obtained after each rotation.
2616 # @ref tui_multi_rotation "Example"
2617 def MultiRotate1D(self,theObject, theAxis, theNbTimes):
2618 # Example: see GEOM_TestAll.py
2619 theAxis, theNbTimes, Parameters = ParseParameters(theAxis, theNbTimes)
2620 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
2621 RaiseIfFailed("MultiRotate1D", self.TrsfOp)
2622 anObj.SetParameters(Parameters)
2625 ## Rotate the given object around the
2626 # given axis on the given angle a given number
2627 # times and multi-translate each rotation result.
2628 # Translation direction passes through center of gravity
2629 # of rotated shape and its projection on the rotation axis.
2630 # @param theObject The object to be rotated.
2631 # @param theAxis Rotation axis.
2632 # @param theAngle Rotation angle in graduces.
2633 # @param theNbTimes1 Quantity of rotations to be done.
2634 # @param theStep Translation distance.
2635 # @param theNbTimes2 Quantity of translations to be done.
2636 # @return New GEOM_Object, containing compound of all the
2637 # shapes, obtained after each transformation.
2639 # @ref tui_multi_rotation "Example"
2640 def MultiRotate2D(self,theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2):
2641 # Example: see GEOM_TestAll.py
2642 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
2643 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
2644 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
2645 anObj.SetParameters(Parameters)
2648 ## The same, as MultiRotate1D(), but axis is given by direction and point
2649 # @ref swig_MakeMultiRotation "Example"
2650 def MakeMultiRotation1D(self,aShape,aDir,aPoint,aNbTimes):
2651 # Example: see GEOM_TestOthers.py
2652 aVec = self.MakeLine(aPoint,aDir)
2653 anObj = self.MultiRotate1D(aShape,aVec,aNbTimes)
2656 ## The same, as MultiRotate2D(), but axis is given by direction and point
2657 # @ref swig_MakeMultiRotation "Example"
2658 def MakeMultiRotation2D(self,aShape,aDir,aPoint,anAngle,nbtimes1,aStep,nbtimes2):
2659 # Example: see GEOM_TestOthers.py
2660 aVec = self.MakeLine(aPoint,aDir)
2661 anObj = self.MultiRotate2D(aShape,aVec,anAngle,nbtimes1,aStep,nbtimes2)
2664 # end of l3_transform
2667 ## @addtogroup l3_local
2670 ## Perform a fillet on all edges of the given shape.
2671 # @param theShape Shape, to perform fillet on.
2672 # @param theR Fillet radius.
2673 # @return New GEOM_Object, containing the result shape.
2675 # @ref tui_fillet "Example 1"
2676 # \n @ref swig_MakeFilletAll "Example 2"
2677 def MakeFilletAll(self,theShape, theR):
2678 # Example: see GEOM_TestOthers.py
2679 theR,Parameters = ParseParameters(theR)
2680 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
2681 RaiseIfFailed("MakeFilletAll", self.LocalOp)
2682 anObj.SetParameters(Parameters)
2685 ## Perform a fillet on the specified edges/faces of the given shape
2686 # @param theShape Shape, to perform fillet on.
2687 # @param theR Fillet radius.
2688 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR>.
2689 # @param theListShapes Global indices of edges/faces to perform fillet on.
2690 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2691 # @return New GEOM_Object, containing the result shape.
2693 # @ref tui_fillet "Example"
2694 def MakeFillet(self,theShape, theR, theShapeType, theListShapes):
2695 # Example: see GEOM_TestAll.py
2696 theR,Parameters = ParseParameters(theR)
2698 if theShapeType == ShapeType["EDGE"]:
2699 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
2700 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
2702 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
2703 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
2704 anObj.SetParameters(Parameters)
2707 ## The same that MakeFillet but with two Fillet Radius R1 and R2
2708 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes):
2709 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
2711 if theShapeType == ShapeType["EDGE"]:
2712 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
2713 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
2715 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
2716 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
2717 anObj.SetParameters(Parameters)
2720 ## Perform a fillet on the specified edges of the given wire shape
2721 # @param theShape - Wire Shape(with planar edges) to perform fillet on.
2722 # @param theR - Fillet radius.
2723 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
2724 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2725 # @return New GEOM_Object, containing the result shape.
2727 # @ref tui_fillet1d "Example"
2728 def MakeFillet1D(self,theShape, theR, theListOfVertexes):
2729 # Example: see GEOM_TestAll.py
2730 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes)
2731 RaiseIfFailed("MakeFillet1D", self.LocalOp)
2734 ## Perform a fillet on the specified edges/faces of the given shape
2735 # @param theShape - Face Shape to perform fillet on.
2736 # @param theR - Fillet radius.
2737 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
2738 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2739 # @return New GEOM_Object, containing the result shape.
2741 # @ref tui_fillet2d "Example"
2742 def MakeFillet2D(self,theShape, theR, theListOfVertexes):
2743 # Example: see GEOM_TestAll.py
2744 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
2745 RaiseIfFailed("MakeFillet2D", self.LocalOp)
2748 ## Perform a fillet on the specified edges of the given shape
2749 # @param theShape - Wire Shape to perform fillet on.
2750 # @param theR - Fillet radius.
2751 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
2752 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2753 # \note The list of vertices could be empty,
2754 # in this case fillet will done done at all vertices in wire
2755 # @return New GEOM_Object, containing the result shape.
2757 # @ref tui_fillet2d "Example"
2758 def MakeFillet1D(self,theShape, theR, theListOfVertexes):
2759 # Example: see GEOM_TestAll.py
2760 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes)
2761 RaiseIfFailed("MakeFillet1D", self.LocalOp)
2764 ## Perform a symmetric chamfer on all edges of the given shape.
2765 # @param theShape Shape, to perform chamfer on.
2766 # @param theD Chamfer size along each face.
2767 # @return New GEOM_Object, containing the result shape.
2769 # @ref tui_chamfer "Example 1"
2770 # \n @ref swig_MakeChamferAll "Example 2"
2771 def MakeChamferAll(self,theShape, theD):
2772 # Example: see GEOM_TestOthers.py
2773 theD,Parameters = ParseParameters(theD)
2774 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
2775 RaiseIfFailed("MakeChamferAll", self.LocalOp)
2776 anObj.SetParameters(Parameters)
2779 ## Perform a chamfer on edges, common to the specified faces,
2780 # with distance D1 on the Face1
2781 # @param theShape Shape, to perform chamfer on.
2782 # @param theD1 Chamfer size along \a theFace1.
2783 # @param theD2 Chamfer size along \a theFace2.
2784 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
2785 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2786 # @return New GEOM_Object, containing the result shape.
2788 # @ref tui_chamfer "Example"
2789 def MakeChamferEdge(self,theShape, theD1, theD2, theFace1, theFace2):
2790 # Example: see GEOM_TestAll.py
2791 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
2792 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
2793 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
2794 anObj.SetParameters(Parameters)
2797 ## The Same that MakeChamferEdge but with params theD is chamfer length and
2798 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
2799 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2):
2801 if isinstance(theAngle,str):
2803 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
2805 theAngle = theAngle*math.pi/180.0
2806 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
2807 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
2808 anObj.SetParameters(Parameters)
2811 ## Perform a chamfer on all edges of the specified faces,
2812 # with distance D1 on the first specified face (if several for one edge)
2813 # @param theShape Shape, to perform chamfer on.
2814 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
2815 # connected to the edge, are in \a theFaces, \a theD1
2816 # will be get along face, which is nearer to \a theFaces beginning.
2817 # @param theD2 Chamfer size along another of two faces, connected to the edge.
2818 # @param theFaces Sequence of global indices of faces of \a theShape.
2819 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2820 # @return New GEOM_Object, containing the result shape.
2822 # @ref tui_chamfer "Example"
2823 def MakeChamferFaces(self,theShape, theD1, theD2, theFaces):
2824 # Example: see GEOM_TestAll.py
2825 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
2826 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
2827 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
2828 anObj.SetParameters(Parameters)
2831 ## The Same that MakeChamferFaces but with params theD is chamfer lenght and
2832 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
2834 # @ref swig_FilletChamfer "Example"
2835 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces):
2837 if isinstance(theAngle,str):
2839 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
2841 theAngle = theAngle*math.pi/180.0
2842 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
2843 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
2844 anObj.SetParameters(Parameters)
2847 ## Perform a chamfer on edges,
2848 # with distance D1 on the first specified face (if several for one edge)
2849 # @param theShape Shape, to perform chamfer on.
2850 # @param theD1,theD2 Chamfer size
2851 # @param theEdges Sequence of edges of \a theShape.
2852 # @return New GEOM_Object, containing the result shape.
2854 # @ref swig_FilletChamfer "Example"
2855 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges):
2856 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
2857 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
2858 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
2859 anObj.SetParameters(Parameters)
2862 ## The Same that MakeChamferEdges but with params theD is chamfer lenght and
2863 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
2864 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges):
2866 if isinstance(theAngle,str):
2868 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
2870 theAngle = theAngle*math.pi/180.0
2871 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
2872 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
2873 anObj.SetParameters(Parameters)
2876 ## Shortcut to MakeChamferEdge() and MakeChamferFaces()
2878 # @ref swig_MakeChamfer "Example"
2879 def MakeChamfer(self,aShape,d1,d2,aShapeType,ListShape):
2880 # Example: see GEOM_TestOthers.py
2882 if aShapeType == ShapeType["EDGE"]:
2883 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1])
2885 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape)
2891 ## @addtogroup l3_basic_op
2894 ## Perform an Archimde operation on the given shape with given parameters.
2895 # The object presenting the resulting face is returned.
2896 # @param theShape Shape to be put in water.
2897 # @param theWeight Weight og the shape.
2898 # @param theWaterDensity Density of the water.
2899 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
2900 # @return New GEOM_Object, containing a section of \a theShape
2901 # by a plane, corresponding to water level.
2903 # @ref tui_archimede "Example"
2904 def Archimede(self,theShape, theWeight, theWaterDensity, theMeshDeflection):
2905 # Example: see GEOM_TestAll.py
2906 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
2907 theWeight,theWaterDensity,theMeshDeflection)
2908 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
2909 RaiseIfFailed("MakeArchimede", self.LocalOp)
2910 anObj.SetParameters(Parameters)
2913 # end of l3_basic_op
2916 ## @addtogroup l2_measure
2919 ## Get point coordinates
2922 # @ref tui_measurement_tools_page "Example"
2923 def PointCoordinates(self,Point):
2924 # Example: see GEOM_TestMeasures.py
2925 aTuple = self.MeasuOp.PointCoordinates(Point)
2926 RaiseIfFailed("PointCoordinates", self.MeasuOp)
2929 ## Get summarized length of all wires,
2930 # area of surface and volume of the given shape.
2931 # @param theShape Shape to define properties of.
2932 # @return [theLength, theSurfArea, theVolume]
2933 # theLength: Summarized length of all wires of the given shape.
2934 # theSurfArea: Area of surface of the given shape.
2935 # theVolume: Volume of the given shape.
2937 # @ref tui_measurement_tools_page "Example"
2938 def BasicProperties(self,theShape):
2939 # Example: see GEOM_TestMeasures.py
2940 aTuple = self.MeasuOp.GetBasicProperties(theShape)
2941 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
2944 ## Get parameters of bounding box of the given shape
2945 # @param theShape Shape to obtain bounding box of.
2946 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
2947 # Xmin,Xmax: Limits of shape along OX axis.
2948 # Ymin,Ymax: Limits of shape along OY axis.
2949 # Zmin,Zmax: Limits of shape along OZ axis.
2951 # @ref tui_measurement_tools_page "Example"
2952 def BoundingBox(self,theShape):
2953 # Example: see GEOM_TestMeasures.py
2954 aTuple = self.MeasuOp.GetBoundingBox(theShape)
2955 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
2958 ## Get inertia matrix and moments of inertia of theShape.
2959 # @param theShape Shape to calculate inertia of.
2960 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
2961 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
2962 # Ix,Iy,Iz: Moments of inertia of the given shape.
2964 # @ref tui_measurement_tools_page "Example"
2965 def Inertia(self,theShape):
2966 # Example: see GEOM_TestMeasures.py
2967 aTuple = self.MeasuOp.GetInertia(theShape)
2968 RaiseIfFailed("GetInertia", self.MeasuOp)
2971 ## Get minimal distance between the given shapes.
2972 # @param theShape1,theShape2 Shapes to find minimal distance between.
2973 # @return Value of the minimal distance between the given shapes.
2975 # @ref tui_measurement_tools_page "Example"
2976 def MinDistance(self, theShape1, theShape2):
2977 # Example: see GEOM_TestMeasures.py
2978 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
2979 RaiseIfFailed("GetMinDistance", self.MeasuOp)
2982 ## Get minimal distance between the given shapes.
2983 # @param theShape1,theShape2 Shapes to find minimal distance between.
2984 # @return Value of the minimal distance between the given shapes.
2986 # @ref swig_all_measure "Example"
2987 def MinDistanceComponents(self, theShape1, theShape2):
2988 # Example: see GEOM_TestMeasures.py
2989 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
2990 RaiseIfFailed("GetMinDistance", self.MeasuOp)
2991 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
2994 ## Get angle between the given shapes in degrees.
2995 # @param theShape1,theShape2 Lines or linear edges to find angle between.
2996 # @return Value of the angle between the given shapes in degrees.
2998 # @ref tui_measurement_tools_page "Example"
2999 def GetAngle(self, theShape1, theShape2):
3000 # Example: see GEOM_TestMeasures.py
3001 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
3002 RaiseIfFailed("GetAngle", self.MeasuOp)
3004 ## Get angle between the given shapes in radians.
3005 # @param theShape1,theShape2 Lines or linear edges to find angle between.
3006 # @return Value of the angle between the given shapes in radians.
3008 # @ref tui_measurement_tools_page "Example"
3009 def GetAngleRadians(self, theShape1, theShape2):
3010 # Example: see GEOM_TestMeasures.py
3011 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
3012 RaiseIfFailed("GetAngle", self.MeasuOp)
3015 ## @name Curve Curvature Measurement
3016 # Methods for receiving radius of curvature of curves
3017 # in the given point
3020 ## Measure curvature of a curve at a point, set by parameter.
3021 # @ref swig_todo "Example"
3022 def CurveCurvatureByParam(self, theCurve, theParam):
3023 # Example: see GEOM_TestMeasures.py
3024 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
3025 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
3029 # @ref swig_todo "Example"
3030 def CurveCurvatureByPoint(self, theCurve, thePoint):
3031 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
3032 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
3036 ## @name Surface Curvature Measurement
3037 # Methods for receiving max and min radius of curvature of surfaces
3038 # in the given point
3042 ## @ref swig_todo "Example"
3043 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
3044 # Example: see GEOM_TestMeasures.py
3045 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
3046 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
3050 ## @ref swig_todo "Example"
3051 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
3052 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
3053 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
3057 ## @ref swig_todo "Example"
3058 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
3059 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
3060 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
3064 ## @ref swig_todo "Example"
3065 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
3066 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
3067 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
3071 ## Get min and max tolerances of sub-shapes of theShape
3072 # @param theShape Shape, to get tolerances of.
3073 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
3074 # FaceMin,FaceMax: Min and max tolerances of the faces.
3075 # EdgeMin,EdgeMax: Min and max tolerances of the edges.
3076 # VertMin,VertMax: Min and max tolerances of the vertices.
3078 # @ref tui_measurement_tools_page "Example"
3079 def Tolerance(self,theShape):
3080 # Example: see GEOM_TestMeasures.py
3081 aTuple = self.MeasuOp.GetTolerance(theShape)
3082 RaiseIfFailed("GetTolerance", self.MeasuOp)
3085 ## Obtain description of the given shape (number of sub-shapes of each type)
3086 # @param theShape Shape to be described.
3087 # @return Description of the given shape.
3089 # @ref tui_measurement_tools_page "Example"
3090 def WhatIs(self,theShape):
3091 # Example: see GEOM_TestMeasures.py
3092 aDescr = self.MeasuOp.WhatIs(theShape)
3093 RaiseIfFailed("WhatIs", self.MeasuOp)
3096 ## Get a point, situated at the centre of mass of theShape.
3097 # @param theShape Shape to define centre of mass of.
3098 # @return New GEOM_Object, containing the created point.
3100 # @ref tui_measurement_tools_page "Example"
3101 def MakeCDG(self,theShape):
3102 # Example: see GEOM_TestMeasures.py
3103 anObj = self.MeasuOp.GetCentreOfMass(theShape)
3104 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
3107 ## Get a normale to the given face. If the point is not given,
3108 # the normale is calculated at the center of mass.
3109 # @param theFace Face to define normale of.
3110 # @param theOptionalPoint Point to compute the normale at.
3111 # @return New GEOM_Object, containing the created vector.
3113 # @ref swig_todo "Example"
3114 def GetNormal(self, theFace, theOptionalPoint = None):
3115 # Example: see GEOM_TestMeasures.py
3116 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
3117 RaiseIfFailed("GetNormal", self.MeasuOp)
3120 ## Check a topology of the given shape.
3121 # @param theShape Shape to check validity of.
3122 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked,
3123 # if TRUE, the shape's geometry will be checked also.
3124 # @return TRUE, if the shape "seems to be valid".
3125 # If theShape is invalid, prints a description of problem.
3127 # @ref tui_measurement_tools_page "Example"
3128 def CheckShape(self,theShape, theIsCheckGeom = 0):
3129 # Example: see GEOM_TestMeasures.py
3131 (IsValid, Status) = self.MeasuOp.CheckShapeWithGeometry(theShape)
3132 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
3134 (IsValid, Status) = self.MeasuOp.CheckShape(theShape)
3135 RaiseIfFailed("CheckShape", self.MeasuOp)
3140 ## Get position (LCS) of theShape.
3142 # Origin of the LCS is situated at the shape's center of mass.
3143 # Axes of the LCS are obtained from shape's location or,
3144 # if the shape is a planar face, from position of its plane.
3146 # @param theShape Shape to calculate position of.
3147 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
3148 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
3149 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
3150 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
3152 # @ref swig_todo "Example"
3153 def GetPosition(self,theShape):
3154 # Example: see GEOM_TestMeasures.py
3155 aTuple = self.MeasuOp.GetPosition(theShape)
3156 RaiseIfFailed("GetPosition", self.MeasuOp)
3159 ## Get kind of theShape.
3161 # @param theShape Shape to get a kind of.
3162 # @return Returns a kind of shape in terms of <VAR>GEOM_IKindOfShape.shape_kind</VAR> enumeration
3163 # and a list of parameters, describing the shape.
3164 # @note Concrete meaning of each value, returned via \a theIntegers
3165 # or \a theDoubles list depends on the kind of the shape.
3166 # The full list of possible outputs is:
3168 # - geompy.kind.COMPOUND nb_solids nb_faces nb_edges nb_vertices
3169 # - geompy.kind.COMPSOLID nb_solids nb_faces nb_edges nb_vertices
3171 # - geompy.kind.SHELL geompy.info.CLOSED nb_faces nb_edges nb_vertices
3172 # - geompy.kind.SHELL geompy.info.UNCLOSED nb_faces nb_edges nb_vertices
3174 # - geompy.kind.WIRE geompy.info.CLOSED nb_edges nb_vertices
3175 # - geompy.kind.WIRE geompy.info.UNCLOSED nb_edges nb_vertices
3177 # - geompy.kind.SPHERE xc yc zc R
3178 # - geompy.kind.CYLINDER xb yb zb dx dy dz R H
3179 # - geompy.kind.BOX xc yc zc ax ay az
3180 # - geompy.kind.ROTATED_BOX xc yc zc zx zy zz xx xy xz ax ay az
3181 # - geompy.kind.TORUS xc yc zc dx dy dz R_1 R_2
3182 # - geompy.kind.CONE xb yb zb dx dy dz R_1 R_2 H
3183 # - geompy.kind.POLYHEDRON nb_faces nb_edges nb_vertices
3184 # - geompy.kind.SOLID nb_faces nb_edges nb_vertices
3186 # - geompy.kind.SPHERE2D xc yc zc R
3187 # - geompy.kind.CYLINDER2D xb yb zb dx dy dz R H
3188 # - geompy.kind.TORUS2D xc yc zc dx dy dz R_1 R_2
3189 # - geompy.kind.CONE2D xc yc zc dx dy dz R_1 R_2 H
3190 # - geompy.kind.DISK_CIRCLE xc yc zc dx dy dz R
3191 # - geompy.kind.DISK_ELLIPSE xc yc zc dx dy dz R_1 R_2
3192 # - geompy.kind.POLYGON xo yo zo dx dy dz nb_edges nb_vertices
3193 # - geompy.kind.PLANE xo yo zo dx dy dz
3194 # - geompy.kind.PLANAR xo yo zo dx dy dz nb_edges nb_vertices
3195 # - geompy.kind.FACE nb_edges nb_vertices
3197 # - geompy.kind.CIRCLE xc yc zc dx dy dz R
3198 # - geompy.kind.ARC_CIRCLE xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2
3199 # - geompy.kind.ELLIPSE xc yc zc dx dy dz R_1 R_2
3200 # - geompy.kind.ARC_ELLIPSE xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2
3201 # - geompy.kind.LINE xo yo zo dx dy dz
3202 # - geompy.kind.SEGMENT x1 y1 z1 x2 y2 z2
3203 # - geompy.kind.EDGE nb_vertices
3205 # - geompy.kind.VERTEX x y z
3207 # @ref swig_todo "Example"
3208 def KindOfShape(self,theShape):
3209 # Example: see GEOM_TestMeasures.py
3210 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
3211 RaiseIfFailed("KindOfShape", self.MeasuOp)
3213 aKind = aRoughTuple[0]
3214 anInts = aRoughTuple[1]
3215 aDbls = aRoughTuple[2]
3217 # Now there is no exception from this rule:
3218 aKindTuple = [aKind] + aDbls + anInts
3220 # If they are we will regroup parameters for such kind of shape.
3222 #if aKind == kind.SOME_KIND:
3223 # # SOME_KIND int int double int double double
3224 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
3231 ## @addtogroup l2_import_export
3234 ## Import a shape from the BREP or IGES or STEP file
3235 # (depends on given format) with given name.
3236 # @param theFileName The file, containing the shape.
3237 # @param theFormatName Specify format for the file reading.
3238 # Available formats can be obtained with InsertOp.ImportTranslators() method.
3239 # If format 'IGES_SCALE' is used instead 'IGES' length unit will be
3240 # set to 'meter' and result model will be scaled.
3241 # @return New GEOM_Object, containing the imported shape.
3243 # @ref swig_Import_Export "Example"
3244 def Import(self,theFileName, theFormatName):
3245 # Example: see GEOM_TestOthers.py
3246 anObj = self.InsertOp.Import(theFileName, theFormatName)
3247 RaiseIfFailed("Import", self.InsertOp)
3250 ## Shortcut to Import() for BREP format
3252 # @ref swig_Import_Export "Example"
3253 def ImportBREP(self,theFileName):
3254 # Example: see GEOM_TestOthers.py
3255 return self.Import(theFileName, "BREP")
3257 ## Shortcut to Import() for IGES format
3259 # @ref swig_Import_Export "Example"
3260 def ImportIGES(self,theFileName):
3261 # Example: see GEOM_TestOthers.py
3262 return self.Import(theFileName, "IGES")
3264 ## Return length unit from given IGES file
3266 # @ref swig_Import_Export "Example"
3267 def GetIGESUnit(self,theFileName):
3268 # Example: see GEOM_TestOthers.py
3269 anObj = self.InsertOp.Import(theFileName, "IGES_UNIT")
3270 #RaiseIfFailed("Import", self.InsertOp)
3271 # recieve name using returned vertex
3273 vertices = self.SubShapeAll(anObj,ShapeType["VERTEX"])
3275 p = self.PointCoordinates(vertices[0])
3276 if abs(p[0]-0.01) < 1.e-6:
3278 elif abs(p[0]-0.001) < 1.e-6:
3282 ## Shortcut to Import() for STEP format
3284 # @ref swig_Import_Export "Example"
3285 def ImportSTEP(self,theFileName):
3286 # Example: see GEOM_TestOthers.py
3287 return self.Import(theFileName, "STEP")
3289 ## Export the given shape into a file with given name.
3290 # @param theObject Shape to be stored in the file.
3291 # @param theFileName Name of the file to store the given shape in.
3292 # @param theFormatName Specify format for the shape storage.
3293 # Available formats can be obtained with InsertOp.ImportTranslators() method.
3295 # @ref swig_Import_Export "Example"
3296 def Export(self,theObject, theFileName, theFormatName):
3297 # Example: see GEOM_TestOthers.py
3298 self.InsertOp.Export(theObject, theFileName, theFormatName)
3299 if self.InsertOp.IsDone() == 0:
3300 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
3304 ## Shortcut to Export() for BREP format
3306 # @ref swig_Import_Export "Example"
3307 def ExportBREP(self,theObject, theFileName):
3308 # Example: see GEOM_TestOthers.py
3309 return self.Export(theObject, theFileName, "BREP")
3311 ## Shortcut to Export() for IGES format
3313 # @ref swig_Import_Export "Example"
3314 def ExportIGES(self,theObject, theFileName):
3315 # Example: see GEOM_TestOthers.py
3316 return self.Export(theObject, theFileName, "IGES")
3318 ## Shortcut to Export() for STEP format
3320 # @ref swig_Import_Export "Example"
3321 def ExportSTEP(self,theObject, theFileName):
3322 # Example: see GEOM_TestOthers.py
3323 return self.Export(theObject, theFileName, "STEP")
3325 # end of l2_import_export
3328 ## @addtogroup l3_blocks
3331 ## Create a quadrangle face from four edges. Order of Edges is not
3332 # important. It is not necessary that edges share the same vertex.
3333 # @param E1,E2,E3,E4 Edges for the face bound.
3334 # @return New GEOM_Object, containing the created face.
3336 # @ref tui_building_by_blocks_page "Example"
3337 def MakeQuad(self,E1, E2, E3, E4):
3338 # Example: see GEOM_Spanner.py
3339 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
3340 RaiseIfFailed("MakeQuad", self.BlocksOp)
3343 ## Create a quadrangle face on two edges.
3344 # The missing edges will be built by creating the shortest ones.
3345 # @param E1,E2 Two opposite edges for the face.
3346 # @return New GEOM_Object, containing the created face.
3348 # @ref tui_building_by_blocks_page "Example"
3349 def MakeQuad2Edges(self,E1, E2):
3350 # Example: see GEOM_Spanner.py
3351 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
3352 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
3355 ## Create a quadrangle face with specified corners.
3356 # The missing edges will be built by creating the shortest ones.
3357 # @param V1,V2,V3,V4 Corner vertices for the face.
3358 # @return New GEOM_Object, containing the created face.
3360 # @ref tui_building_by_blocks_page "Example 1"
3361 # \n @ref swig_MakeQuad4Vertices "Example 2"
3362 def MakeQuad4Vertices(self,V1, V2, V3, V4):
3363 # Example: see GEOM_Spanner.py
3364 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
3365 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
3368 ## Create a hexahedral solid, bounded by the six given faces. Order of
3369 # faces is not important. It is not necessary that Faces share the same edge.
3370 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
3371 # @return New GEOM_Object, containing the created solid.
3373 # @ref tui_building_by_blocks_page "Example 1"
3374 # \n @ref swig_MakeHexa "Example 2"
3375 def MakeHexa(self,F1, F2, F3, F4, F5, F6):
3376 # Example: see GEOM_Spanner.py
3377 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
3378 RaiseIfFailed("MakeHexa", self.BlocksOp)
3381 ## Create a hexahedral solid between two given faces.
3382 # The missing faces will be built by creating the smallest ones.
3383 # @param F1,F2 Two opposite faces for the hexahedral solid.
3384 # @return New GEOM_Object, containing the created solid.
3386 # @ref tui_building_by_blocks_page "Example 1"
3387 # \n @ref swig_MakeHexa2Faces "Example 2"
3388 def MakeHexa2Faces(self,F1, F2):
3389 # Example: see GEOM_Spanner.py
3390 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
3391 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
3397 ## @addtogroup l3_blocks_op
3400 ## Get a vertex, found in the given shape by its coordinates.
3401 # @param theShape Block or a compound of blocks.
3402 # @param theX,theY,theZ Coordinates of the sought vertex.
3403 # @param theEpsilon Maximum allowed distance between the resulting
3404 # vertex and point with the given coordinates.
3405 # @return New GEOM_Object, containing the found vertex.
3407 # @ref swig_GetPoint "Example"
3408 def GetPoint(self,theShape, theX, theY, theZ, theEpsilon):
3409 # Example: see GEOM_TestOthers.py
3410 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
3411 RaiseIfFailed("GetPoint", self.BlocksOp)
3414 ## Get an edge, found in the given shape by two given vertices.
3415 # @param theShape Block or a compound of blocks.
3416 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
3417 # @return New GEOM_Object, containing the found edge.
3419 # @ref swig_todo "Example"
3420 def GetEdge(self,theShape, thePoint1, thePoint2):
3421 # Example: see GEOM_Spanner.py
3422 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
3423 RaiseIfFailed("GetEdge", self.BlocksOp)
3426 ## Find an edge of the given shape, which has minimal distance to the given point.
3427 # @param theShape Block or a compound of blocks.
3428 # @param thePoint Point, close to the desired edge.
3429 # @return New GEOM_Object, containing the found edge.
3431 # @ref swig_GetEdgeNearPoint "Example"
3432 def GetEdgeNearPoint(self,theShape, thePoint):
3433 # Example: see GEOM_TestOthers.py
3434 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
3435 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
3438 ## Returns a face, found in the given shape by four given corner vertices.
3439 # @param theShape Block or a compound of blocks.
3440 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
3441 # @return New GEOM_Object, containing the found face.
3443 # @ref swig_todo "Example"
3444 def GetFaceByPoints(self,theShape, thePoint1, thePoint2, thePoint3, thePoint4):
3445 # Example: see GEOM_Spanner.py
3446 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
3447 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
3450 ## Get a face of block, found in the given shape by two given edges.
3451 # @param theShape Block or a compound of blocks.
3452 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
3453 # @return New GEOM_Object, containing the found face.
3455 # @ref swig_todo "Example"
3456 def GetFaceByEdges(self,theShape, theEdge1, theEdge2):
3457 # Example: see GEOM_Spanner.py
3458 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
3459 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
3462 ## Find a face, opposite to the given one in the given block.
3463 # @param theBlock Must be a hexahedral solid.
3464 # @param theFace Face of \a theBlock, opposite to the desired face.
3465 # @return New GEOM_Object, containing the found face.
3467 # @ref swig_GetOppositeFace "Example"
3468 def GetOppositeFace(self,theBlock, theFace):
3469 # Example: see GEOM_Spanner.py
3470 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
3471 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
3474 ## Find a face of the given shape, which has minimal distance to the given point.
3475 # @param theShape Block or a compound of blocks.
3476 # @param thePoint Point, close to the desired face.
3477 # @return New GEOM_Object, containing the found face.
3479 # @ref swig_GetFaceNearPoint "Example"
3480 def GetFaceNearPoint(self,theShape, thePoint):
3481 # Example: see GEOM_Spanner.py
3482 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
3483 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
3486 ## Find a face of block, whose outside normale has minimal angle with the given vector.
3487 # @param theBlock Block or a compound of blocks.
3488 # @param theVector Vector, close to the normale of the desired face.
3489 # @return New GEOM_Object, containing the found face.
3491 # @ref swig_todo "Example"
3492 def GetFaceByNormale(self, theBlock, theVector):
3493 # Example: see GEOM_Spanner.py
3494 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
3495 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
3498 # end of l3_blocks_op
3501 ## @addtogroup l4_blocks_measure
3504 ## Check, if the compound of blocks is given.
3505 # To be considered as a compound of blocks, the
3506 # given shape must satisfy the following conditions:
3507 # - Each element of the compound should be a Block (6 faces and 12 edges).
3508 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
3509 # - The compound should be connexe.
3510 # - The glue between two quadrangle faces should be applied.
3511 # @param theCompound The compound to check.
3512 # @return TRUE, if the given shape is a compound of blocks.
3513 # If theCompound is not valid, prints all discovered errors.
3515 # @ref tui_measurement_tools_page "Example 1"
3516 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
3517 def CheckCompoundOfBlocks(self,theCompound):
3518 # Example: see GEOM_Spanner.py
3519 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
3520 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
3522 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
3526 ## Remove all seam and degenerated edges from \a theShape.
3527 # Unite faces and edges, sharing one surface. It means that
3528 # this faces must have references to one C++ surface object (handle).
3529 # @param theShape The compound or single solid to remove irregular edges from.
3530 # @param theOptimumNbFaces If more than zero, unite faces only for those solids,
3531 # that have more than theOptimumNbFaces faces. If zero, unite faces always,
3532 # regardsless their quantity in the solid. If negative (the default value),
3533 # do not unite faces at all. For blocks repairing recommended value is 6.
3534 # @return Improved shape.
3536 # @ref swig_RemoveExtraEdges "Example"
3537 def RemoveExtraEdges(self,theShape,theOptimumNbFaces=-1):
3538 # Example: see GEOM_TestOthers.py
3539 anObj = self.BlocksOp.RemoveExtraEdges(theShape,theOptimumNbFaces)
3540 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
3543 ## Check, if the given shape is a blocks compound.
3544 # Fix all detected errors.
3545 # \note Single block can be also fixed by this method.
3546 # @param theShape The compound to check and improve.
3547 # @return Improved compound.
3549 # @ref swig_CheckAndImprove "Example"
3550 def CheckAndImprove(self,theShape):
3551 # Example: see GEOM_TestOthers.py
3552 anObj = self.BlocksOp.CheckAndImprove(theShape)
3553 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
3556 # end of l4_blocks_measure
3559 ## @addtogroup l3_blocks_op
3562 ## Get all the blocks, contained in the given compound.
3563 # @param theCompound The compound to explode.
3564 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
3565 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
3566 # \note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
3567 # @return List of GEOM_Objects, containing the retrieved blocks.
3569 # @ref tui_explode_on_blocks "Example 1"
3570 # \n @ref swig_MakeBlockExplode "Example 2"
3571 def MakeBlockExplode(self,theCompound, theMinNbFaces, theMaxNbFaces):
3572 # Example: see GEOM_TestOthers.py
3573 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
3574 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
3575 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
3577 anObj.SetParameters(Parameters)
3581 ## Find block, containing the given point inside its volume or on boundary.
3582 # @param theCompound Compound, to find block in.
3583 # @param thePoint Point, close to the desired block. If the point lays on
3584 # boundary between some blocks, we return block with nearest center.
3585 # @return New GEOM_Object, containing the found block.
3587 # @ref swig_todo "Example"
3588 def GetBlockNearPoint(self,theCompound, thePoint):
3589 # Example: see GEOM_Spanner.py
3590 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
3591 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
3594 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
3595 # @param theCompound Compound, to find block in.
3596 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
3597 # @return New GEOM_Object, containing the found block.
3599 # @ref swig_GetBlockByParts "Example"
3600 def GetBlockByParts(self,theCompound, theParts):
3601 # Example: see GEOM_TestOthers.py
3602 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
3603 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
3606 ## Return all blocks, containing all the elements, passed as the parts.
3607 # @param theCompound Compound, to find blocks in.
3608 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
3609 # @return List of GEOM_Objects, containing the found blocks.
3611 # @ref swig_todo "Example"
3612 def GetBlocksByParts(self,theCompound, theParts):
3613 # Example: see GEOM_Spanner.py
3614 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
3615 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
3618 ## Multi-transformate block and glue the result.
3619 # Transformation is defined so, as to superpose direction faces.
3620 # @param Block Hexahedral solid to be multi-transformed.
3621 # @param DirFace1 ID of First direction face.
3622 # @param DirFace2 ID of Second direction face.
3623 # @param NbTimes Quantity of transformations to be done.
3624 # \note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
3625 # @return New GEOM_Object, containing the result shape.
3627 # @ref tui_multi_transformation "Example"
3628 def MakeMultiTransformation1D(self,Block, DirFace1, DirFace2, NbTimes):
3629 # Example: see GEOM_Spanner.py
3630 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
3631 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
3632 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
3633 anObj.SetParameters(Parameters)
3636 ## Multi-transformate block and glue the result.
3637 # @param Block Hexahedral solid to be multi-transformed.
3638 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
3639 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
3640 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
3641 # @return New GEOM_Object, containing the result shape.
3643 # @ref tui_multi_transformation "Example"
3644 def MakeMultiTransformation2D(self,Block, DirFace1U, DirFace2U, NbTimesU,
3645 DirFace1V, DirFace2V, NbTimesV):
3646 # Example: see GEOM_Spanner.py
3647 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
3648 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
3649 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
3650 DirFace1V, DirFace2V, NbTimesV)
3651 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
3652 anObj.SetParameters(Parameters)
3655 ## Build all possible propagation groups.
3656 # Propagation group is a set of all edges, opposite to one (main)
3657 # edge of this group directly or through other opposite edges.
3658 # Notion of Opposite Edge make sence only on quadrangle face.
3659 # @param theShape Shape to build propagation groups on.
3660 # @return List of GEOM_Objects, each of them is a propagation group.
3662 # @ref swig_Propagate "Example"
3663 def Propagate(self,theShape):
3664 # Example: see GEOM_TestOthers.py
3665 listChains = self.BlocksOp.Propagate(theShape)
3666 RaiseIfFailed("Propagate", self.BlocksOp)
3669 # end of l3_blocks_op
3672 ## @addtogroup l3_groups
3675 ## Creates a new group which will store sub shapes of theMainShape
3676 # @param theMainShape is a GEOM object on which the group is selected
3677 # @param theShapeType defines a shape type of the group
3678 # @return a newly created GEOM group
3680 # @ref tui_working_with_groups_page "Example 1"
3681 # \n @ref swig_CreateGroup "Example 2"
3682 def CreateGroup(self,theMainShape, theShapeType):
3683 # Example: see GEOM_TestOthers.py
3684 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
3685 RaiseIfFailed("CreateGroup", self.GroupOp)
3688 ## Adds a sub object with ID theSubShapeId to the group
3689 # @param theGroup is a GEOM group to which the new sub shape is added
3690 # @param theSubShapeID is a sub shape ID in the main object.
3691 # \note Use method GetSubShapeID() to get an unique ID of the sub shape
3693 # @ref tui_working_with_groups_page "Example"
3694 def AddObject(self,theGroup, theSubShapeID):
3695 # Example: see GEOM_TestOthers.py
3696 self.GroupOp.AddObject(theGroup, theSubShapeID)
3697 RaiseIfFailed("AddObject", self.GroupOp)
3700 ## Removes a sub object with ID \a theSubShapeId from the group
3701 # @param theGroup is a GEOM group from which the new sub shape is removed
3702 # @param theSubShapeID is a sub shape ID in the main object.
3703 # \note Use method GetSubShapeID() to get an unique ID of the sub shape
3705 # @ref tui_working_with_groups_page "Example"
3706 def RemoveObject(self,theGroup, theSubShapeID):
3707 # Example: see GEOM_TestOthers.py
3708 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
3709 RaiseIfFailed("RemoveObject", self.GroupOp)
3712 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
3713 # @param theGroup is a GEOM group to which the new sub shapes are added.
3714 # @param theSubShapes is a list of sub shapes to be added.
3716 # @ref tui_working_with_groups_page "Example"
3717 def UnionList (self,theGroup, theSubShapes):
3718 # Example: see GEOM_TestOthers.py
3719 self.GroupOp.UnionList(theGroup, theSubShapes)
3720 RaiseIfFailed("UnionList", self.GroupOp)
3723 ## Works like the above method, but argument
3724 # theSubShapes here is a list of sub-shapes indices
3726 # @ref swig_UnionIDs "Example"
3727 def UnionIDs(self,theGroup, theSubShapes):
3728 # Example: see GEOM_TestOthers.py
3729 self.GroupOp.UnionIDs(theGroup, theSubShapes)
3730 RaiseIfFailed("UnionIDs", self.GroupOp)
3733 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
3734 # @param theGroup is a GEOM group from which the sub-shapes are removed.
3735 # @param theSubShapes is a list of sub-shapes to be removed.
3737 # @ref tui_working_with_groups_page "Example"
3738 def DifferenceList (self,theGroup, theSubShapes):
3739 # Example: see GEOM_TestOthers.py
3740 self.GroupOp.DifferenceList(theGroup, theSubShapes)
3741 RaiseIfFailed("DifferenceList", self.GroupOp)
3744 ## Works like the above method, but argument
3745 # theSubShapes here is a list of sub-shapes indices
3747 # @ref swig_DifferenceIDs "Example"
3748 def DifferenceIDs(self,theGroup, theSubShapes):
3749 # Example: see GEOM_TestOthers.py
3750 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
3751 RaiseIfFailed("DifferenceIDs", self.GroupOp)
3754 ## Returns a list of sub objects ID stored in the group
3755 # @param theGroup is a GEOM group for which a list of IDs is requested
3757 # @ref swig_GetObjectIDs "Example"
3758 def GetObjectIDs(self,theGroup):
3759 # Example: see GEOM_TestOthers.py
3760 ListIDs = self.GroupOp.GetObjects(theGroup)
3761 RaiseIfFailed("GetObjects", self.GroupOp)
3764 ## Returns a type of sub objects stored in the group
3765 # @param theGroup is a GEOM group which type is returned.
3767 # @ref swig_GetType "Example"
3768 def GetType(self,theGroup):
3769 # Example: see GEOM_TestOthers.py
3770 aType = self.GroupOp.GetType(theGroup)
3771 RaiseIfFailed("GetType", self.GroupOp)
3774 ## Returns a main shape associated with the group
3775 # @param theGroup is a GEOM group for which a main shape object is requested
3776 # @return a GEOM object which is a main shape for theGroup
3778 # @ref swig_GetMainShape "Example"
3779 def GetMainShape(self,theGroup):
3780 # Example: see GEOM_TestOthers.py
3781 anObj = self.GroupOp.GetMainShape(theGroup)
3782 RaiseIfFailed("GetMainShape", self.GroupOp)
3785 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
3786 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
3788 # @ref swig_todo "Example"
3789 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1):
3790 edges = self.SubShapeAll(theShape, ShapeType["EDGE"])
3793 Props = self.BasicProperties(edge)
3794 if min_length <= Props[0] and Props[0] <= max_length:
3795 if (not include_min) and (min_length == Props[0]):
3798 if (not include_max) and (Props[0] == max_length):
3801 edges_in_range.append(edge)
3803 if len(edges_in_range) <= 0:
3804 print "No edges found by given criteria"
3807 group_edges = self.CreateGroup(theShape, ShapeType["EDGE"])
3808 self.UnionList(group_edges, edges_in_range)
3812 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
3813 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
3815 # @ref swig_todo "Example"
3816 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
3817 nb_selected = sg.SelectedCount()
3819 print "Select a shape before calling this function, please."
3822 print "Only one shape must be selected"
3825 id_shape = sg.getSelected(0)
3826 shape = IDToObject( id_shape )
3828 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
3832 if include_min: left_str = " <= "
3833 if include_max: right_str = " <= "
3835 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
3836 + left_str + "length" + right_str + `max_length`)
3838 sg.updateObjBrowser(1)
3845 ## Create a copy of the given object
3846 # @ingroup l1_geompy_auxiliary
3848 # @ref swig_all_advanced "Example"
3849 def MakeCopy(self,theOriginal):
3850 # Example: see GEOM_TestAll.py
3851 anObj = self.InsertOp.MakeCopy(theOriginal)
3852 RaiseIfFailed("MakeCopy", self.InsertOp)
3855 ## Add Path to load python scripts from
3856 # @ingroup l1_geompy_auxiliary
3857 def addPath(self,Path):
3858 if (sys.path.count(Path) < 1):
3859 sys.path.append(Path)
3862 #Register the new proxy for GEOM_Gen
3863 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geompyDC)