1 # Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 # This library is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU Lesser General Public
8 # License as published by the Free Software Foundation; either
9 # version 2.1 of the License.
11 # This library is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # Lesser General Public License for more details.
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with this library; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 # GEOM GEOM_SWIG : binding of C++ omplementaion with Python
24 # Author : Paul RASCLE, EDF
32 ## @defgroup l1_geompy_auxiliary Auxiliary data structures and methods
34 ## @defgroup l1_geompy_purpose All package methods, grouped by their purpose
36 ## @defgroup l2_import_export Importing/exporting geometrical objects
37 ## @defgroup l2_creating Creating geometrical objects
39 ## @defgroup l3_basic_go Creating Basic Geometric Objects
41 ## @defgroup l4_curves Creating Curves
44 ## @defgroup l3_3d_primitives Creating 3D Primitives
45 ## @defgroup l3_complex Creating Complex Objects
46 ## @defgroup l3_groups Working with groups
47 ## @defgroup l3_blocks Building by blocks
49 ## @defgroup l4_blocks_measure Check and Improve
52 ## @defgroup l3_sketcher Sketcher
53 ## @defgroup l3_advanced Creating Advanced Geometrical Objects
55 ## @defgroup l4_decompose Decompose objects
56 ## @defgroup l4_access Access to sub-shapes by their unique IDs inside the main shape
57 ## @defgroup l4_obtain Access to subshapes by a criteria
62 ## @defgroup l2_transforming Transforming geometrical objects
64 ## @defgroup l3_basic_op Basic Operations
65 ## @defgroup l3_boolean Boolean Operations
66 ## @defgroup l3_transform Transformation Operations
67 ## @defgroup l3_local Local Operations (Fillet and Chamfer)
68 ## @defgroup l3_blocks_op Blocks Operations
69 ## @defgroup l3_healing Repairing Operations
70 ## @defgroup l3_restore_ss Restore presentation parameters and a tree of subshapes
73 ## @defgroup l2_measure Using measurement tools
81 from salome_notebook import *
86 ## Enumeration ShapeType as a dictionary
87 # @ingroup l1_geompy_auxiliary
88 ShapeType = {"COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8}
90 ## Raise an Error, containing the Method_name, if Operation is Failed
91 ## @ingroup l1_geompy_auxiliary
92 def RaiseIfFailed (Method_name, Operation):
93 if Operation.IsDone() == 0 and Operation.GetErrorCode() != "NOT_FOUND_ANY":
94 raise RuntimeError, Method_name + " : " + Operation.GetErrorCode()
96 ## Return list of variables value from salome notebook
97 ## @ingroup l1_geompy_auxiliary
98 def ParseParameters(*parameters):
101 for parameter in parameters:
102 if isinstance(parameter,str):
103 if notebook.isVariable(parameter):
104 Result.append(notebook.get(parameter))
106 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
108 Result.append(parameter)
111 StringResult = StringResult + str(parameter)
112 StringResult = StringResult + ":"
114 StringResult = StringResult[:len(StringResult)-1]
115 Result.append(StringResult)
118 ## Return list of variables value from salome notebook
119 ## @ingroup l1_geompy_auxiliary
123 for parameter in list:
124 if isinstance(parameter,str) and notebook.isVariable(parameter):
125 Result.append(str(notebook.get(parameter)))
128 Result.append(str(parameter))
131 StringResult = StringResult + str(parameter)
132 StringResult = StringResult + ":"
134 StringResult = StringResult[:len(StringResult)-1]
135 return Result, StringResult
137 ## Return list of variables value from salome notebook
138 ## @ingroup l1_geompy_auxiliary
139 def ParseSketcherCommand(command):
142 sections = command.split(":")
143 for section in sections:
144 parameters = section.split(" ")
146 for parameter in parameters:
147 if paramIndex > 1 and parameter.find("'") != -1:
148 parameter = parameter.replace("'","")
149 if notebook.isVariable(parameter):
150 Result = Result + str(notebook.get(parameter)) + " "
153 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
157 Result = Result + str(parameter) + " "
160 StringResult = StringResult + parameter
161 StringResult = StringResult + ":"
163 paramIndex = paramIndex + 1
165 Result = Result[:len(Result)-1] + ":"
167 Result = Result[:len(Result)-1]
168 return Result, StringResult
170 ## Kinds of shape enumeration
171 # @ingroup l1_geompy_auxiliary
172 kind = GEOM.GEOM_IKindOfShape
174 ## Information about closed/unclosed state of shell or wire
175 # @ingroup l1_geompy_auxiliary
182 class geompyDC(GEOM._objref_GEOM_Gen):
185 GEOM._objref_GEOM_Gen.__init__(self)
186 self.myBuilder = None
204 ## @addtogroup l1_geompy_auxiliary
206 def init_geom(self,theStudy):
207 self.myStudy = theStudy
208 self.myStudyId = self.myStudy._get_StudyId()
209 self.myBuilder = self.myStudy.NewBuilder()
210 self.father = self.myStudy.FindComponent("GEOM")
211 if self.father is None:
212 self.father = self.myBuilder.NewComponent("GEOM")
213 A1 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributeName")
214 FName = A1._narrow(SALOMEDS.AttributeName)
215 FName.SetValue("Geometry")
216 A2 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributePixMap")
217 aPixmap = A2._narrow(SALOMEDS.AttributePixMap)
218 aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry")
219 self.myBuilder.DefineComponentInstance(self.father,self)
221 self.BasicOp = self.GetIBasicOperations (self.myStudyId)
222 self.CurvesOp = self.GetICurvesOperations (self.myStudyId)
223 self.PrimOp = self.GetI3DPrimOperations (self.myStudyId)
224 self.ShapesOp = self.GetIShapesOperations (self.myStudyId)
225 self.HealOp = self.GetIHealingOperations (self.myStudyId)
226 self.InsertOp = self.GetIInsertOperations (self.myStudyId)
227 self.BoolOp = self.GetIBooleanOperations (self.myStudyId)
228 self.TrsfOp = self.GetITransformOperations(self.myStudyId)
229 self.LocalOp = self.GetILocalOperations (self.myStudyId)
230 self.MeasuOp = self.GetIMeasureOperations (self.myStudyId)
231 self.BlocksOp = self.GetIBlocksOperations (self.myStudyId)
232 self.GroupOp = self.GetIGroupOperations (self.myStudyId)
235 ## Get name for sub-shape aSubObj of shape aMainObj
237 # @ref swig_SubShapeAllSorted "Example"
238 def SubShapeName(self,aSubObj, aMainObj):
239 # Example: see GEOM_TestAll.py
241 #aSubId = orb.object_to_string(aSubObj)
242 #aMainId = orb.object_to_string(aMainObj)
243 #index = gg.getIndexTopology(aSubId, aMainId)
244 #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
245 index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
246 name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
249 ## Publish in study aShape with name aName
251 # \param aShape the shape to be published
252 # \param aName the name for the shape
253 # \param doRestoreSubShapes if True, finds and publishes also
254 # sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
255 # and published sub-shapes of arguments
256 # \param theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes for
257 # these arguments description
258 # \return study entry of the published shape in form of string
260 # @ref swig_MakeQuad4Vertices "Example"
261 def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
262 theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
263 # Example: see GEOM_TestAll.py
265 aSObject = self.AddInStudy(self.myStudy, aShape, aName, None)
266 if doRestoreSubShapes:
267 self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs,
268 theFindMethod, theInheritFirstArg)
270 print "addToStudy() failed"
272 return aShape.GetStudyEntry()
274 ## Publish in study aShape with name aName as sub-object of previously published aFather
276 # @ref swig_SubShapeAllSorted "Example"
277 def addToStudyInFather(self, aFather, aShape, aName):
278 # Example: see GEOM_TestAll.py
280 aSObject = self.AddInStudy(self.myStudy, aShape, aName, aFather)
282 print "addToStudyInFather() failed"
284 return aShape.GetStudyEntry()
286 # end of l1_geompy_auxiliary
289 ## @addtogroup l3_restore_ss
292 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
293 # To be used from python scripts out of geompy.addToStudy (non-default usage)
294 # \param theObject published GEOM object, arguments of which will be published
295 # \param theArgs list of GEOM_Object, operation arguments to be published.
296 # If this list is empty, all operation arguments will be published
297 # \param theFindMethod method to search subshapes, corresponding to arguments and
298 # their subshapes. Value from enumeration GEOM::find_shape_method.
299 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
300 # Do not publish subshapes in place of arguments, but only
301 # in place of subshapes of the first argument,
302 # because the whole shape corresponds to the first argument.
303 # Mainly to be used after transformations, but it also can be
304 # usefull after partition with one object shape, and some other
305 # operations, where only the first argument has to be considered.
306 # If theObject has only one argument shape, this flag is automatically
307 # considered as True, not regarding really passed value.
308 # \return True in case of success, False otherwise.
310 # @ref tui_restore_prs_params "Example"
311 def RestoreSubShapes (self, theObject, theArgs=[],
312 theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
313 # Example: see GEOM_TestAll.py
314 return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
315 theFindMethod, theInheritFirstArg)
317 # end of l3_restore_ss
320 ## @addtogroup l3_basic_go
323 ## Create point by three coordinates.
324 # @param theX The X coordinate of the point.
325 # @param theY The Y coordinate of the point.
326 # @param theZ The Z coordinate of the point.
327 # @return New GEOM_Object, containing the created point.
329 # @ref tui_creation_point "Example"
330 def MakeVertex(self,theX, theY, theZ):
331 # Example: see GEOM_TestAll.py
332 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
333 anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
334 RaiseIfFailed("MakePointXYZ", self.BasicOp)
335 anObj.SetParameters(Parameters)
338 ## Create a point, distant from the referenced point
339 # on the given distances along the coordinate axes.
340 # @param theReference The referenced point.
341 # @param theX Displacement from the referenced point along OX axis.
342 # @param theY Displacement from the referenced point along OY axis.
343 # @param theZ Displacement from the referenced point along OZ axis.
344 # @return New GEOM_Object, containing the created point.
346 # @ref tui_creation_point "Example"
347 def MakeVertexWithRef(self,theReference, theX, theY, theZ):
348 # Example: see GEOM_TestAll.py
349 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
350 anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
351 RaiseIfFailed("MakePointWithReference", self.BasicOp)
352 anObj.SetParameters(Parameters)
355 ## Create a point, corresponding to the given parameter on the given curve.
356 # @param theRefCurve The referenced curve.
357 # @param theParameter Value of parameter on the referenced curve.
358 # @return New GEOM_Object, containing the created point.
360 # @ref tui_creation_point "Example"
361 def MakeVertexOnCurve(self,theRefCurve, theParameter):
362 # Example: see GEOM_TestAll.py
363 theParameter, Parameters = ParseParameters(theParameter)
364 anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter)
365 RaiseIfFailed("MakePointOnCurve", self.BasicOp)
366 anObj.SetParameters(Parameters)
369 ## Create a point, corresponding to the given parameters on the
371 # @param theRefSurf The referenced surface.
372 # @param theUParameter Value of U-parameter on the referenced surface.
373 # @param theVParameter Value of V-parameter on the referenced surface.
374 # @return New GEOM_Object, containing the created point.
376 # @ref swig_MakeVertexOnSurface "Example"
377 def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter):
378 theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
379 # Example: see GEOM_TestAll.py
380 anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
381 RaiseIfFailed("MakePointOnSurface", self.BasicOp)
382 anObj.SetParameters(Parameters);
385 ## Create a point on intersection of two lines.
386 # @param theRefLine1, theRefLine2 The referenced lines.
387 # @return New GEOM_Object, containing the created point.
389 # @ref swig_MakeVertexOnLinesIntersection "Example"
390 def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2):
391 # Example: see GEOM_TestAll.py
392 anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
393 RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
396 ## Create a tangent, corresponding to the given parameter on the given curve.
397 # @param theRefCurve The referenced curve.
398 # @param theParameter Value of parameter on the referenced curve.
399 # @return New GEOM_Object, containing the created tangent.
401 # @ref swig_MakeTangentOnCurve "Example"
402 def MakeTangentOnCurve(self, theRefCurve, theParameter):
403 anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
404 RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
407 ## Create a vector with the given components.
408 # @param theDX X component of the vector.
409 # @param theDY Y component of the vector.
410 # @param theDZ Z component of the vector.
411 # @return New GEOM_Object, containing the created vector.
413 # @ref tui_creation_vector "Example"
414 def MakeVectorDXDYDZ(self,theDX, theDY, theDZ):
415 # Example: see GEOM_TestAll.py
416 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
417 anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
418 RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
419 anObj.SetParameters(Parameters)
422 ## Create a vector between two points.
423 # @param thePnt1 Start point for the vector.
424 # @param thePnt2 End point for the vector.
425 # @return New GEOM_Object, containing the created vector.
427 # @ref tui_creation_vector "Example"
428 def MakeVector(self,thePnt1, thePnt2):
429 # Example: see GEOM_TestAll.py
430 anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
431 RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
434 ## Create a line, passing through the given point
435 # and parrallel to the given direction
436 # @param thePnt Point. The resulting line will pass through it.
437 # @param theDir Direction. The resulting line will be parallel to it.
438 # @return New GEOM_Object, containing the created line.
440 # @ref tui_creation_line "Example"
441 def MakeLine(self,thePnt, theDir):
442 # Example: see GEOM_TestAll.py
443 anObj = self.BasicOp.MakeLine(thePnt, theDir)
444 RaiseIfFailed("MakeLine", self.BasicOp)
447 ## Create a line, passing through the given points
448 # @param thePnt1 First of two points, defining the line.
449 # @param thePnt2 Second of two points, defining the line.
450 # @return New GEOM_Object, containing the created line.
452 # @ref tui_creation_line "Example"
453 def MakeLineTwoPnt(self,thePnt1, thePnt2):
454 # Example: see GEOM_TestAll.py
455 anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
456 RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
459 ## Create a line on two faces intersection.
460 # @param theFace1 First of two faces, defining the line.
461 # @param theFace2 Second of two faces, defining the line.
462 # @return New GEOM_Object, containing the created line.
464 # @ref swig_MakeLineTwoFaces "Example"
465 def MakeLineTwoFaces(self, theFace1, theFace2):
466 # Example: see GEOM_TestAll.py
467 anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
468 RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
471 ## Create a plane, passing through the given point
472 # and normal to the given vector.
473 # @param thePnt Point, the plane has to pass through.
474 # @param theVec Vector, defining the plane normal direction.
475 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
476 # @return New GEOM_Object, containing the created plane.
478 # @ref tui_creation_plane "Example"
479 def MakePlane(self,thePnt, theVec, theTrimSize):
480 # Example: see GEOM_TestAll.py
481 theTrimSize, Parameters = ParseParameters(theTrimSize);
482 anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
483 RaiseIfFailed("MakePlanePntVec", self.BasicOp)
484 anObj.SetParameters(Parameters)
487 ## Create a plane, passing through the three given points
488 # @param thePnt1 First of three points, defining the plane.
489 # @param thePnt2 Second of three points, defining the plane.
490 # @param thePnt3 Fird of three points, defining the plane.
491 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
492 # @return New GEOM_Object, containing the created plane.
494 # @ref tui_creation_plane "Example"
495 def MakePlaneThreePnt(self,thePnt1, thePnt2, thePnt3, theTrimSize):
496 # Example: see GEOM_TestAll.py
497 theTrimSize, Parameters = ParseParameters(theTrimSize);
498 anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
499 RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
500 anObj.SetParameters(Parameters)
503 ## Create a plane, similar to the existing one, but with another size of representing face.
504 # @param theFace Referenced plane or LCS(Marker).
505 # @param theTrimSize New half size of a side of quadrangle face, representing the plane.
506 # @return New GEOM_Object, containing the created plane.
508 # @ref tui_creation_plane "Example"
509 def MakePlaneFace(self,theFace, theTrimSize):
510 # Example: see GEOM_TestAll.py
511 theTrimSize, Parameters = ParseParameters(theTrimSize);
512 anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
513 RaiseIfFailed("MakePlaneFace", self.BasicOp)
514 anObj.SetParameters(Parameters)
517 ## Create a local coordinate system.
518 # @param OX,OY,OZ Three coordinates of coordinate system origin.
519 # @param XDX,XDY,XDZ Three components of OX direction
520 # @param YDX,YDY,YDZ Three components of OY direction
521 # @return New GEOM_Object, containing the created coordinate system.
523 # @ref swig_MakeMarker "Example"
524 def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ):
525 # Example: see GEOM_TestAll.py
526 OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
527 anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
528 RaiseIfFailed("MakeMarker", self.BasicOp)
529 anObj.SetParameters(Parameters)
532 ## Create a local coordinate system.
533 # @param theOrigin Point of coordinate system origin.
534 # @param theXVec Vector of X direction
535 # @param theYVec Vector of Y direction
536 # @return New GEOM_Object, containing the created coordinate system.
538 # @ref swig_MakeMarker "Example"
539 def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec):
540 O = self.PointCoordinates( theOrigin )
542 for vec in [ theXVec, theYVec ]:
543 v1, v2 = self.SubShapeAll( vec, ShapeType["VERTEX"] )
544 p1 = self.PointCoordinates( v1 )
545 p2 = self.PointCoordinates( v2 )
546 for i in range( 0, 3 ):
547 OXOY.append( p2[i] - p1[i] )
549 anObj = self.BasicOp.MakeMarker( O[0], O[1], O[2],
550 OXOY[0], OXOY[1], OXOY[2],
551 OXOY[3], OXOY[4], OXOY[5], )
552 RaiseIfFailed("MakeMarker", self.BasicOp)
558 ## @addtogroup l4_curves
561 ## Create an arc of circle, passing through three given points.
562 # @param thePnt1 Start point of the arc.
563 # @param thePnt2 Middle point of the arc.
564 # @param thePnt3 End point of the arc.
565 # @return New GEOM_Object, containing the created arc.
567 # @ref swig_MakeArc "Example"
568 def MakeArc(self,thePnt1, thePnt2, thePnt3):
569 # Example: see GEOM_TestAll.py
570 anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
571 RaiseIfFailed("MakeArc", self.CurvesOp)
574 ## Create an arc of circle from a center and 2 points.
575 # @param thePnt1 Center of the arc
576 # @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
577 # @param thePnt3 End point of the arc (Gives also a direction)
578 # @param theSense Orientation of the arc
579 # @return New GEOM_Object, containing the created arc.
581 # @ref swig_MakeArc "Example"
582 def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False):
583 # Example: see GEOM_TestAll.py
584 anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
585 RaiseIfFailed("MakeArcCenter", self.CurvesOp)
588 ## Create an arc of ellipse, of center and two points.
589 # @param theCenter Center of the arc.
590 # @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
591 # @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
592 # @return New GEOM_Object, containing the created arc.
594 # @ref swig_MakeArc "Example"
595 def MakeArcOfEllipse(self,theCenter, thePnt1, thePnt2):
596 # Example: see GEOM_TestAll.py
597 anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
598 RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
601 ## Create a circle with given center, normal vector and radius.
602 # @param thePnt Circle center.
603 # @param theVec Vector, normal to the plane of the circle.
604 # @param theR Circle radius.
605 # @return New GEOM_Object, containing the created circle.
607 # @ref tui_creation_circle "Example"
608 def MakeCircle(self, thePnt, theVec, theR):
609 # Example: see GEOM_TestAll.py
610 theR, Parameters = ParseParameters(theR)
611 anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
612 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
613 anObj.SetParameters(Parameters)
616 ## Create a circle with given radius.
617 # Center of the circle will be in the origin of global
618 # coordinate system and normal vector will be codirected with Z axis
619 # @param theR Circle radius.
620 # @return New GEOM_Object, containing the created circle.
621 def MakeCircleR(self, theR):
622 anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
623 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
626 ## Create a circle, passing through three given points
627 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
628 # @return New GEOM_Object, containing the created circle.
630 # @ref tui_creation_circle "Example"
631 def MakeCircleThreePnt(self,thePnt1, thePnt2, thePnt3):
632 # Example: see GEOM_TestAll.py
633 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
634 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
637 ## Create a circle, with given point1 as center,
638 # passing through the point2 as radius and laying in the plane,
639 # defined by all three given points.
640 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
641 # @return New GEOM_Object, containing the created circle.
643 # @ref swig_MakeCircle "Example"
644 def MakeCircleCenter2Pnt(self,thePnt1, thePnt2, thePnt3):
645 # Example: see GEOM_example6.py
646 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
647 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
650 ## Create an ellipse with given center, normal vector and radiuses.
651 # @param thePnt Ellipse center.
652 # @param theVec Vector, normal to the plane of the ellipse.
653 # @param theRMajor Major ellipse radius.
654 # @param theRMinor Minor ellipse radius.
655 # @param theVecMaj Vector, direction of the ellipse's main axis.
656 # @return New GEOM_Object, containing the created ellipse.
658 # @ref tui_creation_ellipse "Example"
659 def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None):
660 # Example: see GEOM_TestAll.py
661 theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
662 if theVecMaj is not None:
663 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
665 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
667 RaiseIfFailed("MakeEllipse", self.CurvesOp)
668 anObj.SetParameters(Parameters)
671 ## Create an ellipse with given radiuses.
672 # Center of the ellipse will be in the origin of global
673 # coordinate system and normal vector will be codirected with Z axis
674 # @param theRMajor Major ellipse radius.
675 # @param theRMinor Minor ellipse radius.
676 # @return New GEOM_Object, containing the created ellipse.
677 def MakeEllipseRR(self, theRMajor, theRMinor):
678 anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
679 RaiseIfFailed("MakeEllipse", self.CurvesOp)
682 ## Create a polyline on the set of points.
683 # @param thePoints Sequence of points for the polyline.
684 # @return New GEOM_Object, containing the created polyline.
686 # @ref tui_creation_curve "Example"
687 def MakePolyline(self,thePoints):
688 # Example: see GEOM_TestAll.py
689 anObj = self.CurvesOp.MakePolyline(thePoints)
690 RaiseIfFailed("MakePolyline", self.CurvesOp)
693 ## Create bezier curve on the set of points.
694 # @param thePoints Sequence of points for the bezier curve.
695 # @return New GEOM_Object, containing the created bezier curve.
697 # @ref tui_creation_curve "Example"
698 def MakeBezier(self,thePoints):
699 # Example: see GEOM_TestAll.py
700 anObj = self.CurvesOp.MakeSplineBezier(thePoints)
701 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
704 ## Create B-Spline curve on the set of points.
705 # @param thePoints Sequence of points for the B-Spline curve.
706 # @return New GEOM_Object, containing the created B-Spline curve.
708 # @ref tui_creation_curve "Example"
709 def MakeInterpol(self,thePoints):
710 # Example: see GEOM_TestAll.py
711 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints)
712 RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
718 ## @addtogroup l3_sketcher
721 ## Create a sketcher (wire or face), following the textual description,
722 # passed through <VAR>theCommand</VAR> argument. \n
723 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
724 # Format of the description string have to be the following:
726 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
729 # - x1, y1 are coordinates of the first sketcher point (zero by default),
731 # - "R angle" : Set the direction by angle
732 # - "D dx dy" : Set the direction by DX & DY
735 # - "TT x y" : Create segment by point at X & Y
736 # - "T dx dy" : Create segment by point with DX & DY
737 # - "L length" : Create segment by direction & Length
738 # - "IX x" : Create segment by direction & Intersect. X
739 # - "IY y" : Create segment by direction & Intersect. Y
742 # - "C radius length" : Create arc by direction, radius and length(in degree)
745 # - "WW" : Close Wire (to finish)
746 # - "WF" : Close Wire and build face (to finish)
748 # @param theCommand String, defining the sketcher in local
749 # coordinates of the working plane.
750 # @param theWorkingPlane Nine double values, defining origin,
751 # OZ and OX directions of the working plane.
752 # @return New GEOM_Object, containing the created wire.
754 # @ref tui_sketcher_page "Example"
755 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0]):
756 # Example: see GEOM_TestAll.py
757 theCommand,Parameters = ParseSketcherCommand(theCommand)
758 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
759 RaiseIfFailed("MakeSketcher", self.CurvesOp)
760 anObj.SetParameters(Parameters)
763 ## Create a sketcher (wire or face), following the textual description,
764 # passed through <VAR>theCommand</VAR> argument. \n
765 # For format of the description string see the previous method.\n
766 # @param theCommand String, defining the sketcher in local
767 # coordinates of the working plane.
768 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
769 # @return New GEOM_Object, containing the created wire.
771 # @ref tui_sketcher_page "Example"
772 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane):
773 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
774 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
777 ## Create a sketcher wire, following the numerical description,
778 # passed through <VAR>theCoordinates</VAR> argument. \n
779 # @param theCoordinates double values, defining points to create a wire,
781 # @return New GEOM_Object, containing the created wire.
783 # @ref tui_sketcher_page "Example"
784 def Make3DSketcher(self, theCoordinates):
785 anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
786 RaiseIfFailed("Make3DSketcher", self.CurvesOp)
792 ## @addtogroup l3_3d_primitives
795 ## Create a box by coordinates of two opposite vertices.
797 # @ref tui_creation_box "Example"
798 def MakeBox(self,x1,y1,z1,x2,y2,z2):
799 # Example: see GEOM_TestAll.py
800 pnt1 = self.MakeVertex(x1,y1,z1)
801 pnt2 = self.MakeVertex(x2,y2,z2)
802 return self.MakeBoxTwoPnt(pnt1,pnt2)
804 ## Create a box with specified dimensions along the coordinate axes
805 # and with edges, parallel to the coordinate axes.
806 # Center of the box will be at point (DX/2, DY/2, DZ/2).
807 # @param theDX Length of Box edges, parallel to OX axis.
808 # @param theDY Length of Box edges, parallel to OY axis.
809 # @param theDZ Length of Box edges, parallel to OZ axis.
810 # @return New GEOM_Object, containing the created box.
812 # @ref tui_creation_box "Example"
813 def MakeBoxDXDYDZ(self,theDX, theDY, theDZ):
814 # Example: see GEOM_TestAll.py
815 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
816 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
817 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
818 anObj.SetParameters(Parameters)
821 ## Create a box with two specified opposite vertices,
822 # and with edges, parallel to the coordinate axes
823 # @param thePnt1 First of two opposite vertices.
824 # @param thePnt2 Second of two opposite vertices.
825 # @return New GEOM_Object, containing the created box.
827 # @ref tui_creation_box "Example"
828 def MakeBoxTwoPnt(self,thePnt1, thePnt2):
829 # Example: see GEOM_TestAll.py
830 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
831 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
834 ## Create a face with specified dimensions along OX-OY coordinate axes,
835 # with edges, parallel to this coordinate axes.
836 # @param theH height of Face.
837 # @param theW width of Face.
838 # @param theOrientation orientation belong axis OXY OYZ OZX
839 # @return New GEOM_Object, containing the created face.
841 # @ref tui_creation_face "Example"
842 def MakeFaceHW(self,theH, theW, theOrientation):
843 # Example: see GEOM_TestAll.py
844 theH,theW,Parameters = ParseParameters(theH, theW)
845 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
846 RaiseIfFailed("MakeFaceHW", self.PrimOp)
847 anObj.SetParameters(Parameters)
850 ## Create a face from another plane and two sizes,
851 # vertical size and horisontal size.
852 # @param theObj Normale vector to the creating face or
854 # @param theH Height (vertical size).
855 # @param theW Width (horisontal size).
856 # @return New GEOM_Object, containing the created face.
858 # @ref tui_creation_face "Example"
859 def MakeFaceObjHW(self, theObj, theH, theW):
860 # Example: see GEOM_TestAll.py
861 theH,theW,Parameters = ParseParameters(theH, theW)
862 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
863 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
864 anObj.SetParameters(Parameters)
867 ## Create a disk with given center, normal vector and radius.
868 # @param thePnt Disk center.
869 # @param theVec Vector, normal to the plane of the disk.
870 # @param theR Disk radius.
871 # @return New GEOM_Object, containing the created disk.
873 # @ref tui_creation_disk "Example"
874 def MakeDiskPntVecR(self,thePnt, theVec, theR):
875 # Example: see GEOM_TestAll.py
876 theR,Parameters = ParseParameters(theR)
877 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
878 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
879 anObj.SetParameters(Parameters)
882 ## Create a disk, passing through three given points
883 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
884 # @return New GEOM_Object, containing the created disk.
886 # @ref tui_creation_disk "Example"
887 def MakeDiskThreePnt(self,thePnt1, thePnt2, thePnt3):
888 # Example: see GEOM_TestAll.py
889 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
890 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
893 ## Create a disk with specified dimensions along OX-OY coordinate axes.
894 # @param theR Radius of Face.
895 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
896 # @return New GEOM_Object, containing the created disk.
898 # @ref tui_creation_face "Example"
899 def MakeDiskR(self,theR, theOrientation):
900 # Example: see GEOM_TestAll.py
901 theR,Parameters = ParseParameters(theR)
902 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
903 RaiseIfFailed("MakeDiskR", self.PrimOp)
904 anObj.SetParameters(Parameters)
907 ## Create a cylinder with given base point, axis, radius and height.
908 # @param thePnt Central point of cylinder base.
909 # @param theAxis Cylinder axis.
910 # @param theR Cylinder radius.
911 # @param theH Cylinder height.
912 # @return New GEOM_Object, containing the created cylinder.
914 # @ref tui_creation_cylinder "Example"
915 def MakeCylinder(self,thePnt, theAxis, theR, theH):
916 # Example: see GEOM_TestAll.py
917 theR,theH,Parameters = ParseParameters(theR, theH)
918 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
919 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
920 anObj.SetParameters(Parameters)
923 ## Create a cylinder with given radius and height at
924 # the origin of coordinate system. Axis of the cylinder
925 # will be collinear to the OZ axis of the coordinate system.
926 # @param theR Cylinder radius.
927 # @param theH Cylinder height.
928 # @return New GEOM_Object, containing the created cylinder.
930 # @ref tui_creation_cylinder "Example"
931 def MakeCylinderRH(self,theR, theH):
932 # Example: see GEOM_TestAll.py
933 theR,theH,Parameters = ParseParameters(theR, theH)
934 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
935 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
936 anObj.SetParameters(Parameters)
939 ## Create a sphere with given center and radius.
940 # @param thePnt Sphere center.
941 # @param theR Sphere radius.
942 # @return New GEOM_Object, containing the created sphere.
944 # @ref tui_creation_sphere "Example"
945 def MakeSpherePntR(self, thePnt, theR):
946 # Example: see GEOM_TestAll.py
947 theR,Parameters = ParseParameters(theR)
948 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
949 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
950 anObj.SetParameters(Parameters)
953 ## Create a sphere with given center and radius.
954 # @param x,y,z Coordinates of sphere center.
955 # @param theR Sphere radius.
956 # @return New GEOM_Object, containing the created sphere.
958 # @ref tui_creation_sphere "Example"
959 def MakeSphere(self, x, y, z, theR):
960 # Example: see GEOM_TestAll.py
961 point = self.MakeVertex(x, y, z)
962 anObj = self.MakeSpherePntR(point, theR)
965 ## Create a sphere with given radius at the origin of coordinate system.
966 # @param theR Sphere radius.
967 # @return New GEOM_Object, containing the created sphere.
969 # @ref tui_creation_sphere "Example"
970 def MakeSphereR(self, theR):
971 # Example: see GEOM_TestAll.py
972 theR,Parameters = ParseParameters(theR)
973 anObj = self.PrimOp.MakeSphereR(theR)
974 RaiseIfFailed("MakeSphereR", self.PrimOp)
975 anObj.SetParameters(Parameters)
978 ## Create a cone with given base point, axis, height and radiuses.
979 # @param thePnt Central point of the first cone base.
980 # @param theAxis Cone axis.
981 # @param theR1 Radius of the first cone base.
982 # @param theR2 Radius of the second cone base.
983 # \note If both radiuses are non-zero, the cone will be truncated.
984 # \note If the radiuses are equal, a cylinder will be created instead.
985 # @param theH Cone height.
986 # @return New GEOM_Object, containing the created cone.
988 # @ref tui_creation_cone "Example"
989 def MakeCone(self,thePnt, theAxis, theR1, theR2, theH):
990 # Example: see GEOM_TestAll.py
991 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
992 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
993 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
994 anObj.SetParameters(Parameters)
997 ## Create a cone with given height and radiuses at
998 # the origin of coordinate system. Axis of the cone will
999 # be collinear to the OZ axis of the coordinate system.
1000 # @param theR1 Radius of the first cone base.
1001 # @param theR2 Radius of the second cone base.
1002 # \note If both radiuses are non-zero, the cone will be truncated.
1003 # \note If the radiuses are equal, a cylinder will be created instead.
1004 # @param theH Cone height.
1005 # @return New GEOM_Object, containing the created cone.
1007 # @ref tui_creation_cone "Example"
1008 def MakeConeR1R2H(self,theR1, theR2, theH):
1009 # Example: see GEOM_TestAll.py
1010 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
1011 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
1012 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
1013 anObj.SetParameters(Parameters)
1016 ## Create a torus with given center, normal vector and radiuses.
1017 # @param thePnt Torus central point.
1018 # @param theVec Torus axis of symmetry.
1019 # @param theRMajor Torus major radius.
1020 # @param theRMinor Torus minor radius.
1021 # @return New GEOM_Object, containing the created torus.
1023 # @ref tui_creation_torus "Example"
1024 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor):
1025 # Example: see GEOM_TestAll.py
1026 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
1027 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
1028 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
1029 anObj.SetParameters(Parameters)
1032 ## Create a torus with given radiuses at the origin of coordinate system.
1033 # @param theRMajor Torus major radius.
1034 # @param theRMinor Torus minor radius.
1035 # @return New GEOM_Object, containing the created torus.
1037 # @ref tui_creation_torus "Example"
1038 def MakeTorusRR(self, theRMajor, theRMinor):
1039 # Example: see GEOM_TestAll.py
1040 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
1041 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
1042 RaiseIfFailed("MakeTorusRR", self.PrimOp)
1043 anObj.SetParameters(Parameters)
1046 # end of l3_3d_primitives
1049 ## @addtogroup l3_complex
1052 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
1053 # @param theBase Base shape to be extruded.
1054 # @param thePoint1 First end of extrusion vector.
1055 # @param thePoint2 Second end of extrusion vector.
1056 # @return New GEOM_Object, containing the created prism.
1058 # @ref tui_creation_prism "Example"
1059 def MakePrism(self, theBase, thePoint1, thePoint2):
1060 # Example: see GEOM_TestAll.py
1061 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
1062 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
1065 ## Create a shape by extrusion of the base shape along the vector,
1066 # i.e. all the space, transfixed by the base shape during its translation
1067 # along the vector on the given distance.
1068 # @param theBase Base shape to be extruded.
1069 # @param theVec Direction of extrusion.
1070 # @param theH Prism dimension along theVec.
1071 # @return New GEOM_Object, containing the created prism.
1073 # @ref tui_creation_prism "Example"
1074 def MakePrismVecH(self, theBase, theVec, theH):
1075 # Example: see GEOM_TestAll.py
1076 theH,Parameters = ParseParameters(theH)
1077 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
1078 RaiseIfFailed("MakePrismVecH", self.PrimOp)
1079 anObj.SetParameters(Parameters)
1082 ## Create a shape by extrusion of the base shape along the vector,
1083 # i.e. all the space, transfixed by the base shape during its translation
1084 # along the vector on the given distance in 2 Ways (forward/backward) .
1085 # @param theBase Base shape to be extruded.
1086 # @param theVec Direction of extrusion.
1087 # @param theH Prism dimension along theVec in forward direction.
1088 # @return New GEOM_Object, containing the created prism.
1090 # @ref tui_creation_prism "Example"
1091 def MakePrismVecH2Ways(self, theBase, theVec, theH):
1092 # Example: see GEOM_TestAll.py
1093 theH,Parameters = ParseParameters(theH)
1094 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
1095 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
1096 anObj.SetParameters(Parameters)
1099 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
1100 # @param theBase Base shape to be extruded.
1101 # @param theDX, theDY, theDZ Directions of extrusion.
1102 # @return New GEOM_Object, containing the created prism.
1104 # @ref tui_creation_prism "Example"
1105 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ):
1106 # Example: see GEOM_TestAll.py
1107 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1108 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
1109 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
1110 anObj.SetParameters(Parameters)
1113 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
1114 # i.e. all the space, transfixed by the base shape during its translation
1115 # along the vector on the given distance in 2 Ways (forward/backward) .
1116 # @param theBase Base shape to be extruded.
1117 # @param theDX, theDY, theDZ Directions of extrusion.
1118 # @return New GEOM_Object, containing the created prism.
1120 # @ref tui_creation_prism "Example"
1121 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ):
1122 # Example: see GEOM_TestAll.py
1123 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1124 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
1125 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
1126 anObj.SetParameters(Parameters)
1129 ## Create a shape by revolution of the base shape around the axis
1130 # on the given angle, i.e. all the space, transfixed by the base
1131 # shape during its rotation around the axis on the given angle.
1132 # @param theBase Base shape to be rotated.
1133 # @param theAxis Rotation axis.
1134 # @param theAngle Rotation angle in radians.
1135 # @return New GEOM_Object, containing the created revolution.
1137 # @ref tui_creation_revolution "Example"
1138 def MakeRevolution(self, theBase, theAxis, theAngle):
1139 # Example: see GEOM_TestAll.py
1140 theAngle,Parameters = ParseParameters(theAngle)
1141 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
1142 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
1143 anObj.SetParameters(Parameters)
1146 ## The Same Revolution but in both ways forward&backward.
1147 def MakeRevolution2Ways(self, theBase, theAxis, theAngle):
1148 theAngle,Parameters = ParseParameters(theAngle)
1149 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
1150 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
1151 anObj.SetParameters(Parameters)
1154 ## Create a filling from the given compound of contours.
1155 # @param theShape the compound of contours
1156 # @param theMinDeg a minimal degree of BSpline surface to create
1157 # @param theMaxDeg a maximal degree of BSpline surface to create
1158 # @param theTol2D a 2d tolerance to be reached
1159 # @param theTol3D a 3d tolerance to be reached
1160 # @param theNbIter a number of iteration of approximation algorithm
1161 # @param isApprox if True, BSpline curves are generated in the process
1162 # of surface construction. By default it is False, that means
1163 # the surface is created using Besier curves. The usage of
1164 # Approximation makes the algorithm work slower, but allows
1165 # building the surface for rather complex cases
1166 # @return New GEOM_Object, containing the created filling surface.
1168 # @ref tui_creation_filling "Example"
1169 def MakeFilling(self, theShape, theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter, isApprox=0):
1170 # Example: see GEOM_TestAll.py
1171 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg,
1172 theTol2D, theTol3D, theNbIter)
1173 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
1174 theTol2D, theTol3D, theNbIter, isApprox)
1175 RaiseIfFailed("MakeFilling", self.PrimOp)
1176 anObj.SetParameters(Parameters)
1179 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
1180 # @param theSeqSections - set of specified sections.
1181 # @param theModeSolid - mode defining building solid or shell
1182 # @param thePreci - precision 3D used for smoothing by default 1.e-6
1183 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
1184 # @return New GEOM_Object, containing the created shell or solid.
1186 # @ref swig_todo "Example"
1187 def MakeThruSections(self,theSeqSections,theModeSolid,thePreci,theRuled):
1188 # Example: see GEOM_TestAll.py
1189 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
1190 RaiseIfFailed("MakeThruSections", self.PrimOp)
1193 ## Create a shape by extrusion of the base shape along
1194 # the path shape. The path shape can be a wire or an edge.
1195 # @param theBase Base shape to be extruded.
1196 # @param thePath Path shape to extrude the base shape along it.
1197 # @return New GEOM_Object, containing the created pipe.
1199 # @ref tui_creation_pipe "Example"
1200 def MakePipe(self,theBase, thePath):
1201 # Example: see GEOM_TestAll.py
1202 anObj = self.PrimOp.MakePipe(theBase, thePath)
1203 RaiseIfFailed("MakePipe", self.PrimOp)
1206 ## Create a shape by extrusion of the profile shape along
1207 # the path shape. The path shape can be a wire or an edge.
1208 # the several profiles can be specified in the several locations of path.
1209 # @param theSeqBases - list of Bases shape to be extruded.
1210 # @param theLocations - list of locations on the path corresponding
1211 # specified list of the Bases shapes. Number of locations
1212 # should be equal to number of bases or list of locations can be empty.
1213 # @param thePath - Path shape to extrude the base shape along it.
1214 # @param theWithContact - the mode defining that the section is translated to be in
1215 # contact with the spine.
1216 # @param theWithCorrection - defining that the section is rotated to be
1217 # orthogonal to the spine tangent in the correspondent point
1218 # @return New GEOM_Object, containing the created pipe.
1220 # @ref tui_creation_pipe_with_diff_sec "Example"
1221 def MakePipeWithDifferentSections(self, theSeqBases,
1222 theLocations, thePath,
1223 theWithContact, theWithCorrection):
1224 anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
1225 theLocations, thePath,
1226 theWithContact, theWithCorrection)
1227 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
1230 ## Create a shape by extrusion of the profile shape along
1231 # the path shape. The path shape can be a wire or a edge.
1232 # the several profiles can be specified in the several locations of path.
1233 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
1234 # shell or face. If number of faces in neighbour sections
1235 # aren't coincided result solid between such sections will
1236 # be created using external boundaries of this shells.
1237 # @param theSeqSubBases - list of corresponding subshapes of section shapes.
1238 # This list is used for searching correspondences between
1239 # faces in the sections. Size of this list must be equal
1240 # to size of list of base shapes.
1241 # @param theLocations - list of locations on the path corresponding
1242 # specified list of the Bases shapes. Number of locations
1243 # should be equal to number of bases. First and last
1244 # locations must be coincided with first and last vertexes
1245 # of path correspondingly.
1246 # @param thePath - Path shape to extrude the base shape along it.
1247 # @param theWithContact - the mode defining that the section is translated to be in
1248 # contact with the spine.
1249 # @param theWithCorrection - defining that the section is rotated to be
1250 # orthogonal to the spine tangent in the correspondent point
1251 # @return New GEOM_Object, containing the created solids.
1253 # @ref tui_creation_pipe_with_shell_sec "Example"
1254 def MakePipeWithShellSections(self,theSeqBases, theSeqSubBases,
1255 theLocations, thePath,
1256 theWithContact, theWithCorrection):
1257 anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
1258 theLocations, thePath,
1259 theWithContact, theWithCorrection)
1260 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
1263 ## Create a shape by extrusion of the profile shape along
1264 # the path shape. This function is used only for debug pipe
1265 # functionality - it is a version of previous function
1266 # (MakePipeWithShellSections(...)) which give a possibility to
1267 # recieve information about creating pipe between each pair of
1268 # sections step by step.
1269 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
1270 theLocations, thePath,
1271 theWithContact, theWithCorrection):
1273 nbsect = len(theSeqBases)
1274 nbsubsect = len(theSeqSubBases)
1275 #print "nbsect = ",nbsect
1276 for i in range(1,nbsect):
1278 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
1279 tmpLocations = [ theLocations[i-1], theLocations[i] ]
1281 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
1282 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
1283 tmpLocations, thePath,
1284 theWithContact, theWithCorrection)
1285 if self.PrimOp.IsDone() == 0:
1286 print "Problems with pipe creation between ",i," and ",i+1," sections"
1287 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
1290 print "Pipe between ",i," and ",i+1," sections is OK"
1295 resc = self.MakeCompound(res)
1296 #resc = self.MakeSewing(res, 0.001)
1297 #print "resc: ",resc
1300 ## Create solids between given sections
1301 # @param theSeqBases - list of sections (shell or face).
1302 # @param theLocations - list of corresponding vertexes
1303 # @return New GEOM_Object, containing the created solids.
1305 # @ref tui_creation_pipe_without_path "Example"
1306 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations):
1307 anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
1308 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
1311 ## Create a shape by extrusion of the base shape along
1312 # the path shape with constant bi-normal direction along the given vector.
1313 # The path shape can be a wire or an edge.
1314 # @param theBase Base shape to be extruded.
1315 # @param thePath Path shape to extrude the base shape along it.
1316 # @param theVec Vector defines a constant binormal direction to keep the
1317 # same angle beetween the direction and the sections
1318 # along the sweep surface.
1319 # @return New GEOM_Object, containing the created pipe.
1321 # @ref tui_creation_pipe "Example"
1322 def MakePipeBiNormalAlongVector(self,theBase, thePath, theVec):
1323 # Example: see GEOM_TestAll.py
1324 anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
1325 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
1331 ## @addtogroup l3_advanced
1334 ## Create a linear edge with specified ends.
1335 # @param thePnt1 Point for the first end of edge.
1336 # @param thePnt2 Point for the second end of edge.
1337 # @return New GEOM_Object, containing the created edge.
1339 # @ref tui_creation_edge "Example"
1340 def MakeEdge(self,thePnt1, thePnt2):
1341 # Example: see GEOM_TestAll.py
1342 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
1343 RaiseIfFailed("MakeEdge", self.ShapesOp)
1346 ## Create a wire from the set of edges and wires.
1347 # @param theEdgesAndWires List of edges and/or wires.
1348 # @return New GEOM_Object, containing the created wire.
1350 # @ref tui_creation_wire "Example"
1351 def MakeWire(self,theEdgesAndWires):
1352 # Example: see GEOM_TestAll.py
1353 anObj = self.ShapesOp.MakeWire(theEdgesAndWires)
1354 RaiseIfFailed("MakeWire", self.ShapesOp)
1357 ## Create a face on the given wire.
1358 # @param theWire closed Wire or Edge to build the face on.
1359 # @param isPlanarWanted If TRUE, only planar face will be built.
1360 # If impossible, NULL object will be returned.
1361 # @return New GEOM_Object, containing the created face.
1363 # @ref tui_creation_face "Example"
1364 def MakeFace(self,theWire, isPlanarWanted):
1365 # Example: see GEOM_TestAll.py
1366 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
1367 RaiseIfFailed("MakeFace", self.ShapesOp)
1370 ## Create a face on the given wires set.
1371 # @param theWires List of closed wires or edges to build the face on.
1372 # @param isPlanarWanted If TRUE, only planar face will be built.
1373 # If impossible, NULL object will be returned.
1374 # @return New GEOM_Object, containing the created face.
1376 # @ref tui_creation_face "Example"
1377 def MakeFaceWires(self,theWires, isPlanarWanted):
1378 # Example: see GEOM_TestAll.py
1379 anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
1380 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
1383 ## Shortcut to MakeFaceWires()
1385 # @ref tui_creation_face "Example 1"
1386 # \n @ref swig_MakeFaces "Example 2"
1387 def MakeFaces(self,theWires, isPlanarWanted):
1388 # Example: see GEOM_TestOthers.py
1389 anObj = self.MakeFaceWires(theWires, isPlanarWanted)
1392 ## Create a shell from the set of faces and shells.
1393 # @param theFacesAndShells List of faces and/or shells.
1394 # @return New GEOM_Object, containing the created shell.
1396 # @ref tui_creation_shell "Example"
1397 def MakeShell(self,theFacesAndShells):
1398 # Example: see GEOM_TestAll.py
1399 anObj = self.ShapesOp.MakeShell(theFacesAndShells)
1400 RaiseIfFailed("MakeShell", self.ShapesOp)
1403 ## Create a solid, bounded by the given shells.
1404 # @param theShells Sequence of bounding shells.
1405 # @return New GEOM_Object, containing the created solid.
1407 # @ref tui_creation_solid "Example"
1408 def MakeSolid(self,theShells):
1409 # Example: see GEOM_TestAll.py
1410 anObj = self.ShapesOp.MakeSolidShells(theShells)
1411 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
1414 ## Create a compound of the given shapes.
1415 # @param theShapes List of shapes to put in compound.
1416 # @return New GEOM_Object, containing the created compound.
1418 # @ref tui_creation_compound "Example"
1419 def MakeCompound(self,theShapes):
1420 # Example: see GEOM_TestAll.py
1421 anObj = self.ShapesOp.MakeCompound(theShapes)
1422 RaiseIfFailed("MakeCompound", self.ShapesOp)
1425 # end of l3_advanced
1428 ## @addtogroup l2_measure
1431 ## Gives quantity of faces in the given shape.
1432 # @param theShape Shape to count faces of.
1433 # @return Quantity of faces.
1435 # @ref swig_NumberOfFaces "Example"
1436 def NumberOfFaces(self,theShape):
1437 # Example: see GEOM_TestOthers.py
1438 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
1439 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
1442 ## Gives quantity of edges in the given shape.
1443 # @param theShape Shape to count edges of.
1444 # @return Quantity of edges.
1446 # @ref swig_NumberOfEdges "Example"
1447 def NumberOfEdges(self,theShape):
1448 # Example: see GEOM_TestOthers.py
1449 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
1450 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
1456 ## @addtogroup l3_healing
1459 ## Reverses an orientation the given shape.
1460 # @param theShape Shape to be reversed.
1461 # @return The reversed copy of theShape.
1463 # @ref swig_ChangeOrientation "Example"
1464 def ChangeOrientation(self,theShape):
1465 # Example: see GEOM_TestAll.py
1466 anObj = self.ShapesOp.ChangeOrientation(theShape)
1467 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
1470 ## Shortcut to ChangeOrientation()
1472 # @ref swig_OrientationChange "Example"
1473 def OrientationChange(self,theShape):
1474 # Example: see GEOM_TestOthers.py
1475 anObj = self.ChangeOrientation(theShape)
1481 ## @addtogroup l4_obtain
1484 ## Retrieve all free faces from the given shape.
1485 # Free face is a face, which is not shared between two shells of the shape.
1486 # @param theShape Shape to find free faces in.
1487 # @return List of IDs of all free faces, contained in theShape.
1489 # @ref tui_measurement_tools_page "Example"
1490 def GetFreeFacesIDs(self,theShape):
1491 # Example: see GEOM_TestOthers.py
1492 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
1493 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
1496 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
1497 # @param theShape1 Shape to find sub-shapes in.
1498 # @param theShape2 Shape to find shared sub-shapes with.
1499 # @param theShapeType Type of sub-shapes to be retrieved.
1500 # @return List of sub-shapes of theShape1, shared with theShape2.
1502 # @ref swig_GetSharedShapes "Example"
1503 def GetSharedShapes(self,theShape1, theShape2, theShapeType):
1504 # Example: see GEOM_TestOthers.py
1505 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
1506 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
1509 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
1510 # situated relatively the specified plane by the certain way,
1511 # defined through <VAR>theState</VAR> parameter.
1512 # @param theShape Shape to find sub-shapes of.
1513 # @param theShapeType Type of sub-shapes to be retrieved.
1514 # @param theAx1 Vector (or line, or linear edge), specifying normal
1515 # direction and location of the plane to find shapes on.
1516 # @param theState The state of the subshapes to find. It can be one of
1517 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1518 # @return List of all found sub-shapes.
1520 # @ref swig_GetShapesOnPlane "Example"
1521 def GetShapesOnPlane(self,theShape, theShapeType, theAx1, theState):
1522 # Example: see GEOM_TestOthers.py
1523 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
1524 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
1527 ## Works like the above method, but returns list of sub-shapes indices
1529 # @ref swig_GetShapesOnPlaneIDs "Example"
1530 def GetShapesOnPlaneIDs(self,theShape, theShapeType, theAx1, theState):
1531 # Example: see GEOM_TestOthers.py
1532 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
1533 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
1536 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
1537 # situated relatively the specified plane by the certain way,
1538 # defined through <VAR>theState</VAR> parameter.
1539 # @param theShape Shape to find sub-shapes of.
1540 # @param theShapeType Type of sub-shapes to be retrieved.
1541 # @param theAx1 Vector (or line, or linear edge), specifying normal
1542 # direction of the plane to find shapes on.
1543 # @param thePnt Point specifying location of the plane to find shapes on.
1544 # @param theState The state of the subshapes to find. It can be one of
1545 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1546 # @return List of all found sub-shapes.
1548 # @ref swig_GetShapesOnPlaneWithLocation "Example"
1549 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState):
1550 # Example: see GEOM_TestOthers.py
1551 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
1552 theAx1, thePnt, theState)
1553 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
1556 ## Works like the above method, but returns list of sub-shapes indices
1558 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
1559 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
1560 # Example: see GEOM_TestOthers.py
1561 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
1562 theAx1, thePnt, theState)
1563 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
1566 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1567 # the specified cylinder by the certain way, defined through \a theState parameter.
1568 # @param theShape Shape to find sub-shapes of.
1569 # @param theShapeType Type of sub-shapes to be retrieved.
1570 # @param theAxis Vector (or line, or linear edge), specifying
1571 # axis of the cylinder to find shapes on.
1572 # @param theRadius Radius of the cylinder to find shapes on.
1573 # @param theState The state of the subshapes to find. It can be one of
1574 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1575 # @return List of all found sub-shapes.
1577 # @ref swig_GetShapesOnCylinder "Example"
1578 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState):
1579 # Example: see GEOM_TestOthers.py
1580 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
1581 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
1584 ## Works like the above method, but returns list of sub-shapes indices
1586 # @ref swig_GetShapesOnCylinderIDs "Example"
1587 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
1588 # Example: see GEOM_TestOthers.py
1589 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
1590 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
1593 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1594 # the specified sphere by the certain way, defined through \a theState parameter.
1595 # @param theShape Shape to find sub-shapes of.
1596 # @param theShapeType Type of sub-shapes to be retrieved.
1597 # @param theCenter Point, specifying center of the sphere to find shapes on.
1598 # @param theRadius Radius of the sphere to find shapes on.
1599 # @param theState The state of the subshapes to find. It can be one of
1600 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1601 # @return List of all found sub-shapes.
1603 # @ref swig_GetShapesOnSphere "Example"
1604 def GetShapesOnSphere(self,theShape, theShapeType, theCenter, theRadius, theState):
1605 # Example: see GEOM_TestOthers.py
1606 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
1607 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
1610 ## Works like the above method, but returns list of sub-shapes indices
1612 # @ref swig_GetShapesOnSphereIDs "Example"
1613 def GetShapesOnSphereIDs(self,theShape, theShapeType, theCenter, theRadius, theState):
1614 # Example: see GEOM_TestOthers.py
1615 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
1616 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
1619 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1620 # the specified quadrangle by the certain way, defined through \a theState parameter.
1621 # @param theShape Shape to find sub-shapes of.
1622 # @param theShapeType Type of sub-shapes to be retrieved.
1623 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
1624 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
1625 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
1626 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
1627 # @param theState The state of the subshapes to find. It can be one of
1628 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1629 # @return List of all found sub-shapes.
1631 # @ref swig_GetShapesOnQuadrangle "Example"
1632 def GetShapesOnQuadrangle(self, theShape, theShapeType,
1633 theTopLeftPoint, theTopRigthPoint,
1634 theBottomLeftPoint, theBottomRigthPoint, theState):
1635 # Example: see GEOM_TestOthers.py
1636 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
1637 theTopLeftPoint, theTopRigthPoint,
1638 theBottomLeftPoint, theBottomRigthPoint, theState)
1639 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
1642 ## Works like the above method, but returns list of sub-shapes indices
1644 # @ref swig_GetShapesOnQuadrangleIDs "Example"
1645 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
1646 theTopLeftPoint, theTopRigthPoint,
1647 theBottomLeftPoint, theBottomRigthPoint, theState):
1648 # Example: see GEOM_TestOthers.py
1649 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
1650 theTopLeftPoint, theTopRigthPoint,
1651 theBottomLeftPoint, theBottomRigthPoint, theState)
1652 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
1655 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1656 # the specified \a theBox by the certain way, defined through \a theState parameter.
1657 # @param theBox Shape for relative comparing.
1658 # @param theShape Shape to find sub-shapes of.
1659 # @param theShapeType Type of sub-shapes to be retrieved.
1660 # @param theState The state of the subshapes to find. It can be one of
1661 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1662 # @return List of all found sub-shapes.
1664 # @ref swig_GetShapesOnBox "Example"
1665 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState):
1666 # Example: see GEOM_TestOthers.py
1667 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
1668 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
1671 ## Works like the above method, but returns list of sub-shapes indices
1673 # @ref swig_GetShapesOnBoxIDs "Example"
1674 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
1675 # Example: see GEOM_TestOthers.py
1676 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
1677 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
1680 ## Find in \a theShape all sub-shapes of type \a theShapeType,
1681 # situated relatively the specified \a theCheckShape by the
1682 # certain way, defined through \a theState parameter.
1683 # @param theCheckShape Shape for relative comparing.
1684 # @param theShape Shape to find sub-shapes of.
1685 # @param theShapeType Type of sub-shapes to be retrieved.
1686 # @param theState The state of the subshapes to find. It can be one of
1687 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1688 # @return List of all found sub-shapes.
1690 # @ref swig_GetShapesOnShape "Example"
1691 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState):
1692 # Example: see GEOM_TestOthers.py
1693 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
1694 theShapeType, theState)
1695 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
1698 ## Works like the above method, but returns result as compound
1700 # @ref swig_GetShapesOnShapeAsCompound "Example"
1701 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState):
1702 # Example: see GEOM_TestOthers.py
1703 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
1704 theShapeType, theState)
1705 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
1708 ## Works like the above method, but returns list of sub-shapes indices
1710 # @ref swig_GetShapesOnShapeIDs "Example"
1711 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
1712 # Example: see GEOM_TestOthers.py
1713 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
1714 theShapeType, theState)
1715 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
1718 ## Get sub-shape(s) of theShapeWhere, which are
1719 # coincident with \a theShapeWhat or could be a part of it.
1720 # @param theShapeWhere Shape to find sub-shapes of.
1721 # @param theShapeWhat Shape, specifying what to find.
1722 # @return Group of all found sub-shapes or a single found sub-shape.
1724 # @ref swig_GetInPlace "Example"
1725 def GetInPlace(self,theShapeWhere, theShapeWhat):
1726 # Example: see GEOM_TestOthers.py
1727 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
1728 RaiseIfFailed("GetInPlace", self.ShapesOp)
1731 ## Get sub-shape(s) of \a theShapeWhere, which are
1732 # coincident with \a theShapeWhat or could be a part of it.
1734 # Implementation of this method is based on a saved history of an operation,
1735 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
1736 # arguments (an argument shape or a sub-shape of an argument shape).
1737 # The operation could be the Partition or one of boolean operations,
1738 # performed on simple shapes (not on compounds).
1740 # @param theShapeWhere Shape to find sub-shapes of.
1741 # @param theShapeWhat Shape, specifying what to find (must be in the
1742 # building history of the ShapeWhere).
1743 # @return Group of all found sub-shapes or a single found sub-shape.
1745 # @ref swig_GetInPlace "Example"
1746 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat):
1747 # Example: see GEOM_TestOthers.py
1748 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
1749 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
1752 ## Get sub-shape of theShapeWhere, which is
1753 # equal to \a theShapeWhat.
1754 # @param theShapeWhere Shape to find sub-shape of.
1755 # @param theShapeWhat Shape, specifying what to find.
1756 # @return New GEOM_Object for found sub-shape.
1758 # @ref swig_GetSame "Example"
1759 def GetSame(self,theShapeWhere, theShapeWhat):
1760 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
1761 RaiseIfFailed("GetSame", self.ShapesOp)
1767 ## @addtogroup l4_access
1770 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
1771 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
1773 # @ref swig_all_decompose "Example"
1774 def GetSubShape(self, aShape, ListOfID):
1775 # Example: see GEOM_TestAll.py
1776 anObj = self.AddSubShape(aShape,ListOfID)
1779 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
1781 # @ref swig_all_decompose "Example"
1782 def GetSubShapeID(self, aShape, aSubShape):
1783 # Example: see GEOM_TestAll.py
1784 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
1785 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
1791 ## @addtogroup l4_decompose
1794 ## Explode a shape on subshapes of a given type.
1795 # @param aShape Shape to be exploded.
1796 # @param aType Type of sub-shapes to be retrieved.
1797 # @return List of sub-shapes of type theShapeType, contained in theShape.
1799 # @ref swig_all_decompose "Example"
1800 def SubShapeAll(self, aShape, aType):
1801 # Example: see GEOM_TestAll.py
1802 ListObj = self.ShapesOp.MakeExplode(aShape,aType,0)
1803 RaiseIfFailed("MakeExplode", self.ShapesOp)
1806 ## Explode a shape on subshapes of a given type.
1807 # @param aShape Shape to be exploded.
1808 # @param aType Type of sub-shapes to be retrieved.
1809 # @return List of IDs of sub-shapes.
1811 # @ref swig_all_decompose "Example"
1812 def SubShapeAllIDs(self, aShape, aType):
1813 ListObj = self.ShapesOp.SubShapeAllIDs(aShape,aType,0)
1814 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
1817 ## Explode a shape on subshapes of a given type.
1818 # Sub-shapes will be sorted by coordinates of their gravity centers.
1819 # @param aShape Shape to be exploded.
1820 # @param aType Type of sub-shapes to be retrieved.
1821 # @return List of sub-shapes of type theShapeType, contained in theShape.
1823 # @ref swig_SubShapeAllSorted "Example"
1824 def SubShapeAllSorted(self, aShape, aType):
1825 # Example: see GEOM_TestAll.py
1826 ListObj = self.ShapesOp.MakeExplode(aShape,aType,1)
1827 RaiseIfFailed("MakeExplode", self.ShapesOp)
1830 ## Explode a shape on subshapes of a given type.
1831 # Sub-shapes will be sorted by coordinates of their gravity centers.
1832 # @param aShape Shape to be exploded.
1833 # @param aType Type of sub-shapes to be retrieved.
1834 # @return List of IDs of sub-shapes.
1836 # @ref swig_all_decompose "Example"
1837 def SubShapeAllSortedIDs(self, aShape, aType):
1838 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape,aType,1)
1839 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
1842 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
1843 # selected by they indices in list of all sub-shapes of type <VAR>aType</VAR>.
1844 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
1846 # @ref swig_all_decompose "Example"
1847 def SubShape(self, aShape, aType, ListOfInd):
1848 # Example: see GEOM_TestAll.py
1850 AllShapeList = self.SubShapeAll(aShape, aType)
1851 for ind in ListOfInd:
1852 ListOfIDs.append(self.GetSubShapeID(aShape, AllShapeList[ind - 1]))
1853 anObj = self.GetSubShape(aShape, ListOfIDs)
1856 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
1857 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
1858 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
1860 # @ref swig_all_decompose "Example"
1861 def SubShapeSorted(self,aShape, aType, ListOfInd):
1862 # Example: see GEOM_TestAll.py
1864 AllShapeList = self.SubShapeAllSorted(aShape, aType)
1865 for ind in ListOfInd:
1866 ListOfIDs.append(self.GetSubShapeID(aShape, AllShapeList[ind - 1]))
1867 anObj = self.GetSubShape(aShape, ListOfIDs)
1870 # end of l4_decompose
1873 ## @addtogroup l3_healing
1876 ## Apply a sequence of Shape Healing operators to the given object.
1877 # @param theShape Shape to be processed.
1878 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
1879 # @param theParameters List of names of parameters
1880 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
1881 # @param theValues List of values of parameters, in the same order
1882 # as parameters are listed in <VAR>theParameters</VAR> list.
1883 # @return New GEOM_Object, containing processed shape.
1885 # @ref tui_shape_processing "Example"
1886 def ProcessShape(self,theShape, theOperators, theParameters, theValues):
1887 # Example: see GEOM_TestHealing.py
1888 theValues,Parameters = ParseList(theValues)
1889 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
1890 RaiseIfFailed("ProcessShape", self.HealOp)
1891 for string in (theOperators + theParameters):
1892 Parameters = ":" + Parameters
1894 anObj.SetParameters(Parameters)
1897 ## Remove faces from the given object (shape).
1898 # @param theObject Shape to be processed.
1899 # @param theFaces Indices of faces to be removed, if EMPTY then the method
1900 # removes ALL faces of the given object.
1901 # @return New GEOM_Object, containing processed shape.
1903 # @ref tui_suppress_faces "Example"
1904 def SuppressFaces(self,theObject, theFaces):
1905 # Example: see GEOM_TestHealing.py
1906 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
1907 RaiseIfFailed("SuppressFaces", self.HealOp)
1910 ## Sewing of some shapes into single shape.
1912 # @ref tui_sewing "Example"
1913 def MakeSewing(self, ListShape, theTolerance):
1914 # Example: see GEOM_TestHealing.py
1915 comp = self.MakeCompound(ListShape)
1916 anObj = self.Sew(comp, theTolerance)
1919 ## Sewing of the given object.
1920 # @param theObject Shape to be processed.
1921 # @param theTolerance Required tolerance value.
1922 # @return New GEOM_Object, containing processed shape.
1923 def Sew(self, theObject, theTolerance):
1924 # Example: see MakeSewing() above
1925 theTolerance,Parameters = ParseParameters(theTolerance)
1926 anObj = self.HealOp.Sew(theObject, theTolerance)
1927 RaiseIfFailed("Sew", self.HealOp)
1928 anObj.SetParameters(Parameters)
1931 ## Remove internal wires and edges from the given object (face).
1932 # @param theObject Shape to be processed.
1933 # @param theWires Indices of wires to be removed, if EMPTY then the method
1934 # removes ALL internal wires of the given object.
1935 # @return New GEOM_Object, containing processed shape.
1937 # @ref tui_suppress_internal_wires "Example"
1938 def SuppressInternalWires(self,theObject, theWires):
1939 # Example: see GEOM_TestHealing.py
1940 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
1941 RaiseIfFailed("RemoveIntWires", self.HealOp)
1944 ## Remove internal closed contours (holes) from the given object.
1945 # @param theObject Shape to be processed.
1946 # @param theWires Indices of wires to be removed, if EMPTY then the method
1947 # removes ALL internal holes of the given object
1948 # @return New GEOM_Object, containing processed shape.
1950 # @ref tui_suppress_holes "Example"
1951 def SuppressHoles(self,theObject, theWires):
1952 # Example: see GEOM_TestHealing.py
1953 anObj = self.HealOp.FillHoles(theObject, theWires)
1954 RaiseIfFailed("FillHoles", self.HealOp)
1957 ## Close an open wire.
1958 # @param theObject Shape to be processed.
1959 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
1960 # if -1, then <VAR>theObject</VAR> itself is a wire.
1961 # @param isCommonVertex If TRUE : closure by creation of a common vertex,
1962 # If FALS : closure by creation of an edge between ends.
1963 # @return New GEOM_Object, containing processed shape.
1965 # @ref tui_close_contour "Example"
1966 def CloseContour(self,theObject, theWires, isCommonVertex):
1967 # Example: see GEOM_TestHealing.py
1968 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
1969 RaiseIfFailed("CloseContour", self.HealOp)
1972 ## Addition of a point to a given edge object.
1973 # @param theObject Shape to be processed.
1974 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
1975 # if -1, then theObject itself is the edge.
1976 # @param theValue Value of parameter on edge or length parameter,
1977 # depending on \a isByParameter.
1978 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1],
1979 # if FALSE : \a theValue is treated as a length parameter [0..1]
1980 # @return New GEOM_Object, containing processed shape.
1982 # @ref tui_add_point_on_edge "Example"
1983 def DivideEdge(self,theObject, theEdgeIndex, theValue, isByParameter):
1984 # Example: see GEOM_TestHealing.py
1985 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
1986 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
1987 RaiseIfFailed("DivideEdge", self.HealOp)
1988 anObj.SetParameters(Parameters)
1991 ## Change orientation of the given object. Updates given shape.
1992 # @param theObject Shape to be processed.
1994 # @ref swig_todo "Example"
1995 def ChangeOrientationShell(self,theObject):
1996 theObject = self.HealOp.ChangeOrientation(theObject)
1997 RaiseIfFailed("ChangeOrientation", self.HealOp)
2000 ## Change orientation of the given object.
2001 # @param theObject Shape to be processed.
2002 # @return New GEOM_Object, containing processed shape.
2004 # @ref swig_todo "Example"
2005 def ChangeOrientationShellCopy(self,theObject):
2006 anObj = self.HealOp.ChangeOrientationCopy(theObject)
2007 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
2010 ## Get a list of wires (wrapped in GEOM_Object-s),
2011 # that constitute a free boundary of the given shape.
2012 # @param theObject Shape to get free boundary of.
2013 # @return [status, theClosedWires, theOpenWires]
2014 # status: FALSE, if an error(s) occured during the method execution.
2015 # theClosedWires: Closed wires on the free boundary of the given shape.
2016 # theOpenWires: Open wires on the free boundary of the given shape.
2018 # @ref tui_measurement_tools_page "Example"
2019 def GetFreeBoundary(self,theObject):
2020 # Example: see GEOM_TestHealing.py
2021 anObj = self.HealOp.GetFreeBoundary(theObject)
2022 RaiseIfFailed("GetFreeBoundary", self.HealOp)
2025 ## Replace coincident faces in theShape by one face.
2026 # @param theShape Initial shape.
2027 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
2028 # @param doKeepNonSolids If FALSE, only solids will present in the result,
2029 # otherwise all initial shapes.
2030 # @return New GEOM_Object, containing a copy of theShape without coincident faces.
2032 # @ref tui_glue_faces "Example"
2033 def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True):
2034 # Example: see GEOM_Spanner.py
2035 theTolerance,Parameters = ParseParameters(theTolerance)
2036 anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
2038 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
2039 anObj.SetParameters(Parameters)
2042 ## Find coincident faces in theShape for possible gluing.
2043 # @param theShape Initial shape.
2044 # @param theTolerance Maximum distance between faces,
2045 # which can be considered as coincident.
2048 # @ref swig_todo "Example"
2049 def GetGlueFaces(self, theShape, theTolerance):
2050 # Example: see GEOM_Spanner.py
2051 anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
2052 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
2055 ## Replace coincident faces in theShape by one face
2056 # in compliance with given list of faces
2057 # @param theShape Initial shape.
2058 # @param theTolerance Maximum distance between faces,
2059 # which can be considered as coincident.
2060 # @param theFaces List of faces for gluing.
2061 # @param doKeepNonSolids If FALSE, only solids will present in the result,
2062 # otherwise all initial shapes.
2063 # @return New GEOM_Object, containing a copy of theShape
2064 # without some faces.
2066 # @ref swig_todo "Example"
2067 def MakeGlueFacesByList(self, theShape, theTolerance, theFaces, doKeepNonSolids=True):
2068 # Example: see GEOM_Spanner.py
2069 anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces, doKeepNonSolids)
2071 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
2077 ## @addtogroup l3_boolean Boolean Operations
2080 # -----------------------------------------------------------------------------
2081 # Boolean (Common, Cut, Fuse, Section)
2082 # -----------------------------------------------------------------------------
2084 ## Perform one of boolean operations on two given shapes.
2085 # @param theShape1 First argument for boolean operation.
2086 # @param theShape2 Second argument for boolean operation.
2087 # @param theOperation Indicates the operation to be done:
2088 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
2089 # @return New GEOM_Object, containing the result shape.
2091 # @ref tui_fuse "Example"
2092 def MakeBoolean(self,theShape1, theShape2, theOperation):
2093 # Example: see GEOM_TestAll.py
2094 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation)
2095 RaiseIfFailed("MakeBoolean", self.BoolOp)
2098 ## Shortcut to MakeBoolean(s1, s2, 1)
2100 # @ref tui_common "Example 1"
2101 # \n @ref swig_MakeCommon "Example 2"
2102 def MakeCommon(self, s1, s2):
2103 # Example: see GEOM_TestOthers.py
2104 return self.MakeBoolean(s1, s2, 1)
2106 ## Shortcut to MakeBoolean(s1, s2, 2)
2108 # @ref tui_cut "Example 1"
2109 # \n @ref swig_MakeCommon "Example 2"
2110 def MakeCut(self, s1, s2):
2111 # Example: see GEOM_TestOthers.py
2112 return self.MakeBoolean(s1, s2, 2)
2114 ## Shortcut to MakeBoolean(s1, s2, 3)
2116 # @ref tui_fuse "Example 1"
2117 # \n @ref swig_MakeCommon "Example 2"
2118 def MakeFuse(self, s1, s2):
2119 # Example: see GEOM_TestOthers.py
2120 return self.MakeBoolean(s1, s2, 3)
2122 ## Shortcut to MakeBoolean(s1, s2, 4)
2124 # @ref tui_section "Example 1"
2125 # \n @ref swig_MakeCommon "Example 2"
2126 def MakeSection(self, s1, s2):
2127 # Example: see GEOM_TestOthers.py
2128 return self.MakeBoolean(s1, s2, 4)
2133 ## @addtogroup l3_basic_op
2136 ## Perform partition operation.
2137 # @param ListShapes Shapes to be intersected.
2138 # @param ListTools Shapes to intersect theShapes.
2139 # !!!NOTE: Each compound from ListShapes and ListTools will be exploded
2140 # in order to avoid possible intersection between shapes from
2142 # @param Limit Type of resulting shapes (corresponding to TopAbs_ShapeEnum).
2143 # @param KeepNonlimitShapes: if this parameter == 0 - only shapes with
2144 # type <= Limit are kept in the result,
2145 # else - shapes with type > Limit are kept
2146 # also (if they exist)
2148 # After implementation new version of PartitionAlgo (October 2006)
2149 # other parameters are ignored by current functionality. They are kept
2150 # in this function only for support old versions.
2151 # Ignored parameters:
2152 # @param ListKeepInside Shapes, outside which the results will be deleted.
2153 # Each shape from theKeepInside must belong to theShapes also.
2154 # @param ListRemoveInside Shapes, inside which the results will be deleted.
2155 # Each shape from theRemoveInside must belong to theShapes also.
2156 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
2157 # @param ListMaterials Material indices for each shape. Make sence,
2158 # only if theRemoveWebs is TRUE.
2160 # @return New GEOM_Object, containing the result shapes.
2162 # @ref tui_partition "Example"
2163 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
2164 Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
2165 KeepNonlimitShapes=0):
2166 # Example: see GEOM_TestAll.py
2167 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
2168 ListKeepInside, ListRemoveInside,
2169 Limit, RemoveWebs, ListMaterials,
2170 KeepNonlimitShapes);
2171 RaiseIfFailed("MakePartition", self.BoolOp)
2174 ## Perform partition operation.
2175 # This method may be useful if it is needed to make a partition for
2176 # compound contains nonintersected shapes. Performance will be better
2177 # since intersection between shapes from compound is not performed.
2179 # Description of all parameters as in previous method MakePartition()
2181 # !!!NOTE: Passed compounds (via ListShapes or via ListTools)
2182 # have to consist of nonintersecting shapes.
2184 # @return New GEOM_Object, containing the result shapes.
2186 # @ref swig_todo "Example"
2187 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
2188 ListKeepInside=[], ListRemoveInside=[],
2189 Limit=ShapeType["SHAPE"], RemoveWebs=0,
2190 ListMaterials=[], KeepNonlimitShapes=0):
2191 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
2192 ListKeepInside, ListRemoveInside,
2193 Limit, RemoveWebs, ListMaterials,
2194 KeepNonlimitShapes);
2195 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
2198 ## Shortcut to MakePartition()
2200 # @ref tui_partition "Example 1"
2201 # \n @ref swig_Partition "Example 2"
2202 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
2203 Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
2204 KeepNonlimitShapes=0):
2205 # Example: see GEOM_TestOthers.py
2206 anObj = self.MakePartition(ListShapes, ListTools,
2207 ListKeepInside, ListRemoveInside,
2208 Limit, RemoveWebs, ListMaterials,
2209 KeepNonlimitShapes);
2212 ## Perform partition of the Shape with the Plane
2213 # @param theShape Shape to be intersected.
2214 # @param thePlane Tool shape, to intersect theShape.
2215 # @return New GEOM_Object, containing the result shape.
2217 # @ref tui_partition "Example"
2218 def MakeHalfPartition(self,theShape, thePlane):
2219 # Example: see GEOM_TestAll.py
2220 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
2221 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
2224 # end of l3_basic_op
2227 ## @addtogroup l3_transform
2230 ## Translate the given object along the vector, specified
2231 # by its end points, creating its copy before the translation.
2232 # @param theObject The object to be translated.
2233 # @param thePoint1 Start point of translation vector.
2234 # @param thePoint2 End point of translation vector.
2235 # @return New GEOM_Object, containing the translated object.
2237 # @ref tui_translation "Example 1"
2238 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
2239 def MakeTranslationTwoPoints(self,theObject, thePoint1, thePoint2):
2240 # Example: see GEOM_TestAll.py
2241 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
2242 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
2245 ## Translate the given object along the vector, specified by its components.
2246 # @param theObject The object to be translated.
2247 # @param theDX,theDY,theDZ Components of translation vector.
2248 # @return Translated GEOM_Object.
2250 # @ref tui_translation "Example"
2251 def TranslateDXDYDZ(self,theObject, theDX, theDY, theDZ):
2252 # Example: see GEOM_TestAll.py
2253 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
2254 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
2255 anObj.SetParameters(Parameters)
2256 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
2259 ## Translate the given object along the vector, specified
2260 # by its components, creating its copy before the translation.
2261 # @param theObject The object to be translated.
2262 # @param theDX,theDY,theDZ Components of translation vector.
2263 # @return New GEOM_Object, containing the translated object.
2265 # @ref tui_translation "Example"
2266 def MakeTranslation(self,theObject, theDX, theDY, theDZ):
2267 # Example: see GEOM_TestAll.py
2268 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
2269 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
2270 anObj.SetParameters(Parameters)
2271 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
2274 ## Translate the given object along the given vector,
2275 # creating its copy before the translation.
2276 # @param theObject The object to be translated.
2277 # @param theVector The translation vector.
2278 # @return New GEOM_Object, containing the translated object.
2280 # @ref tui_translation "Example"
2281 def MakeTranslationVector(self,theObject, theVector):
2282 # Example: see GEOM_TestAll.py
2283 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
2284 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
2287 ## Translate the given object along the given vector on given distance.
2288 # @param theObject The object to be translated.
2289 # @param theVector The translation vector.
2290 # @param theDistance The translation distance.
2291 # @param theCopy Flag used to translate object itself or create a copy.
2292 # @return Translated GEOM_Object.
2294 # @ref tui_translation "Example"
2295 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy):
2296 # Example: see GEOM_TestAll.py
2297 theDistance,Parameters = ParseParameters(theDistance)
2298 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
2299 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
2300 anObj.SetParameters(Parameters)
2303 ## Translate the given object along the given vector on given distance,
2304 # creating its copy before the translation.
2305 # @param theObject The object to be translated.
2306 # @param theVector The translation vector.
2307 # @param theDistance The translation distance.
2308 # @return New GEOM_Object, containing the translated object.
2310 # @ref tui_translation "Example"
2311 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance):
2312 # Example: see GEOM_TestAll.py
2313 theDistance,Parameters = ParseParameters(theDistance)
2314 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
2315 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
2316 anObj.SetParameters(Parameters)
2319 ## Rotate the given object around the given axis on the given angle.
2320 # @param theObject The object to be rotated.
2321 # @param theAxis Rotation axis.
2322 # @param theAngle Rotation angle in radians.
2323 # @return Rotated GEOM_Object.
2325 # @ref tui_rotation "Example"
2326 def Rotate(self,theObject, theAxis, theAngle):
2327 # Example: see GEOM_TestAll.py
2329 if isinstance(theAngle,str):
2331 theAngle, Parameters = ParseParameters(theAngle)
2333 theAngle = theAngle*math.pi/180.0
2334 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
2335 RaiseIfFailed("RotateCopy", self.TrsfOp)
2336 anObj.SetParameters(Parameters)
2339 ## Rotate the given object around the given axis
2340 # on the given angle, creating its copy before the rotatation.
2341 # @param theObject The object to be rotated.
2342 # @param theAxis Rotation axis.
2343 # @param theAngle Rotation angle in radians.
2344 # @return New GEOM_Object, containing the rotated object.
2346 # @ref tui_rotation "Example"
2347 def MakeRotation(self,theObject, theAxis, theAngle):
2348 # Example: see GEOM_TestAll.py
2350 if isinstance(theAngle,str):
2352 theAngle, Parameters = ParseParameters(theAngle)
2354 theAngle = theAngle*math.pi/180.0
2355 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
2356 RaiseIfFailed("RotateCopy", self.TrsfOp)
2357 anObj.SetParameters(Parameters)
2360 ## Rotate given object around vector perpendicular to plane
2361 # containing three points, creating its copy before the rotatation.
2362 # @param theObject The object to be rotated.
2363 # @param theCentPoint central point - the axis is the vector perpendicular to the plane
2364 # containing the three points.
2365 # @param thePoint1,thePoint2 - in a perpendicular plane of the axis.
2366 # @return New GEOM_Object, containing the rotated object.
2368 # @ref tui_rotation "Example"
2369 def MakeRotationThreePoints(self,theObject, theCentPoint, thePoint1, thePoint2):
2370 # Example: see GEOM_TestAll.py
2371 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
2372 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
2375 ## Scale the given object by the factor, creating its copy before the scaling.
2376 # @param theObject The object to be scaled.
2377 # @param thePoint Center point for scaling.
2378 # Passing None for it means scaling relatively the origin of global CS.
2379 # @param theFactor Scaling factor value.
2380 # @return New GEOM_Object, containing the scaled shape.
2382 # @ref tui_scale "Example"
2383 def MakeScaleTransform(self, theObject, thePoint, theFactor):
2384 # Example: see GEOM_TestAll.py
2385 theFactor, Parameters = ParseParameters(theFactor)
2386 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
2387 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
2388 anObj.SetParameters(Parameters)
2391 ## Scale the given object by different factors along coordinate axes,
2392 # creating its copy before the scaling.
2393 # @param theObject The object to be scaled.
2394 # @param thePoint Center point for scaling.
2395 # Passing None for it means scaling relatively the origin of global CS.
2396 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
2397 # @return New GEOM_Object, containing the scaled shape.
2399 # @ref swig_scale "Example"
2400 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ):
2401 # Example: see GEOM_TestAll.py
2402 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
2403 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
2404 theFactorX, theFactorY, theFactorZ)
2405 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
2406 anObj.SetParameters(Parameters)
2409 ## Create an object, symmetrical
2410 # to the given one relatively the given plane.
2411 # @param theObject The object to be mirrored.
2412 # @param thePlane Plane of symmetry.
2413 # @return New GEOM_Object, containing the mirrored shape.
2415 # @ref tui_mirror "Example"
2416 def MakeMirrorByPlane(self,theObject, thePlane):
2417 # Example: see GEOM_TestAll.py
2418 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
2419 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
2422 ## Create an object, symmetrical
2423 # to the given one relatively the given axis.
2424 # @param theObject The object to be mirrored.
2425 # @param theAxis Axis of symmetry.
2426 # @return New GEOM_Object, containing the mirrored shape.
2428 # @ref tui_mirror "Example"
2429 def MakeMirrorByAxis(self,theObject, theAxis):
2430 # Example: see GEOM_TestAll.py
2431 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
2432 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
2435 ## Create an object, symmetrical
2436 # to the given one relatively the given point.
2437 # @param theObject The object to be mirrored.
2438 # @param thePoint Point of symmetry.
2439 # @return New GEOM_Object, containing the mirrored shape.
2441 # @ref tui_mirror "Example"
2442 def MakeMirrorByPoint(self,theObject, thePoint):
2443 # Example: see GEOM_TestAll.py
2444 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
2445 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
2448 ## Modify the Location of the given object by LCS,
2449 # creating its copy before the setting.
2450 # @param theObject The object to be displaced.
2451 # @param theStartLCS Coordinate system to perform displacement from it.
2452 # If \a theStartLCS is NULL, displacement
2453 # will be performed from global CS.
2454 # If \a theObject itself is used as \a theStartLCS,
2455 # its location will be changed to \a theEndLCS.
2456 # @param theEndLCS Coordinate system to perform displacement to it.
2457 # @return New GEOM_Object, containing the displaced shape.
2459 # @ref tui_modify_location "Example"
2460 def MakePosition(self,theObject, theStartLCS, theEndLCS):
2461 # Example: see GEOM_TestAll.py
2462 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
2463 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
2466 ## Modify the Location of the given object by Path,
2467 # @param theObject The object to be displaced.
2468 # @param thePath Wire or Edge along that the object will be translated.
2469 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
2470 # @param theCopy is to create a copy objects if true.
2471 # @param theReverse - 0 for usual direction, 1 to reverse path direction.
2472 # @return New GEOM_Object, containing the displaced shape.
2474 # @ref tui_modify_location "Example"
2475 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
2476 # Example: see GEOM_TestAll.py
2477 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
2478 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
2481 ## Create new object as offset of the given one.
2482 # @param theObject The base object for the offset.
2483 # @param theOffset Offset value.
2484 # @return New GEOM_Object, containing the offset object.
2486 # @ref tui_offset "Example"
2487 def MakeOffset(self,theObject, theOffset):
2488 # Example: see GEOM_TestAll.py
2489 theOffset, Parameters = ParseParameters(theOffset)
2490 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
2491 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
2492 anObj.SetParameters(Parameters)
2495 # -----------------------------------------------------------------------------
2497 # -----------------------------------------------------------------------------
2499 ## Translate the given object along the given vector a given number times
2500 # @param theObject The object to be translated.
2501 # @param theVector Direction of the translation.
2502 # @param theStep Distance to translate on.
2503 # @param theNbTimes Quantity of translations to be done.
2504 # @return New GEOM_Object, containing compound of all
2505 # the shapes, obtained after each translation.
2507 # @ref tui_multi_translation "Example"
2508 def MakeMultiTranslation1D(self,theObject, theVector, theStep, theNbTimes):
2509 # Example: see GEOM_TestAll.py
2510 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
2511 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
2512 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
2513 anObj.SetParameters(Parameters)
2516 ## Conseqently apply two specified translations to theObject specified number of times.
2517 # @param theObject The object to be translated.
2518 # @param theVector1 Direction of the first translation.
2519 # @param theStep1 Step of the first translation.
2520 # @param theNbTimes1 Quantity of translations to be done along theVector1.
2521 # @param theVector2 Direction of the second translation.
2522 # @param theStep2 Step of the second translation.
2523 # @param theNbTimes2 Quantity of translations to be done along theVector2.
2524 # @return New GEOM_Object, containing compound of all
2525 # the shapes, obtained after each translation.
2527 # @ref tui_multi_translation "Example"
2528 def MakeMultiTranslation2D(self,theObject, theVector1, theStep1, theNbTimes1,
2529 theVector2, theStep2, theNbTimes2):
2530 # Example: see GEOM_TestAll.py
2531 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
2532 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
2533 theVector2, theStep2, theNbTimes2)
2534 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
2535 anObj.SetParameters(Parameters)
2538 ## Rotate the given object around the given axis a given number times.
2539 # Rotation angle will be 2*PI/theNbTimes.
2540 # @param theObject The object to be rotated.
2541 # @param theAxis The rotation axis.
2542 # @param theNbTimes Quantity of rotations to be done.
2543 # @return New GEOM_Object, containing compound of all the
2544 # shapes, obtained after each rotation.
2546 # @ref tui_multi_rotation "Example"
2547 def MultiRotate1D(self,theObject, theAxis, theNbTimes):
2548 # Example: see GEOM_TestAll.py
2549 theAxis, theNbTimes, Parameters = ParseParameters(theAxis, theNbTimes)
2550 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
2551 RaiseIfFailed("MultiRotate1D", self.TrsfOp)
2552 anObj.SetParameters(Parameters)
2555 ## Rotate the given object around the
2556 # given axis on the given angle a given number
2557 # times and multi-translate each rotation result.
2558 # Translation direction passes through center of gravity
2559 # of rotated shape and its projection on the rotation axis.
2560 # @param theObject The object to be rotated.
2561 # @param theAxis Rotation axis.
2562 # @param theAngle Rotation angle in graduces.
2563 # @param theNbTimes1 Quantity of rotations to be done.
2564 # @param theStep Translation distance.
2565 # @param theNbTimes2 Quantity of translations to be done.
2566 # @return New GEOM_Object, containing compound of all the
2567 # shapes, obtained after each transformation.
2569 # @ref tui_multi_rotation "Example"
2570 def MultiRotate2D(self,theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2):
2571 # Example: see GEOM_TestAll.py
2572 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
2573 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
2574 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
2575 anObj.SetParameters(Parameters)
2578 ## The same, as MultiRotate1D(), but axis is given by direction and point
2579 # @ref swig_MakeMultiRotation "Example"
2580 def MakeMultiRotation1D(self,aShape,aDir,aPoint,aNbTimes):
2581 # Example: see GEOM_TestOthers.py
2582 aVec = self.MakeLine(aPoint,aDir)
2583 anObj = self.MultiRotate1D(aShape,aVec,aNbTimes)
2586 ## The same, as MultiRotate2D(), but axis is given by direction and point
2587 # @ref swig_MakeMultiRotation "Example"
2588 def MakeMultiRotation2D(self,aShape,aDir,aPoint,anAngle,nbtimes1,aStep,nbtimes2):
2589 # Example: see GEOM_TestOthers.py
2590 aVec = self.MakeLine(aPoint,aDir)
2591 anObj = self.MultiRotate2D(aShape,aVec,anAngle,nbtimes1,aStep,nbtimes2)
2594 # end of l3_transform
2597 ## @addtogroup l3_local
2600 ## Perform a fillet on all edges of the given shape.
2601 # @param theShape Shape, to perform fillet on.
2602 # @param theR Fillet radius.
2603 # @return New GEOM_Object, containing the result shape.
2605 # @ref tui_fillet "Example 1"
2606 # \n @ref swig_MakeFilletAll "Example 2"
2607 def MakeFilletAll(self,theShape, theR):
2608 # Example: see GEOM_TestOthers.py
2609 theR,Parameters = ParseParameters(theR)
2610 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
2611 RaiseIfFailed("MakeFilletAll", self.LocalOp)
2612 anObj.SetParameters(Parameters)
2615 ## Perform a fillet on the specified edges/faces of the given shape
2616 # @param theShape Shape, to perform fillet on.
2617 # @param theR Fillet radius.
2618 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR>.
2619 # @param theListShapes Global indices of edges/faces to perform fillet on.
2620 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2621 # @return New GEOM_Object, containing the result shape.
2623 # @ref tui_fillet "Example"
2624 def MakeFillet(self,theShape, theR, theShapeType, theListShapes):
2625 # Example: see GEOM_TestAll.py
2626 theR,Parameters = ParseParameters(theR)
2628 if theShapeType == ShapeType["EDGE"]:
2629 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
2630 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
2632 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
2633 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
2634 anObj.SetParameters(Parameters)
2637 ## The same that MakeFillet but with two Fillet Radius R1 and R2
2638 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes):
2639 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
2641 if theShapeType == ShapeType["EDGE"]:
2642 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
2643 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
2645 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
2646 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
2647 anObj.SetParameters(Parameters)
2650 ## Perform a fillet on the specified edges/faces of the given shape
2651 # @param theShape - Face Shape to perform fillet on.
2652 # @param theR - Fillet radius.
2653 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
2654 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2655 # @return New GEOM_Object, containing the result shape.
2657 # @ref tui_fillet2d "Example"
2658 def MakeFillet2D(self,theShape, theR, theListOfVertexes):
2659 # Example: see GEOM_TestAll.py
2660 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
2661 RaiseIfFailed("MakeFillet2D", self.LocalOp)
2664 ## Perform a symmetric chamfer on all edges of the given shape.
2665 # @param theShape Shape, to perform chamfer on.
2666 # @param theD Chamfer size along each face.
2667 # @return New GEOM_Object, containing the result shape.
2669 # @ref tui_chamfer "Example 1"
2670 # \n @ref swig_MakeChamferAll "Example 2"
2671 def MakeChamferAll(self,theShape, theD):
2672 # Example: see GEOM_TestOthers.py
2673 theD,Parameters = ParseParameters(theD)
2674 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
2675 RaiseIfFailed("MakeChamferAll", self.LocalOp)
2676 anObj.SetParameters(Parameters)
2679 ## Perform a chamfer on edges, common to the specified faces,
2680 # with distance D1 on the Face1
2681 # @param theShape Shape, to perform chamfer on.
2682 # @param theD1 Chamfer size along \a theFace1.
2683 # @param theD2 Chamfer size along \a theFace2.
2684 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
2685 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2686 # @return New GEOM_Object, containing the result shape.
2688 # @ref tui_chamfer "Example"
2689 def MakeChamferEdge(self,theShape, theD1, theD2, theFace1, theFace2):
2690 # Example: see GEOM_TestAll.py
2691 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
2692 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
2693 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
2694 anObj.SetParameters(Parameters)
2697 ## The Same that MakeChamferEdge but with params theD is chamfer length and
2698 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
2699 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2):
2701 if isinstance(theAngle,str):
2703 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
2705 theAngle = theAngle*math.pi/180.0
2706 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
2707 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
2708 anObj.SetParameters(Parameters)
2711 ## Perform a chamfer on all edges of the specified faces,
2712 # with distance D1 on the first specified face (if several for one edge)
2713 # @param theShape Shape, to perform chamfer on.
2714 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
2715 # connected to the edge, are in \a theFaces, \a theD1
2716 # will be get along face, which is nearer to \a theFaces beginning.
2717 # @param theD2 Chamfer size along another of two faces, connected to the edge.
2718 # @param theFaces Sequence of global indices of faces of \a theShape.
2719 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2720 # @return New GEOM_Object, containing the result shape.
2722 # @ref tui_chamfer "Example"
2723 def MakeChamferFaces(self,theShape, theD1, theD2, theFaces):
2724 # Example: see GEOM_TestAll.py
2725 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
2726 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
2727 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
2728 anObj.SetParameters(Parameters)
2731 ## The Same that MakeChamferFaces but with params theD is chamfer lenght and
2732 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
2734 # @ref swig_FilletChamfer "Example"
2735 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces):
2737 if isinstance(theAngle,str):
2739 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
2741 theAngle = theAngle*math.pi/180.0
2742 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
2743 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
2744 anObj.SetParameters(Parameters)
2747 ## Perform a chamfer on edges,
2748 # with distance D1 on the first specified face (if several for one edge)
2749 # @param theShape Shape, to perform chamfer on.
2750 # @param theD1,theD2 Chamfer size
2751 # @param theEdges Sequence of edges of \a theShape.
2752 # @return New GEOM_Object, containing the result shape.
2754 # @ref swig_FilletChamfer "Example"
2755 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges):
2756 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
2757 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
2758 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
2759 anObj.SetParameters(Parameters)
2762 ## The Same that MakeChamferEdges but with params theD is chamfer lenght and
2763 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
2764 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges):
2766 if isinstance(theAngle,str):
2768 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
2770 theAngle = theAngle*math.pi/180.0
2771 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
2772 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
2773 anObj.SetParameters(Parameters)
2776 ## Shortcut to MakeChamferEdge() and MakeChamferFaces()
2778 # @ref swig_MakeChamfer "Example"
2779 def MakeChamfer(self,aShape,d1,d2,aShapeType,ListShape):
2780 # Example: see GEOM_TestOthers.py
2782 if aShapeType == ShapeType["EDGE"]:
2783 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1])
2785 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape)
2791 ## @addtogroup l3_basic_op
2794 ## Perform an Archimde operation on the given shape with given parameters.
2795 # The object presenting the resulting face is returned.
2796 # @param theShape Shape to be put in water.
2797 # @param theWeight Weight og the shape.
2798 # @param theWaterDensity Density of the water.
2799 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
2800 # @return New GEOM_Object, containing a section of \a theShape
2801 # by a plane, corresponding to water level.
2803 # @ref tui_archimede "Example"
2804 def Archimede(self,theShape, theWeight, theWaterDensity, theMeshDeflection):
2805 # Example: see GEOM_TestAll.py
2806 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
2807 theWeight,theWaterDensity,theMeshDeflection)
2808 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
2809 RaiseIfFailed("MakeArchimede", self.LocalOp)
2810 anObj.SetParameters(Parameters)
2813 # end of l3_basic_op
2816 ## @addtogroup l2_measure
2819 ## Get point coordinates
2822 # @ref tui_measurement_tools_page "Example"
2823 def PointCoordinates(self,Point):
2824 # Example: see GEOM_TestMeasures.py
2825 aTuple = self.MeasuOp.PointCoordinates(Point)
2826 RaiseIfFailed("PointCoordinates", self.MeasuOp)
2829 ## Get summarized length of all wires,
2830 # area of surface and volume of the given shape.
2831 # @param theShape Shape to define properties of.
2832 # @return [theLength, theSurfArea, theVolume]
2833 # theLength: Summarized length of all wires of the given shape.
2834 # theSurfArea: Area of surface of the given shape.
2835 # theVolume: Volume of the given shape.
2837 # @ref tui_measurement_tools_page "Example"
2838 def BasicProperties(self,theShape):
2839 # Example: see GEOM_TestMeasures.py
2840 aTuple = self.MeasuOp.GetBasicProperties(theShape)
2841 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
2844 ## Get parameters of bounding box of the given shape
2845 # @param theShape Shape to obtain bounding box of.
2846 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
2847 # Xmin,Xmax: Limits of shape along OX axis.
2848 # Ymin,Ymax: Limits of shape along OY axis.
2849 # Zmin,Zmax: Limits of shape along OZ axis.
2851 # @ref tui_measurement_tools_page "Example"
2852 def BoundingBox(self,theShape):
2853 # Example: see GEOM_TestMeasures.py
2854 aTuple = self.MeasuOp.GetBoundingBox(theShape)
2855 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
2858 ## Get inertia matrix and moments of inertia of theShape.
2859 # @param theShape Shape to calculate inertia of.
2860 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
2861 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
2862 # Ix,Iy,Iz: Moments of inertia of the given shape.
2864 # @ref tui_measurement_tools_page "Example"
2865 def Inertia(self,theShape):
2866 # Example: see GEOM_TestMeasures.py
2867 aTuple = self.MeasuOp.GetInertia(theShape)
2868 RaiseIfFailed("GetInertia", self.MeasuOp)
2871 ## Get minimal distance between the given shapes.
2872 # @param theShape1,theShape2 Shapes to find minimal distance between.
2873 # @return Value of the minimal distance between the given shapes.
2875 # @ref tui_measurement_tools_page "Example"
2876 def MinDistance(self, theShape1, theShape2):
2877 # Example: see GEOM_TestMeasures.py
2878 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
2879 RaiseIfFailed("GetMinDistance", self.MeasuOp)
2882 ## Get minimal distance between the given shapes.
2883 # @param theShape1,theShape2 Shapes to find minimal distance between.
2884 # @return Value of the minimal distance between the given shapes.
2886 # @ref swig_all_measure "Example"
2887 def MinDistanceComponents(self, theShape1, theShape2):
2888 # Example: see GEOM_TestMeasures.py
2889 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
2890 RaiseIfFailed("GetMinDistance", self.MeasuOp)
2891 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
2894 ## Get angle between the given shapes in degrees.
2895 # @param theShape1,theShape2 Lines or linear edges to find angle between.
2896 # @return Value of the angle between the given shapes in degrees.
2898 # @ref tui_measurement_tools_page "Example"
2899 def GetAngle(self, theShape1, theShape2):
2900 # Example: see GEOM_TestMeasures.py
2901 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
2902 RaiseIfFailed("GetAngle", self.MeasuOp)
2904 ## Get angle between the given shapes in radians.
2905 # @param theShape1,theShape2 Lines or linear edges to find angle between.
2906 # @return Value of the angle between the given shapes in radians.
2908 # @ref tui_measurement_tools_page "Example"
2909 def GetAngleRadians(self, theShape1, theShape2):
2910 # Example: see GEOM_TestMeasures.py
2911 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
2912 RaiseIfFailed("GetAngle", self.MeasuOp)
2915 ## @name Curve Curvature Measurement
2916 # Methods for receiving radius of curvature of curves
2917 # in the given point
2920 ## Measure curvature of a curve at a point, set by parameter.
2921 # @ref swig_todo "Example"
2922 def CurveCurvatureByParam(self, theCurve, theParam):
2923 # Example: see GEOM_TestMeasures.py
2924 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
2925 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
2929 # @ref swig_todo "Example"
2930 def CurveCurvatureByPoint(self, theCurve, thePoint):
2931 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
2932 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
2936 ## @name Surface Curvature Measurement
2937 # Methods for receiving max and min radius of curvature of surfaces
2938 # in the given point
2942 ## @ref swig_todo "Example"
2943 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
2944 # Example: see GEOM_TestMeasures.py
2945 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
2946 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
2950 ## @ref swig_todo "Example"
2951 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
2952 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
2953 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
2957 ## @ref swig_todo "Example"
2958 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
2959 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
2960 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
2964 ## @ref swig_todo "Example"
2965 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
2966 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
2967 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
2971 ## Get min and max tolerances of sub-shapes of theShape
2972 # @param theShape Shape, to get tolerances of.
2973 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
2974 # FaceMin,FaceMax: Min and max tolerances of the faces.
2975 # EdgeMin,EdgeMax: Min and max tolerances of the edges.
2976 # VertMin,VertMax: Min and max tolerances of the vertices.
2978 # @ref tui_measurement_tools_page "Example"
2979 def Tolerance(self,theShape):
2980 # Example: see GEOM_TestMeasures.py
2981 aTuple = self.MeasuOp.GetTolerance(theShape)
2982 RaiseIfFailed("GetTolerance", self.MeasuOp)
2985 ## Obtain description of the given shape (number of sub-shapes of each type)
2986 # @param theShape Shape to be described.
2987 # @return Description of the given shape.
2989 # @ref tui_measurement_tools_page "Example"
2990 def WhatIs(self,theShape):
2991 # Example: see GEOM_TestMeasures.py
2992 aDescr = self.MeasuOp.WhatIs(theShape)
2993 RaiseIfFailed("WhatIs", self.MeasuOp)
2996 ## Get a point, situated at the centre of mass of theShape.
2997 # @param theShape Shape to define centre of mass of.
2998 # @return New GEOM_Object, containing the created point.
3000 # @ref tui_measurement_tools_page "Example"
3001 def MakeCDG(self,theShape):
3002 # Example: see GEOM_TestMeasures.py
3003 anObj = self.MeasuOp.GetCentreOfMass(theShape)
3004 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
3007 ## Get a normale to the given face. If the point is not given,
3008 # the normale is calculated at the center of mass.
3009 # @param theFace Face to define normale of.
3010 # @param theOptionalPoint Point to compute the normale at.
3011 # @return New GEOM_Object, containing the created vector.
3013 # @ref swig_todo "Example"
3014 def GetNormal(self, theFace, theOptionalPoint = None):
3015 # Example: see GEOM_TestMeasures.py
3016 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
3017 RaiseIfFailed("GetNormal", self.MeasuOp)
3020 ## Check a topology of the given shape.
3021 # @param theShape Shape to check validity of.
3022 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked,
3023 # if TRUE, the shape's geometry will be checked also.
3024 # @return TRUE, if the shape "seems to be valid".
3025 # If theShape is invalid, prints a description of problem.
3027 # @ref tui_measurement_tools_page "Example"
3028 def CheckShape(self,theShape, theIsCheckGeom = 0):
3029 # Example: see GEOM_TestMeasures.py
3031 (IsValid, Status) = self.MeasuOp.CheckShapeWithGeometry(theShape)
3032 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
3034 (IsValid, Status) = self.MeasuOp.CheckShape(theShape)
3035 RaiseIfFailed("CheckShape", self.MeasuOp)
3040 ## Get position (LCS) of theShape.
3042 # Origin of the LCS is situated at the shape's center of mass.
3043 # Axes of the LCS are obtained from shape's location or,
3044 # if the shape is a planar face, from position of its plane.
3046 # @param theShape Shape to calculate position of.
3047 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
3048 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
3049 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
3050 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
3052 # @ref swig_todo "Example"
3053 def GetPosition(self,theShape):
3054 # Example: see GEOM_TestMeasures.py
3055 aTuple = self.MeasuOp.GetPosition(theShape)
3056 RaiseIfFailed("GetPosition", self.MeasuOp)
3059 ## Get kind of theShape.
3061 # @param theShape Shape to get a kind of.
3062 # @return Returns a kind of shape in terms of <VAR>GEOM_IKindOfShape.shape_kind</VAR> enumeration
3063 # and a list of parameters, describing the shape.
3064 # @note Concrete meaning of each value, returned via \a theIntegers
3065 # or \a theDoubles list depends on the kind of the shape.
3066 # The full list of possible outputs is:
3068 # - geompy.kind.COMPOUND nb_solids nb_faces nb_edges nb_vertices
3069 # - geompy.kind.COMPSOLID nb_solids nb_faces nb_edges nb_vertices
3071 # - geompy.kind.SHELL geompy.info.CLOSED nb_faces nb_edges nb_vertices
3072 # - geompy.kind.SHELL geompy.info.UNCLOSED nb_faces nb_edges nb_vertices
3074 # - geompy.kind.WIRE geompy.info.CLOSED nb_edges nb_vertices
3075 # - geompy.kind.WIRE geompy.info.UNCLOSED nb_edges nb_vertices
3077 # - geompy.kind.SPHERE xc yc zc R
3078 # - geompy.kind.CYLINDER xb yb zb dx dy dz R H
3079 # - geompy.kind.BOX xc yc zc ax ay az
3080 # - geompy.kind.ROTATED_BOX xc yc zc zx zy zz xx xy xz ax ay az
3081 # - geompy.kind.TORUS xc yc zc dx dy dz R_1 R_2
3082 # - geompy.kind.CONE xb yb zb dx dy dz R_1 R_2 H
3083 # - geompy.kind.POLYHEDRON nb_faces nb_edges nb_vertices
3084 # - geompy.kind.SOLID nb_faces nb_edges nb_vertices
3086 # - geompy.kind.SPHERE2D xc yc zc R
3087 # - geompy.kind.CYLINDER2D xb yb zb dx dy dz R H
3088 # - geompy.kind.TORUS2D xc yc zc dx dy dz R_1 R_2
3089 # - geompy.kind.CONE2D xc yc zc dx dy dz R_1 R_2 H
3090 # - geompy.kind.DISK_CIRCLE xc yc zc dx dy dz R
3091 # - geompy.kind.DISK_ELLIPSE xc yc zc dx dy dz R_1 R_2
3092 # - geompy.kind.POLYGON xo yo zo dx dy dz nb_edges nb_vertices
3093 # - geompy.kind.PLANE xo yo zo dx dy dz
3094 # - geompy.kind.PLANAR xo yo zo dx dy dz nb_edges nb_vertices
3095 # - geompy.kind.FACE nb_edges nb_vertices
3097 # - geompy.kind.CIRCLE xc yc zc dx dy dz R
3098 # - geompy.kind.ARC_CIRCLE xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2
3099 # - geompy.kind.ELLIPSE xc yc zc dx dy dz R_1 R_2
3100 # - geompy.kind.ARC_ELLIPSE xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2
3101 # - geompy.kind.LINE xo yo zo dx dy dz
3102 # - geompy.kind.SEGMENT x1 y1 z1 x2 y2 z2
3103 # - geompy.kind.EDGE nb_vertices
3105 # - geompy.kind.VERTEX x y z
3107 # @ref swig_todo "Example"
3108 def KindOfShape(self,theShape):
3109 # Example: see GEOM_TestMeasures.py
3110 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
3111 RaiseIfFailed("KindOfShape", self.MeasuOp)
3113 aKind = aRoughTuple[0]
3114 anInts = aRoughTuple[1]
3115 aDbls = aRoughTuple[2]
3117 # Now there is no exception from this rule:
3118 aKindTuple = [aKind] + aDbls + anInts
3120 # If they are we will regroup parameters for such kind of shape.
3122 #if aKind == kind.SOME_KIND:
3123 # # SOME_KIND int int double int double double
3124 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
3131 ## @addtogroup l2_import_export
3134 ## Import a shape from the BREP or IGES or STEP file
3135 # (depends on given format) with given name.
3136 # @param theFileName The file, containing the shape.
3137 # @param theFormatName Specify format for the file reading.
3138 # Available formats can be obtained with InsertOp.ImportTranslators() method.
3139 # @return New GEOM_Object, containing the imported shape.
3141 # @ref swig_Import_Export "Example"
3142 def Import(self,theFileName, theFormatName):
3143 # Example: see GEOM_TestOthers.py
3144 anObj = self.InsertOp.Import(theFileName, theFormatName)
3145 RaiseIfFailed("Import", self.InsertOp)
3148 ## Shortcut to Import() for BREP format
3150 # @ref swig_Import_Export "Example"
3151 def ImportBREP(self,theFileName):
3152 # Example: see GEOM_TestOthers.py
3153 return self.Import(theFileName, "BREP")
3155 ## Shortcut to Import() for IGES format
3157 # @ref swig_Import_Export "Example"
3158 def ImportIGES(self,theFileName):
3159 # Example: see GEOM_TestOthers.py
3160 return self.Import(theFileName, "IGES")
3162 ## Shortcut to Import() for STEP format
3164 # @ref swig_Import_Export "Example"
3165 def ImportSTEP(self,theFileName):
3166 # Example: see GEOM_TestOthers.py
3167 return self.Import(theFileName, "STEP")
3169 ## Export the given shape into a file with given name.
3170 # @param theObject Shape to be stored in the file.
3171 # @param theFileName Name of the file to store the given shape in.
3172 # @param theFormatName Specify format for the shape storage.
3173 # Available formats can be obtained with InsertOp.ImportTranslators() method.
3175 # @ref swig_Import_Export "Example"
3176 def Export(self,theObject, theFileName, theFormatName):
3177 # Example: see GEOM_TestOthers.py
3178 self.InsertOp.Export(theObject, theFileName, theFormatName)
3179 if self.InsertOp.IsDone() == 0:
3180 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
3184 ## Shortcut to Export() for BREP format
3186 # @ref swig_Import_Export "Example"
3187 def ExportBREP(self,theObject, theFileName):
3188 # Example: see GEOM_TestOthers.py
3189 return self.Export(theObject, theFileName, "BREP")
3191 ## Shortcut to Export() for IGES format
3193 # @ref swig_Import_Export "Example"
3194 def ExportIGES(self,theObject, theFileName):
3195 # Example: see GEOM_TestOthers.py
3196 return self.Export(theObject, theFileName, "IGES")
3198 ## Shortcut to Export() for STEP format
3200 # @ref swig_Import_Export "Example"
3201 def ExportSTEP(self,theObject, theFileName):
3202 # Example: see GEOM_TestOthers.py
3203 return self.Export(theObject, theFileName, "STEP")
3205 # end of l2_import_export
3208 ## @addtogroup l3_blocks
3211 ## Create a quadrangle face from four edges. Order of Edges is not
3212 # important. It is not necessary that edges share the same vertex.
3213 # @param E1,E2,E3,E4 Edges for the face bound.
3214 # @return New GEOM_Object, containing the created face.
3216 # @ref tui_building_by_blocks_page "Example"
3217 def MakeQuad(self,E1, E2, E3, E4):
3218 # Example: see GEOM_Spanner.py
3219 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
3220 RaiseIfFailed("MakeQuad", self.BlocksOp)
3223 ## Create a quadrangle face on two edges.
3224 # The missing edges will be built by creating the shortest ones.
3225 # @param E1,E2 Two opposite edges for the face.
3226 # @return New GEOM_Object, containing the created face.
3228 # @ref tui_building_by_blocks_page "Example"
3229 def MakeQuad2Edges(self,E1, E2):
3230 # Example: see GEOM_Spanner.py
3231 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
3232 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
3235 ## Create a quadrangle face with specified corners.
3236 # The missing edges will be built by creating the shortest ones.
3237 # @param V1,V2,V3,V4 Corner vertices for the face.
3238 # @return New GEOM_Object, containing the created face.
3240 # @ref tui_building_by_blocks_page "Example 1"
3241 # \n @ref swig_MakeQuad4Vertices "Example 2"
3242 def MakeQuad4Vertices(self,V1, V2, V3, V4):
3243 # Example: see GEOM_Spanner.py
3244 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
3245 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
3248 ## Create a hexahedral solid, bounded by the six given faces. Order of
3249 # faces is not important. It is not necessary that Faces share the same edge.
3250 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
3251 # @return New GEOM_Object, containing the created solid.
3253 # @ref tui_building_by_blocks_page "Example 1"
3254 # \n @ref swig_MakeHexa "Example 2"
3255 def MakeHexa(self,F1, F2, F3, F4, F5, F6):
3256 # Example: see GEOM_Spanner.py
3257 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
3258 RaiseIfFailed("MakeHexa", self.BlocksOp)
3261 ## Create a hexahedral solid between two given faces.
3262 # The missing faces will be built by creating the smallest ones.
3263 # @param F1,F2 Two opposite faces for the hexahedral solid.
3264 # @return New GEOM_Object, containing the created solid.
3266 # @ref tui_building_by_blocks_page "Example 1"
3267 # \n @ref swig_MakeHexa2Faces "Example 2"
3268 def MakeHexa2Faces(self,F1, F2):
3269 # Example: see GEOM_Spanner.py
3270 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
3271 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
3277 ## @addtogroup l3_blocks_op
3280 ## Get a vertex, found in the given shape by its coordinates.
3281 # @param theShape Block or a compound of blocks.
3282 # @param theX,theY,theZ Coordinates of the sought vertex.
3283 # @param theEpsilon Maximum allowed distance between the resulting
3284 # vertex and point with the given coordinates.
3285 # @return New GEOM_Object, containing the found vertex.
3287 # @ref swig_GetPoint "Example"
3288 def GetPoint(self,theShape, theX, theY, theZ, theEpsilon):
3289 # Example: see GEOM_TestOthers.py
3290 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
3291 RaiseIfFailed("GetPoint", self.BlocksOp)
3294 ## Get an edge, found in the given shape by two given vertices.
3295 # @param theShape Block or a compound of blocks.
3296 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
3297 # @return New GEOM_Object, containing the found edge.
3299 # @ref swig_todo "Example"
3300 def GetEdge(self,theShape, thePoint1, thePoint2):
3301 # Example: see GEOM_Spanner.py
3302 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
3303 RaiseIfFailed("GetEdge", self.BlocksOp)
3306 ## Find an edge of the given shape, which has minimal distance to the given point.
3307 # @param theShape Block or a compound of blocks.
3308 # @param thePoint Point, close to the desired edge.
3309 # @return New GEOM_Object, containing the found edge.
3311 # @ref swig_GetEdgeNearPoint "Example"
3312 def GetEdgeNearPoint(self,theShape, thePoint):
3313 # Example: see GEOM_TestOthers.py
3314 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
3315 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
3318 ## Returns a face, found in the given shape by four given corner vertices.
3319 # @param theShape Block or a compound of blocks.
3320 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
3321 # @return New GEOM_Object, containing the found face.
3323 # @ref swig_todo "Example"
3324 def GetFaceByPoints(self,theShape, thePoint1, thePoint2, thePoint3, thePoint4):
3325 # Example: see GEOM_Spanner.py
3326 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
3327 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
3330 ## Get a face of block, found in the given shape by two given edges.
3331 # @param theShape Block or a compound of blocks.
3332 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
3333 # @return New GEOM_Object, containing the found face.
3335 # @ref swig_todo "Example"
3336 def GetFaceByEdges(self,theShape, theEdge1, theEdge2):
3337 # Example: see GEOM_Spanner.py
3338 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
3339 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
3342 ## Find a face, opposite to the given one in the given block.
3343 # @param theBlock Must be a hexahedral solid.
3344 # @param theFace Face of \a theBlock, opposite to the desired face.
3345 # @return New GEOM_Object, containing the found face.
3347 # @ref swig_GetOppositeFace "Example"
3348 def GetOppositeFace(self,theBlock, theFace):
3349 # Example: see GEOM_Spanner.py
3350 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
3351 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
3354 ## Find a face of the given shape, which has minimal distance to the given point.
3355 # @param theShape Block or a compound of blocks.
3356 # @param thePoint Point, close to the desired face.
3357 # @return New GEOM_Object, containing the found face.
3359 # @ref swig_GetFaceNearPoint "Example"
3360 def GetFaceNearPoint(self,theShape, thePoint):
3361 # Example: see GEOM_Spanner.py
3362 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
3363 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
3366 ## Find a face of block, whose outside normale has minimal angle with the given vector.
3367 # @param theBlock Block or a compound of blocks.
3368 # @param theVector Vector, close to the normale of the desired face.
3369 # @return New GEOM_Object, containing the found face.
3371 # @ref swig_todo "Example"
3372 def GetFaceByNormale(self, theBlock, theVector):
3373 # Example: see GEOM_Spanner.py
3374 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
3375 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
3378 # end of l3_blocks_op
3381 ## @addtogroup l4_blocks_measure
3384 ## Check, if the compound of blocks is given.
3385 # To be considered as a compound of blocks, the
3386 # given shape must satisfy the following conditions:
3387 # - Each element of the compound should be a Block (6 faces and 12 edges).
3388 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
3389 # - The compound should be connexe.
3390 # - The glue between two quadrangle faces should be applied.
3391 # @param theCompound The compound to check.
3392 # @return TRUE, if the given shape is a compound of blocks.
3393 # If theCompound is not valid, prints all discovered errors.
3395 # @ref tui_measurement_tools_page "Example 1"
3396 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
3397 def CheckCompoundOfBlocks(self,theCompound):
3398 # Example: see GEOM_Spanner.py
3399 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
3400 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
3402 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
3406 ## Remove all seam and degenerated edges from \a theShape.
3407 # Unite faces and edges, sharing one surface. It means that
3408 # this faces must have references to one C++ surface object (handle).
3409 # @param theShape The compound or single solid to remove irregular edges from.
3410 # @return Improved shape.
3412 # @ref swig_RemoveExtraEdges "Example"
3413 def RemoveExtraEdges(self,theShape):
3414 # Example: see GEOM_TestOthers.py
3415 anObj = self.BlocksOp.RemoveExtraEdges(theShape)
3416 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
3419 ## Check, if the given shape is a blocks compound.
3420 # Fix all detected errors.
3421 # \note Single block can be also fixed by this method.
3422 # @param theShape The compound to check and improve.
3423 # @return Improved compound.
3425 # @ref swig_CheckAndImprove "Example"
3426 def CheckAndImprove(self,theShape):
3427 # Example: see GEOM_TestOthers.py
3428 anObj = self.BlocksOp.CheckAndImprove(theShape)
3429 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
3432 # end of l4_blocks_measure
3435 ## @addtogroup l3_blocks_op
3438 ## Get all the blocks, contained in the given compound.
3439 # @param theCompound The compound to explode.
3440 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
3441 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
3442 # \note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
3443 # @return List of GEOM_Objects, containing the retrieved blocks.
3445 # @ref tui_explode_on_blocks "Example 1"
3446 # \n @ref swig_MakeBlockExplode "Example 2"
3447 def MakeBlockExplode(self,theCompound, theMinNbFaces, theMaxNbFaces):
3448 # Example: see GEOM_TestOthers.py
3449 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
3450 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
3451 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
3453 anObj.SetParameters(Parameters)
3457 ## Find block, containing the given point inside its volume or on boundary.
3458 # @param theCompound Compound, to find block in.
3459 # @param thePoint Point, close to the desired block. If the point lays on
3460 # boundary between some blocks, we return block with nearest center.
3461 # @return New GEOM_Object, containing the found block.
3463 # @ref swig_todo "Example"
3464 def GetBlockNearPoint(self,theCompound, thePoint):
3465 # Example: see GEOM_Spanner.py
3466 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
3467 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
3470 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
3471 # @param theCompound Compound, to find block in.
3472 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
3473 # @return New GEOM_Object, containing the found block.
3475 # @ref swig_GetBlockByParts "Example"
3476 def GetBlockByParts(self,theCompound, theParts):
3477 # Example: see GEOM_TestOthers.py
3478 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
3479 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
3482 ## Return all blocks, containing all the elements, passed as the parts.
3483 # @param theCompound Compound, to find blocks in.
3484 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
3485 # @return List of GEOM_Objects, containing the found blocks.
3487 # @ref swig_todo "Example"
3488 def GetBlocksByParts(self,theCompound, theParts):
3489 # Example: see GEOM_Spanner.py
3490 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
3491 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
3494 ## Multi-transformate block and glue the result.
3495 # Transformation is defined so, as to superpose direction faces.
3496 # @param Block Hexahedral solid to be multi-transformed.
3497 # @param DirFace1 ID of First direction face.
3498 # @param DirFace2 ID of Second direction face.
3499 # @param NbTimes Quantity of transformations to be done.
3500 # \note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
3501 # @return New GEOM_Object, containing the result shape.
3503 # @ref tui_multi_transformation "Example"
3504 def MakeMultiTransformation1D(self,Block, DirFace1, DirFace2, NbTimes):
3505 # Example: see GEOM_Spanner.py
3506 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
3507 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
3508 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
3509 anObj.SetParameters(Parameters)
3512 ## Multi-transformate block and glue the result.
3513 # @param Block Hexahedral solid to be multi-transformed.
3514 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
3515 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
3516 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
3517 # @return New GEOM_Object, containing the result shape.
3519 # @ref tui_multi_transformation "Example"
3520 def MakeMultiTransformation2D(self,Block, DirFace1U, DirFace2U, NbTimesU,
3521 DirFace1V, DirFace2V, NbTimesV):
3522 # Example: see GEOM_Spanner.py
3523 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
3524 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
3525 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
3526 DirFace1V, DirFace2V, NbTimesV)
3527 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
3528 anObj.SetParameters(Parameters)
3531 ## Build all possible propagation groups.
3532 # Propagation group is a set of all edges, opposite to one (main)
3533 # edge of this group directly or through other opposite edges.
3534 # Notion of Opposite Edge make sence only on quadrangle face.
3535 # @param theShape Shape to build propagation groups on.
3536 # @return List of GEOM_Objects, each of them is a propagation group.
3538 # @ref swig_Propagate "Example"
3539 def Propagate(self,theShape):
3540 # Example: see GEOM_TestOthers.py
3541 listChains = self.BlocksOp.Propagate(theShape)
3542 RaiseIfFailed("Propagate", self.BlocksOp)
3545 # end of l3_blocks_op
3548 ## @addtogroup l3_groups
3551 ## Creates a new group which will store sub shapes of theMainShape
3552 # @param theMainShape is a GEOM object on which the group is selected
3553 # @param theShapeType defines a shape type of the group
3554 # @return a newly created GEOM group
3556 # @ref tui_working_with_groups_page "Example 1"
3557 # \n @ref swig_CreateGroup "Example 2"
3558 def CreateGroup(self,theMainShape, theShapeType):
3559 # Example: see GEOM_TestOthers.py
3560 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
3561 RaiseIfFailed("CreateGroup", self.GroupOp)
3564 ## Adds a sub object with ID theSubShapeId to the group
3565 # @param theGroup is a GEOM group to which the new sub shape is added
3566 # @param theSubShapeID is a sub shape ID in the main object.
3567 # \note Use method GetSubShapeID() to get an unique ID of the sub shape
3569 # @ref tui_working_with_groups_page "Example"
3570 def AddObject(self,theGroup, theSubShapeID):
3571 # Example: see GEOM_TestOthers.py
3572 self.GroupOp.AddObject(theGroup, theSubShapeID)
3573 RaiseIfFailed("AddObject", self.GroupOp)
3576 ## Removes a sub object with ID \a theSubShapeId from the group
3577 # @param theGroup is a GEOM group from which the new sub shape is removed
3578 # @param theSubShapeID is a sub shape ID in the main object.
3579 # \note Use method GetSubShapeID() to get an unique ID of the sub shape
3581 # @ref tui_working_with_groups_page "Example"
3582 def RemoveObject(self,theGroup, theSubShapeID):
3583 # Example: see GEOM_TestOthers.py
3584 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
3585 RaiseIfFailed("RemoveObject", self.GroupOp)
3588 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
3589 # @param theGroup is a GEOM group to which the new sub shapes are added.
3590 # @param theSubShapes is a list of sub shapes to be added.
3592 # @ref tui_working_with_groups_page "Example"
3593 def UnionList (self,theGroup, theSubShapes):
3594 # Example: see GEOM_TestOthers.py
3595 self.GroupOp.UnionList(theGroup, theSubShapes)
3596 RaiseIfFailed("UnionList", self.GroupOp)
3599 ## Works like the above method, but argument
3600 # theSubShapes here is a list of sub-shapes indices
3602 # @ref swig_UnionIDs "Example"
3603 def UnionIDs(self,theGroup, theSubShapes):
3604 # Example: see GEOM_TestOthers.py
3605 self.GroupOp.UnionIDs(theGroup, theSubShapes)
3606 RaiseIfFailed("UnionIDs", self.GroupOp)
3609 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
3610 # @param theGroup is a GEOM group from which the sub-shapes are removed.
3611 # @param theSubShapes is a list of sub-shapes to be removed.
3613 # @ref tui_working_with_groups_page "Example"
3614 def DifferenceList (self,theGroup, theSubShapes):
3615 # Example: see GEOM_TestOthers.py
3616 self.GroupOp.DifferenceList(theGroup, theSubShapes)
3617 RaiseIfFailed("DifferenceList", self.GroupOp)
3620 ## Works like the above method, but argument
3621 # theSubShapes here is a list of sub-shapes indices
3623 # @ref swig_DifferenceIDs "Example"
3624 def DifferenceIDs(self,theGroup, theSubShapes):
3625 # Example: see GEOM_TestOthers.py
3626 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
3627 RaiseIfFailed("DifferenceIDs", self.GroupOp)
3630 ## Returns a list of sub objects ID stored in the group
3631 # @param theGroup is a GEOM group for which a list of IDs is requested
3633 # @ref swig_GetObjectIDs "Example"
3634 def GetObjectIDs(self,theGroup):
3635 # Example: see GEOM_TestOthers.py
3636 ListIDs = self.GroupOp.GetObjects(theGroup)
3637 RaiseIfFailed("GetObjects", self.GroupOp)
3640 ## Returns a type of sub objects stored in the group
3641 # @param theGroup is a GEOM group which type is returned.
3643 # @ref swig_GetType "Example"
3644 def GetType(self,theGroup):
3645 # Example: see GEOM_TestOthers.py
3646 aType = self.GroupOp.GetType(theGroup)
3647 RaiseIfFailed("GetType", self.GroupOp)
3650 ## Returns a main shape associated with the group
3651 # @param theGroup is a GEOM group for which a main shape object is requested
3652 # @return a GEOM object which is a main shape for theGroup
3654 # @ref swig_GetMainShape "Example"
3655 def GetMainShape(self,theGroup):
3656 # Example: see GEOM_TestOthers.py
3657 anObj = self.GroupOp.GetMainShape(theGroup)
3658 RaiseIfFailed("GetMainShape", self.GroupOp)
3661 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
3662 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
3664 # @ref swig_todo "Example"
3665 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1):
3666 edges = self.SubShapeAll(theShape, ShapeType["EDGE"])
3669 Props = self.BasicProperties(edge)
3670 if min_length <= Props[0] and Props[0] <= max_length:
3671 if (not include_min) and (min_length == Props[0]):
3674 if (not include_max) and (Props[0] == max_length):
3677 edges_in_range.append(edge)
3679 if len(edges_in_range) <= 0:
3680 print "No edges found by given criteria"
3683 group_edges = self.CreateGroup(theShape, ShapeType["EDGE"])
3684 self.UnionList(group_edges, edges_in_range)
3688 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
3689 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
3691 # @ref swig_todo "Example"
3692 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
3693 nb_selected = sg.SelectedCount()
3695 print "Select a shape before calling this function, please."
3698 print "Only one shape must be selected"
3701 id_shape = sg.getSelected(0)
3702 shape = IDToObject( id_shape )
3704 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
3708 if include_min: left_str = " <= "
3709 if include_max: right_str = " <= "
3711 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
3712 + left_str + "length" + right_str + `max_length`)
3714 sg.updateObjBrowser(1)
3721 ## Create a copy of the given object
3722 # @ingroup l1_geompy_auxiliary
3724 # @ref swig_all_advanced "Example"
3725 def MakeCopy(self,theOriginal):
3726 # Example: see GEOM_TestAll.py
3727 anObj = self.InsertOp.MakeCopy(theOriginal)
3728 RaiseIfFailed("MakeCopy", self.InsertOp)
3731 ## Add Path to load python scripts from
3732 # @ingroup l1_geompy_auxiliary
3733 def addPath(self,Path):
3734 if (sys.path.count(Path) < 1):
3735 sys.path.append(Path)
3738 #Register the new proxy for GEOM_Gen
3739 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geompyDC)