1 # GEOM GEOM_SWIG : binding of C++ omplementaion with Python
3 # Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 # This library is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU Lesser General Public
8 # License as published by the Free Software Foundation; either
9 # version 2.1 of the License.
11 # This library is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # Lesser General Public License for more details.
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with this library; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
25 # Author : Paul RASCLE, EDF
34 ## @defgroup l1_geompy_auxiliary Auxiliary data structures and methods
36 ## @defgroup l1_geompy_purpose All package methods, grouped by their purpose
38 ## @defgroup l2_import_export Importing/exporting geometrical objects
39 ## @defgroup l2_creating Creating geometrical objects
41 ## @defgroup l3_basic_go Creating Basic Geometric Objects
43 ## @defgroup l4_curves Creating Curves
46 ## @defgroup l3_3d_primitives Creating 3D Primitives
47 ## @defgroup l3_complex Creating Complex Objects
48 ## @defgroup l3_groups Working with groups
49 ## @defgroup l3_blocks Building by blocks
51 ## @defgroup l4_blocks_measure Check and Improve
54 ## @defgroup l3_sketcher Sketcher
55 ## @defgroup l3_advanced Creating Advanced Geometrical Objects
57 ## @defgroup l4_decompose Decompose objects
58 ## @defgroup l4_access Access to sub-shapes by their unique IDs inside the main shape
59 ## @defgroup l4_obtain Access to subshapes by a criteria
64 ## @defgroup l2_transforming Transforming geometrical objects
66 ## @defgroup l3_basic_op Basic Operations
67 ## @defgroup l3_boolean Boolean Operations
68 ## @defgroup l3_transform Transformation Operations
69 ## @defgroup l3_local Local Operations (Fillet and Chamfer)
70 ## @defgroup l3_blocks_op Blocks Operations
71 ## @defgroup l3_healing Repairing Operations
72 ## @defgroup l3_restore_ss Restore presentation parameters and a tree of subshapes
75 ## @defgroup l2_measure Using measurement tools
83 from salome_notebook import *
88 ## Enumeration ShapeType as a dictionary
89 # @ingroup l1_geompy_auxiliary
90 ShapeType = {"COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8}
92 ## Raise an Error, containing the Method_name, if Operation is Failed
93 ## @ingroup l1_geompy_auxiliary
94 def RaiseIfFailed (Method_name, Operation):
95 if Operation.IsDone() == 0 and Operation.GetErrorCode() != "NOT_FOUND_ANY":
96 raise RuntimeError, Method_name + " : " + Operation.GetErrorCode()
98 ## Return list of variables value from salome notebook
99 ## @ingroup l1_geompy_auxiliary
100 def ParseParameters(*parameters):
103 for parameter in parameters:
104 if isinstance(parameter,str):
105 if notebook.isVariable(parameter):
106 Result.append(notebook.get(parameter))
110 Result.append(parameter)
113 StringResult = StringResult + str(parameter)
114 StringResult = StringResult + ":"
116 StringResult = StringResult[:len(StringResult)-1]
117 Result.append(StringResult)
121 ## Kinds of shape enumeration
122 # @ingroup l1_geompy_auxiliary
123 kind = GEOM.GEOM_IKindOfShape
125 ## Information about closed/unclosed state of shell or wire
126 # @ingroup l1_geompy_auxiliary
133 class geompyDC(GEOM._objref_GEOM_Gen):
135 ## @addtogroup l1_geompy_auxiliary
138 GEOM._objref_GEOM_Gen.__init__(self)
139 self.myBuilder = None
157 def init_geom(self,theStudy):
158 self.myStudy = theStudy
159 self.myStudyId = self.myStudy._get_StudyId()
160 self.myBuilder = self.myStudy.NewBuilder()
161 self.father = self.myStudy.FindComponent("GEOM")
162 if self.father is None:
163 self.father = self.myBuilder.NewComponent("GEOM")
164 A1 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributeName")
165 FName = A1._narrow(SALOMEDS.AttributeName)
166 FName.SetValue("Geometry")
167 A2 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributePixMap")
168 aPixmap = A2._narrow(SALOMEDS.AttributePixMap)
169 aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry")
170 self.myBuilder.DefineComponentInstance(self.father,self)
172 self.BasicOp = self.GetIBasicOperations (self.myStudyId)
173 self.CurvesOp = self.GetICurvesOperations (self.myStudyId)
174 self.PrimOp = self.GetI3DPrimOperations (self.myStudyId)
175 self.ShapesOp = self.GetIShapesOperations (self.myStudyId)
176 self.HealOp = self.GetIHealingOperations (self.myStudyId)
177 self.InsertOp = self.GetIInsertOperations (self.myStudyId)
178 self.BoolOp = self.GetIBooleanOperations (self.myStudyId)
179 self.TrsfOp = self.GetITransformOperations(self.myStudyId)
180 self.LocalOp = self.GetILocalOperations (self.myStudyId)
181 self.MeasuOp = self.GetIMeasureOperations (self.myStudyId)
182 self.BlocksOp = self.GetIBlocksOperations (self.myStudyId)
183 self.GroupOp = self.GetIGroupOperations (self.myStudyId)
186 ## Get name for sub-shape aSubObj of shape aMainObj
188 # @ref swig_SubShapeAllSorted "Example"
189 def SubShapeName(self,aSubObj, aMainObj):
190 # Example: see GEOM_TestAll.py
192 #aSubId = orb.object_to_string(aSubObj)
193 #aMainId = orb.object_to_string(aMainObj)
194 #index = gg.getIndexTopology(aSubId, aMainId)
195 #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
196 index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
197 name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
200 ## Publish in study aShape with name aName
202 # \param aShape the shape to be published
203 # \param aName the name for the shape
204 # \param doRestoreSubShapes if True, finds and publishes also
205 # sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
206 # and published sub-shapes of arguments
207 # \param theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes for
208 # these arguments description
209 # \return study entry of the published shape in form of string
211 # @ref swig_MakeQuad4Vertices "Example"
212 def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
213 theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
214 # Example: see GEOM_TestAll.py
216 aSObject = self.AddInStudy(self.myStudy, aShape, aName, None)
217 if doRestoreSubShapes:
218 self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs,
219 theFindMethod, theInheritFirstArg)
221 print "addToStudy() failed"
223 return aShape.GetStudyEntry()
225 ## Publish in study aShape with name aName as sub-object of previously published aFather
227 # @ref swig_SubShapeAllSorted "Example"
228 def addToStudyInFather(self, aFather, aShape, aName):
229 # Example: see GEOM_TestAll.py
231 aSObject = self.AddInStudy(myStudy, aShape, aName, aFather)
233 print "addToStudyInFather() failed"
235 return aShape.GetStudyEntry()
237 # end of l1_geompy_auxiliary
240 ## @addtogroup l3_restore_ss
243 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
244 # To be used from python scripts out of geompy.addToStudy (non-default usage)
245 # \param theObject published GEOM object, arguments of which will be published
246 # \param theArgs list of GEOM_Object, operation arguments to be published.
247 # If this list is empty, all operation arguments will be published
248 # \param theFindMethod method to search subshapes, corresponding to arguments and
249 # their subshapes. Value from enumeration GEOM::find_shape_method.
250 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
251 # Do not publish subshapes in place of arguments, but only
252 # in place of subshapes of the first argument,
253 # because the whole shape corresponds to the first argument.
254 # Mainly to be used after transformations, but it also can be
255 # usefull after partition with one object shape, and some other
256 # operations, where only the first argument has to be considered.
257 # If theObject has only one argument shape, this flag is automatically
258 # considered as True, not regarding really passed value.
259 # \return True in case of success, False otherwise.
261 # @ref tui_restore_prs_params "Example"
262 def RestoreSubShapes (self, theObject, theArgs=[],
263 theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
264 # Example: see GEOM_TestAll.py
265 return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
266 theFindMethod, theInheritFirstArg)
268 # end of l3_restore_ss
271 ## @addtogroup l3_basic_go
274 ## Create point by three coordinates.
275 # @param theX The X coordinate of the point.
276 # @param theY The Y coordinate of the point.
277 # @param theZ The Z coordinate of the point.
278 # @return New GEOM_Object, containing the created point.
280 # @ref tui_creation_point "Example"
281 def MakeVertex(self,theX, theY, theZ):
282 # Example: see GEOM_TestAll.py
283 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
284 anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
285 RaiseIfFailed("MakePointXYZ", self.BasicOp)
286 anObj.SetParameters(Parameters)
289 ## Create a point, distant from the referenced point
290 # on the given distances along the coordinate axes.
291 # @param theReference The referenced point.
292 # @param theX Displacement from the referenced point along OX axis.
293 # @param theY Displacement from the referenced point along OY axis.
294 # @param theZ Displacement from the referenced point along OZ axis.
295 # @return New GEOM_Object, containing the created point.
297 # @ref tui_creation_point "Example"
298 def MakeVertexWithRef(self,theReference, theX, theY, theZ):
299 # Example: see GEOM_TestAll.py
300 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
301 anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
302 RaiseIfFailed("MakePointWithReference", self.BasicOp)
303 anObj.SetParameters(Parameters)
306 ## Create a point, corresponding to the given parameter on the given curve.
307 # @param theRefCurve The referenced curve.
308 # @param theParameter Value of parameter on the referenced curve.
309 # @return New GEOM_Object, containing the created point.
311 # @ref tui_creation_point "Example"
312 def MakeVertexOnCurve(self,theRefCurve, theParameter):
313 # Example: see GEOM_TestAll.py
314 theParameter, Parameters = ParseParameters(theParameter)
315 anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter)
316 RaiseIfFailed("MakePointOnCurve", self.BasicOp)
317 anObj.SetParameters(Parameters)
320 ## Create a point, corresponding to the given parameters on the
322 # @param theRefSurf The referenced surface.
323 # @param theUParameter Value of U-parameter on the referenced surface.
324 # @param theVParameter Value of V-parameter on the referenced surface.
325 # @return New GEOM_Object, containing the created point.
327 # @ref swig_MakeVertexOnSurface "Example"
328 def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter):
329 theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
330 # Example: see GEOM_TestAll.py
331 anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
332 RaiseIfFailed("MakePointOnSurface", self.BasicOp)
333 anObj.SetParameters(Parameters);
336 ## Create a point on intersection of two lines.
337 # @param theRefLine1, theRefLine2 The referenced lines.
338 # @return New GEOM_Object, containing the created point.
340 # @ref swig_MakeVertexOnLinesIntersection "Example"
341 def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2):
342 # Example: see GEOM_TestAll.py
343 anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
344 RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
347 ## Create a tangent, corresponding to the given parameter on the given curve.
348 # @param theRefCurve The referenced curve.
349 # @param theParameter Value of parameter on the referenced curve.
350 # @return New GEOM_Object, containing the created tangent.
352 # @ref swig_MakeTangentOnCurve "Example"
353 def MakeTangentOnCurve(self, theRefCurve, theParameter):
354 anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
355 RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
358 ## Create a vector with the given components.
359 # @param theDX X component of the vector.
360 # @param theDY Y component of the vector.
361 # @param theDZ Z component of the vector.
362 # @return New GEOM_Object, containing the created vector.
364 # @ref tui_creation_vector "Example"
365 def MakeVectorDXDYDZ(self,theDX, theDY, theDZ):
366 # Example: see GEOM_TestAll.py
367 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
368 anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
369 RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
370 anObj.SetParameters(Parameters)
373 ## Create a vector between two points.
374 # @param thePnt1 Start point for the vector.
375 # @param thePnt2 End point for the vector.
376 # @return New GEOM_Object, containing the created vector.
378 # @ref tui_creation_vector "Example"
379 def MakeVector(self,thePnt1, thePnt2):
380 # Example: see GEOM_TestAll.py
381 anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
382 RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
385 ## Create a line, passing through the given point
386 # and parrallel to the given direction
387 # @param thePnt Point. The resulting line will pass through it.
388 # @param theDir Direction. The resulting line will be parallel to it.
389 # @return New GEOM_Object, containing the created line.
391 # @ref tui_creation_line "Example"
392 def MakeLine(self,thePnt, theDir):
393 # Example: see GEOM_TestAll.py
394 anObj = self.BasicOp.MakeLine(thePnt, theDir)
395 RaiseIfFailed("MakeLine", self.BasicOp)
398 ## Create a line, passing through the given points
399 # @param thePnt1 First of two points, defining the line.
400 # @param thePnt2 Second of two points, defining the line.
401 # @return New GEOM_Object, containing the created line.
403 # @ref tui_creation_line "Example"
404 def MakeLineTwoPnt(self,thePnt1, thePnt2):
405 # Example: see GEOM_TestAll.py
406 anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
407 RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
410 ## Create a line on two faces intersection.
411 # @param theFace1 First of two faces, defining the line.
412 # @param theFace2 Second of two faces, defining the line.
413 # @return New GEOM_Object, containing the created line.
415 # @ref swig_MakeLineTwoFaces "Example"
416 def MakeLineTwoFaces(self, theFace1, theFace2):
417 # Example: see GEOM_TestAll.py
418 anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
419 RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
422 ## Create a plane, passing through the given point
423 # and normal to the given vector.
424 # @param thePnt Point, the plane has to pass through.
425 # @param theVec Vector, defining the plane normal direction.
426 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
427 # @return New GEOM_Object, containing the created plane.
429 # @ref tui_creation_plane "Example"
430 def MakePlane(self,thePnt, theVec, theTrimSize):
431 # Example: see GEOM_TestAll.py
432 theTrimSize, Parameters = ParseParameters(theTrimSize);
433 anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
434 RaiseIfFailed("MakePlanePntVec", self.BasicOp)
435 anObj.SetParameters(Parameters)
438 ## Create a plane, passing through the three given points
439 # @param thePnt1 First of three points, defining the plane.
440 # @param thePnt2 Second of three points, defining the plane.
441 # @param thePnt3 Fird of three points, defining the plane.
442 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
443 # @return New GEOM_Object, containing the created plane.
445 # @ref tui_creation_plane "Example"
446 def MakePlaneThreePnt(self,thePnt1, thePnt2, thePnt3, theTrimSize):
447 # Example: see GEOM_TestAll.py
448 theTrimSize, Parameters = ParseParameters(theTrimSize);
449 anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
450 RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
451 anObj.SetParameters(Parameters)
454 ## Create a plane, similar to the existing one, but with another size of representing face.
455 # @param theFace Referenced plane or LCS(Marker).
456 # @param theTrimSize New half size of a side of quadrangle face, representing the plane.
457 # @return New GEOM_Object, containing the created plane.
459 # @ref tui_creation_plane "Example"
460 def MakePlaneFace(self,theFace, theTrimSize):
461 # Example: see GEOM_TestAll.py
462 theTrimSize, Parameters = ParseParameters(theTrimSize);
463 anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
464 RaiseIfFailed("MakePlaneFace", self.BasicOp)
465 anObj.SetParameters(Parameters)
468 ## Create a local coordinate system.
469 # @param OX,OY,OZ Three coordinates of coordinate system origin.
470 # @param XDX,XDY,XDZ Three components of OX direction
471 # @param YDX,YDY,YDZ Three components of OY direction
472 # @return New GEOM_Object, containing the created coordinate system.
474 # @ref swig_MakeMarker "Example"
475 def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ):
476 # Example: see GEOM_TestAll.py
477 OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
478 anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
479 RaiseIfFailed("MakeMarker", self.BasicOp)
480 anObj.SetParameters(Parameters)
483 ## Create a local coordinate system.
484 # @param theOrigin Point of coordinate system origin.
485 # @param theXVec Vector of X direction
486 # @param theYVec Vector of Y direction
487 # @return New GEOM_Object, containing the created coordinate system.
489 # @ref swig_MakeMarker "Example"
490 def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec):
491 O = self.PointCoordinates( theOrigin )
493 for vec in [ theXVec, theYVec ]:
494 v1, v2 = self.SubShapeAll( vec, ShapeType["VERTEX"] )
495 p1 = self.PointCoordinates( v1 )
496 p2 = self.PointCoordinates( v2 )
497 for i in range( 0, 3 ):
498 OXOY.append( p2[i] - p1[i] )
500 anObj = self.BasicOp.MakeMarker( O[0], O[1], O[2],
501 OXOY[0], OXOY[1], OXOY[2],
502 OXOY[3], OXOY[4], OXOY[5], )
503 RaiseIfFailed("MakeMarker", self.BasicOp)
509 ## @addtogroup l4_curves
512 ## Create an arc of circle, passing through three given points.
513 # @param thePnt1 Start point of the arc.
514 # @param thePnt2 Middle point of the arc.
515 # @param thePnt3 End point of the arc.
516 # @return New GEOM_Object, containing the created arc.
518 # @ref swig_MakeArc "Example"
519 def MakeArc(self,thePnt1, thePnt2, thePnt3):
520 # Example: see GEOM_TestAll.py
521 anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
522 RaiseIfFailed("MakeArc", self.CurvesOp)
525 ## Create an arc of circle from a center and 2 points.
526 # @param thePnt1 Center of the arc
527 # @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
528 # @param thePnt3 End point of the arc (Gives also a direction)
529 # @param theSense Orientation of the arc
530 # @return New GEOM_Object, containing the created arc.
532 # @ref swig_MakeArc "Example"
533 def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False):
534 # Example: see GEOM_TestAll.py
535 anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
536 RaiseIfFailed("MakeArcCenter", self.CurvesOp)
539 ## Create a circle with given center, normal vector and radius.
540 # @param thePnt Circle center.
541 # @param theVec Vector, normal to the plane of the circle.
542 # @param theR Circle radius.
543 # @return New GEOM_Object, containing the created circle.
545 # @ref tui_creation_circle "Example"
546 def MakeCircle(self, thePnt, theVec, theR):
547 # Example: see GEOM_TestAll.py
548 theR, Parameters = ParseParameters(theR)
549 anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
550 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
551 anObj.SetParameters(Parameters)
554 ## Create a circle with given radius.
555 # Center of the circle will be in the origin of global
556 # coordinate system and normal vector will be codirected with Z axis
557 # @param theR Circle radius.
558 # @return New GEOM_Object, containing the created circle.
559 def MakeCircleR(self, theR):
560 anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
561 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
564 ## Create a circle, passing through three given points
565 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
566 # @return New GEOM_Object, containing the created circle.
568 # @ref tui_creation_circle "Example"
569 def MakeCircleThreePnt(self,thePnt1, thePnt2, thePnt3):
570 # Example: see GEOM_TestAll.py
571 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
572 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
575 ## Create a circle, with given point1 as center,
576 # passing through the point2 as radius and laying in the plane,
577 # defined by all three given points.
578 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
579 # @return New GEOM_Object, containing the created circle.
581 # @ref swig_MakeCircle "Example"
582 def MakeCircleCenter2Pnt(self,thePnt1, thePnt2, thePnt3):
583 # Example: see GEOM_example6.py
584 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
585 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
588 ## Create an ellipse with given center, normal vector and radiuses.
589 # @param thePnt Ellipse center.
590 # @param theVec Vector, normal to the plane of the ellipse.
591 # @param theRMajor Major ellipse radius.
592 # @param theRMinor Minor ellipse radius.
593 # @return New GEOM_Object, containing the created ellipse.
595 # @ref tui_creation_ellipse "Example"
596 def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor):
597 # Example: see GEOM_TestAll.py
598 theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
599 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
600 RaiseIfFailed("MakeEllipse", self.CurvesOp)
601 anObj.SetParameters(Parameters)
604 ## Create an ellipse with given radiuses.
605 # Center of the ellipse will be in the origin of global
606 # coordinate system and normal vector will be codirected with Z axis
607 # @param theRMajor Major ellipse radius.
608 # @param theRMinor Minor ellipse radius.
609 # @return New GEOM_Object, containing the created ellipse.
610 def MakeEllipseRR(self, theRMajor, theRMinor):
611 anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
612 RaiseIfFailed("MakeEllipse", self.CurvesOp)
615 ## Create a polyline on the set of points.
616 # @param thePoints Sequence of points for the polyline.
617 # @return New GEOM_Object, containing the created polyline.
619 # @ref tui_creation_curve "Example"
620 def MakePolyline(self,thePoints):
621 # Example: see GEOM_TestAll.py
622 anObj = self.CurvesOp.MakePolyline(thePoints)
623 RaiseIfFailed("MakePolyline", self.CurvesOp)
626 ## Create bezier curve on the set of points.
627 # @param thePoints Sequence of points for the bezier curve.
628 # @return New GEOM_Object, containing the created bezier curve.
630 # @ref tui_creation_curve "Example"
631 def MakeBezier(self,thePoints):
632 # Example: see GEOM_TestAll.py
633 anObj = self.CurvesOp.MakeSplineBezier(thePoints)
634 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
637 ## Create B-Spline curve on the set of points.
638 # @param thePoints Sequence of points for the B-Spline curve.
639 # @return New GEOM_Object, containing the created B-Spline curve.
641 # @ref tui_creation_curve "Example"
642 def MakeInterpol(self,thePoints):
643 # Example: see GEOM_TestAll.py
644 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints)
645 RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
651 ## @addtogroup l3_sketcher
654 ## Create a sketcher (wire or face), following the textual description,
655 # passed through <VAR>theCommand</VAR> argument. \n
656 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
657 # Format of the description string have to be the following:
659 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
662 # - x1, y1 are coordinates of the first sketcher point (zero by default),
664 # - "R angle" : Set the direction by angle
665 # - "D dx dy" : Set the direction by DX & DY
668 # - "TT x y" : Create segment by point at X & Y
669 # - "T dx dy" : Create segment by point with DX & DY
670 # - "L length" : Create segment by direction & Length
671 # - "IX x" : Create segment by direction & Intersect. X
672 # - "IY y" : Create segment by direction & Intersect. Y
675 # - "C radius length" : Create arc by direction, radius and length(in degree)
678 # - "WW" : Close Wire (to finish)
679 # - "WF" : Close Wire and build face (to finish)
681 # @param theCommand String, defining the sketcher in local
682 # coordinates of the working plane.
683 # @param theWorkingPlane Nine double values, defining origin,
684 # OZ and OX directions of the working plane.
685 # @return New GEOM_Object, containing the created wire.
687 # @ref tui_sketcher_page "Example"
688 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0]):
689 # Example: see GEOM_TestAll.py
690 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
691 RaiseIfFailed("MakeSketcher", self.CurvesOp)
694 ## Create a sketcher (wire or face), following the textual description,
695 # passed through <VAR>theCommand</VAR> argument. \n
696 # For format of the description string see the previous method.\n
697 # @param theCommand String, defining the sketcher in local
698 # coordinates of the working plane.
699 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
700 # @return New GEOM_Object, containing the created wire.
702 # @ref tui_sketcher_page "Example"
703 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane):
704 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
705 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
711 ## @addtogroup l3_3d_primitives
714 ## Create a box by coordinates of two opposite vertices.
716 # @ref tui_creation_box "Example"
717 def MakeBox(self,x1,y1,z1,x2,y2,z2):
718 # Example: see GEOM_TestAll.py
719 pnt1 = self.MakeVertex(x1,y1,z1)
720 pnt2 = self.MakeVertex(x2,y2,z2)
721 return self.MakeBoxTwoPnt(pnt1,pnt2)
723 ## Create a box with specified dimensions along the coordinate axes
724 # and with edges, parallel to the coordinate axes.
725 # Center of the box will be at point (DX/2, DY/2, DZ/2).
726 # @param theDX Length of Box edges, parallel to OX axis.
727 # @param theDY Length of Box edges, parallel to OY axis.
728 # @param theDZ Length of Box edges, parallel to OZ axis.
729 # @return New GEOM_Object, containing the created box.
731 # @ref tui_creation_box "Example"
732 def MakeBoxDXDYDZ(self,theDX, theDY, theDZ):
733 # Example: see GEOM_TestAll.py
734 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
735 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
736 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
737 anObj.SetParameters(Parameters)
740 ## Create a box with two specified opposite vertices,
741 # and with edges, parallel to the coordinate axes
742 # @param thePnt1 First of two opposite vertices.
743 # @param thePnt2 Second of two opposite vertices.
744 # @return New GEOM_Object, containing the created box.
746 # @ref tui_creation_box "Example"
747 def MakeBoxTwoPnt(self,thePnt1, thePnt2):
748 # Example: see GEOM_TestAll.py
749 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
750 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
753 ## Create a face with specified dimensions along OX-OY coordinate axes,
754 # with edges, parallel to this coordinate axes.
755 # @param theH height of Face.
756 # @param theW width of Face.
757 # @param theOrientation orientation belong axis OXY OYZ OZX
758 # @return New GEOM_Object, containing the created face.
760 # @ref tui_creation_face "Example"
761 def MakeFaceHW(self,theH, theW, theOrientation):
762 # Example: see GEOM_TestAll.py
763 theH,theW,Parameters = ParseParameters(theH, theW)
764 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
765 RaiseIfFailed("MakeFaceHW", self.PrimOp)
766 anObj.SetParameters(Parameters)
769 ## Create a face from another plane and two sizes,
770 # vertical size and horisontal size.
771 # @param theObj Normale vector to the creating face or
773 # @param theH Height (vertical size).
774 # @param theW Width (horisontal size).
775 # @return New GEOM_Object, containing the created face.
777 # @ref tui_creation_face "Example"
778 def MakeFaceObjHW(self, theObj, theH, theW):
779 # Example: see GEOM_TestAll.py
780 theH,theW,Parameters = ParseParameters(theH, theW)
781 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
782 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
783 anObj.SetParameters(Parameters)
786 ## Create a disk with given center, normal vector and radius.
787 # @param thePnt Disk center.
788 # @param theVec Vector, normal to the plane of the disk.
789 # @param theR Disk radius.
790 # @return New GEOM_Object, containing the created disk.
792 # @ref tui_creation_disk "Example"
793 def MakeDiskPntVecR(self,thePnt, theVec, theR):
794 # Example: see GEOM_TestAll.py
795 theR,Parameters = ParseParameters(theR)
796 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
797 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
798 anObj.SetParameters(Parameters)
801 ## Create a disk, passing through three given points
802 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
803 # @return New GEOM_Object, containing the created disk.
805 # @ref tui_creation_disk "Example"
806 def MakeDiskThreePnt(self,thePnt1, thePnt2, thePnt3):
807 # Example: see GEOM_TestAll.py
808 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
809 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
812 ## Create a disk with specified dimensions along OX-OY coordinate axes.
813 # @param theR Radius of Face.
814 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
815 # @return New GEOM_Object, containing the created disk.
817 # @ref tui_creation_face "Example"
818 def MakeDiskR(self,theR, theOrientation):
819 # Example: see GEOM_TestAll.py
820 theR,Parameters = ParseParameters(theR)
821 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
822 RaiseIfFailed("MakeDiskR", self.PrimOp)
823 anObj.SetParameters(Parameters)
826 ## Create a cylinder with given base point, axis, radius and height.
827 # @param thePnt Central point of cylinder base.
828 # @param theAxis Cylinder axis.
829 # @param theR Cylinder radius.
830 # @param theH Cylinder height.
831 # @return New GEOM_Object, containing the created cylinder.
833 # @ref tui_creation_cylinder "Example"
834 def MakeCylinder(self,thePnt, theAxis, theR, theH):
835 # Example: see GEOM_TestAll.py
836 theR,theH,Parameters = ParseParameters(theR, theH)
837 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
838 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
839 anObj.SetParameters(Parameters)
842 ## Create a cylinder with given radius and height at
843 # the origin of coordinate system. Axis of the cylinder
844 # will be collinear to the OZ axis of the coordinate system.
845 # @param theR Cylinder radius.
846 # @param theH Cylinder height.
847 # @return New GEOM_Object, containing the created cylinder.
849 # @ref tui_creation_cylinder "Example"
850 def MakeCylinderRH(self,theR, theH):
851 # Example: see GEOM_TestAll.py
852 theR,theH,Parameters = ParseParameters(theR, theH)
853 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
854 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
855 anObj.SetParameters(Parameters)
858 ## Create a sphere with given center and radius.
859 # @param thePnt Sphere center.
860 # @param theR Sphere radius.
861 # @return New GEOM_Object, containing the created sphere.
863 # @ref tui_creation_sphere "Example"
864 def MakeSpherePntR(self, thePnt, theR):
865 # Example: see GEOM_TestAll.py
866 theR,Parameters = ParseParameters(theR)
867 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
868 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
869 anObj.SetParameters(Parameters)
872 ## Create a sphere with given center and radius.
873 # @param x,y,z Coordinates of sphere center.
874 # @param theR Sphere radius.
875 # @return New GEOM_Object, containing the created sphere.
877 # @ref tui_creation_sphere "Example"
878 def MakeSphere(self, x, y, z, theR):
879 # Example: see GEOM_TestAll.py
880 point = self.MakeVertex(x, y, z)
881 anObj = self.MakeSpherePntR(point, theR)
884 ## Create a sphere with given radius at the origin of coordinate system.
885 # @param theR Sphere radius.
886 # @return New GEOM_Object, containing the created sphere.
888 # @ref tui_creation_sphere "Example"
889 def MakeSphereR(self, theR):
890 # Example: see GEOM_TestAll.py
891 theR,Parameters = ParseParameters(theR)
892 anObj = self.PrimOp.MakeSphereR(theR)
893 RaiseIfFailed("MakeSphereR", self.PrimOp)
894 anObj.SetParameters(Parameters)
897 ## Create a cone with given base point, axis, height and radiuses.
898 # @param thePnt Central point of the first cone base.
899 # @param theAxis Cone axis.
900 # @param theR1 Radius of the first cone base.
901 # @param theR2 Radius of the second cone base.
902 # \note If both radiuses are non-zero, the cone will be truncated.
903 # \note If the radiuses are equal, a cylinder will be created instead.
904 # @param theH Cone height.
905 # @return New GEOM_Object, containing the created cone.
907 # @ref tui_creation_cone "Example"
908 def MakeCone(self,thePnt, theAxis, theR1, theR2, theH):
909 # Example: see GEOM_TestAll.py
910 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
911 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
912 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
913 anObj.SetParameters(Parameters)
916 ## Create a cone with given height and radiuses at
917 # the origin of coordinate system. Axis of the cone will
918 # be collinear to the OZ axis of the coordinate system.
919 # @param theR1 Radius of the first cone base.
920 # @param theR2 Radius of the second cone base.
921 # \note If both radiuses are non-zero, the cone will be truncated.
922 # \note If the radiuses are equal, a cylinder will be created instead.
923 # @param theH Cone height.
924 # @return New GEOM_Object, containing the created cone.
926 # @ref tui_creation_cone "Example"
927 def MakeConeR1R2H(self,theR1, theR2, theH):
928 # Example: see GEOM_TestAll.py
929 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
930 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
931 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
932 anObj.SetParameters(Parameters)
935 ## Create a torus with given center, normal vector and radiuses.
936 # @param thePnt Torus central point.
937 # @param theVec Torus axis of symmetry.
938 # @param theRMajor Torus major radius.
939 # @param theRMinor Torus minor radius.
940 # @return New GEOM_Object, containing the created torus.
942 # @ref tui_creation_torus "Example"
943 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor):
944 # Example: see GEOM_TestAll.py
945 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
946 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
947 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
948 anObj.SetParameters(Parameters)
951 ## Create a torus with given radiuses at the origin of coordinate system.
952 # @param theRMajor Torus major radius.
953 # @param theRMinor Torus minor radius.
954 # @return New GEOM_Object, containing the created torus.
956 # @ref tui_creation_torus "Example"
957 def MakeTorusRR(self, theRMajor, theRMinor):
958 # Example: see GEOM_TestAll.py
959 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
960 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
961 RaiseIfFailed("MakeTorusRR", self.PrimOp)
962 anObj.SetParameters(Parameters)
965 # end of l3_3d_primitives
968 ## @addtogroup l3_complex
971 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
972 # @param theBase Base shape to be extruded.
973 # @param thePoint1 First end of extrusion vector.
974 # @param thePoint2 Second end of extrusion vector.
975 # @return New GEOM_Object, containing the created prism.
977 # @ref tui_creation_prism "Example"
978 def MakePrism(self, theBase, thePoint1, thePoint2):
979 # Example: see GEOM_TestAll.py
980 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
981 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
984 ## Create a shape by extrusion of the base shape along the vector,
985 # i.e. all the space, transfixed by the base shape during its translation
986 # along the vector on the given distance.
987 # @param theBase Base shape to be extruded.
988 # @param theVec Direction of extrusion.
989 # @param theH Prism dimension along theVec.
990 # @return New GEOM_Object, containing the created prism.
992 # @ref tui_creation_prism "Example"
993 def MakePrismVecH(self, theBase, theVec, theH):
994 # Example: see GEOM_TestAll.py
995 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
996 RaiseIfFailed("MakePrismVecH", self.PrimOp)
999 ## Create a shape by extrusion of the base shape along the vector,
1000 # i.e. all the space, transfixed by the base shape during its translation
1001 # along the vector on the given distance in 2 Ways (forward/backward) .
1002 # @param theBase Base shape to be extruded.
1003 # @param theVec Direction of extrusion.
1004 # @param theH Prism dimension along theVec in forward direction.
1005 # @return New GEOM_Object, containing the created prism.
1007 # @ref tui_creation_prism "Example"
1008 def MakePrismVecH2Ways(self, theBase, theVec, theH):
1009 # Example: see GEOM_TestAll.py
1010 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
1011 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
1014 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
1015 # @param theBase Base shape to be extruded.
1016 # @param theDX, theDY, theDZ Directions of extrusion.
1017 # @return New GEOM_Object, containing the created prism.
1019 # @ref tui_creation_prism "Example"
1020 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ):
1021 # Example: see GEOM_TestAll.py
1022 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
1023 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
1026 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
1027 # i.e. all the space, transfixed by the base shape during its translation
1028 # along the vector on the given distance in 2 Ways (forward/backward) .
1029 # @param theBase Base shape to be extruded.
1030 # @param theDX, theDY, theDZ Directions of extrusion.
1031 # @return New GEOM_Object, containing the created prism.
1033 # @ref tui_creation_prism "Example"
1034 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ):
1035 # Example: see GEOM_TestAll.py
1036 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
1037 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
1040 ## Create a shape by revolution of the base shape around the axis
1041 # on the given angle, i.e. all the space, transfixed by the base
1042 # shape during its rotation around the axis on the given angle.
1043 # @param theBase Base shape to be rotated.
1044 # @param theAxis Rotation axis.
1045 # @param theAngle Rotation angle in radians.
1046 # @return New GEOM_Object, containing the created revolution.
1048 # @ref tui_creation_revolution "Example"
1049 def MakeRevolution(self, theBase, theAxis, theAngle):
1050 # Example: see GEOM_TestAll.py
1051 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
1052 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
1055 ## The Same Revolution but in both ways forward&backward.
1056 def MakeRevolution2Ways(self, theBase, theAxis, theAngle):
1057 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
1058 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
1061 ## Create a filling from the given compound of contours.
1062 # @param theShape the compound of contours
1063 # @param theMinDeg a minimal degree of BSpline surface to create
1064 # @param theMaxDeg a maximal degree of BSpline surface to create
1065 # @param theTol2D a 2d tolerance to be reached
1066 # @param theTol3D a 3d tolerance to be reached
1067 # @param theNbIter a number of iteration of approximation algorithm
1068 # @param isApprox if True, BSpline curves are generated in the process
1069 # of surface construction. By default it is False, that means
1070 # the surface is created using Besier curves. The usage of
1071 # Approximation makes the algorithm work slower, but allows
1072 # building the surface for rather complex cases
1073 # @return New GEOM_Object, containing the created filling surface.
1075 # @ref tui_creation_filling "Example"
1076 def MakeFilling(self, theShape, theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter, isApprox=0):
1077 # Example: see GEOM_TestAll.py
1078 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
1079 theTol2D, theTol3D, theNbIter, isApprox)
1080 RaiseIfFailed("MakeFilling", self.PrimOp)
1083 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
1084 # @param theSeqSections - set of specified sections.
1085 # @param theModeSolid - mode defining building solid or shell
1086 # @param thePreci - precision 3D used for smoothing by default 1.e-6
1087 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
1088 # @return New GEOM_Object, containing the created shell or solid.
1090 # @ref swig_todo "Example"
1091 def MakeThruSections(self,theSeqSections,theModeSolid,thePreci,theRuled):
1092 # Example: see GEOM_TestAll.py
1093 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
1094 RaiseIfFailed("MakeThruSections", self.PrimOp)
1097 ## Create a shape by extrusion of the base shape along
1098 # the path shape. The path shape can be a wire or an edge.
1099 # @param theBase Base shape to be extruded.
1100 # @param thePath Path shape to extrude the base shape along it.
1101 # @return New GEOM_Object, containing the created pipe.
1103 # @ref tui_creation_pipe "Example"
1104 def MakePipe(self,theBase, thePath):
1105 # Example: see GEOM_TestAll.py
1106 anObj = self.PrimOp.MakePipe(theBase, thePath)
1107 RaiseIfFailed("MakePipe", self.PrimOp)
1110 ## Create a shape by extrusion of the profile shape along
1111 # the path shape. The path shape can be a wire or an edge.
1112 # the several profiles can be specified in the several locations of path.
1113 # @param theSeqBases - list of Bases shape to be extruded.
1114 # @param theLocations - list of locations on the path corresponding
1115 # specified list of the Bases shapes. Number of locations
1116 # should be equal to number of bases or list of locations can be empty.
1117 # @param thePath - Path shape to extrude the base shape along it.
1118 # @param theWithContact - the mode defining that the section is translated to be in
1119 # contact with the spine.
1120 # @param theWithCorrection - defining that the section is rotated to be
1121 # orthogonal to the spine tangent in the correspondent point
1122 # @return New GEOM_Object, containing the created pipe.
1124 # @ref tui_creation_pipe_with_diff_sec "Example"
1125 def MakePipeWithDifferentSections(self, theSeqBases,
1126 theLocations, thePath,
1127 theWithContact, theWithCorrection):
1128 anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
1129 theLocations, thePath,
1130 theWithContact, theWithCorrection)
1131 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
1134 ## Create a shape by extrusion of the profile shape along
1135 # the path shape. The path shape can be a wire or a edge.
1136 # the several profiles can be specified in the several locations of path.
1137 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
1138 # shell or face. If number of faces in neighbour sections
1139 # aren't coincided result solid between such sections will
1140 # be created using external boundaries of this shells.
1141 # @param theSeqSubBases - list of corresponding subshapes of section shapes.
1142 # This list is used for searching correspondences between
1143 # faces in the sections. Size of this list must be equal
1144 # to size of list of base shapes.
1145 # @param theLocations - list of locations on the path corresponding
1146 # specified list of the Bases shapes. Number of locations
1147 # should be equal to number of bases. First and last
1148 # locations must be coincided with first and last vertexes
1149 # of path correspondingly.
1150 # @param thePath - Path shape to extrude the base shape along it.
1151 # @param theWithContact - the mode defining that the section is translated to be in
1152 # contact with the spine.
1153 # @param theWithCorrection - defining that the section is rotated to be
1154 # orthogonal to the spine tangent in the correspondent point
1155 # @return New GEOM_Object, containing the created solids.
1157 # @ref tui_creation_pipe_with_shell_sec "Example"
1158 def MakePipeWithShellSections(self,theSeqBases, theSeqSubBases,
1159 theLocations, thePath,
1160 theWithContact, theWithCorrection):
1161 anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
1162 theLocations, thePath,
1163 theWithContact, theWithCorrection)
1164 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
1167 ## Create a shape by extrusion of the profile shape along
1168 # the path shape. This function is used only for debug pipe
1169 # functionality - it is a version of previous function
1170 # (MakePipeWithShellSections(...)) which give a possibility to
1171 # recieve information about creating pipe between each pair of
1172 # sections step by step.
1173 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
1174 theLocations, thePath,
1175 theWithContact, theWithCorrection):
1177 nbsect = len(theSeqBases)
1178 nbsubsect = len(theSeqSubBases)
1179 #print "nbsect = ",nbsect
1180 for i in range(1,nbsect):
1182 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
1183 tmpLocations = [ theLocations[i-1], theLocations[i] ]
1185 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
1186 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
1187 tmpLocations, thePath,
1188 theWithContact, theWithCorrection)
1189 if self.PrimOp.IsDone() == 0:
1190 print "Problems with pipe creation between ",i," and ",i+1," sections"
1191 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
1194 print "Pipe between ",i," and ",i+1," sections is OK"
1199 resc = self.MakeCompound(res)
1200 #resc = self.MakeSewing(res, 0.001)
1201 #print "resc: ",resc
1204 ## Create solids between given sections
1205 # @param theSeqBases - list of sections (shell or face).
1206 # @param theLocations - list of corresponding vertexes
1207 # @return New GEOM_Object, containing the created solids.
1209 # @ref tui_creation_pipe_without_path "Example"
1210 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations):
1211 anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
1212 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
1215 ## Create a shape by extrusion of the base shape along
1216 # the path shape with constant bi-normal direction along the given vector.
1217 # The path shape can be a wire or an edge.
1218 # @param theBase Base shape to be extruded.
1219 # @param thePath Path shape to extrude the base shape along it.
1220 # @param theVec Vector defines a constant binormal direction to keep the
1221 # same angle beetween the direction and the sections
1222 # along the sweep surface.
1223 # @return New GEOM_Object, containing the created pipe.
1225 # @ref tui_creation_pipe "Example"
1226 def MakePipeBiNormalAlongVector(self,theBase, thePath, theVec):
1227 # Example: see GEOM_TestAll.py
1228 anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
1229 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
1235 ## @addtogroup l3_advanced
1238 ## Create a linear edge with specified ends.
1239 # @param thePnt1 Point for the first end of edge.
1240 # @param thePnt2 Point for the second end of edge.
1241 # @return New GEOM_Object, containing the created edge.
1243 # @ref tui_creation_edge "Example"
1244 def MakeEdge(self,thePnt1, thePnt2):
1245 # Example: see GEOM_TestAll.py
1246 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
1247 RaiseIfFailed("MakeEdge", self.ShapesOp)
1250 ## Create a wire from the set of edges and wires.
1251 # @param theEdgesAndWires List of edges and/or wires.
1252 # @return New GEOM_Object, containing the created wire.
1254 # @ref tui_creation_wire "Example"
1255 def MakeWire(self,theEdgesAndWires):
1256 # Example: see GEOM_TestAll.py
1257 anObj = self.ShapesOp.MakeWire(theEdgesAndWires)
1258 RaiseIfFailed("MakeWire", self.ShapesOp)
1261 ## Create a face on the given wire.
1262 # @param theWire closed Wire or Edge to build the face on.
1263 # @param isPlanarWanted If TRUE, only planar face will be built.
1264 # If impossible, NULL object will be returned.
1265 # @return New GEOM_Object, containing the created face.
1267 # @ref tui_creation_face "Example"
1268 def MakeFace(self,theWire, isPlanarWanted):
1269 # Example: see GEOM_TestAll.py
1270 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
1271 RaiseIfFailed("MakeFace", self.ShapesOp)
1274 ## Create a face on the given wires set.
1275 # @param theWires List of closed wires or edges to build the face on.
1276 # @param isPlanarWanted If TRUE, only planar face will be built.
1277 # If impossible, NULL object will be returned.
1278 # @return New GEOM_Object, containing the created face.
1280 # @ref tui_creation_face "Example"
1281 def MakeFaceWires(self,theWires, isPlanarWanted):
1282 # Example: see GEOM_TestAll.py
1283 anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
1284 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
1287 ## Shortcut to MakeFaceWires()
1289 # @ref tui_creation_face "Example 1"
1290 # \n @ref swig_MakeFaces "Example 2"
1291 def MakeFaces(self,theWires, isPlanarWanted):
1292 # Example: see GEOM_TestOthers.py
1293 anObj = self.MakeFaceWires(theWires, isPlanarWanted)
1296 ## Create a shell from the set of faces and shells.
1297 # @param theFacesAndShells List of faces and/or shells.
1298 # @return New GEOM_Object, containing the created shell.
1300 # @ref tui_creation_shell "Example"
1301 def MakeShell(self,theFacesAndShells):
1302 # Example: see GEOM_TestAll.py
1303 anObj = self.ShapesOp.MakeShell(theFacesAndShells)
1304 RaiseIfFailed("MakeShell", self.ShapesOp)
1307 ## Create a solid, bounded by the given shells.
1308 # @param theShells Sequence of bounding shells.
1309 # @return New GEOM_Object, containing the created solid.
1311 # @ref tui_creation_solid "Example"
1312 def MakeSolid(self,theShells):
1313 # Example: see GEOM_TestAll.py
1314 anObj = self.ShapesOp.MakeSolidShells(theShells)
1315 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
1318 ## Create a compound of the given shapes.
1319 # @param theShapes List of shapes to put in compound.
1320 # @return New GEOM_Object, containing the created compound.
1322 # @ref tui_creation_compound "Example"
1323 def MakeCompound(self,theShapes):
1324 # Example: see GEOM_TestAll.py
1325 anObj = self.ShapesOp.MakeCompound(theShapes)
1326 RaiseIfFailed("MakeCompound", self.ShapesOp)
1329 # end of l3_advanced
1332 ## @addtogroup l2_measure
1335 ## Gives quantity of faces in the given shape.
1336 # @param theShape Shape to count faces of.
1337 # @return Quantity of faces.
1339 # @ref swig_NumberOfFaces "Example"
1340 def NumberOfFaces(self,theShape):
1341 # Example: see GEOM_TestOthers.py
1342 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
1343 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
1346 ## Gives quantity of edges in the given shape.
1347 # @param theShape Shape to count edges of.
1348 # @return Quantity of edges.
1350 # @ref swig_NumberOfEdges "Example"
1351 def NumberOfEdges(self,theShape):
1352 # Example: see GEOM_TestOthers.py
1353 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
1354 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
1360 ## @addtogroup l3_healing
1363 ## Reverses an orientation the given shape.
1364 # @param theShape Shape to be reversed.
1365 # @return The reversed copy of theShape.
1367 # @ref swig_ChangeOrientation "Example"
1368 def ChangeOrientation(self,theShape):
1369 # Example: see GEOM_TestAll.py
1370 anObj = self.ShapesOp.ChangeOrientation(theShape)
1371 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
1374 ## Shortcut to ChangeOrientation()
1376 # @ref swig_OrientationChange "Example"
1377 def OrientationChange(self,theShape):
1378 # Example: see GEOM_TestOthers.py
1379 anObj = self.ChangeOrientation(theShape)
1385 ## @addtogroup l4_obtain
1388 ## Retrieve all free faces from the given shape.
1389 # Free face is a face, which is not shared between two shells of the shape.
1390 # @param theShape Shape to find free faces in.
1391 # @return List of IDs of all free faces, contained in theShape.
1393 # @ref tui_measurement_tools_page "Example"
1394 def GetFreeFacesIDs(self,theShape):
1395 # Example: see GEOM_TestOthers.py
1396 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
1397 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
1400 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
1401 # @param theShape1 Shape to find sub-shapes in.
1402 # @param theShape2 Shape to find shared sub-shapes with.
1403 # @param theShapeType Type of sub-shapes to be retrieved.
1404 # @return List of sub-shapes of theShape1, shared with theShape2.
1406 # @ref swig_GetSharedShapes "Example"
1407 def GetSharedShapes(self,theShape1, theShape2, theShapeType):
1408 # Example: see GEOM_TestOthers.py
1409 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
1410 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
1413 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
1414 # situated relatively the specified plane by the certain way,
1415 # defined through <VAR>theState</VAR> parameter.
1416 # @param theShape Shape to find sub-shapes of.
1417 # @param theShapeType Type of sub-shapes to be retrieved.
1418 # @param theAx1 Vector (or line, or linear edge), specifying normal
1419 # direction and location of the plane to find shapes on.
1420 # @param theState The state of the subshapes to find. It can be one of
1421 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1422 # @return List of all found sub-shapes.
1424 # @ref swig_GetShapesOnPlane "Example"
1425 def GetShapesOnPlane(self,theShape, theShapeType, theAx1, theState):
1426 # Example: see GEOM_TestOthers.py
1427 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
1428 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
1431 ## Works like the above method, but returns list of sub-shapes indices
1433 # @ref swig_GetShapesOnPlaneIDs "Example"
1434 def GetShapesOnPlaneIDs(self,theShape, theShapeType, theAx1, theState):
1435 # Example: see GEOM_TestOthers.py
1436 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
1437 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
1440 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
1441 # situated relatively the specified plane by the certain way,
1442 # defined through <VAR>theState</VAR> parameter.
1443 # @param theShape Shape to find sub-shapes of.
1444 # @param theShapeType Type of sub-shapes to be retrieved.
1445 # @param theAx1 Vector (or line, or linear edge), specifying normal
1446 # direction of the plane to find shapes on.
1447 # @param thePnt Point specifying location of the plane to find shapes on.
1448 # @param theState The state of the subshapes to find. It can be one of
1449 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1450 # @return List of all found sub-shapes.
1452 # @ref swig_GetShapesOnPlaneWithLocation "Example"
1453 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState):
1454 # Example: see GEOM_TestOthers.py
1455 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
1456 theAx1, thePnt, theState)
1457 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
1460 ## Works like the above method, but returns list of sub-shapes indices
1462 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
1463 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
1464 # Example: see GEOM_TestOthers.py
1465 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
1466 theAx1, thePnt, theState)
1467 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
1470 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1471 # the specified cylinder by the certain way, defined through \a theState parameter.
1472 # @param theShape Shape to find sub-shapes of.
1473 # @param theShapeType Type of sub-shapes to be retrieved.
1474 # @param theAxis Vector (or line, or linear edge), specifying
1475 # axis of the cylinder to find shapes on.
1476 # @param theRadius Radius of the cylinder to find shapes on.
1477 # @param theState The state of the subshapes to find. It can be one of
1478 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1479 # @return List of all found sub-shapes.
1481 # @ref swig_GetShapesOnCylinder "Example"
1482 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState):
1483 # Example: see GEOM_TestOthers.py
1484 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
1485 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
1488 ## Works like the above method, but returns list of sub-shapes indices
1490 # @ref swig_GetShapesOnCylinderIDs "Example"
1491 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
1492 # Example: see GEOM_TestOthers.py
1493 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
1494 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
1497 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1498 # the specified sphere by the certain way, defined through \a theState parameter.
1499 # @param theShape Shape to find sub-shapes of.
1500 # @param theShapeType Type of sub-shapes to be retrieved.
1501 # @param theCenter Point, specifying center of the sphere to find shapes on.
1502 # @param theRadius Radius of the sphere to find shapes on.
1503 # @param theState The state of the subshapes to find. It can be one of
1504 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1505 # @return List of all found sub-shapes.
1507 # @ref swig_GetShapesOnSphere "Example"
1508 def GetShapesOnSphere(self,theShape, theShapeType, theCenter, theRadius, theState):
1509 # Example: see GEOM_TestOthers.py
1510 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
1511 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
1514 ## Works like the above method, but returns list of sub-shapes indices
1516 # @ref swig_GetShapesOnSphereIDs "Example"
1517 def GetShapesOnSphereIDs(self,theShape, theShapeType, theCenter, theRadius, theState):
1518 # Example: see GEOM_TestOthers.py
1519 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
1520 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
1523 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1524 # the specified quadrangle by the certain way, defined through \a theState parameter.
1525 # @param theShape Shape to find sub-shapes of.
1526 # @param theShapeType Type of sub-shapes to be retrieved.
1527 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
1528 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
1529 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
1530 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
1531 # @param theState The state of the subshapes to find. It can be one of
1532 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1533 # @return List of all found sub-shapes.
1535 # @ref swig_GetShapesOnQuadrangle "Example"
1536 def GetShapesOnQuadrangle(self, theShape, theShapeType,
1537 theTopLeftPoint, theTopRigthPoint,
1538 theBottomLeftPoint, theBottomRigthPoint, theState):
1539 # Example: see GEOM_TestOthers.py
1540 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
1541 theTopLeftPoint, theTopRigthPoint,
1542 theBottomLeftPoint, theBottomRigthPoint, theState)
1543 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
1546 ## Works like the above method, but returns list of sub-shapes indices
1548 # @ref swig_GetShapesOnQuadrangleIDs "Example"
1549 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
1550 theTopLeftPoint, theTopRigthPoint,
1551 theBottomLeftPoint, theBottomRigthPoint, theState):
1552 # Example: see GEOM_TestOthers.py
1553 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
1554 theTopLeftPoint, theTopRigthPoint,
1555 theBottomLeftPoint, theBottomRigthPoint, theState)
1556 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
1559 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1560 # the specified \a theBox by the certain way, defined through \a theState parameter.
1561 # @param theBox Shape for relative comparing.
1562 # @param theShape Shape to find sub-shapes of.
1563 # @param theShapeType Type of sub-shapes to be retrieved.
1564 # @param theState The state of the subshapes to find. It can be one of
1565 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1566 # @return List of all found sub-shapes.
1568 # @ref swig_GetShapesOnBox "Example"
1569 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState):
1570 # Example: see GEOM_TestOthers.py
1571 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
1572 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
1575 ## Works like the above method, but returns list of sub-shapes indices
1577 # @ref swig_GetShapesOnBoxIDs "Example"
1578 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
1579 # Example: see GEOM_TestOthers.py
1580 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
1581 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
1584 ## Find in \a theShape all sub-shapes of type \a theShapeType,
1585 # situated relatively the specified \a theCheckShape by the
1586 # certain way, defined through \a theState parameter.
1587 # @param theCheckShape Shape for relative comparing.
1588 # @param theShape Shape to find sub-shapes of.
1589 # @param theShapeType Type of sub-shapes to be retrieved.
1590 # @param theState The state of the subshapes to find. It can be one of
1591 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1592 # @return List of all found sub-shapes.
1594 # @ref swig_GetShapesOnShape "Example"
1595 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState):
1596 # Example: see GEOM_TestOthers.py
1597 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
1598 theShapeType, theState)
1599 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
1602 ## Works like the above method, but returns result as compound
1604 # @ref swig_GetShapesOnShapeAsCompound "Example"
1605 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState):
1606 # Example: see GEOM_TestOthers.py
1607 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
1608 theShapeType, theState)
1609 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
1612 ## Works like the above method, but returns list of sub-shapes indices
1614 # @ref swig_GetShapesOnShapeIDs "Example"
1615 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
1616 # Example: see GEOM_TestOthers.py
1617 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
1618 theShapeType, theState)
1619 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
1622 ## Get sub-shape(s) of theShapeWhere, which are
1623 # coincident with \a theShapeWhat or could be a part of it.
1624 # @param theShapeWhere Shape to find sub-shapes of.
1625 # @param theShapeWhat Shape, specifying what to find.
1626 # @return Group of all found sub-shapes or a single found sub-shape.
1628 # @ref swig_GetInPlace "Example"
1629 def GetInPlace(self,theShapeWhere, theShapeWhat):
1630 # Example: see GEOM_TestOthers.py
1631 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
1632 RaiseIfFailed("GetInPlace", self.ShapesOp)
1635 ## Get sub-shape(s) of \a theShapeWhere, which are
1636 # coincident with \a theShapeWhat or could be a part of it.
1638 # Implementation of this method is based on a saved history of an operation,
1639 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
1640 # arguments (an argument shape or a sub-shape of an argument shape).
1641 # The operation could be the Partition or one of boolean operations,
1642 # performed on simple shapes (not on compounds).
1644 # @param theShapeWhere Shape to find sub-shapes of.
1645 # @param theShapeWhat Shape, specifying what to find (must be in the
1646 # building history of the ShapeWhere).
1647 # @return Group of all found sub-shapes or a single found sub-shape.
1649 # @ref swig_GetInPlace "Example"
1650 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat):
1651 # Example: see GEOM_TestOthers.py
1652 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
1653 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
1656 ## Get sub-shape of theShapeWhere, which is
1657 # equal to \a theShapeWhat.
1658 # @param theShapeWhere Shape to find sub-shape of.
1659 # @param theShapeWhat Shape, specifying what to find.
1660 # @return New GEOM_Object for found sub-shape.
1662 # @ref swig_GetSame "Example"
1663 def GetSame(self,theShapeWhere, theShapeWhat):
1664 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
1665 RaiseIfFailed("GetSame", self.ShapesOp)
1671 ## @addtogroup l4_access
1674 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
1675 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
1677 # @ref swig_all_decompose "Example"
1678 def GetSubShape(self, aShape, ListOfID):
1679 # Example: see GEOM_TestAll.py
1680 anObj = self.AddSubShape(aShape,ListOfID)
1683 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
1685 # @ref swig_all_decompose "Example"
1686 def GetSubShapeID(self, aShape, aSubShape):
1687 # Example: see GEOM_TestAll.py
1688 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
1689 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
1695 ## @addtogroup l4_decompose
1698 ## Explode a shape on subshapes of a given type.
1699 # @param aShape Shape to be exploded.
1700 # @param aType Type of sub-shapes to be retrieved.
1701 # @return List of sub-shapes of type theShapeType, contained in theShape.
1703 # @ref swig_all_decompose "Example"
1704 def SubShapeAll(self, aShape, aType):
1705 # Example: see GEOM_TestAll.py
1706 ListObj = self.ShapesOp.MakeExplode(aShape,aType,0)
1707 RaiseIfFailed("MakeExplode", self.ShapesOp)
1710 ## Explode a shape on subshapes of a given type.
1711 # @param aShape Shape to be exploded.
1712 # @param aType Type of sub-shapes to be retrieved.
1713 # @return List of IDs of sub-shapes.
1715 # @ref swig_all_decompose "Example"
1716 def SubShapeAllIDs(self, aShape, aType):
1717 ListObj = self.ShapesOp.SubShapeAllIDs(aShape,aType,0)
1718 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
1721 ## Explode a shape on subshapes of a given type.
1722 # Sub-shapes will be sorted by coordinates of their gravity centers.
1723 # @param aShape Shape to be exploded.
1724 # @param aType Type of sub-shapes to be retrieved.
1725 # @return List of sub-shapes of type theShapeType, contained in theShape.
1727 # @ref swig_SubShapeAllSorted "Example"
1728 def SubShapeAllSorted(self, aShape, aType):
1729 # Example: see GEOM_TestAll.py
1730 ListObj = self.ShapesOp.MakeExplode(aShape,aType,1)
1731 RaiseIfFailed("MakeExplode", self.ShapesOp)
1734 ## Explode a shape on subshapes of a given type.
1735 # Sub-shapes will be sorted by coordinates of their gravity centers.
1736 # @param aShape Shape to be exploded.
1737 # @param aType Type of sub-shapes to be retrieved.
1738 # @return List of IDs of sub-shapes.
1740 # @ref swig_all_decompose "Example"
1741 def SubShapeAllSortedIDs(self, aShape, aType):
1742 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape,aType,1)
1743 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
1746 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
1747 # selected by they indices in list of all sub-shapes of type <VAR>aType</VAR>.
1748 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
1750 # @ref swig_all_decompose "Example"
1751 def SubShape(self, aShape, aType, ListOfInd):
1752 # Example: see GEOM_TestAll.py
1754 AllShapeList = self.SubShapeAll(aShape, aType)
1755 for ind in ListOfInd:
1756 ListOfIDs.append(self.GetSubShapeID(aShape, AllShapeList[ind - 1]))
1757 anObj = self.GetSubShape(aShape, ListOfIDs)
1760 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
1761 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
1762 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
1764 # @ref swig_all_decompose "Example"
1765 def SubShapeSorted(self,aShape, aType, ListOfInd):
1766 # Example: see GEOM_TestAll.py
1768 AllShapeList = self.SubShapeAllSorted(aShape, aType)
1769 for ind in ListOfInd:
1770 ListOfIDs.append(self.GetSubShapeID(aShape, AllShapeList[ind - 1]))
1771 anObj = self.GetSubShape(aShape, ListOfIDs)
1774 # end of l4_decompose
1777 ## @addtogroup l3_healing
1780 ## Apply a sequence of Shape Healing operators to the given object.
1781 # @param theShape Shape to be processed.
1782 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
1783 # @param theParameters List of names of parameters
1784 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
1785 # @param theValues List of values of parameters, in the same order
1786 # as parameters are listed in <VAR>theParameters</VAR> list.
1787 # @return New GEOM_Object, containing processed shape.
1789 # @ref tui_shape_processing "Example"
1790 def ProcessShape(self,theShape, theOperators, theParameters, theValues):
1791 # Example: see GEOM_TestHealing.py
1792 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
1793 RaiseIfFailed("ProcessShape", self.HealOp)
1796 ## Remove faces from the given object (shape).
1797 # @param theObject Shape to be processed.
1798 # @param theFaces Indices of faces to be removed, if EMPTY then the method
1799 # removes ALL faces of the given object.
1800 # @return New GEOM_Object, containing processed shape.
1802 # @ref tui_suppress_faces "Example"
1803 def SuppressFaces(self,theObject, theFaces):
1804 # Example: see GEOM_TestHealing.py
1805 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
1806 RaiseIfFailed("SuppressFaces", self.HealOp)
1809 ## Sewing of some shapes into single shape.
1811 # @ref tui_sewing "Example"
1812 def MakeSewing(self, ListShape, theTolerance):
1813 # Example: see GEOM_TestHealing.py
1814 comp = self.MakeCompound(ListShape)
1815 anObj = self.Sew(comp, theTolerance)
1818 ## Sewing of the given object.
1819 # @param theObject Shape to be processed.
1820 # @param theTolerance Required tolerance value.
1821 # @return New GEOM_Object, containing processed shape.
1822 def Sew(self, theObject, theTolerance):
1823 # Example: see MakeSewing() above
1824 anObj = self.HealOp.Sew(theObject, theTolerance)
1825 RaiseIfFailed("Sew", self.HealOp)
1828 ## Remove internal wires and edges from the given object (face).
1829 # @param theObject Shape to be processed.
1830 # @param theWires Indices of wires to be removed, if EMPTY then the method
1831 # removes ALL internal wires of the given object.
1832 # @return New GEOM_Object, containing processed shape.
1834 # @ref tui_suppress_internal_wires "Example"
1835 def SuppressInternalWires(self,theObject, theWires):
1836 # Example: see GEOM_TestHealing.py
1837 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
1838 RaiseIfFailed("RemoveIntWires", self.HealOp)
1841 ## Remove internal closed contours (holes) from the given object.
1842 # @param theObject Shape to be processed.
1843 # @param theWires Indices of wires to be removed, if EMPTY then the method
1844 # removes ALL internal holes of the given object
1845 # @return New GEOM_Object, containing processed shape.
1847 # @ref tui_suppress_holes "Example"
1848 def SuppressHoles(self,theObject, theWires):
1849 # Example: see GEOM_TestHealing.py
1850 anObj = self.HealOp.FillHoles(theObject, theWires)
1851 RaiseIfFailed("FillHoles", self.HealOp)
1854 ## Close an open wire.
1855 # @param theObject Shape to be processed.
1856 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
1857 # if -1, then <VAR>theObject</VAR> itself is a wire.
1858 # @param isCommonVertex If TRUE : closure by creation of a common vertex,
1859 # If FALS : closure by creation of an edge between ends.
1860 # @return New GEOM_Object, containing processed shape.
1862 # @ref tui_close_contour "Example"
1863 def CloseContour(self,theObject, theWires, isCommonVertex):
1864 # Example: see GEOM_TestHealing.py
1865 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
1866 RaiseIfFailed("CloseContour", self.HealOp)
1869 ## Addition of a point to a given edge object.
1870 # @param theObject Shape to be processed.
1871 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
1872 # if -1, then theObject itself is the edge.
1873 # @param theValue Value of parameter on edge or length parameter,
1874 # depending on \a isByParameter.
1875 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1],
1876 # if FALSE : \a theValue is treated as a length parameter [0..1]
1877 # @return New GEOM_Object, containing processed shape.
1879 # @ref tui_add_point_on_edge "Example"
1880 def DivideEdge(self,theObject, theEdgeIndex, theValue, isByParameter):
1881 # Example: see GEOM_TestHealing.py
1882 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
1883 RaiseIfFailed("DivideEdge", self.HealOp)
1886 ## Change orientation of the given object. Updates given shape.
1887 # @param theObject Shape to be processed.
1889 # @ref swig_todo "Example"
1890 def ChangeOrientationShell(self,theObject):
1891 theObject = self.HealOp.ChangeOrientation(theObject)
1892 RaiseIfFailed("ChangeOrientation", self.HealOp)
1895 ## Change orientation of the given object.
1896 # @param theObject Shape to be processed.
1897 # @return New GEOM_Object, containing processed shape.
1899 # @ref swig_todo "Example"
1900 def ChangeOrientationShellCopy(self,theObject):
1901 anObj = self.HealOp.ChangeOrientationCopy(theObject)
1902 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
1905 ## Get a list of wires (wrapped in GEOM_Object-s),
1906 # that constitute a free boundary of the given shape.
1907 # @param theObject Shape to get free boundary of.
1908 # @return [status, theClosedWires, theOpenWires]
1909 # status: FALSE, if an error(s) occured during the method execution.
1910 # theClosedWires: Closed wires on the free boundary of the given shape.
1911 # theOpenWires: Open wires on the free boundary of the given shape.
1913 # @ref tui_measurement_tools_page "Example"
1914 def GetFreeBoundary(self,theObject):
1915 # Example: see GEOM_TestHealing.py
1916 anObj = self.HealOp.GetFreeBoundary(theObject)
1917 RaiseIfFailed("GetFreeBoundary", self.HealOp)
1920 ## Replace coincident faces in theShape by one face.
1921 # @param theShape Initial shape.
1922 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
1923 # @param doKeepNonSolids If FALSE, only solids will present in the result,
1924 # otherwise all initial shapes.
1925 # @return New GEOM_Object, containing a copy of theShape without coincident faces.
1927 # @ref tui_glue_faces "Example"
1928 def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True):
1929 # Example: see GEOM_Spanner.py
1930 anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
1932 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
1935 ## Find coincident faces in theShape for possible gluing.
1936 # @param theShape Initial shape.
1937 # @param theTolerance Maximum distance between faces,
1938 # which can be considered as coincident.
1941 # @ref swig_todo "Example"
1942 def GetGlueFaces(self, theShape, theTolerance):
1943 # Example: see GEOM_Spanner.py
1944 anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
1945 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
1948 ## Replace coincident faces in theShape by one face
1949 # in compliance with given list of faces
1950 # @param theShape Initial shape.
1951 # @param theTolerance Maximum distance between faces,
1952 # which can be considered as coincident.
1953 # @param theFaces List of faces for gluing.
1954 # @param doKeepNonSolids If FALSE, only solids will present in the result,
1955 # otherwise all initial shapes.
1956 # @return New GEOM_Object, containing a copy of theShape
1957 # without some faces.
1959 # @ref swig_todo "Example"
1960 def MakeGlueFacesByList(self, theShape, theTolerance, theFaces, doKeepNonSolids=True):
1961 # Example: see GEOM_Spanner.py
1962 anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces, doKeepNonSolids)
1964 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
1970 ## @addtogroup l3_boolean Boolean Operations
1973 # -----------------------------------------------------------------------------
1974 # Boolean (Common, Cut, Fuse, Section)
1975 # -----------------------------------------------------------------------------
1977 ## Perform one of boolean operations on two given shapes.
1978 # @param theShape1 First argument for boolean operation.
1979 # @param theShape2 Second argument for boolean operation.
1980 # @param theOperation Indicates the operation to be done:
1981 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
1982 # @return New GEOM_Object, containing the result shape.
1984 # @ref tui_fuse "Example"
1985 def MakeBoolean(self,theShape1, theShape2, theOperation):
1986 # Example: see GEOM_TestAll.py
1987 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation)
1988 RaiseIfFailed("MakeBoolean", self.BoolOp)
1991 ## Shortcut to MakeBoolean(s1, s2, 1)
1993 # @ref tui_common "Example 1"
1994 # \n @ref swig_MakeCommon "Example 2"
1995 def MakeCommon(self, s1, s2):
1996 # Example: see GEOM_TestOthers.py
1997 return self.MakeBoolean(s1, s2, 1)
1999 ## Shortcut to MakeBoolean(s1, s2, 2)
2001 # @ref tui_cut "Example 1"
2002 # \n @ref swig_MakeCommon "Example 2"
2003 def MakeCut(self, s1, s2):
2004 # Example: see GEOM_TestOthers.py
2005 return self.MakeBoolean(s1, s2, 2)
2007 ## Shortcut to MakeBoolean(s1, s2, 3)
2009 # @ref tui_fuse "Example 1"
2010 # \n @ref swig_MakeCommon "Example 2"
2011 def MakeFuse(self, s1, s2):
2012 # Example: see GEOM_TestOthers.py
2013 return self.MakeBoolean(s1, s2, 3)
2015 ## Shortcut to MakeBoolean(s1, s2, 4)
2017 # @ref tui_section "Example 1"
2018 # \n @ref swig_MakeCommon "Example 2"
2019 def MakeSection(self, s1, s2):
2020 # Example: see GEOM_TestOthers.py
2021 return self.MakeBoolean(s1, s2, 4)
2026 ## @addtogroup l3_basic_op
2029 ## Perform partition operation.
2030 # @param ListShapes Shapes to be intersected.
2031 # @param ListTools Shapes to intersect theShapes.
2032 # !!!NOTE: Each compound from ListShapes and ListTools will be exploded
2033 # in order to avoid possible intersection between shapes from
2035 # @param Limit Type of resulting shapes (corresponding to TopAbs_ShapeEnum).
2036 # @param KeepNonlimitShapes: if this parameter == 0 - only shapes with
2037 # type <= Limit are kept in the result,
2038 # else - shapes with type > Limit are kept
2039 # also (if they exist)
2041 # After implementation new version of PartitionAlgo (October 2006)
2042 # other parameters are ignored by current functionality. They are kept
2043 # in this function only for support old versions.
2044 # Ignored parameters:
2045 # @param ListKeepInside Shapes, outside which the results will be deleted.
2046 # Each shape from theKeepInside must belong to theShapes also.
2047 # @param ListRemoveInside Shapes, inside which the results will be deleted.
2048 # Each shape from theRemoveInside must belong to theShapes also.
2049 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
2050 # @param ListMaterials Material indices for each shape. Make sence,
2051 # only if theRemoveWebs is TRUE.
2053 # @return New GEOM_Object, containing the result shapes.
2055 # @ref tui_partition "Example"
2056 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
2057 Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
2058 KeepNonlimitShapes=0):
2059 # Example: see GEOM_TestAll.py
2060 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
2061 ListKeepInside, ListRemoveInside,
2062 Limit, RemoveWebs, ListMaterials,
2063 KeepNonlimitShapes);
2064 RaiseIfFailed("MakePartition", self.BoolOp)
2067 ## Perform partition operation.
2068 # This method may be useful if it is needed to make a partition for
2069 # compound contains nonintersected shapes. Performance will be better
2070 # since intersection between shapes from compound is not performed.
2072 # Description of all parameters as in previous method MakePartition()
2074 # !!!NOTE: Passed compounds (via ListShapes or via ListTools)
2075 # have to consist of nonintersecting shapes.
2077 # @return New GEOM_Object, containing the result shapes.
2079 # @ref swig_todo "Example"
2080 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
2081 ListKeepInside=[], ListRemoveInside=[],
2082 Limit=ShapeType["SHAPE"], RemoveWebs=0,
2083 ListMaterials=[], KeepNonlimitShapes=0):
2084 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
2085 ListKeepInside, ListRemoveInside,
2086 Limit, RemoveWebs, ListMaterials,
2087 KeepNonlimitShapes);
2088 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
2091 ## Shortcut to MakePartition()
2093 # @ref tui_partition "Example 1"
2094 # \n @ref swig_Partition "Example 2"
2095 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
2096 Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
2097 KeepNonlimitShapes=0):
2098 # Example: see GEOM_TestOthers.py
2099 anObj = self.MakePartition(ListShapes, ListTools,
2100 ListKeepInside, ListRemoveInside,
2101 Limit, RemoveWebs, ListMaterials,
2102 KeepNonlimitShapes);
2105 ## Perform partition of the Shape with the Plane
2106 # @param theShape Shape to be intersected.
2107 # @param thePlane Tool shape, to intersect theShape.
2108 # @return New GEOM_Object, containing the result shape.
2110 # @ref tui_partition "Example"
2111 def MakeHalfPartition(self,theShape, thePlane):
2112 # Example: see GEOM_TestAll.py
2113 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
2114 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
2117 # end of l3_basic_op
2120 ## @addtogroup l3_transform
2123 ## Translate the given object along the vector, specified
2124 # by its end points, creating its copy before the translation.
2125 # @param theObject The object to be translated.
2126 # @param thePoint1 Start point of translation vector.
2127 # @param thePoint2 End point of translation vector.
2128 # @return New GEOM_Object, containing the translated object.
2130 # @ref tui_translation "Example 1"
2131 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
2132 def MakeTranslationTwoPoints(self,theObject, thePoint1, thePoint2):
2133 # Example: see GEOM_TestAll.py
2134 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
2135 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
2138 ## Translate the given object along the vector, specified
2139 # by its components, creating its copy before the translation.
2140 # @param theObject The object to be translated.
2141 # @param theDX,theDY,theDZ Components of translation vector.
2142 # @return New GEOM_Object, containing the translated object.
2144 # @ref tui_translation "Example"
2145 def MakeTranslation(self,theObject, theDX, theDY, theDZ):
2146 # Example: see GEOM_TestAll.py
2147 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
2148 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
2151 ## Translate the given object along the given vector,
2152 # creating its copy before the translation.
2153 # @param theObject The object to be translated.
2154 # @param theVector The translation vector.
2155 # @return New GEOM_Object, containing the translated object.
2157 # @ref tui_translation "Example"
2158 def MakeTranslationVector(self,theObject, theVector):
2159 # Example: see GEOM_TestAll.py
2160 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
2161 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
2164 ## Translate the given object along the given vector on given distance,
2165 # creating its copy before the translation.
2166 # @param theObject The object to be translated.
2167 # @param theVector The translation vector.
2168 # @param theDistance The translation distance.
2169 # @return New GEOM_Object, containing the translated object.
2171 # @ref tui_translation "Example"
2172 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance):
2173 # Example: see GEOM_TestAll.py
2174 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
2175 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
2178 ## Rotate the given object around the given axis
2179 # on the given angle, creating its copy before the rotatation.
2180 # @param theObject The object to be rotated.
2181 # @param theAxis Rotation axis.
2182 # @param theAngle Rotation angle in radians.
2183 # @return New GEOM_Object, containing the rotated object.
2185 # @ref tui_rotation "Example"
2186 def MakeRotation(self,theObject, theAxis, theAngle):
2187 # Example: see GEOM_TestAll.py
2188 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
2189 RaiseIfFailed("RotateCopy", self.TrsfOp)
2192 ## Rotate given object around vector perpendicular to plane
2193 # containing three points, creating its copy before the rotatation.
2194 # @param theObject The object to be rotated.
2195 # @param theCentPoint central point - the axis is the vector perpendicular to the plane
2196 # containing the three points.
2197 # @param thePoint1,thePoint2 - in a perpendicular plane of the axis.
2198 # @return New GEOM_Object, containing the rotated object.
2200 # @ref tui_rotation "Example"
2201 def MakeRotationThreePoints(self,theObject, theCentPoint, thePoint1, thePoint2):
2202 # Example: see GEOM_TestAll.py
2203 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
2204 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
2207 ## Scale the given object by the factor, creating its copy before the scaling.
2208 # @param theObject The object to be scaled.
2209 # @param thePoint Center point for scaling.
2210 # Passing None for it means scaling relatively the origin of global CS.
2211 # @param theFactor Scaling factor value.
2212 # @return New GEOM_Object, containing the scaled shape.
2214 # @ref tui_scale "Example"
2215 def MakeScaleTransform(self, theObject, thePoint, theFactor):
2216 # Example: see GEOM_TestAll.py
2217 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
2218 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
2221 ## Scale the given object by different factors along coordinate axes,
2222 # creating its copy before the scaling.
2223 # @param theObject The object to be scaled.
2224 # @param thePoint Center point for scaling.
2225 # Passing None for it means scaling relatively the origin of global CS.
2226 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
2227 # @return New GEOM_Object, containing the scaled shape.
2229 # @ref swig_scale "Example"
2230 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ):
2231 # Example: see GEOM_TestAll.py
2232 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
2233 theFactorX, theFactorY, theFactorZ)
2234 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
2237 ## Create an object, symmetrical
2238 # to the given one relatively the given plane.
2239 # @param theObject The object to be mirrored.
2240 # @param thePlane Plane of symmetry.
2241 # @return New GEOM_Object, containing the mirrored shape.
2243 # @ref tui_mirror "Example"
2244 def MakeMirrorByPlane(self,theObject, thePlane):
2245 # Example: see GEOM_TestAll.py
2246 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
2247 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
2250 ## Create an object, symmetrical
2251 # to the given one relatively the given axis.
2252 # @param theObject The object to be mirrored.
2253 # @param theAxis Axis of symmetry.
2254 # @return New GEOM_Object, containing the mirrored shape.
2256 # @ref tui_mirror "Example"
2257 def MakeMirrorByAxis(self,theObject, theAxis):
2258 # Example: see GEOM_TestAll.py
2259 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
2260 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
2263 ## Create an object, symmetrical
2264 # to the given one relatively the given point.
2265 # @param theObject The object to be mirrored.
2266 # @param thePoint Point of symmetry.
2267 # @return New GEOM_Object, containing the mirrored shape.
2269 # @ref tui_mirror "Example"
2270 def MakeMirrorByPoint(self,theObject, thePoint):
2271 # Example: see GEOM_TestAll.py
2272 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
2273 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
2276 ## Modify the Location of the given object by LCS,
2277 # creating its copy before the setting.
2278 # @param theObject The object to be displaced.
2279 # @param theStartLCS Coordinate system to perform displacement from it.
2280 # If \a theStartLCS is NULL, displacement
2281 # will be performed from global CS.
2282 # If \a theObject itself is used as \a theStartLCS,
2283 # its location will be changed to \a theEndLCS.
2284 # @param theEndLCS Coordinate system to perform displacement to it.
2285 # @return New GEOM_Object, containing the displaced shape.
2287 # @ref tui_modify_location "Example"
2288 def MakePosition(self,theObject, theStartLCS, theEndLCS):
2289 # Example: see GEOM_TestAll.py
2290 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
2291 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
2294 ## Create new object as offset of the given one.
2295 # @param theObject The base object for the offset.
2296 # @param theOffset Offset value.
2297 # @return New GEOM_Object, containing the offset object.
2299 # @ref tui_offset "Example"
2300 def MakeOffset(self,theObject, theOffset):
2301 # Example: see GEOM_TestAll.py
2302 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
2303 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
2306 # -----------------------------------------------------------------------------
2308 # -----------------------------------------------------------------------------
2310 ## Translate the given object along the given vector a given number times
2311 # @param theObject The object to be translated.
2312 # @param theVector Direction of the translation.
2313 # @param theStep Distance to translate on.
2314 # @param theNbTimes Quantity of translations to be done.
2315 # @return New GEOM_Object, containing compound of all
2316 # the shapes, obtained after each translation.
2318 # @ref tui_multi_translation "Example"
2319 def MakeMultiTranslation1D(self,theObject, theVector, theStep, theNbTimes):
2320 # Example: see GEOM_TestAll.py
2321 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
2322 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
2325 ## Conseqently apply two specified translations to theObject specified number of times.
2326 # @param theObject The object to be translated.
2327 # @param theVector1 Direction of the first translation.
2328 # @param theStep1 Step of the first translation.
2329 # @param theNbTimes1 Quantity of translations to be done along theVector1.
2330 # @param theVector2 Direction of the second translation.
2331 # @param theStep2 Step of the second translation.
2332 # @param theNbTimes2 Quantity of translations to be done along theVector2.
2333 # @return New GEOM_Object, containing compound of all
2334 # the shapes, obtained after each translation.
2336 # @ref tui_multi_translation "Example"
2337 def MakeMultiTranslation2D(self,theObject, theVector1, theStep1, theNbTimes1,
2338 theVector2, theStep2, theNbTimes2):
2339 # Example: see GEOM_TestAll.py
2340 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
2341 theVector2, theStep2, theNbTimes2)
2342 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
2345 ## Rotate the given object around the given axis a given number times.
2346 # Rotation angle will be 2*PI/theNbTimes.
2347 # @param theObject The object to be rotated.
2348 # @param theAxis The rotation axis.
2349 # @param theNbTimes Quantity of rotations to be done.
2350 # @return New GEOM_Object, containing compound of all the
2351 # shapes, obtained after each rotation.
2353 # @ref tui_multi_rotation "Example"
2354 def MultiRotate1D(self,theObject, theAxis, theNbTimes):
2355 # Example: see GEOM_TestAll.py
2356 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
2357 RaiseIfFailed("MultiRotate1D", self.TrsfOp)
2360 ## Rotate the given object around the
2361 # given axis on the given angle a given number
2362 # times and multi-translate each rotation result.
2363 # Translation direction passes through center of gravity
2364 # of rotated shape and its projection on the rotation axis.
2365 # @param theObject The object to be rotated.
2366 # @param theAxis Rotation axis.
2367 # @param theAngle Rotation angle in graduces.
2368 # @param theNbTimes1 Quantity of rotations to be done.
2369 # @param theStep Translation distance.
2370 # @param theNbTimes2 Quantity of translations to be done.
2371 # @return New GEOM_Object, containing compound of all the
2372 # shapes, obtained after each transformation.
2374 # @ref tui_multi_rotation "Example"
2375 def MultiRotate2D(self,theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2):
2376 # Example: see GEOM_TestAll.py
2377 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
2378 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
2381 ## The same, as MultiRotate1D(), but axis is given by direction and point
2382 # @ref swig_MakeMultiRotation "Example"
2383 def MakeMultiRotation1D(self,aShape,aDir,aPoint,aNbTimes):
2384 # Example: see GEOM_TestOthers.py
2385 aVec = self.MakeLine(aPoint,aDir)
2386 anObj = self.MultiRotate1D(aShape,aVec,aNbTimes)
2389 ## The same, as MultiRotate2D(), but axis is given by direction and point
2390 # @ref swig_MakeMultiRotation "Example"
2391 def MakeMultiRotation2D(self,aShape,aDir,aPoint,anAngle,nbtimes1,aStep,nbtimes2):
2392 # Example: see GEOM_TestOthers.py
2393 aVec = self.MakeLine(aPoint,aDir)
2394 anObj = self.MultiRotate2D(aShape,aVec,anAngle,nbtimes1,aStep,nbtimes2)
2397 # end of l3_transform
2400 ## @addtogroup l3_local
2403 ## Perform a fillet on all edges of the given shape.
2404 # @param theShape Shape, to perform fillet on.
2405 # @param theR Fillet radius.
2406 # @return New GEOM_Object, containing the result shape.
2408 # @ref tui_fillet "Example 1"
2409 # \n @ref swig_MakeFilletAll "Example 2"
2410 def MakeFilletAll(self,theShape, theR):
2411 # Example: see GEOM_TestOthers.py
2412 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
2413 RaiseIfFailed("MakeFilletAll", self.LocalOp)
2416 ## Perform a fillet on the specified edges/faces of the given shape
2417 # @param theShape Shape, to perform fillet on.
2418 # @param theR Fillet radius.
2419 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR>.
2420 # @param theListShapes Global indices of edges/faces to perform fillet on.
2421 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2422 # @return New GEOM_Object, containing the result shape.
2424 # @ref tui_fillet "Example"
2425 def MakeFillet(self,theShape, theR, theShapeType, theListShapes):
2426 # Example: see GEOM_TestAll.py
2428 if theShapeType == ShapeType["EDGE"]:
2429 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
2430 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
2432 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
2433 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
2436 ## The same that MakeFillet but with two Fillet Radius R1 and R2
2437 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes):
2439 if theShapeType == ShapeType["EDGE"]:
2440 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
2441 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
2443 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
2444 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
2447 ## Perform a symmetric chamfer on all edges of the given shape.
2448 # @param theShape Shape, to perform chamfer on.
2449 # @param theD Chamfer size along each face.
2450 # @return New GEOM_Object, containing the result shape.
2452 # @ref tui_chamfer "Example 1"
2453 # \n @ref swig_MakeChamferAll "Example 2"
2454 def MakeChamferAll(self,theShape, theD):
2455 # Example: see GEOM_TestOthers.py
2456 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
2457 RaiseIfFailed("MakeChamferAll", self.LocalOp)
2460 ## Perform a chamfer on edges, common to the specified faces,
2461 # with distance D1 on the Face1
2462 # @param theShape Shape, to perform chamfer on.
2463 # @param theD1 Chamfer size along \a theFace1.
2464 # @param theD2 Chamfer size along \a theFace2.
2465 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
2466 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2467 # @return New GEOM_Object, containing the result shape.
2469 # @ref tui_chamfer "Example"
2470 def MakeChamferEdge(self,theShape, theD1, theD2, theFace1, theFace2):
2471 # Example: see GEOM_TestAll.py
2472 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
2473 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
2476 ## The Same that MakeChamferEdge but with params theD is chamfer length and
2477 # theAngle is Angle of chamfer (angle in radians)
2478 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2):
2479 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
2480 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
2483 ## Perform a chamfer on all edges of the specified faces,
2484 # with distance D1 on the first specified face (if several for one edge)
2485 # @param theShape Shape, to perform chamfer on.
2486 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
2487 # connected to the edge, are in \a theFaces, \a theD1
2488 # will be get along face, which is nearer to \a theFaces beginning.
2489 # @param theD2 Chamfer size along another of two faces, connected to the edge.
2490 # @param theFaces Sequence of global indices of faces of \a theShape.
2491 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2492 # @return New GEOM_Object, containing the result shape.
2494 # @ref tui_chamfer "Example"
2495 def MakeChamferFaces(self,theShape, theD1, theD2, theFaces):
2496 # Example: see GEOM_TestAll.py
2497 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
2498 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
2501 ## The Same that MakeChamferFaces but with params theD is chamfer lenght and
2502 # theAngle is Angle of chamfer (angle in radians)
2504 # @ref swig_FilletChamfer "Example"
2505 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces):
2506 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
2507 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
2510 ## Perform a chamfer on edges,
2511 # with distance D1 on the first specified face (if several for one edge)
2512 # @param theShape Shape, to perform chamfer on.
2513 # @param theD1,theD2 Chamfer size
2514 # @param theEdges Sequence of edges of \a theShape.
2515 # @return New GEOM_Object, containing the result shape.
2517 # @ref swig_FilletChamfer "Example"
2518 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges):
2519 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
2520 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
2523 ## The Same that MakeChamferEdges but with params theD is chamfer lenght and
2524 # theAngle is Angle of chamfer (angle in radians)
2525 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges):
2526 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
2527 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
2530 ## Shortcut to MakeChamferEdge() and MakeChamferFaces()
2532 # @ref swig_MakeChamfer "Example"
2533 def MakeChamfer(self,aShape,d1,d2,aShapeType,ListShape):
2534 # Example: see GEOM_TestOthers.py
2536 if aShapeType == ShapeType["EDGE"]:
2537 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1])
2539 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape)
2545 ## @addtogroup l3_basic_op
2548 ## Perform an Archimde operation on the given shape with given parameters.
2549 # The object presenting the resulting face is returned.
2550 # @param theShape Shape to be put in water.
2551 # @param theWeight Weight og the shape.
2552 # @param theWaterDensity Density of the water.
2553 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
2554 # @return New GEOM_Object, containing a section of \a theShape
2555 # by a plane, corresponding to water level.
2557 # @ref tui_archimede "Example"
2558 def Archimede(self,theShape, theWeight, theWaterDensity, theMeshDeflection):
2559 # Example: see GEOM_TestAll.py
2560 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
2561 RaiseIfFailed("MakeArchimede", self.LocalOp)
2564 # end of l3_basic_op
2567 ## @addtogroup l2_measure
2570 ## Get point coordinates
2573 # @ref tui_measurement_tools_page "Example"
2574 def PointCoordinates(self,Point):
2575 # Example: see GEOM_TestMeasures.py
2576 aTuple = self.MeasuOp.PointCoordinates(Point)
2577 RaiseIfFailed("PointCoordinates", self.MeasuOp)
2580 ## Get summarized length of all wires,
2581 # area of surface and volume of the given shape.
2582 # @param theShape Shape to define properties of.
2583 # @return [theLength, theSurfArea, theVolume]
2584 # theLength: Summarized length of all wires of the given shape.
2585 # theSurfArea: Area of surface of the given shape.
2586 # theVolume: Volume of the given shape.
2588 # @ref tui_measurement_tools_page "Example"
2589 def BasicProperties(self,theShape):
2590 # Example: see GEOM_TestMeasures.py
2591 aTuple = self.MeasuOp.GetBasicProperties(theShape)
2592 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
2595 ## Get parameters of bounding box of the given shape
2596 # @param theShape Shape to obtain bounding box of.
2597 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
2598 # Xmin,Xmax: Limits of shape along OX axis.
2599 # Ymin,Ymax: Limits of shape along OY axis.
2600 # Zmin,Zmax: Limits of shape along OZ axis.
2602 # @ref tui_measurement_tools_page "Example"
2603 def BoundingBox(self,theShape):
2604 # Example: see GEOM_TestMeasures.py
2605 aTuple = self.MeasuOp.GetBoundingBox(theShape)
2606 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
2609 ## Get inertia matrix and moments of inertia of theShape.
2610 # @param theShape Shape to calculate inertia of.
2611 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
2612 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
2613 # Ix,Iy,Iz: Moments of inertia of the given shape.
2615 # @ref tui_measurement_tools_page "Example"
2616 def Inertia(self,theShape):
2617 # Example: see GEOM_TestMeasures.py
2618 aTuple = self.MeasuOp.GetInertia(theShape)
2619 RaiseIfFailed("GetInertia", self.MeasuOp)
2622 ## Get minimal distance between the given shapes.
2623 # @param theShape1,theShape2 Shapes to find minimal distance between.
2624 # @return Value of the minimal distance between the given shapes.
2626 # @ref tui_measurement_tools_page "Example"
2627 def MinDistance(self, theShape1, theShape2):
2628 # Example: see GEOM_TestMeasures.py
2629 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
2630 RaiseIfFailed("GetMinDistance", self.MeasuOp)
2633 ## Get minimal distance between the given shapes.
2634 # @param theShape1,theShape2 Shapes to find minimal distance between.
2635 # @return Value of the minimal distance between the given shapes.
2637 # @ref swig_all_measure "Example"
2638 def MinDistanceComponents(self, theShape1, theShape2):
2639 # Example: see GEOM_TestMeasures.py
2640 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
2641 RaiseIfFailed("GetMinDistance", self.MeasuOp)
2642 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
2645 ## Get angle between the given shapes in degrees.
2646 # @param theShape1,theShape2 Lines or linear edges to find angle between.
2647 # @return Value of the angle between the given shapes in degrees.
2649 # @ref tui_measurement_tools_page "Example"
2650 def GetAngle(self, theShape1, theShape2):
2651 # Example: see GEOM_TestMeasures.py
2652 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
2653 RaiseIfFailed("GetAngle", self.MeasuOp)
2655 ## Get angle between the given shapes in radians.
2656 # @param theShape1,theShape2 Lines or linear edges to find angle between.
2657 # @return Value of the angle between the given shapes in radians.
2659 # @ref tui_measurement_tools_page "Example"
2660 def GetAngleRadians(self, theShape1, theShape2):
2661 # Example: see GEOM_TestMeasures.py
2662 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
2663 RaiseIfFailed("GetAngle", self.MeasuOp)
2666 ## @name Curve Curvature Measurement
2667 # Methods for receiving radius of curvature of curves
2668 # in the given point
2671 ## Measure curvature of a curve at a point, set by parameter.
2672 # @ref swig_todo "Example"
2673 def CurveCurvatureByParam(self, theCurve, theParam):
2674 # Example: see GEOM_TestMeasures.py
2675 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
2676 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
2680 # @ref swig_todo "Example"
2681 def CurveCurvatureByPoint(self, theCurve, thePoint):
2682 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
2683 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
2687 ## @name Surface Curvature Measurement
2688 # Methods for receiving max and min radius of curvature of surfaces
2689 # in the given point
2693 ## @ref swig_todo "Example"
2694 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
2695 # Example: see GEOM_TestMeasures.py
2696 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
2697 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
2701 ## @ref swig_todo "Example"
2702 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
2703 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
2704 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
2708 ## @ref swig_todo "Example"
2709 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
2710 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
2711 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
2715 ## @ref swig_todo "Example"
2716 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
2717 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
2718 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
2722 ## Get min and max tolerances of sub-shapes of theShape
2723 # @param theShape Shape, to get tolerances of.
2724 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
2725 # FaceMin,FaceMax: Min and max tolerances of the faces.
2726 # EdgeMin,EdgeMax: Min and max tolerances of the edges.
2727 # VertMin,VertMax: Min and max tolerances of the vertices.
2729 # @ref tui_measurement_tools_page "Example"
2730 def Tolerance(self,theShape):
2731 # Example: see GEOM_TestMeasures.py
2732 aTuple = self.MeasuOp.GetTolerance(theShape)
2733 RaiseIfFailed("GetTolerance", self.MeasuOp)
2736 ## Obtain description of the given shape (number of sub-shapes of each type)
2737 # @param theShape Shape to be described.
2738 # @return Description of the given shape.
2740 # @ref tui_measurement_tools_page "Example"
2741 def WhatIs(self,theShape):
2742 # Example: see GEOM_TestMeasures.py
2743 aDescr = self.MeasuOp.WhatIs(theShape)
2744 RaiseIfFailed("WhatIs", self.MeasuOp)
2747 ## Get a point, situated at the centre of mass of theShape.
2748 # @param theShape Shape to define centre of mass of.
2749 # @return New GEOM_Object, containing the created point.
2751 # @ref tui_measurement_tools_page "Example"
2752 def MakeCDG(self,theShape):
2753 # Example: see GEOM_TestMeasures.py
2754 anObj = self.MeasuOp.GetCentreOfMass(theShape)
2755 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
2758 ## Get a normale to the given face. If the point is not given,
2759 # the normale is calculated at the center of mass.
2760 # @param theFace Face to define normale of.
2761 # @param theOptionalPoint Point to compute the normale at.
2762 # @return New GEOM_Object, containing the created vector.
2764 # @ref swig_todo "Example"
2765 def GetNormal(self, theFace, theOptionalPoint = None):
2766 # Example: see GEOM_TestMeasures.py
2767 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
2768 RaiseIfFailed("GetNormal", self.MeasuOp)
2771 ## Check a topology of the given shape.
2772 # @param theShape Shape to check validity of.
2773 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked,
2774 # if TRUE, the shape's geometry will be checked also.
2775 # @return TRUE, if the shape "seems to be valid".
2776 # If theShape is invalid, prints a description of problem.
2778 # @ref tui_measurement_tools_page "Example"
2779 def CheckShape(self,theShape, theIsCheckGeom = 0):
2780 # Example: see GEOM_TestMeasures.py
2782 (IsValid, Status) = self.MeasuOp.CheckShapeWithGeometry(theShape)
2783 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
2785 (IsValid, Status) = self.MeasuOp.CheckShape(theShape)
2786 RaiseIfFailed("CheckShape", self.MeasuOp)
2791 ## Get position (LCS) of theShape.
2793 # Origin of the LCS is situated at the shape's center of mass.
2794 # Axes of the LCS are obtained from shape's location or,
2795 # if the shape is a planar face, from position of its plane.
2797 # @param theShape Shape to calculate position of.
2798 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
2799 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
2800 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
2801 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
2803 # @ref swig_todo "Example"
2804 def GetPosition(self,theShape):
2805 # Example: see GEOM_TestMeasures.py
2806 aTuple = self.MeasuOp.GetPosition(theShape)
2807 RaiseIfFailed("GetPosition", self.MeasuOp)
2810 ## Get kind of theShape.
2812 # @param theShape Shape to get a kind of.
2813 # @return Returns a kind of shape in terms of <VAR>GEOM_IKindOfShape.shape_kind</VAR> enumeration
2814 # and a list of parameters, describing the shape.
2815 # @note Concrete meaning of each value, returned via \a theIntegers
2816 # or \a theDoubles list depends on the kind of the shape.
2817 # The full list of possible outputs is:
2819 # - geompy.kind.COMPOUND nb_solids nb_faces nb_edges nb_vertices
2820 # - geompy.kind.COMPSOLID nb_solids nb_faces nb_edges nb_vertices
2822 # - geompy.kind.SHELL geompy.info.CLOSED nb_faces nb_edges nb_vertices
2823 # - geompy.kind.SHELL geompy.info.UNCLOSED nb_faces nb_edges nb_vertices
2825 # - geompy.kind.WIRE geompy.info.CLOSED nb_edges nb_vertices
2826 # - geompy.kind.WIRE geompy.info.UNCLOSED nb_edges nb_vertices
2828 # - geompy.kind.SPHERE xc yc zc R
2829 # - geompy.kind.CYLINDER xb yb zb dx dy dz R H
2830 # - geompy.kind.BOX xc yc zc ax ay az
2831 # - geompy.kind.ROTATED_BOX xc yc zc zx zy zz xx xy xz ax ay az
2832 # - geompy.kind.TORUS xc yc zc dx dy dz R_1 R_2
2833 # - geompy.kind.CONE xb yb zb dx dy dz R_1 R_2 H
2834 # - geompy.kind.POLYHEDRON nb_faces nb_edges nb_vertices
2835 # - geompy.kind.SOLID nb_faces nb_edges nb_vertices
2837 # - geompy.kind.SPHERE2D xc yc zc R
2838 # - geompy.kind.CYLINDER2D xb yb zb dx dy dz R H
2839 # - geompy.kind.TORUS2D xc yc zc dx dy dz R_1 R_2
2840 # - geompy.kind.CONE2D xc yc zc dx dy dz R_1 R_2 H
2841 # - geompy.kind.DISK_CIRCLE xc yc zc dx dy dz R
2842 # - geompy.kind.DISK_ELLIPSE xc yc zc dx dy dz R_1 R_2
2843 # - geompy.kind.POLYGON xo yo zo dx dy dz nb_edges nb_vertices
2844 # - geompy.kind.PLANE xo yo zo dx dy dz
2845 # - geompy.kind.PLANAR xo yo zo dx dy dz nb_edges nb_vertices
2846 # - geompy.kind.FACE nb_edges nb_vertices
2848 # - geompy.kind.CIRCLE xc yc zc dx dy dz R
2849 # - geompy.kind.ARC_CIRCLE xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2
2850 # - geompy.kind.ELLIPSE xc yc zc dx dy dz R_1 R_2
2851 # - geompy.kind.ARC_ELLIPSE xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2
2852 # - geompy.kind.LINE xo yo zo dx dy dz
2853 # - geompy.kind.SEGMENT x1 y1 z1 x2 y2 z2
2854 # - geompy.kind.EDGE nb_vertices
2856 # - geompy.kind.VERTEX x y z
2858 # @ref swig_todo "Example"
2859 def KindOfShape(self,theShape):
2860 # Example: see GEOM_TestMeasures.py
2861 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
2862 RaiseIfFailed("KindOfShape", self.MeasuOp)
2864 aKind = aRoughTuple[0]
2865 anInts = aRoughTuple[1]
2866 aDbls = aRoughTuple[2]
2868 # Now there is no exception from this rule:
2869 aKindTuple = [aKind] + aDbls + anInts
2871 # If they are we will regroup parameters for such kind of shape.
2873 #if aKind == kind.SOME_KIND:
2874 # # SOME_KIND int int double int double double
2875 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
2882 ## @addtogroup l2_import_export
2885 ## Import a shape from the BREP or IGES or STEP file
2886 # (depends on given format) with given name.
2887 # @param theFileName The file, containing the shape.
2888 # @param theFormatName Specify format for the file reading.
2889 # Available formats can be obtained with InsertOp.ImportTranslators() method.
2890 # @return New GEOM_Object, containing the imported shape.
2892 # @ref swig_Import_Export "Example"
2893 def Import(self,theFileName, theFormatName):
2894 # Example: see GEOM_TestOthers.py
2895 anObj = self.InsertOp.Import(theFileName, theFormatName)
2896 RaiseIfFailed("Import", self.InsertOp)
2899 ## Shortcut to Import() for BREP format
2901 # @ref swig_Import_Export "Example"
2902 def ImportBREP(self,theFileName):
2903 # Example: see GEOM_TestOthers.py
2904 return self.Import(theFileName, "BREP")
2906 ## Shortcut to Import() for IGES format
2908 # @ref swig_Import_Export "Example"
2909 def ImportIGES(self,theFileName):
2910 # Example: see GEOM_TestOthers.py
2911 return self.Import(theFileName, "IGES")
2913 ## Shortcut to Import() for STEP format
2915 # @ref swig_Import_Export "Example"
2916 def ImportSTEP(self,theFileName):
2917 # Example: see GEOM_TestOthers.py
2918 return self.Import(theFileName, "STEP")
2920 ## Export the given shape into a file with given name.
2921 # @param theObject Shape to be stored in the file.
2922 # @param theFileName Name of the file to store the given shape in.
2923 # @param theFormatName Specify format for the shape storage.
2924 # Available formats can be obtained with InsertOp.ImportTranslators() method.
2926 # @ref swig_Import_Export "Example"
2927 def Export(self,theObject, theFileName, theFormatName):
2928 # Example: see GEOM_TestOthers.py
2929 self.InsertOp.Export(theObject, theFileName, theFormatName)
2930 if self.InsertOp.IsDone() == 0:
2931 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
2935 ## Shortcut to Export() for BREP format
2937 # @ref swig_Import_Export "Example"
2938 def ExportBREP(self,theObject, theFileName):
2939 # Example: see GEOM_TestOthers.py
2940 return self.Export(theObject, theFileName, "BREP")
2942 ## Shortcut to Export() for IGES format
2944 # @ref swig_Import_Export "Example"
2945 def ExportIGES(self,theObject, theFileName):
2946 # Example: see GEOM_TestOthers.py
2947 return self.Export(theObject, theFileName, "IGES")
2949 ## Shortcut to Export() for STEP format
2951 # @ref swig_Import_Export "Example"
2952 def ExportSTEP(self,theObject, theFileName):
2953 # Example: see GEOM_TestOthers.py
2954 return self.Export(theObject, theFileName, "STEP")
2956 # end of l2_import_export
2959 ## @addtogroup l3_blocks
2962 ## Create a quadrangle face from four edges. Order of Edges is not
2963 # important. It is not necessary that edges share the same vertex.
2964 # @param E1,E2,E3,E4 Edges for the face bound.
2965 # @return New GEOM_Object, containing the created face.
2967 # @ref tui_building_by_blocks_page "Example"
2968 def MakeQuad(self,E1, E2, E3, E4):
2969 # Example: see GEOM_Spanner.py
2970 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
2971 RaiseIfFailed("MakeQuad", self.BlocksOp)
2974 ## Create a quadrangle face on two edges.
2975 # The missing edges will be built by creating the shortest ones.
2976 # @param E1,E2 Two opposite edges for the face.
2977 # @return New GEOM_Object, containing the created face.
2979 # @ref tui_building_by_blocks_page "Example"
2980 def MakeQuad2Edges(self,E1, E2):
2981 # Example: see GEOM_Spanner.py
2982 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
2983 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
2986 ## Create a quadrangle face with specified corners.
2987 # The missing edges will be built by creating the shortest ones.
2988 # @param V1,V2,V3,V4 Corner vertices for the face.
2989 # @return New GEOM_Object, containing the created face.
2991 # @ref tui_building_by_blocks_page "Example 1"
2992 # \n @ref swig_MakeQuad4Vertices "Example 2"
2993 def MakeQuad4Vertices(self,V1, V2, V3, V4):
2994 # Example: see GEOM_Spanner.py
2995 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
2996 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
2999 ## Create a hexahedral solid, bounded by the six given faces. Order of
3000 # faces is not important. It is not necessary that Faces share the same edge.
3001 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
3002 # @return New GEOM_Object, containing the created solid.
3004 # @ref tui_building_by_blocks_page "Example 1"
3005 # \n @ref swig_MakeHexa "Example 2"
3006 def MakeHexa(self,F1, F2, F3, F4, F5, F6):
3007 # Example: see GEOM_Spanner.py
3008 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
3009 RaiseIfFailed("MakeHexa", self.BlocksOp)
3012 ## Create a hexahedral solid between two given faces.
3013 # The missing faces will be built by creating the smallest ones.
3014 # @param F1,F2 Two opposite faces for the hexahedral solid.
3015 # @return New GEOM_Object, containing the created solid.
3017 # @ref tui_building_by_blocks_page "Example 1"
3018 # \n @ref swig_MakeHexa2Faces "Example 2"
3019 def MakeHexa2Faces(self,F1, F2):
3020 # Example: see GEOM_Spanner.py
3021 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
3022 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
3028 ## @addtogroup l3_blocks_op
3031 ## Get a vertex, found in the given shape by its coordinates.
3032 # @param theShape Block or a compound of blocks.
3033 # @param theX,theY,theZ Coordinates of the sought vertex.
3034 # @param theEpsilon Maximum allowed distance between the resulting
3035 # vertex and point with the given coordinates.
3036 # @return New GEOM_Object, containing the found vertex.
3038 # @ref swig_GetPoint "Example"
3039 def GetPoint(self,theShape, theX, theY, theZ, theEpsilon):
3040 # Example: see GEOM_TestOthers.py
3041 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
3042 RaiseIfFailed("GetPoint", self.BlocksOp)
3045 ## Get an edge, found in the given shape by two given vertices.
3046 # @param theShape Block or a compound of blocks.
3047 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
3048 # @return New GEOM_Object, containing the found edge.
3050 # @ref swig_todo "Example"
3051 def GetEdge(self,theShape, thePoint1, thePoint2):
3052 # Example: see GEOM_Spanner.py
3053 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
3054 RaiseIfFailed("GetEdge", self.BlocksOp)
3057 ## Find an edge of the given shape, which has minimal distance to the given point.
3058 # @param theShape Block or a compound of blocks.
3059 # @param thePoint Point, close to the desired edge.
3060 # @return New GEOM_Object, containing the found edge.
3062 # @ref swig_GetEdgeNearPoint "Example"
3063 def GetEdgeNearPoint(self,theShape, thePoint):
3064 # Example: see GEOM_TestOthers.py
3065 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
3066 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
3069 ## Returns a face, found in the given shape by four given corner vertices.
3070 # @param theShape Block or a compound of blocks.
3071 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
3072 # @return New GEOM_Object, containing the found face.
3074 # @ref swig_todo "Example"
3075 def GetFaceByPoints(self,theShape, thePoint1, thePoint2, thePoint3, thePoint4):
3076 # Example: see GEOM_Spanner.py
3077 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
3078 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
3081 ## Get a face of block, found in the given shape by two given edges.
3082 # @param theShape Block or a compound of blocks.
3083 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
3084 # @return New GEOM_Object, containing the found face.
3086 # @ref swig_todo "Example"
3087 def GetFaceByEdges(self,theShape, theEdge1, theEdge2):
3088 # Example: see GEOM_Spanner.py
3089 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
3090 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
3093 ## Find a face, opposite to the given one in the given block.
3094 # @param theBlock Must be a hexahedral solid.
3095 # @param theFace Face of \a theBlock, opposite to the desired face.
3096 # @return New GEOM_Object, containing the found face.
3098 # @ref swig_GetOppositeFace "Example"
3099 def GetOppositeFace(self,theBlock, theFace):
3100 # Example: see GEOM_Spanner.py
3101 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
3102 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
3105 ## Find a face of the given shape, which has minimal distance to the given point.
3106 # @param theShape Block or a compound of blocks.
3107 # @param thePoint Point, close to the desired face.
3108 # @return New GEOM_Object, containing the found face.
3110 # @ref swig_GetFaceNearPoint "Example"
3111 def GetFaceNearPoint(self,theShape, thePoint):
3112 # Example: see GEOM_Spanner.py
3113 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
3114 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
3117 ## Find a face of block, whose outside normale has minimal angle with the given vector.
3118 # @param theBlock Block or a compound of blocks.
3119 # @param theVector Vector, close to the normale of the desired face.
3120 # @return New GEOM_Object, containing the found face.
3122 # @ref swig_todo "Example"
3123 def GetFaceByNormale(self, theBlock, theVector):
3124 # Example: see GEOM_Spanner.py
3125 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
3126 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
3129 # end of l3_blocks_op
3132 ## @addtogroup l4_blocks_measure
3135 ## Check, if the compound of blocks is given.
3136 # To be considered as a compound of blocks, the
3137 # given shape must satisfy the following conditions:
3138 # - Each element of the compound should be a Block (6 faces and 12 edges).
3139 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
3140 # - The compound should be connexe.
3141 # - The glue between two quadrangle faces should be applied.
3142 # @param theCompound The compound to check.
3143 # @return TRUE, if the given shape is a compound of blocks.
3144 # If theCompound is not valid, prints all discovered errors.
3146 # @ref tui_measurement_tools_page "Example 1"
3147 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
3148 def CheckCompoundOfBlocks(self,theCompound):
3149 # Example: see GEOM_Spanner.py
3150 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
3151 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
3153 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
3157 ## Remove all seam and degenerated edges from \a theShape.
3158 # Unite faces and edges, sharing one surface. It means that
3159 # this faces must have references to one C++ surface object (handle).
3160 # @param theShape The compound or single solid to remove irregular edges from.
3161 # @return Improved shape.
3163 # @ref swig_RemoveExtraEdges "Example"
3164 def RemoveExtraEdges(self,theShape):
3165 # Example: see GEOM_TestOthers.py
3166 anObj = self.BlocksOp.RemoveExtraEdges(theShape)
3167 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
3170 ## Check, if the given shape is a blocks compound.
3171 # Fix all detected errors.
3172 # \note Single block can be also fixed by this method.
3173 # @param theShape The compound to check and improve.
3174 # @return Improved compound.
3176 # @ref swig_CheckAndImprove "Example"
3177 def CheckAndImprove(self,theShape):
3178 # Example: see GEOM_TestOthers.py
3179 anObj = self.BlocksOp.CheckAndImprove(theShape)
3180 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
3183 # end of l4_blocks_measure
3186 ## @addtogroup l3_blocks_op
3189 ## Get all the blocks, contained in the given compound.
3190 # @param theCompound The compound to explode.
3191 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
3192 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
3193 # \note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
3194 # @return List of GEOM_Objects, containing the retrieved blocks.
3196 # @ref tui_explode_on_blocks "Example 1"
3197 # \n @ref swig_MakeBlockExplode "Example 2"
3198 def MakeBlockExplode(self,theCompound, theMinNbFaces, theMaxNbFaces):
3199 # Example: see GEOM_TestOthers.py
3200 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
3201 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
3204 ## Find block, containing the given point inside its volume or on boundary.
3205 # @param theCompound Compound, to find block in.
3206 # @param thePoint Point, close to the desired block. If the point lays on
3207 # boundary between some blocks, we return block with nearest center.
3208 # @return New GEOM_Object, containing the found block.
3210 # @ref swig_todo "Example"
3211 def GetBlockNearPoint(self,theCompound, thePoint):
3212 # Example: see GEOM_Spanner.py
3213 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
3214 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
3217 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
3218 # @param theCompound Compound, to find block in.
3219 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
3220 # @return New GEOM_Object, containing the found block.
3222 # @ref swig_GetBlockByParts "Example"
3223 def GetBlockByParts(self,theCompound, theParts):
3224 # Example: see GEOM_TestOthers.py
3225 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
3226 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
3229 ## Return all blocks, containing all the elements, passed as the parts.
3230 # @param theCompound Compound, to find blocks in.
3231 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
3232 # @return List of GEOM_Objects, containing the found blocks.
3234 # @ref swig_todo "Example"
3235 def GetBlocksByParts(self,theCompound, theParts):
3236 # Example: see GEOM_Spanner.py
3237 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
3238 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
3241 ## Multi-transformate block and glue the result.
3242 # Transformation is defined so, as to superpose direction faces.
3243 # @param Block Hexahedral solid to be multi-transformed.
3244 # @param DirFace1 ID of First direction face.
3245 # @param DirFace2 ID of Second direction face.
3246 # @param NbTimes Quantity of transformations to be done.
3247 # \note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
3248 # @return New GEOM_Object, containing the result shape.
3250 # @ref tui_multi_transformation "Example"
3251 def MakeMultiTransformation1D(self,Block, DirFace1, DirFace2, NbTimes):
3252 # Example: see GEOM_Spanner.py
3253 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
3254 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
3257 ## Multi-transformate block and glue the result.
3258 # @param Block Hexahedral solid to be multi-transformed.
3259 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
3260 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
3261 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
3262 # @return New GEOM_Object, containing the result shape.
3264 # @ref tui_multi_transformation "Example"
3265 def MakeMultiTransformation2D(self,Block, DirFace1U, DirFace2U, NbTimesU,
3266 DirFace1V, DirFace2V, NbTimesV):
3267 # Example: see GEOM_Spanner.py
3268 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
3269 DirFace1V, DirFace2V, NbTimesV)
3270 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
3273 ## Build all possible propagation groups.
3274 # Propagation group is a set of all edges, opposite to one (main)
3275 # edge of this group directly or through other opposite edges.
3276 # Notion of Opposite Edge make sence only on quadrangle face.
3277 # @param theShape Shape to build propagation groups on.
3278 # @return List of GEOM_Objects, each of them is a propagation group.
3280 # @ref swig_Propagate "Example"
3281 def Propagate(self,theShape):
3282 # Example: see GEOM_TestOthers.py
3283 listChains = self.BlocksOp.Propagate(theShape)
3284 RaiseIfFailed("Propagate", self.BlocksOp)
3287 # end of l3_blocks_op
3290 ## @addtogroup l3_groups
3293 ## Creates a new group which will store sub shapes of theMainShape
3294 # @param theMainShape is a GEOM object on which the group is selected
3295 # @param theShapeType defines a shape type of the group
3296 # @return a newly created GEOM group
3298 # @ref tui_working_with_groups_page "Example 1"
3299 # \n @ref swig_CreateGroup "Example 2"
3300 def CreateGroup(self,theMainShape, theShapeType):
3301 # Example: see GEOM_TestOthers.py
3302 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
3303 RaiseIfFailed("CreateGroup", self.GroupOp)
3306 ## Adds a sub object with ID theSubShapeId to the group
3307 # @param theGroup is a GEOM group to which the new sub shape is added
3308 # @param theSubShapeID is a sub shape ID in the main object.
3309 # \note Use method GetSubShapeID() to get an unique ID of the sub shape
3311 # @ref tui_working_with_groups_page "Example"
3312 def AddObject(self,theGroup, theSubShapeID):
3313 # Example: see GEOM_TestOthers.py
3314 self.GroupOp.AddObject(theGroup, theSubShapeID)
3315 RaiseIfFailed("AddObject", self.GroupOp)
3318 ## Removes a sub object with ID \a theSubShapeId from the group
3319 # @param theGroup is a GEOM group from which the new sub shape is removed
3320 # @param theSubShapeID is a sub shape ID in the main object.
3321 # \note Use method GetSubShapeID() to get an unique ID of the sub shape
3323 # @ref tui_working_with_groups_page "Example"
3324 def RemoveObject(self,theGroup, theSubShapeID):
3325 # Example: see GEOM_TestOthers.py
3326 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
3327 RaiseIfFailed("RemoveObject", self.GroupOp)
3330 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
3331 # @param theGroup is a GEOM group to which the new sub shapes are added.
3332 # @param theSubShapes is a list of sub shapes to be added.
3334 # @ref tui_working_with_groups_page "Example"
3335 def UnionList (self,theGroup, theSubShapes):
3336 # Example: see GEOM_TestOthers.py
3337 self.GroupOp.UnionList(theGroup, theSubShapes)
3338 RaiseIfFailed("UnionList", self.GroupOp)
3341 ## Works like the above method, but argument
3342 # theSubShapes here is a list of sub-shapes indices
3344 # @ref swig_UnionIDs "Example"
3345 def UnionIDs(self,theGroup, theSubShapes):
3346 # Example: see GEOM_TestOthers.py
3347 self.GroupOp.UnionIDs(theGroup, theSubShapes)
3348 RaiseIfFailed("UnionIDs", self.GroupOp)
3351 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
3352 # @param theGroup is a GEOM group from which the sub-shapes are removed.
3353 # @param theSubShapes is a list of sub-shapes to be removed.
3355 # @ref tui_working_with_groups_page "Example"
3356 def DifferenceList (self,theGroup, theSubShapes):
3357 # Example: see GEOM_TestOthers.py
3358 self.GroupOp.DifferenceList(theGroup, theSubShapes)
3359 RaiseIfFailed("DifferenceList", self.GroupOp)
3362 ## Works like the above method, but argument
3363 # theSubShapes here is a list of sub-shapes indices
3365 # @ref swig_DifferenceIDs "Example"
3366 def DifferenceIDs(self,theGroup, theSubShapes):
3367 # Example: see GEOM_TestOthers.py
3368 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
3369 RaiseIfFailed("DifferenceIDs", self.GroupOp)
3372 ## Returns a list of sub objects ID stored in the group
3373 # @param theGroup is a GEOM group for which a list of IDs is requested
3375 # @ref swig_GetObjectIDs "Example"
3376 def GetObjectIDs(self,theGroup):
3377 # Example: see GEOM_TestOthers.py
3378 ListIDs = self.GroupOp.GetObjects(theGroup)
3379 RaiseIfFailed("GetObjects", self.GroupOp)
3382 ## Returns a type of sub objects stored in the group
3383 # @param theGroup is a GEOM group which type is returned.
3385 # @ref swig_GetType "Example"
3386 def GetType(self,theGroup):
3387 # Example: see GEOM_TestOthers.py
3388 aType = self.GroupOp.GetType(theGroup)
3389 RaiseIfFailed("GetType", self.GroupOp)
3392 ## Returns a main shape associated with the group
3393 # @param theGroup is a GEOM group for which a main shape object is requested
3394 # @return a GEOM object which is a main shape for theGroup
3396 # @ref swig_GetMainShape "Example"
3397 def GetMainShape(self,theGroup):
3398 # Example: see GEOM_TestOthers.py
3399 anObj = self.GroupOp.GetMainShape(theGroup)
3400 RaiseIfFailed("GetMainShape", self.GroupOp)
3403 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
3404 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
3406 # @ref swig_todo "Example"
3407 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1):
3408 edges = self.SubShapeAll(theShape, ShapeType["EDGE"])
3411 Props = self.BasicProperties(edge)
3412 if min_length <= Props[0] and Props[0] <= max_length:
3413 if (not include_min) and (min_length == Props[0]):
3416 if (not include_max) and (Props[0] == max_length):
3419 edges_in_range.append(edge)
3421 if len(edges_in_range) <= 0:
3422 print "No edges found by given criteria"
3425 group_edges = self.CreateGroup(theShape, ShapeType["EDGE"])
3426 self.UnionList(group_edges, edges_in_range)
3430 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
3431 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
3433 # @ref swig_todo "Example"
3434 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
3435 nb_selected = sg.SelectedCount()
3437 print "Select a shape before calling this function, please."
3440 print "Only one shape must be selected"
3443 id_shape = sg.getSelected(0)
3444 shape = IDToObject( id_shape )
3446 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
3450 if include_min: left_str = " <= "
3451 if include_max: right_str = " <= "
3453 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
3454 + left_str + "length" + right_str + `max_length`)
3456 sg.updateObjBrowser(1)
3463 ## Create a copy of the given object
3464 # @ingroup l1_geompy_auxiliary
3466 # @ref swig_all_advanced "Example"
3467 def MakeCopy(self,theOriginal):
3468 # Example: see GEOM_TestAll.py
3469 anObj = self.InsertOp.MakeCopy(theOriginal)
3470 RaiseIfFailed("MakeCopy", self.InsertOp)
3473 ## Add Path to load python scripts from
3474 # @ingroup l1_geompy_auxiliary
3475 def addPath(self,Path):
3476 if (sys.path.count(Path) < 1):
3477 sys.path.append(Path)
3480 #Register the new proxy for GEOM_Gen
3481 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geompyDC)