1 # -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
4 # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
5 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
7 # This library is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU Lesser General Public
9 # License as published by the Free Software Foundation; either
10 # version 2.1 of the License.
12 # This library is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # Lesser General Public License for more details.
17 # You should have received a copy of the GNU Lesser General Public
18 # License along with this library; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 # GEOM GEOM_SWIG : binding of C++ omplementaion with Python
25 # Author : Paul RASCLE, EDF
33 ## @defgroup l1_geompy_auxiliary Auxiliary data structures and methods
35 ## @defgroup l1_geompy_purpose All package methods, grouped by their purpose
37 ## @defgroup l2_import_export Importing/exporting geometrical objects
38 ## @defgroup l2_creating Creating geometrical objects
40 ## @defgroup l3_basic_go Creating Basic Geometric Objects
42 ## @defgroup l4_curves Creating Curves
45 ## @defgroup l3_3d_primitives Creating 3D Primitives
46 ## @defgroup l3_complex Creating Complex Objects
47 ## @defgroup l3_groups Working with groups
48 ## @defgroup l3_blocks Building by blocks
50 ## @defgroup l4_blocks_measure Check and Improve
53 ## @defgroup l3_sketcher Sketcher
54 ## @defgroup l3_advanced Creating Advanced Geometrical Objects
56 ## @defgroup l4_decompose Decompose objects
57 ## @defgroup l4_access Access to sub-shapes by their unique IDs inside the main shape
58 ## @defgroup l4_obtain Access to subshapes by a criteria
63 ## @defgroup l2_transforming Transforming geometrical objects
65 ## @defgroup l3_basic_op Basic Operations
66 ## @defgroup l3_boolean Boolean Operations
67 ## @defgroup l3_transform Transformation Operations
68 ## @defgroup l3_local Local Operations (Fillet and Chamfer)
69 ## @defgroup l3_blocks_op Blocks Operations
70 ## @defgroup l3_healing Repairing Operations
71 ## @defgroup l3_restore_ss Restore presentation parameters and a tree of subshapes
74 ## @defgroup l2_measure Using measurement tools
82 from salome_notebook import *
87 ## Enumeration ShapeType as a dictionary
88 # @ingroup l1_geompy_auxiliary
89 ShapeType = {"COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8}
91 ## Raise an Error, containing the Method_name, if Operation is Failed
92 ## @ingroup l1_geompy_auxiliary
93 def RaiseIfFailed (Method_name, Operation):
94 if Operation.IsDone() == 0 and Operation.GetErrorCode() != "NOT_FOUND_ANY":
95 raise RuntimeError, Method_name + " : " + Operation.GetErrorCode()
97 ## Return list of variables value from salome notebook
98 ## @ingroup l1_geompy_auxiliary
99 def ParseParameters(*parameters):
102 for parameter in parameters:
103 if isinstance(parameter,str):
104 if notebook.isVariable(parameter):
105 Result.append(notebook.get(parameter))
107 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
109 Result.append(parameter)
112 StringResult = StringResult + str(parameter)
113 StringResult = StringResult + ":"
115 StringResult = StringResult[:len(StringResult)-1]
116 Result.append(StringResult)
119 ## Return list of variables value from salome notebook
120 ## @ingroup l1_geompy_auxiliary
124 for parameter in list:
125 if isinstance(parameter,str) and notebook.isVariable(parameter):
126 Result.append(str(notebook.get(parameter)))
129 Result.append(str(parameter))
132 StringResult = StringResult + str(parameter)
133 StringResult = StringResult + ":"
135 StringResult = StringResult[:len(StringResult)-1]
136 return Result, StringResult
138 ## Return list of variables value from salome notebook
139 ## @ingroup l1_geompy_auxiliary
140 def ParseSketcherCommand(command):
143 sections = command.split(":")
144 for section in sections:
145 parameters = section.split(" ")
147 for parameter in parameters:
148 if paramIndex > 1 and parameter.find("'") != -1:
149 parameter = parameter.replace("'","")
150 if notebook.isVariable(parameter):
151 Result = Result + str(notebook.get(parameter)) + " "
154 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
158 Result = Result + str(parameter) + " "
161 StringResult = StringResult + parameter
162 StringResult = StringResult + ":"
164 paramIndex = paramIndex + 1
166 Result = Result[:len(Result)-1] + ":"
168 Result = Result[:len(Result)-1]
169 return Result, StringResult
171 ## Kinds of shape enumeration
172 # @ingroup l1_geompy_auxiliary
173 kind = GEOM.GEOM_IKindOfShape
175 ## Information about closed/unclosed state of shell or wire
176 # @ingroup l1_geompy_auxiliary
183 class geompyDC(GEOM._objref_GEOM_Gen):
186 GEOM._objref_GEOM_Gen.__init__(self)
187 self.myBuilder = None
205 ## @addtogroup l1_geompy_auxiliary
207 def init_geom(self,theStudy):
208 self.myStudy = theStudy
209 self.myStudyId = self.myStudy._get_StudyId()
210 self.myBuilder = self.myStudy.NewBuilder()
211 self.father = self.myStudy.FindComponent("GEOM")
212 if self.father is None:
213 self.father = self.myBuilder.NewComponent("GEOM")
214 A1 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributeName")
215 FName = A1._narrow(SALOMEDS.AttributeName)
216 FName.SetValue("Geometry")
217 A2 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributePixMap")
218 aPixmap = A2._narrow(SALOMEDS.AttributePixMap)
219 aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry")
220 self.myBuilder.DefineComponentInstance(self.father,self)
222 self.BasicOp = self.GetIBasicOperations (self.myStudyId)
223 self.CurvesOp = self.GetICurvesOperations (self.myStudyId)
224 self.PrimOp = self.GetI3DPrimOperations (self.myStudyId)
225 self.ShapesOp = self.GetIShapesOperations (self.myStudyId)
226 self.HealOp = self.GetIHealingOperations (self.myStudyId)
227 self.InsertOp = self.GetIInsertOperations (self.myStudyId)
228 self.BoolOp = self.GetIBooleanOperations (self.myStudyId)
229 self.TrsfOp = self.GetITransformOperations(self.myStudyId)
230 self.LocalOp = self.GetILocalOperations (self.myStudyId)
231 self.MeasuOp = self.GetIMeasureOperations (self.myStudyId)
232 self.BlocksOp = self.GetIBlocksOperations (self.myStudyId)
233 self.GroupOp = self.GetIGroupOperations (self.myStudyId)
236 ## Get name for sub-shape aSubObj of shape aMainObj
238 # @ref swig_SubShapeAllSorted "Example"
239 def SubShapeName(self,aSubObj, aMainObj):
240 # Example: see GEOM_TestAll.py
242 #aSubId = orb.object_to_string(aSubObj)
243 #aMainId = orb.object_to_string(aMainObj)
244 #index = gg.getIndexTopology(aSubId, aMainId)
245 #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
246 index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
247 name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
250 ## Publish in study aShape with name aName
252 # \param aShape the shape to be published
253 # \param aName the name for the shape
254 # \param doRestoreSubShapes if True, finds and publishes also
255 # sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
256 # and published sub-shapes of arguments
257 # \param theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes for
258 # these arguments description
259 # \return study entry of the published shape in form of string
261 # @ref swig_MakeQuad4Vertices "Example"
262 def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
263 theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
264 # Example: see GEOM_TestAll.py
266 aSObject = self.AddInStudy(self.myStudy, aShape, aName, None)
267 if doRestoreSubShapes:
268 self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs,
269 theFindMethod, theInheritFirstArg)
271 print "addToStudy() failed"
273 return aShape.GetStudyEntry()
275 ## Publish in study aShape with name aName as sub-object of previously published aFather
277 # @ref swig_SubShapeAllSorted "Example"
278 def addToStudyInFather(self, aFather, aShape, aName):
279 # Example: see GEOM_TestAll.py
281 aSObject = self.AddInStudy(self.myStudy, aShape, aName, aFather)
283 print "addToStudyInFather() failed"
285 return aShape.GetStudyEntry()
287 # end of l1_geompy_auxiliary
290 ## @addtogroup l3_restore_ss
293 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
294 # To be used from python scripts out of geompy.addToStudy (non-default usage)
295 # \param theObject published GEOM object, arguments of which will be published
296 # \param theArgs list of GEOM_Object, operation arguments to be published.
297 # If this list is empty, all operation arguments will be published
298 # \param theFindMethod method to search subshapes, corresponding to arguments and
299 # their subshapes. Value from enumeration GEOM::find_shape_method.
300 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
301 # Do not publish subshapes in place of arguments, but only
302 # in place of subshapes of the first argument,
303 # because the whole shape corresponds to the first argument.
304 # Mainly to be used after transformations, but it also can be
305 # usefull after partition with one object shape, and some other
306 # operations, where only the first argument has to be considered.
307 # If theObject has only one argument shape, this flag is automatically
308 # considered as True, not regarding really passed value.
309 # \return list of published sub-shapes
311 # @ref tui_restore_prs_params "Example"
312 def RestoreSubShapes (self, theObject, theArgs=[],
313 theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
314 # Example: see GEOM_TestAll.py
315 return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
316 theFindMethod, theInheritFirstArg)
318 # end of l3_restore_ss
321 ## @addtogroup l3_basic_go
324 ## Create point by three coordinates.
325 # @param theX The X coordinate of the point.
326 # @param theY The Y coordinate of the point.
327 # @param theZ The Z coordinate of the point.
328 # @return New GEOM_Object, containing the created point.
330 # @ref tui_creation_point "Example"
331 def MakeVertex(self,theX, theY, theZ):
332 # Example: see GEOM_TestAll.py
333 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
334 anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
335 RaiseIfFailed("MakePointXYZ", self.BasicOp)
336 anObj.SetParameters(Parameters)
339 ## Create a point, distant from the referenced point
340 # on the given distances along the coordinate axes.
341 # @param theReference The referenced point.
342 # @param theX Displacement from the referenced point along OX axis.
343 # @param theY Displacement from the referenced point along OY axis.
344 # @param theZ Displacement from the referenced point along OZ axis.
345 # @return New GEOM_Object, containing the created point.
347 # @ref tui_creation_point "Example"
348 def MakeVertexWithRef(self,theReference, theX, theY, theZ):
349 # Example: see GEOM_TestAll.py
350 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
351 anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
352 RaiseIfFailed("MakePointWithReference", self.BasicOp)
353 anObj.SetParameters(Parameters)
356 ## Create a point, corresponding to the given parameter on the given curve.
357 # @param theRefCurve The referenced curve.
358 # @param theParameter Value of parameter on the referenced curve.
359 # @return New GEOM_Object, containing the created point.
361 # @ref tui_creation_point "Example"
362 def MakeVertexOnCurve(self,theRefCurve, theParameter):
363 # Example: see GEOM_TestAll.py
364 theParameter, Parameters = ParseParameters(theParameter)
365 anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter)
366 RaiseIfFailed("MakePointOnCurve", self.BasicOp)
367 anObj.SetParameters(Parameters)
370 ## Create a point by projection give coordinates on the given curve
371 # @param theRefCurve The referenced curve.
372 # @param theX X-coordinate in 3D space
373 # @param theY Y-coordinate in 3D space
374 # @param theZ Z-coordinate in 3D space
375 # @return New GEOM_Object, containing the created point.
377 # @ref tui_creation_point "Example"
378 def MakeVertexOnCurveByCoord(self,theRefCurve, theX, theY, theZ):
379 # Example: see GEOM_TestAll.py
380 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
381 anObj = self.BasicOp.MakePointOnCurveByCoord(theRefCurve, theX, theY, theZ)
382 RaiseIfFailed("MakeVertexOnCurveByCoord", self.BasicOp)
383 anObj.SetParameters(Parameters)
386 ## Create a point, corresponding to the given parameters on the
388 # @param theRefSurf The referenced surface.
389 # @param theUParameter Value of U-parameter on the referenced surface.
390 # @param theVParameter Value of V-parameter on the referenced surface.
391 # @return New GEOM_Object, containing the created point.
393 # @ref swig_MakeVertexOnSurface "Example"
394 def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter):
395 theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
396 # Example: see GEOM_TestAll.py
397 anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
398 RaiseIfFailed("MakePointOnSurface", self.BasicOp)
399 anObj.SetParameters(Parameters);
402 ## Create a point by projection give coordinates on the given surface
403 # @param theRefSurf The referenced surface.
404 # @param theX X-coordinate in 3D space
405 # @param theY Y-coordinate in 3D space
406 # @param theZ Z-coordinate in 3D space
407 # @return New GEOM_Object, containing the created point.
409 # @ref swig_MakeVertexOnSurfaceByCoord "Example"
410 def MakeVertexOnSurfaceByCoord(self, theRefSurf, theX, theY, theZ):
411 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
412 # Example: see GEOM_TestAll.py
413 anObj = self.BasicOp.MakePointOnSurfaceByCoord(theRefSurf, theX, theY, theZ)
414 RaiseIfFailed("MakeVertexOnSurfaceByCoord", self.BasicOp)
415 anObj.SetParameters(Parameters);
418 ## Create a point on intersection of two lines.
419 # @param theRefLine1, theRefLine2 The referenced lines.
420 # @return New GEOM_Object, containing the created point.
422 # @ref swig_MakeVertexOnLinesIntersection "Example"
423 def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2):
424 # Example: see GEOM_TestAll.py
425 anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
426 RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
429 ## Create a tangent, corresponding to the given parameter on the given curve.
430 # @param theRefCurve The referenced curve.
431 # @param theParameter Value of parameter on the referenced curve.
432 # @return New GEOM_Object, containing the created tangent.
434 # @ref swig_MakeTangentOnCurve "Example"
435 def MakeTangentOnCurve(self, theRefCurve, theParameter):
436 anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
437 RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
440 ## Create a tangent plane, corresponding to the given parameter on the given face.
441 # @param theFace The face for which tangent plane should be built.
442 # @param theParameterV vertical value of the center point (0.0 - 1.0).
443 # @param theParameterU horisontal value of the center point (0.0 - 1.0).
444 # @param theTrimSize the size of plane.
445 # @return New GEOM_Object, containing the created tangent.
447 # @ref swig_MakeTangentPlaneOnFace "Example"
448 def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize):
449 anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
450 RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
453 ## Create a vector with the given components.
454 # @param theDX X component of the vector.
455 # @param theDY Y component of the vector.
456 # @param theDZ Z component of the vector.
457 # @return New GEOM_Object, containing the created vector.
459 # @ref tui_creation_vector "Example"
460 def MakeVectorDXDYDZ(self,theDX, theDY, theDZ):
461 # Example: see GEOM_TestAll.py
462 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
463 anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
464 RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
465 anObj.SetParameters(Parameters)
468 ## Create a vector between two points.
469 # @param thePnt1 Start point for the vector.
470 # @param thePnt2 End point for the vector.
471 # @return New GEOM_Object, containing the created vector.
473 # @ref tui_creation_vector "Example"
474 def MakeVector(self,thePnt1, thePnt2):
475 # Example: see GEOM_TestAll.py
476 anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
477 RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
480 ## Create a line, passing through the given point
481 # and parrallel to the given direction
482 # @param thePnt Point. The resulting line will pass through it.
483 # @param theDir Direction. The resulting line will be parallel to it.
484 # @return New GEOM_Object, containing the created line.
486 # @ref tui_creation_line "Example"
487 def MakeLine(self,thePnt, theDir):
488 # Example: see GEOM_TestAll.py
489 anObj = self.BasicOp.MakeLine(thePnt, theDir)
490 RaiseIfFailed("MakeLine", self.BasicOp)
493 ## Create a line, passing through the given points
494 # @param thePnt1 First of two points, defining the line.
495 # @param thePnt2 Second of two points, defining the line.
496 # @return New GEOM_Object, containing the created line.
498 # @ref tui_creation_line "Example"
499 def MakeLineTwoPnt(self,thePnt1, thePnt2):
500 # Example: see GEOM_TestAll.py
501 anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
502 RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
505 ## Create a line on two faces intersection.
506 # @param theFace1 First of two faces, defining the line.
507 # @param theFace2 Second of two faces, defining the line.
508 # @return New GEOM_Object, containing the created line.
510 # @ref swig_MakeLineTwoFaces "Example"
511 def MakeLineTwoFaces(self, theFace1, theFace2):
512 # Example: see GEOM_TestAll.py
513 anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
514 RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
517 ## Create a plane, passing through the given point
518 # and normal to the given vector.
519 # @param thePnt Point, the plane has to pass through.
520 # @param theVec Vector, defining the plane normal direction.
521 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
522 # @return New GEOM_Object, containing the created plane.
524 # @ref tui_creation_plane "Example"
525 def MakePlane(self,thePnt, theVec, theTrimSize):
526 # Example: see GEOM_TestAll.py
527 theTrimSize, Parameters = ParseParameters(theTrimSize);
528 anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
529 RaiseIfFailed("MakePlanePntVec", self.BasicOp)
530 anObj.SetParameters(Parameters)
533 ## Create a plane, passing through the three given points
534 # @param thePnt1 First of three points, defining the plane.
535 # @param thePnt2 Second of three points, defining the plane.
536 # @param thePnt3 Fird of three points, defining the plane.
537 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
538 # @return New GEOM_Object, containing the created plane.
540 # @ref tui_creation_plane "Example"
541 def MakePlaneThreePnt(self,thePnt1, thePnt2, thePnt3, theTrimSize):
542 # Example: see GEOM_TestAll.py
543 theTrimSize, Parameters = ParseParameters(theTrimSize);
544 anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
545 RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
546 anObj.SetParameters(Parameters)
549 ## Create a plane, similar to the existing one, but with another size of representing face.
550 # @param theFace Referenced plane or LCS(Marker).
551 # @param theTrimSize New half size of a side of quadrangle face, representing the plane.
552 # @return New GEOM_Object, containing the created plane.
554 # @ref tui_creation_plane "Example"
555 def MakePlaneFace(self,theFace, theTrimSize):
556 # Example: see GEOM_TestAll.py
557 theTrimSize, Parameters = ParseParameters(theTrimSize);
558 anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
559 RaiseIfFailed("MakePlaneFace", self.BasicOp)
560 anObj.SetParameters(Parameters)
563 ## Create a plane, passing through the 2 vectors
564 # with center in a start point of the first vector.
565 # @param theVec1 Vector, defining center point and plane direction.
566 # @param theVec2 Vector, defining the plane normal direction.
567 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
568 # @return New GEOM_Object, containing the created plane.
570 # @ref tui_creation_plane "Example"
571 def MakePlane2Vec(self,theVec1, theVec2, theTrimSize):
572 # Example: see GEOM_TestAll.py
573 theTrimSize, Parameters = ParseParameters(theTrimSize);
574 anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
575 RaiseIfFailed("MakePlane2Vec", self.BasicOp)
576 anObj.SetParameters(Parameters)
579 ## Create a plane, based on a Local coordinate system.
580 # @param theLCS coordinate system, defining plane.
581 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
582 # @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
583 # @return New GEOM_Object, containing the created plane.
585 # @ref tui_creation_plane "Example"
586 def MakePlaneLCS(self,theLCS, theTrimSize, theOrientation):
587 # Example: see GEOM_TestAll.py
588 theTrimSize, Parameters = ParseParameters(theTrimSize);
589 anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
590 RaiseIfFailed("MakePlaneLCS", self.BasicOp)
591 anObj.SetParameters(Parameters)
594 ## Create a local coordinate system.
595 # @param OX,OY,OZ Three coordinates of coordinate system origin.
596 # @param XDX,XDY,XDZ Three components of OX direction
597 # @param YDX,YDY,YDZ Three components of OY direction
598 # @return New GEOM_Object, containing the created coordinate system.
600 # @ref swig_MakeMarker "Example"
601 def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ):
602 # Example: see GEOM_TestAll.py
603 OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
604 anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
605 RaiseIfFailed("MakeMarker", self.BasicOp)
606 anObj.SetParameters(Parameters)
609 ## Create a local coordinate system.
610 # @param theOrigin Point of coordinate system origin.
611 # @param theXVec Vector of X direction
612 # @param theYVec Vector of Y direction
613 # @return New GEOM_Object, containing the created coordinate system.
615 # @ref swig_MakeMarker "Example"
616 def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec):
617 O = self.PointCoordinates( theOrigin )
619 for vec in [ theXVec, theYVec ]:
620 v1, v2 = self.SubShapeAll( vec, ShapeType["VERTEX"] )
621 p1 = self.PointCoordinates( v1 )
622 p2 = self.PointCoordinates( v2 )
623 for i in range( 0, 3 ):
624 OXOY.append( p2[i] - p1[i] )
626 anObj = self.BasicOp.MakeMarker( O[0], O[1], O[2],
627 OXOY[0], OXOY[1], OXOY[2],
628 OXOY[3], OXOY[4], OXOY[5], )
629 RaiseIfFailed("MakeMarker", self.BasicOp)
635 ## @addtogroup l4_curves
638 ## Create an arc of circle, passing through three given points.
639 # @param thePnt1 Start point of the arc.
640 # @param thePnt2 Middle point of the arc.
641 # @param thePnt3 End point of the arc.
642 # @return New GEOM_Object, containing the created arc.
644 # @ref swig_MakeArc "Example"
645 def MakeArc(self,thePnt1, thePnt2, thePnt3):
646 # Example: see GEOM_TestAll.py
647 anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
648 RaiseIfFailed("MakeArc", self.CurvesOp)
651 ## Create an arc of circle from a center and 2 points.
652 # @param thePnt1 Center of the arc
653 # @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
654 # @param thePnt3 End point of the arc (Gives also a direction)
655 # @param theSense Orientation of the arc
656 # @return New GEOM_Object, containing the created arc.
658 # @ref swig_MakeArc "Example"
659 def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False):
660 # Example: see GEOM_TestAll.py
661 anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
662 RaiseIfFailed("MakeArcCenter", self.CurvesOp)
665 ## Create an arc of ellipse, of center and two points.
666 # @param theCenter Center of the arc.
667 # @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
668 # @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
669 # @return New GEOM_Object, containing the created arc.
671 # @ref swig_MakeArc "Example"
672 def MakeArcOfEllipse(self,theCenter, thePnt1, thePnt2):
673 # Example: see GEOM_TestAll.py
674 anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
675 RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
678 ## Create a circle with given center, normal vector and radius.
679 # @param thePnt Circle center.
680 # @param theVec Vector, normal to the plane of the circle.
681 # @param theR Circle radius.
682 # @return New GEOM_Object, containing the created circle.
684 # @ref tui_creation_circle "Example"
685 def MakeCircle(self, thePnt, theVec, theR):
686 # Example: see GEOM_TestAll.py
687 theR, Parameters = ParseParameters(theR)
688 anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
689 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
690 anObj.SetParameters(Parameters)
693 ## Create a circle with given radius.
694 # Center of the circle will be in the origin of global
695 # coordinate system and normal vector will be codirected with Z axis
696 # @param theR Circle radius.
697 # @return New GEOM_Object, containing the created circle.
698 def MakeCircleR(self, theR):
699 anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
700 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
703 ## Create a circle, passing through three given points
704 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
705 # @return New GEOM_Object, containing the created circle.
707 # @ref tui_creation_circle "Example"
708 def MakeCircleThreePnt(self,thePnt1, thePnt2, thePnt3):
709 # Example: see GEOM_TestAll.py
710 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
711 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
714 ## Create a circle, with given point1 as center,
715 # passing through the point2 as radius and laying in the plane,
716 # defined by all three given points.
717 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
718 # @return New GEOM_Object, containing the created circle.
720 # @ref swig_MakeCircle "Example"
721 def MakeCircleCenter2Pnt(self,thePnt1, thePnt2, thePnt3):
722 # Example: see GEOM_example6.py
723 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
724 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
727 ## Create an ellipse with given center, normal vector and radiuses.
728 # @param thePnt Ellipse center.
729 # @param theVec Vector, normal to the plane of the ellipse.
730 # @param theRMajor Major ellipse radius.
731 # @param theRMinor Minor ellipse radius.
732 # @param theVecMaj Vector, direction of the ellipse's main axis.
733 # @return New GEOM_Object, containing the created ellipse.
735 # @ref tui_creation_ellipse "Example"
736 def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None):
737 # Example: see GEOM_TestAll.py
738 theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
739 if theVecMaj is not None:
740 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
742 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
744 RaiseIfFailed("MakeEllipse", self.CurvesOp)
745 anObj.SetParameters(Parameters)
748 ## Create an ellipse with given radiuses.
749 # Center of the ellipse will be in the origin of global
750 # coordinate system and normal vector will be codirected with Z axis
751 # @param theRMajor Major ellipse radius.
752 # @param theRMinor Minor ellipse radius.
753 # @return New GEOM_Object, containing the created ellipse.
754 def MakeEllipseRR(self, theRMajor, theRMinor):
755 anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
756 RaiseIfFailed("MakeEllipse", self.CurvesOp)
759 ## Create a polyline on the set of points.
760 # @param thePoints Sequence of points for the polyline.
761 # @return New GEOM_Object, containing the created polyline.
763 # @ref tui_creation_curve "Example"
764 def MakePolyline(self,thePoints):
765 # Example: see GEOM_TestAll.py
766 anObj = self.CurvesOp.MakePolyline(thePoints)
767 RaiseIfFailed("MakePolyline", self.CurvesOp)
770 ## Create bezier curve on the set of points.
771 # @param thePoints Sequence of points for the bezier curve.
772 # @return New GEOM_Object, containing the created bezier curve.
774 # @ref tui_creation_curve "Example"
775 def MakeBezier(self,thePoints):
776 # Example: see GEOM_TestAll.py
777 anObj = self.CurvesOp.MakeSplineBezier(thePoints)
778 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
781 ## Create B-Spline curve on the set of points.
782 # @param thePoints Sequence of points for the B-Spline curve.
783 # @param theIsClosed If True, build a closed curve.
784 # @return New GEOM_Object, containing the created B-Spline curve.
786 # @ref tui_creation_curve "Example"
787 def MakeInterpol(self, thePoints, theIsClosed=False):
788 # Example: see GEOM_TestAll.py
789 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed)
790 RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
796 ## @addtogroup l3_sketcher
799 ## Create a sketcher (wire or face), following the textual description,
800 # passed through <VAR>theCommand</VAR> argument. \n
801 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
802 # Format of the description string have to be the following:
804 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
807 # - x1, y1 are coordinates of the first sketcher point (zero by default),
809 # - "R angle" : Set the direction by angle
810 # - "D dx dy" : Set the direction by DX & DY
813 # - "TT x y" : Create segment by point at X & Y
814 # - "T dx dy" : Create segment by point with DX & DY
815 # - "L length" : Create segment by direction & Length
816 # - "IX x" : Create segment by direction & Intersect. X
817 # - "IY y" : Create segment by direction & Intersect. Y
820 # - "C radius length" : Create arc by direction, radius and length(in degree)
823 # - "WW" : Close Wire (to finish)
824 # - "WF" : Close Wire and build face (to finish)
826 # @param theCommand String, defining the sketcher in local
827 # coordinates of the working plane.
828 # @param theWorkingPlane Nine double values, defining origin,
829 # OZ and OX directions of the working plane.
830 # @return New GEOM_Object, containing the created wire.
832 # @ref tui_sketcher_page "Example"
833 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0]):
834 # Example: see GEOM_TestAll.py
835 theCommand,Parameters = ParseSketcherCommand(theCommand)
836 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
837 RaiseIfFailed("MakeSketcher", self.CurvesOp)
838 anObj.SetParameters(Parameters)
841 ## Create a sketcher (wire or face), following the textual description,
842 # passed through <VAR>theCommand</VAR> argument. \n
843 # For format of the description string see the previous method.\n
844 # @param theCommand String, defining the sketcher in local
845 # coordinates of the working plane.
846 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
847 # @return New GEOM_Object, containing the created wire.
849 # @ref tui_sketcher_page "Example"
850 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane):
851 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
852 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
855 ## Create a sketcher wire, following the numerical description,
856 # passed through <VAR>theCoordinates</VAR> argument. \n
857 # @param theCoordinates double values, defining points to create a wire,
859 # @return New GEOM_Object, containing the created wire.
861 # @ref tui_sketcher_page "Example"
862 def Make3DSketcher(self, theCoordinates):
863 anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
864 RaiseIfFailed("Make3DSketcher", self.CurvesOp)
870 ## @addtogroup l3_3d_primitives
873 ## Create a box by coordinates of two opposite vertices.
875 # @ref tui_creation_box "Example"
876 def MakeBox(self,x1,y1,z1,x2,y2,z2):
877 # Example: see GEOM_TestAll.py
878 pnt1 = self.MakeVertex(x1,y1,z1)
879 pnt2 = self.MakeVertex(x2,y2,z2)
880 return self.MakeBoxTwoPnt(pnt1,pnt2)
882 ## Create a box with specified dimensions along the coordinate axes
883 # and with edges, parallel to the coordinate axes.
884 # Center of the box will be at point (DX/2, DY/2, DZ/2).
885 # @param theDX Length of Box edges, parallel to OX axis.
886 # @param theDY Length of Box edges, parallel to OY axis.
887 # @param theDZ Length of Box edges, parallel to OZ axis.
888 # @return New GEOM_Object, containing the created box.
890 # @ref tui_creation_box "Example"
891 def MakeBoxDXDYDZ(self,theDX, theDY, theDZ):
892 # Example: see GEOM_TestAll.py
893 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
894 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
895 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
896 anObj.SetParameters(Parameters)
899 ## Create a box with two specified opposite vertices,
900 # and with edges, parallel to the coordinate axes
901 # @param thePnt1 First of two opposite vertices.
902 # @param thePnt2 Second of two opposite vertices.
903 # @return New GEOM_Object, containing the created box.
905 # @ref tui_creation_box "Example"
906 def MakeBoxTwoPnt(self,thePnt1, thePnt2):
907 # Example: see GEOM_TestAll.py
908 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
909 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
912 ## Create a face with specified dimensions along OX-OY coordinate axes,
913 # with edges, parallel to this coordinate axes.
914 # @param theH height of Face.
915 # @param theW width of Face.
916 # @param theOrientation orientation belong axis OXY OYZ OZX
917 # @return New GEOM_Object, containing the created face.
919 # @ref tui_creation_face "Example"
920 def MakeFaceHW(self,theH, theW, theOrientation):
921 # Example: see GEOM_TestAll.py
922 theH,theW,Parameters = ParseParameters(theH, theW)
923 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
924 RaiseIfFailed("MakeFaceHW", self.PrimOp)
925 anObj.SetParameters(Parameters)
928 ## Create a face from another plane and two sizes,
929 # vertical size and horisontal size.
930 # @param theObj Normale vector to the creating face or
932 # @param theH Height (vertical size).
933 # @param theW Width (horisontal size).
934 # @return New GEOM_Object, containing the created face.
936 # @ref tui_creation_face "Example"
937 def MakeFaceObjHW(self, theObj, theH, theW):
938 # Example: see GEOM_TestAll.py
939 theH,theW,Parameters = ParseParameters(theH, theW)
940 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
941 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
942 anObj.SetParameters(Parameters)
945 ## Create a disk with given center, normal vector and radius.
946 # @param thePnt Disk center.
947 # @param theVec Vector, normal to the plane of the disk.
948 # @param theR Disk radius.
949 # @return New GEOM_Object, containing the created disk.
951 # @ref tui_creation_disk "Example"
952 def MakeDiskPntVecR(self,thePnt, theVec, theR):
953 # Example: see GEOM_TestAll.py
954 theR,Parameters = ParseParameters(theR)
955 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
956 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
957 anObj.SetParameters(Parameters)
960 ## Create a disk, passing through three given points
961 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
962 # @return New GEOM_Object, containing the created disk.
964 # @ref tui_creation_disk "Example"
965 def MakeDiskThreePnt(self,thePnt1, thePnt2, thePnt3):
966 # Example: see GEOM_TestAll.py
967 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
968 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
971 ## Create a disk with specified dimensions along OX-OY coordinate axes.
972 # @param theR Radius of Face.
973 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
974 # @return New GEOM_Object, containing the created disk.
976 # @ref tui_creation_face "Example"
977 def MakeDiskR(self,theR, theOrientation):
978 # Example: see GEOM_TestAll.py
979 theR,Parameters = ParseParameters(theR)
980 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
981 RaiseIfFailed("MakeDiskR", self.PrimOp)
982 anObj.SetParameters(Parameters)
985 ## Create a cylinder with given base point, axis, radius and height.
986 # @param thePnt Central point of cylinder base.
987 # @param theAxis Cylinder axis.
988 # @param theR Cylinder radius.
989 # @param theH Cylinder height.
990 # @return New GEOM_Object, containing the created cylinder.
992 # @ref tui_creation_cylinder "Example"
993 def MakeCylinder(self,thePnt, theAxis, theR, theH):
994 # Example: see GEOM_TestAll.py
995 theR,theH,Parameters = ParseParameters(theR, theH)
996 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
997 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
998 anObj.SetParameters(Parameters)
1001 ## Create a cylinder with given radius and height at
1002 # the origin of coordinate system. Axis of the cylinder
1003 # will be collinear to the OZ axis of the coordinate system.
1004 # @param theR Cylinder radius.
1005 # @param theH Cylinder height.
1006 # @return New GEOM_Object, containing the created cylinder.
1008 # @ref tui_creation_cylinder "Example"
1009 def MakeCylinderRH(self,theR, theH):
1010 # Example: see GEOM_TestAll.py
1011 theR,theH,Parameters = ParseParameters(theR, theH)
1012 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
1013 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
1014 anObj.SetParameters(Parameters)
1017 ## Create a sphere with given center and radius.
1018 # @param thePnt Sphere center.
1019 # @param theR Sphere radius.
1020 # @return New GEOM_Object, containing the created sphere.
1022 # @ref tui_creation_sphere "Example"
1023 def MakeSpherePntR(self, thePnt, theR):
1024 # Example: see GEOM_TestAll.py
1025 theR,Parameters = ParseParameters(theR)
1026 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
1027 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
1028 anObj.SetParameters(Parameters)
1031 ## Create a sphere with given center and radius.
1032 # @param x,y,z Coordinates of sphere center.
1033 # @param theR Sphere radius.
1034 # @return New GEOM_Object, containing the created sphere.
1036 # @ref tui_creation_sphere "Example"
1037 def MakeSphere(self, x, y, z, theR):
1038 # Example: see GEOM_TestAll.py
1039 point = self.MakeVertex(x, y, z)
1040 anObj = self.MakeSpherePntR(point, theR)
1043 ## Create a sphere with given radius at the origin of coordinate system.
1044 # @param theR Sphere radius.
1045 # @return New GEOM_Object, containing the created sphere.
1047 # @ref tui_creation_sphere "Example"
1048 def MakeSphereR(self, theR):
1049 # Example: see GEOM_TestAll.py
1050 theR,Parameters = ParseParameters(theR)
1051 anObj = self.PrimOp.MakeSphereR(theR)
1052 RaiseIfFailed("MakeSphereR", self.PrimOp)
1053 anObj.SetParameters(Parameters)
1056 ## Create a cone with given base point, axis, height and radiuses.
1057 # @param thePnt Central point of the first cone base.
1058 # @param theAxis Cone axis.
1059 # @param theR1 Radius of the first cone base.
1060 # @param theR2 Radius of the second cone base.
1061 # \note If both radiuses are non-zero, the cone will be truncated.
1062 # \note If the radiuses are equal, a cylinder will be created instead.
1063 # @param theH Cone height.
1064 # @return New GEOM_Object, containing the created cone.
1066 # @ref tui_creation_cone "Example"
1067 def MakeCone(self,thePnt, theAxis, theR1, theR2, theH):
1068 # Example: see GEOM_TestAll.py
1069 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
1070 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
1071 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
1072 anObj.SetParameters(Parameters)
1075 ## Create a cone with given height and radiuses at
1076 # the origin of coordinate system. Axis of the cone will
1077 # be collinear to the OZ axis of the coordinate system.
1078 # @param theR1 Radius of the first cone base.
1079 # @param theR2 Radius of the second cone base.
1080 # \note If both radiuses are non-zero, the cone will be truncated.
1081 # \note If the radiuses are equal, a cylinder will be created instead.
1082 # @param theH Cone height.
1083 # @return New GEOM_Object, containing the created cone.
1085 # @ref tui_creation_cone "Example"
1086 def MakeConeR1R2H(self,theR1, theR2, theH):
1087 # Example: see GEOM_TestAll.py
1088 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
1089 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
1090 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
1091 anObj.SetParameters(Parameters)
1094 ## Create a torus with given center, normal vector and radiuses.
1095 # @param thePnt Torus central point.
1096 # @param theVec Torus axis of symmetry.
1097 # @param theRMajor Torus major radius.
1098 # @param theRMinor Torus minor radius.
1099 # @return New GEOM_Object, containing the created torus.
1101 # @ref tui_creation_torus "Example"
1102 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor):
1103 # Example: see GEOM_TestAll.py
1104 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
1105 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
1106 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
1107 anObj.SetParameters(Parameters)
1110 ## Create a torus with given radiuses at the origin of coordinate system.
1111 # @param theRMajor Torus major radius.
1112 # @param theRMinor Torus minor radius.
1113 # @return New GEOM_Object, containing the created torus.
1115 # @ref tui_creation_torus "Example"
1116 def MakeTorusRR(self, theRMajor, theRMinor):
1117 # Example: see GEOM_TestAll.py
1118 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
1119 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
1120 RaiseIfFailed("MakeTorusRR", self.PrimOp)
1121 anObj.SetParameters(Parameters)
1124 # end of l3_3d_primitives
1127 ## @addtogroup l3_complex
1130 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
1131 # @param theBase Base shape to be extruded.
1132 # @param thePoint1 First end of extrusion vector.
1133 # @param thePoint2 Second end of extrusion vector.
1134 # @return New GEOM_Object, containing the created prism.
1136 # @ref tui_creation_prism "Example"
1137 def MakePrism(self, theBase, thePoint1, thePoint2):
1138 # Example: see GEOM_TestAll.py
1139 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
1140 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
1143 ## Create a shape by extrusion of the base shape along the vector,
1144 # i.e. all the space, transfixed by the base shape during its translation
1145 # along the vector on the given distance.
1146 # @param theBase Base shape to be extruded.
1147 # @param theVec Direction of extrusion.
1148 # @param theH Prism dimension along theVec.
1149 # @return New GEOM_Object, containing the created prism.
1151 # @ref tui_creation_prism "Example"
1152 def MakePrismVecH(self, theBase, theVec, theH):
1153 # Example: see GEOM_TestAll.py
1154 theH,Parameters = ParseParameters(theH)
1155 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
1156 RaiseIfFailed("MakePrismVecH", self.PrimOp)
1157 anObj.SetParameters(Parameters)
1160 ## Create a shape by extrusion of the base shape along the vector,
1161 # i.e. all the space, transfixed by the base shape during its translation
1162 # along the vector on the given distance in 2 Ways (forward/backward) .
1163 # @param theBase Base shape to be extruded.
1164 # @param theVec Direction of extrusion.
1165 # @param theH Prism dimension along theVec in forward direction.
1166 # @return New GEOM_Object, containing the created prism.
1168 # @ref tui_creation_prism "Example"
1169 def MakePrismVecH2Ways(self, theBase, theVec, theH):
1170 # Example: see GEOM_TestAll.py
1171 theH,Parameters = ParseParameters(theH)
1172 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
1173 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
1174 anObj.SetParameters(Parameters)
1177 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
1178 # @param theBase Base shape to be extruded.
1179 # @param theDX, theDY, theDZ Directions of extrusion.
1180 # @return New GEOM_Object, containing the created prism.
1182 # @ref tui_creation_prism "Example"
1183 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ):
1184 # Example: see GEOM_TestAll.py
1185 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1186 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
1187 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
1188 anObj.SetParameters(Parameters)
1191 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
1192 # i.e. all the space, transfixed by the base shape during its translation
1193 # along the vector on the given distance in 2 Ways (forward/backward) .
1194 # @param theBase Base shape to be extruded.
1195 # @param theDX, theDY, theDZ Directions of extrusion.
1196 # @return New GEOM_Object, containing the created prism.
1198 # @ref tui_creation_prism "Example"
1199 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ):
1200 # Example: see GEOM_TestAll.py
1201 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1202 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
1203 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
1204 anObj.SetParameters(Parameters)
1207 ## Create a shape by revolution of the base shape around the axis
1208 # on the given angle, i.e. all the space, transfixed by the base
1209 # shape during its rotation around the axis on the given angle.
1210 # @param theBase Base shape to be rotated.
1211 # @param theAxis Rotation axis.
1212 # @param theAngle Rotation angle in radians.
1213 # @return New GEOM_Object, containing the created revolution.
1215 # @ref tui_creation_revolution "Example"
1216 def MakeRevolution(self, theBase, theAxis, theAngle):
1217 # Example: see GEOM_TestAll.py
1218 theAngle,Parameters = ParseParameters(theAngle)
1219 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
1220 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
1221 anObj.SetParameters(Parameters)
1224 ## The Same Revolution but in both ways forward&backward.
1225 def MakeRevolution2Ways(self, theBase, theAxis, theAngle):
1226 theAngle,Parameters = ParseParameters(theAngle)
1227 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
1228 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
1229 anObj.SetParameters(Parameters)
1232 ## Create a filling from the given compound of contours.
1233 # @param theShape the compound of contours
1234 # @param theMinDeg a minimal degree of BSpline surface to create
1235 # @param theMaxDeg a maximal degree of BSpline surface to create
1236 # @param theTol2D a 2d tolerance to be reached
1237 # @param theTol3D a 3d tolerance to be reached
1238 # @param theNbIter a number of iteration of approximation algorithm
1239 # @param isApprox if True, BSpline curves are generated in the process
1240 # of surface construction. By default it is False, that means
1241 # the surface is created using Besier curves. The usage of
1242 # Approximation makes the algorithm work slower, but allows
1243 # building the surface for rather complex cases
1244 # @return New GEOM_Object, containing the created filling surface.
1246 # @ref tui_creation_filling "Example"
1247 def MakeFilling(self, theShape, theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter, isApprox=0):
1248 # Example: see GEOM_TestAll.py
1249 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg,
1250 theTol2D, theTol3D, theNbIter)
1251 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
1252 theTol2D, theTol3D, theNbIter, isApprox)
1253 RaiseIfFailed("MakeFilling", self.PrimOp)
1254 anObj.SetParameters(Parameters)
1257 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
1258 # @param theSeqSections - set of specified sections.
1259 # @param theModeSolid - mode defining building solid or shell
1260 # @param thePreci - precision 3D used for smoothing by default 1.e-6
1261 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
1262 # @return New GEOM_Object, containing the created shell or solid.
1264 # @ref swig_todo "Example"
1265 def MakeThruSections(self,theSeqSections,theModeSolid,thePreci,theRuled):
1266 # Example: see GEOM_TestAll.py
1267 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
1268 RaiseIfFailed("MakeThruSections", self.PrimOp)
1271 ## Create a shape by extrusion of the base shape along
1272 # the path shape. The path shape can be a wire or an edge.
1273 # @param theBase Base shape to be extruded.
1274 # @param thePath Path shape to extrude the base shape along it.
1275 # @return New GEOM_Object, containing the created pipe.
1277 # @ref tui_creation_pipe "Example"
1278 def MakePipe(self,theBase, thePath):
1279 # Example: see GEOM_TestAll.py
1280 anObj = self.PrimOp.MakePipe(theBase, thePath)
1281 RaiseIfFailed("MakePipe", self.PrimOp)
1284 ## Create a shape by extrusion of the profile shape along
1285 # the path shape. The path shape can be a wire or an edge.
1286 # the several profiles can be specified in the several locations of path.
1287 # @param theSeqBases - list of Bases shape to be extruded.
1288 # @param theLocations - list of locations on the path corresponding
1289 # specified list of the Bases shapes. Number of locations
1290 # should be equal to number of bases or list of locations can be empty.
1291 # @param thePath - Path shape to extrude the base shape along it.
1292 # @param theWithContact - the mode defining that the section is translated to be in
1293 # contact with the spine.
1294 # @param theWithCorrection - defining that the section is rotated to be
1295 # orthogonal to the spine tangent in the correspondent point
1296 # @return New GEOM_Object, containing the created pipe.
1298 # @ref tui_creation_pipe_with_diff_sec "Example"
1299 def MakePipeWithDifferentSections(self, theSeqBases,
1300 theLocations, thePath,
1301 theWithContact, theWithCorrection):
1302 anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
1303 theLocations, thePath,
1304 theWithContact, theWithCorrection)
1305 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
1308 ## Create a shape by extrusion of the profile shape along
1309 # the path shape. The path shape can be a wire or a edge.
1310 # the several profiles can be specified in the several locations of path.
1311 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
1312 # shell or face. If number of faces in neighbour sections
1313 # aren't coincided result solid between such sections will
1314 # be created using external boundaries of this shells.
1315 # @param theSeqSubBases - list of corresponding subshapes of section shapes.
1316 # This list is used for searching correspondences between
1317 # faces in the sections. Size of this list must be equal
1318 # to size of list of base shapes.
1319 # @param theLocations - list of locations on the path corresponding
1320 # specified list of the Bases shapes. Number of locations
1321 # should be equal to number of bases. First and last
1322 # locations must be coincided with first and last vertexes
1323 # of path correspondingly.
1324 # @param thePath - Path shape to extrude the base shape along it.
1325 # @param theWithContact - the mode defining that the section is translated to be in
1326 # contact with the spine.
1327 # @param theWithCorrection - defining that the section is rotated to be
1328 # orthogonal to the spine tangent in the correspondent point
1329 # @return New GEOM_Object, containing the created solids.
1331 # @ref tui_creation_pipe_with_shell_sec "Example"
1332 def MakePipeWithShellSections(self,theSeqBases, theSeqSubBases,
1333 theLocations, thePath,
1334 theWithContact, theWithCorrection):
1335 anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
1336 theLocations, thePath,
1337 theWithContact, theWithCorrection)
1338 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
1341 ## Create a shape by extrusion of the profile shape along
1342 # the path shape. This function is used only for debug pipe
1343 # functionality - it is a version of previous function
1344 # (MakePipeWithShellSections(...)) which give a possibility to
1345 # recieve information about creating pipe between each pair of
1346 # sections step by step.
1347 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
1348 theLocations, thePath,
1349 theWithContact, theWithCorrection):
1351 nbsect = len(theSeqBases)
1352 nbsubsect = len(theSeqSubBases)
1353 #print "nbsect = ",nbsect
1354 for i in range(1,nbsect):
1356 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
1357 tmpLocations = [ theLocations[i-1], theLocations[i] ]
1359 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
1360 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
1361 tmpLocations, thePath,
1362 theWithContact, theWithCorrection)
1363 if self.PrimOp.IsDone() == 0:
1364 print "Problems with pipe creation between ",i," and ",i+1," sections"
1365 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
1368 print "Pipe between ",i," and ",i+1," sections is OK"
1373 resc = self.MakeCompound(res)
1374 #resc = self.MakeSewing(res, 0.001)
1375 #print "resc: ",resc
1378 ## Create solids between given sections
1379 # @param theSeqBases - list of sections (shell or face).
1380 # @param theLocations - list of corresponding vertexes
1381 # @return New GEOM_Object, containing the created solids.
1383 # @ref tui_creation_pipe_without_path "Example"
1384 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations):
1385 anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
1386 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
1389 ## Create a shape by extrusion of the base shape along
1390 # the path shape with constant bi-normal direction along the given vector.
1391 # The path shape can be a wire or an edge.
1392 # @param theBase Base shape to be extruded.
1393 # @param thePath Path shape to extrude the base shape along it.
1394 # @param theVec Vector defines a constant binormal direction to keep the
1395 # same angle beetween the direction and the sections
1396 # along the sweep surface.
1397 # @return New GEOM_Object, containing the created pipe.
1399 # @ref tui_creation_pipe "Example"
1400 def MakePipeBiNormalAlongVector(self,theBase, thePath, theVec):
1401 # Example: see GEOM_TestAll.py
1402 anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
1403 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
1409 ## @addtogroup l3_advanced
1412 ## Create a linear edge with specified ends.
1413 # @param thePnt1 Point for the first end of edge.
1414 # @param thePnt2 Point for the second end of edge.
1415 # @return New GEOM_Object, containing the created edge.
1417 # @ref tui_creation_edge "Example"
1418 def MakeEdge(self,thePnt1, thePnt2):
1419 # Example: see GEOM_TestAll.py
1420 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
1421 RaiseIfFailed("MakeEdge", self.ShapesOp)
1424 ## Create a wire from the set of edges and wires.
1425 # @param theEdgesAndWires List of edges and/or wires.
1426 # @param theTolerance Maximum distance between vertices, that will be merged.
1427 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
1428 # @return New GEOM_Object, containing the created wire.
1430 # @ref tui_creation_wire "Example"
1431 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07):
1432 # Example: see GEOM_TestAll.py
1433 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
1434 RaiseIfFailed("MakeWire", self.ShapesOp)
1437 ## Create a face on the given wire.
1438 # @param theWire closed Wire or Edge to build the face on.
1439 # @param isPlanarWanted If TRUE, only planar face will be built.
1440 # If impossible, NULL object will be returned.
1441 # @return New GEOM_Object, containing the created face.
1443 # @ref tui_creation_face "Example"
1444 def MakeFace(self,theWire, isPlanarWanted):
1445 # Example: see GEOM_TestAll.py
1446 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
1447 RaiseIfFailed("MakeFace", self.ShapesOp)
1450 ## Create a face on the given wires set.
1451 # @param theWires List of closed wires or edges to build the face on.
1452 # @param isPlanarWanted If TRUE, only planar face will be built.
1453 # If impossible, NULL object will be returned.
1454 # @return New GEOM_Object, containing the created face.
1456 # @ref tui_creation_face "Example"
1457 def MakeFaceWires(self,theWires, isPlanarWanted):
1458 # Example: see GEOM_TestAll.py
1459 anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
1460 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
1463 ## Shortcut to MakeFaceWires()
1465 # @ref tui_creation_face "Example 1"
1466 # \n @ref swig_MakeFaces "Example 2"
1467 def MakeFaces(self,theWires, isPlanarWanted):
1468 # Example: see GEOM_TestOthers.py
1469 anObj = self.MakeFaceWires(theWires, isPlanarWanted)
1472 ## Create a shell from the set of faces and shells.
1473 # @param theFacesAndShells List of faces and/or shells.
1474 # @return New GEOM_Object, containing the created shell.
1476 # @ref tui_creation_shell "Example"
1477 def MakeShell(self,theFacesAndShells):
1478 # Example: see GEOM_TestAll.py
1479 anObj = self.ShapesOp.MakeShell(theFacesAndShells)
1480 RaiseIfFailed("MakeShell", self.ShapesOp)
1483 ## Create a solid, bounded by the given shells.
1484 # @param theShells Sequence of bounding shells.
1485 # @return New GEOM_Object, containing the created solid.
1487 # @ref tui_creation_solid "Example"
1488 def MakeSolid(self,theShells):
1489 # Example: see GEOM_TestAll.py
1490 anObj = self.ShapesOp.MakeSolidShells(theShells)
1491 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
1494 ## Create a compound of the given shapes.
1495 # @param theShapes List of shapes to put in compound.
1496 # @return New GEOM_Object, containing the created compound.
1498 # @ref tui_creation_compound "Example"
1499 def MakeCompound(self,theShapes):
1500 # Example: see GEOM_TestAll.py
1501 anObj = self.ShapesOp.MakeCompound(theShapes)
1502 RaiseIfFailed("MakeCompound", self.ShapesOp)
1505 # end of l3_advanced
1508 ## @addtogroup l2_measure
1511 ## Gives quantity of faces in the given shape.
1512 # @param theShape Shape to count faces of.
1513 # @return Quantity of faces.
1515 # @ref swig_NumberOf "Example"
1516 def NumberOfFaces(self, theShape):
1517 # Example: see GEOM_TestOthers.py
1518 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
1519 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
1522 ## Gives quantity of edges in the given shape.
1523 # @param theShape Shape to count edges of.
1524 # @return Quantity of edges.
1526 # @ref swig_NumberOf "Example"
1527 def NumberOfEdges(self, theShape):
1528 # Example: see GEOM_TestOthers.py
1529 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
1530 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
1533 ## Gives quantity of subshapes of type theShapeType in the given shape.
1534 # @param theShape Shape to count subshapes of.
1535 # @param theShapeType Type of subshapes to count.
1536 # @return Quantity of subshapes of given type.
1538 # @ref swig_NumberOf "Example"
1539 def NumberOfSubShapes(self, theShape, theShapeType):
1540 # Example: see GEOM_TestOthers.py
1541 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
1542 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
1545 ## Gives quantity of solids in the given shape.
1546 # @param theShape Shape to count solids in.
1547 # @return Quantity of solids.
1549 # @ref swig_NumberOf "Example"
1550 def NumberOfSolids(self, theShape):
1551 # Example: see GEOM_TestOthers.py
1552 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, ShapeType["SOLID"])
1553 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
1559 ## @addtogroup l3_healing
1562 ## Reverses an orientation the given shape.
1563 # @param theShape Shape to be reversed.
1564 # @return The reversed copy of theShape.
1566 # @ref swig_ChangeOrientation "Example"
1567 def ChangeOrientation(self,theShape):
1568 # Example: see GEOM_TestAll.py
1569 anObj = self.ShapesOp.ChangeOrientation(theShape)
1570 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
1573 ## Shortcut to ChangeOrientation()
1575 # @ref swig_OrientationChange "Example"
1576 def OrientationChange(self,theShape):
1577 # Example: see GEOM_TestOthers.py
1578 anObj = self.ChangeOrientation(theShape)
1584 ## @addtogroup l4_obtain
1587 ## Retrieve all free faces from the given shape.
1588 # Free face is a face, which is not shared between two shells of the shape.
1589 # @param theShape Shape to find free faces in.
1590 # @return List of IDs of all free faces, contained in theShape.
1592 # @ref tui_measurement_tools_page "Example"
1593 def GetFreeFacesIDs(self,theShape):
1594 # Example: see GEOM_TestOthers.py
1595 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
1596 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
1599 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
1600 # @param theShape1 Shape to find sub-shapes in.
1601 # @param theShape2 Shape to find shared sub-shapes with.
1602 # @param theShapeType Type of sub-shapes to be retrieved.
1603 # @return List of sub-shapes of theShape1, shared with theShape2.
1605 # @ref swig_GetSharedShapes "Example"
1606 def GetSharedShapes(self,theShape1, theShape2, theShapeType):
1607 # Example: see GEOM_TestOthers.py
1608 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
1609 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
1612 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
1613 # situated relatively the specified plane by the certain way,
1614 # defined through <VAR>theState</VAR> parameter.
1615 # @param theShape Shape to find sub-shapes of.
1616 # @param theShapeType Type of sub-shapes to be retrieved.
1617 # @param theAx1 Vector (or line, or linear edge), specifying normal
1618 # direction and location of the plane to find shapes on.
1619 # @param theState The state of the subshapes to find. It can be one of
1620 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1621 # @return List of all found sub-shapes.
1623 # @ref swig_GetShapesOnPlane "Example"
1624 def GetShapesOnPlane(self,theShape, theShapeType, theAx1, theState):
1625 # Example: see GEOM_TestOthers.py
1626 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
1627 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
1630 ## Works like the above method, but returns list of sub-shapes indices
1632 # @ref swig_GetShapesOnPlaneIDs "Example"
1633 def GetShapesOnPlaneIDs(self,theShape, theShapeType, theAx1, theState):
1634 # Example: see GEOM_TestOthers.py
1635 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
1636 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
1639 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
1640 # situated relatively the specified plane by the certain way,
1641 # defined through <VAR>theState</VAR> parameter.
1642 # @param theShape Shape to find sub-shapes of.
1643 # @param theShapeType Type of sub-shapes to be retrieved.
1644 # @param theAx1 Vector (or line, or linear edge), specifying normal
1645 # direction of the plane to find shapes on.
1646 # @param thePnt Point specifying location of the plane to find shapes on.
1647 # @param theState The state of the subshapes to find. It can be one of
1648 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1649 # @return List of all found sub-shapes.
1651 # @ref swig_GetShapesOnPlaneWithLocation "Example"
1652 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState):
1653 # Example: see GEOM_TestOthers.py
1654 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
1655 theAx1, thePnt, theState)
1656 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
1659 ## Works like the above method, but returns list of sub-shapes indices
1661 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
1662 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
1663 # Example: see GEOM_TestOthers.py
1664 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
1665 theAx1, thePnt, theState)
1666 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
1669 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1670 # the specified cylinder by the certain way, defined through \a theState parameter.
1671 # @param theShape Shape to find sub-shapes of.
1672 # @param theShapeType Type of sub-shapes to be retrieved.
1673 # @param theAxis Vector (or line, or linear edge), specifying
1674 # axis of the cylinder to find shapes on.
1675 # @param theRadius Radius of the cylinder to find shapes on.
1676 # @param theState The state of the subshapes to find. It can be one of
1677 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1678 # @return List of all found sub-shapes.
1680 # @ref swig_GetShapesOnCylinder "Example"
1681 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState):
1682 # Example: see GEOM_TestOthers.py
1683 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
1684 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
1687 ## Works like the above method, but returns list of sub-shapes indices
1689 # @ref swig_GetShapesOnCylinderIDs "Example"
1690 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
1691 # Example: see GEOM_TestOthers.py
1692 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
1693 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
1696 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1697 # the specified sphere by the certain way, defined through \a theState parameter.
1698 # @param theShape Shape to find sub-shapes of.
1699 # @param theShapeType Type of sub-shapes to be retrieved.
1700 # @param theCenter Point, specifying center of the sphere to find shapes on.
1701 # @param theRadius Radius of the sphere to find shapes on.
1702 # @param theState The state of the subshapes to find. It can be one of
1703 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1704 # @return List of all found sub-shapes.
1706 # @ref swig_GetShapesOnSphere "Example"
1707 def GetShapesOnSphere(self,theShape, theShapeType, theCenter, theRadius, theState):
1708 # Example: see GEOM_TestOthers.py
1709 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
1710 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
1713 ## Works like the above method, but returns list of sub-shapes indices
1715 # @ref swig_GetShapesOnSphereIDs "Example"
1716 def GetShapesOnSphereIDs(self,theShape, theShapeType, theCenter, theRadius, theState):
1717 # Example: see GEOM_TestOthers.py
1718 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
1719 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
1722 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1723 # the specified quadrangle by the certain way, defined through \a theState parameter.
1724 # @param theShape Shape to find sub-shapes of.
1725 # @param theShapeType Type of sub-shapes to be retrieved.
1726 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
1727 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
1728 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
1729 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
1730 # @param theState The state of the subshapes to find. It can be one of
1731 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1732 # @return List of all found sub-shapes.
1734 # @ref swig_GetShapesOnQuadrangle "Example"
1735 def GetShapesOnQuadrangle(self, theShape, theShapeType,
1736 theTopLeftPoint, theTopRigthPoint,
1737 theBottomLeftPoint, theBottomRigthPoint, theState):
1738 # Example: see GEOM_TestOthers.py
1739 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
1740 theTopLeftPoint, theTopRigthPoint,
1741 theBottomLeftPoint, theBottomRigthPoint, theState)
1742 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
1745 ## Works like the above method, but returns list of sub-shapes indices
1747 # @ref swig_GetShapesOnQuadrangleIDs "Example"
1748 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
1749 theTopLeftPoint, theTopRigthPoint,
1750 theBottomLeftPoint, theBottomRigthPoint, theState):
1751 # Example: see GEOM_TestOthers.py
1752 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
1753 theTopLeftPoint, theTopRigthPoint,
1754 theBottomLeftPoint, theBottomRigthPoint, theState)
1755 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
1758 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1759 # the specified \a theBox by the certain way, defined through \a theState parameter.
1760 # @param theBox Shape for relative comparing.
1761 # @param theShape Shape to find sub-shapes of.
1762 # @param theShapeType Type of sub-shapes to be retrieved.
1763 # @param theState The state of the subshapes to find. It can be one of
1764 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1765 # @return List of all found sub-shapes.
1767 # @ref swig_GetShapesOnBox "Example"
1768 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState):
1769 # Example: see GEOM_TestOthers.py
1770 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
1771 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
1774 ## Works like the above method, but returns list of sub-shapes indices
1776 # @ref swig_GetShapesOnBoxIDs "Example"
1777 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
1778 # Example: see GEOM_TestOthers.py
1779 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
1780 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
1783 ## Find in \a theShape all sub-shapes of type \a theShapeType,
1784 # situated relatively the specified \a theCheckShape by the
1785 # certain way, defined through \a theState parameter.
1786 # @param theCheckShape Shape for relative comparing.
1787 # @param theShape Shape to find sub-shapes of.
1788 # @param theShapeType Type of sub-shapes to be retrieved.
1789 # @param theState The state of the subshapes to find. It can be one of
1790 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1791 # @return List of all found sub-shapes.
1793 # @ref swig_GetShapesOnShape "Example"
1794 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState):
1795 # Example: see GEOM_TestOthers.py
1796 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
1797 theShapeType, theState)
1798 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
1801 ## Works like the above method, but returns result as compound
1803 # @ref swig_GetShapesOnShapeAsCompound "Example"
1804 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState):
1805 # Example: see GEOM_TestOthers.py
1806 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
1807 theShapeType, theState)
1808 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
1811 ## Works like the above method, but returns list of sub-shapes indices
1813 # @ref swig_GetShapesOnShapeIDs "Example"
1814 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
1815 # Example: see GEOM_TestOthers.py
1816 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
1817 theShapeType, theState)
1818 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
1821 ## Get sub-shape(s) of theShapeWhere, which are
1822 # coincident with \a theShapeWhat or could be a part of it.
1823 # @param theShapeWhere Shape to find sub-shapes of.
1824 # @param theShapeWhat Shape, specifying what to find.
1825 # @return Group of all found sub-shapes or a single found sub-shape.
1827 # @ref swig_GetInPlace "Example"
1828 def GetInPlace(self,theShapeWhere, theShapeWhat):
1829 # Example: see GEOM_TestOthers.py
1830 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
1831 RaiseIfFailed("GetInPlace", self.ShapesOp)
1834 ## Get sub-shape(s) of \a theShapeWhere, which are
1835 # coincident with \a theShapeWhat or could be a part of it.
1837 # Implementation of this method is based on a saved history of an operation,
1838 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
1839 # arguments (an argument shape or a sub-shape of an argument shape).
1840 # The operation could be the Partition or one of boolean operations,
1841 # performed on simple shapes (not on compounds).
1843 # @param theShapeWhere Shape to find sub-shapes of.
1844 # @param theShapeWhat Shape, specifying what to find (must be in the
1845 # building history of the ShapeWhere).
1846 # @return Group of all found sub-shapes or a single found sub-shape.
1848 # @ref swig_GetInPlace "Example"
1849 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat):
1850 # Example: see GEOM_TestOthers.py
1851 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
1852 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
1855 ## Get sub-shape of theShapeWhere, which is
1856 # equal to \a theShapeWhat.
1857 # @param theShapeWhere Shape to find sub-shape of.
1858 # @param theShapeWhat Shape, specifying what to find.
1859 # @return New GEOM_Object for found sub-shape.
1861 # @ref swig_GetSame "Example"
1862 def GetSame(self,theShapeWhere, theShapeWhat):
1863 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
1864 RaiseIfFailed("GetSame", self.ShapesOp)
1870 ## @addtogroup l4_access
1873 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
1874 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
1876 # @ref swig_all_decompose "Example"
1877 def GetSubShape(self, aShape, ListOfID):
1878 # Example: see GEOM_TestAll.py
1879 anObj = self.AddSubShape(aShape,ListOfID)
1882 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
1884 # @ref swig_all_decompose "Example"
1885 def GetSubShapeID(self, aShape, aSubShape):
1886 # Example: see GEOM_TestAll.py
1887 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
1888 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
1894 ## @addtogroup l4_decompose
1897 ## Explode a shape on subshapes of a given type.
1898 # @param aShape Shape to be exploded.
1899 # @param aType Type of sub-shapes to be retrieved.
1900 # @return List of sub-shapes of type theShapeType, contained in theShape.
1902 # @ref swig_all_decompose "Example"
1903 def SubShapeAll(self, aShape, aType):
1904 # Example: see GEOM_TestAll.py
1905 ListObj = self.ShapesOp.MakeExplode(aShape,aType,0)
1906 RaiseIfFailed("MakeExplode", self.ShapesOp)
1909 ## Explode a shape on subshapes of a given type.
1910 # @param aShape Shape to be exploded.
1911 # @param aType Type of sub-shapes to be retrieved.
1912 # @return List of IDs of sub-shapes.
1914 # @ref swig_all_decompose "Example"
1915 def SubShapeAllIDs(self, aShape, aType):
1916 ListObj = self.ShapesOp.SubShapeAllIDs(aShape,aType,0)
1917 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
1920 ## Explode a shape on subshapes of a given type.
1921 # Sub-shapes will be sorted by coordinates of their gravity centers.
1922 # @param aShape Shape to be exploded.
1923 # @param aType Type of sub-shapes to be retrieved.
1924 # @return List of sub-shapes of type theShapeType, contained in theShape.
1926 # @ref swig_SubShapeAllSorted "Example"
1927 def SubShapeAllSorted(self, aShape, aType):
1928 # Example: see GEOM_TestAll.py
1929 ListObj = self.ShapesOp.MakeExplode(aShape,aType,1)
1930 RaiseIfFailed("MakeExplode", self.ShapesOp)
1933 ## Explode a shape on subshapes of a given type.
1934 # Sub-shapes will be sorted by coordinates of their gravity centers.
1935 # @param aShape Shape to be exploded.
1936 # @param aType Type of sub-shapes to be retrieved.
1937 # @return List of IDs of sub-shapes.
1939 # @ref swig_all_decompose "Example"
1940 def SubShapeAllSortedIDs(self, aShape, aType):
1941 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape,aType,1)
1942 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
1945 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
1946 # selected by they indices in list of all sub-shapes of type <VAR>aType</VAR>.
1947 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
1949 # @ref swig_all_decompose "Example"
1950 def SubShape(self, aShape, aType, ListOfInd):
1951 # Example: see GEOM_TestAll.py
1953 AllShapeList = self.SubShapeAll(aShape, aType)
1954 for ind in ListOfInd:
1955 ListOfIDs.append(self.GetSubShapeID(aShape, AllShapeList[ind - 1]))
1956 anObj = self.GetSubShape(aShape, ListOfIDs)
1959 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
1960 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
1961 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
1963 # @ref swig_all_decompose "Example"
1964 def SubShapeSorted(self,aShape, aType, ListOfInd):
1965 # Example: see GEOM_TestAll.py
1967 AllShapeList = self.SubShapeAllSorted(aShape, aType)
1968 for ind in ListOfInd:
1969 ListOfIDs.append(self.GetSubShapeID(aShape, AllShapeList[ind - 1]))
1970 anObj = self.GetSubShape(aShape, ListOfIDs)
1973 # end of l4_decompose
1976 ## @addtogroup l3_healing
1979 ## Apply a sequence of Shape Healing operators to the given object.
1980 # @param theShape Shape to be processed.
1981 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
1982 # @param theParameters List of names of parameters
1983 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
1984 # @param theValues List of values of parameters, in the same order
1985 # as parameters are listed in <VAR>theParameters</VAR> list.
1986 # @return New GEOM_Object, containing processed shape.
1988 # @ref tui_shape_processing "Example"
1989 def ProcessShape(self,theShape, theOperators, theParameters, theValues):
1990 # Example: see GEOM_TestHealing.py
1991 theValues,Parameters = ParseList(theValues)
1992 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
1993 RaiseIfFailed("ProcessShape", self.HealOp)
1994 for string in (theOperators + theParameters):
1995 Parameters = ":" + Parameters
1997 anObj.SetParameters(Parameters)
2000 ## Remove faces from the given object (shape).
2001 # @param theObject Shape to be processed.
2002 # @param theFaces Indices of faces to be removed, if EMPTY then the method
2003 # removes ALL faces of the given object.
2004 # @return New GEOM_Object, containing processed shape.
2006 # @ref tui_suppress_faces "Example"
2007 def SuppressFaces(self,theObject, theFaces):
2008 # Example: see GEOM_TestHealing.py
2009 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
2010 RaiseIfFailed("SuppressFaces", self.HealOp)
2013 ## Sewing of some shapes into single shape.
2015 # @ref tui_sewing "Example"
2016 def MakeSewing(self, ListShape, theTolerance):
2017 # Example: see GEOM_TestHealing.py
2018 comp = self.MakeCompound(ListShape)
2019 anObj = self.Sew(comp, theTolerance)
2022 ## Sewing of the given object.
2023 # @param theObject Shape to be processed.
2024 # @param theTolerance Required tolerance value.
2025 # @return New GEOM_Object, containing processed shape.
2026 def Sew(self, theObject, theTolerance):
2027 # Example: see MakeSewing() above
2028 theTolerance,Parameters = ParseParameters(theTolerance)
2029 anObj = self.HealOp.Sew(theObject, theTolerance)
2030 RaiseIfFailed("Sew", self.HealOp)
2031 anObj.SetParameters(Parameters)
2034 ## Remove internal wires and edges from the given object (face).
2035 # @param theObject Shape to be processed.
2036 # @param theWires Indices of wires to be removed, if EMPTY then the method
2037 # removes ALL internal wires of the given object.
2038 # @return New GEOM_Object, containing processed shape.
2040 # @ref tui_suppress_internal_wires "Example"
2041 def SuppressInternalWires(self,theObject, theWires):
2042 # Example: see GEOM_TestHealing.py
2043 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
2044 RaiseIfFailed("RemoveIntWires", self.HealOp)
2047 ## Remove internal closed contours (holes) from the given object.
2048 # @param theObject Shape to be processed.
2049 # @param theWires Indices of wires to be removed, if EMPTY then the method
2050 # removes ALL internal holes of the given object
2051 # @return New GEOM_Object, containing processed shape.
2053 # @ref tui_suppress_holes "Example"
2054 def SuppressHoles(self,theObject, theWires):
2055 # Example: see GEOM_TestHealing.py
2056 anObj = self.HealOp.FillHoles(theObject, theWires)
2057 RaiseIfFailed("FillHoles", self.HealOp)
2060 ## Close an open wire.
2061 # @param theObject Shape to be processed.
2062 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
2063 # if -1, then <VAR>theObject</VAR> itself is a wire.
2064 # @param isCommonVertex If TRUE : closure by creation of a common vertex,
2065 # If FALS : closure by creation of an edge between ends.
2066 # @return New GEOM_Object, containing processed shape.
2068 # @ref tui_close_contour "Example"
2069 def CloseContour(self,theObject, theWires, isCommonVertex):
2070 # Example: see GEOM_TestHealing.py
2071 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
2072 RaiseIfFailed("CloseContour", self.HealOp)
2075 ## Addition of a point to a given edge object.
2076 # @param theObject Shape to be processed.
2077 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
2078 # if -1, then theObject itself is the edge.
2079 # @param theValue Value of parameter on edge or length parameter,
2080 # depending on \a isByParameter.
2081 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1],
2082 # if FALSE : \a theValue is treated as a length parameter [0..1]
2083 # @return New GEOM_Object, containing processed shape.
2085 # @ref tui_add_point_on_edge "Example"
2086 def DivideEdge(self,theObject, theEdgeIndex, theValue, isByParameter):
2087 # Example: see GEOM_TestHealing.py
2088 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
2089 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
2090 RaiseIfFailed("DivideEdge", self.HealOp)
2091 anObj.SetParameters(Parameters)
2094 ## Change orientation of the given object. Updates given shape.
2095 # @param theObject Shape to be processed.
2097 # @ref swig_todo "Example"
2098 def ChangeOrientationShell(self,theObject):
2099 theObject = self.HealOp.ChangeOrientation(theObject)
2100 RaiseIfFailed("ChangeOrientation", self.HealOp)
2103 ## Change orientation of the given object.
2104 # @param theObject Shape to be processed.
2105 # @return New GEOM_Object, containing processed shape.
2107 # @ref swig_todo "Example"
2108 def ChangeOrientationShellCopy(self,theObject):
2109 anObj = self.HealOp.ChangeOrientationCopy(theObject)
2110 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
2113 ## Get a list of wires (wrapped in GEOM_Object-s),
2114 # that constitute a free boundary of the given shape.
2115 # @param theObject Shape to get free boundary of.
2116 # @return [status, theClosedWires, theOpenWires]
2117 # status: FALSE, if an error(s) occured during the method execution.
2118 # theClosedWires: Closed wires on the free boundary of the given shape.
2119 # theOpenWires: Open wires on the free boundary of the given shape.
2121 # @ref tui_measurement_tools_page "Example"
2122 def GetFreeBoundary(self,theObject):
2123 # Example: see GEOM_TestHealing.py
2124 anObj = self.HealOp.GetFreeBoundary(theObject)
2125 RaiseIfFailed("GetFreeBoundary", self.HealOp)
2128 ## Replace coincident faces in theShape by one face.
2129 # @param theShape Initial shape.
2130 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
2131 # @param doKeepNonSolids If FALSE, only solids will present in the result,
2132 # otherwise all initial shapes.
2133 # @return New GEOM_Object, containing a copy of theShape without coincident faces.
2135 # @ref tui_glue_faces "Example"
2136 def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True):
2137 # Example: see GEOM_Spanner.py
2138 theTolerance,Parameters = ParseParameters(theTolerance)
2139 anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
2141 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
2142 anObj.SetParameters(Parameters)
2145 ## Find coincident faces in theShape for possible gluing.
2146 # @param theShape Initial shape.
2147 # @param theTolerance Maximum distance between faces,
2148 # which can be considered as coincident.
2151 # @ref swig_todo "Example"
2152 def GetGlueFaces(self, theShape, theTolerance):
2153 # Example: see GEOM_Spanner.py
2154 anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
2155 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
2158 ## Replace coincident faces in theShape by one face
2159 # in compliance with given list of faces
2160 # @param theShape Initial shape.
2161 # @param theTolerance Maximum distance between faces,
2162 # which can be considered as coincident.
2163 # @param theFaces List of faces for gluing.
2164 # @param doKeepNonSolids If FALSE, only solids will present in the result,
2165 # otherwise all initial shapes.
2166 # @return New GEOM_Object, containing a copy of theShape
2167 # without some faces.
2169 # @ref swig_todo "Example"
2170 def MakeGlueFacesByList(self, theShape, theTolerance, theFaces, doKeepNonSolids=True):
2171 # Example: see GEOM_Spanner.py
2172 anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces, doKeepNonSolids)
2174 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
2180 ## @addtogroup l3_boolean Boolean Operations
2183 # -----------------------------------------------------------------------------
2184 # Boolean (Common, Cut, Fuse, Section)
2185 # -----------------------------------------------------------------------------
2187 ## Perform one of boolean operations on two given shapes.
2188 # @param theShape1 First argument for boolean operation.
2189 # @param theShape2 Second argument for boolean operation.
2190 # @param theOperation Indicates the operation to be done:
2191 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
2192 # @return New GEOM_Object, containing the result shape.
2194 # @ref tui_fuse "Example"
2195 def MakeBoolean(self,theShape1, theShape2, theOperation):
2196 # Example: see GEOM_TestAll.py
2197 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation)
2198 RaiseIfFailed("MakeBoolean", self.BoolOp)
2201 ## Shortcut to MakeBoolean(s1, s2, 1)
2203 # @ref tui_common "Example 1"
2204 # \n @ref swig_MakeCommon "Example 2"
2205 def MakeCommon(self, s1, s2):
2206 # Example: see GEOM_TestOthers.py
2207 return self.MakeBoolean(s1, s2, 1)
2209 ## Shortcut to MakeBoolean(s1, s2, 2)
2211 # @ref tui_cut "Example 1"
2212 # \n @ref swig_MakeCommon "Example 2"
2213 def MakeCut(self, s1, s2):
2214 # Example: see GEOM_TestOthers.py
2215 return self.MakeBoolean(s1, s2, 2)
2217 ## Shortcut to MakeBoolean(s1, s2, 3)
2219 # @ref tui_fuse "Example 1"
2220 # \n @ref swig_MakeCommon "Example 2"
2221 def MakeFuse(self, s1, s2):
2222 # Example: see GEOM_TestOthers.py
2223 return self.MakeBoolean(s1, s2, 3)
2225 ## Shortcut to MakeBoolean(s1, s2, 4)
2227 # @ref tui_section "Example 1"
2228 # \n @ref swig_MakeCommon "Example 2"
2229 def MakeSection(self, s1, s2):
2230 # Example: see GEOM_TestOthers.py
2231 return self.MakeBoolean(s1, s2, 4)
2236 ## @addtogroup l3_basic_op
2239 ## Perform partition operation.
2240 # @param ListShapes Shapes to be intersected.
2241 # @param ListTools Shapes to intersect theShapes.
2242 # !!!NOTE: Each compound from ListShapes and ListTools will be exploded
2243 # in order to avoid possible intersection between shapes from
2245 # @param Limit Type of resulting shapes (corresponding to TopAbs_ShapeEnum).
2246 # @param KeepNonlimitShapes: if this parameter == 0 - only shapes with
2247 # type <= Limit are kept in the result,
2248 # else - shapes with type > Limit are kept
2249 # also (if they exist)
2251 # After implementation new version of PartitionAlgo (October 2006)
2252 # other parameters are ignored by current functionality. They are kept
2253 # in this function only for support old versions.
2254 # Ignored parameters:
2255 # @param ListKeepInside Shapes, outside which the results will be deleted.
2256 # Each shape from theKeepInside must belong to theShapes also.
2257 # @param ListRemoveInside Shapes, inside which the results will be deleted.
2258 # Each shape from theRemoveInside must belong to theShapes also.
2259 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
2260 # @param ListMaterials Material indices for each shape. Make sence,
2261 # only if theRemoveWebs is TRUE.
2263 # @return New GEOM_Object, containing the result shapes.
2265 # @ref tui_partition "Example"
2266 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
2267 Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
2268 KeepNonlimitShapes=0):
2269 # Example: see GEOM_TestAll.py
2270 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
2271 ListKeepInside, ListRemoveInside,
2272 Limit, RemoveWebs, ListMaterials,
2273 KeepNonlimitShapes);
2274 RaiseIfFailed("MakePartition", self.BoolOp)
2277 ## Perform partition operation.
2278 # This method may be useful if it is needed to make a partition for
2279 # compound contains nonintersected shapes. Performance will be better
2280 # since intersection between shapes from compound is not performed.
2282 # Description of all parameters as in previous method MakePartition()
2284 # !!!NOTE: Passed compounds (via ListShapes or via ListTools)
2285 # have to consist of nonintersecting shapes.
2287 # @return New GEOM_Object, containing the result shapes.
2289 # @ref swig_todo "Example"
2290 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
2291 ListKeepInside=[], ListRemoveInside=[],
2292 Limit=ShapeType["SHAPE"], RemoveWebs=0,
2293 ListMaterials=[], KeepNonlimitShapes=0):
2294 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
2295 ListKeepInside, ListRemoveInside,
2296 Limit, RemoveWebs, ListMaterials,
2297 KeepNonlimitShapes);
2298 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
2301 ## Shortcut to MakePartition()
2303 # @ref tui_partition "Example 1"
2304 # \n @ref swig_Partition "Example 2"
2305 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
2306 Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
2307 KeepNonlimitShapes=0):
2308 # Example: see GEOM_TestOthers.py
2309 anObj = self.MakePartition(ListShapes, ListTools,
2310 ListKeepInside, ListRemoveInside,
2311 Limit, RemoveWebs, ListMaterials,
2312 KeepNonlimitShapes);
2315 ## Perform partition of the Shape with the Plane
2316 # @param theShape Shape to be intersected.
2317 # @param thePlane Tool shape, to intersect theShape.
2318 # @return New GEOM_Object, containing the result shape.
2320 # @ref tui_partition "Example"
2321 def MakeHalfPartition(self,theShape, thePlane):
2322 # Example: see GEOM_TestAll.py
2323 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
2324 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
2327 # end of l3_basic_op
2330 ## @addtogroup l3_transform
2333 ## Translate the given object along the vector, specified
2334 # by its end points, creating its copy before the translation.
2335 # @param theObject The object to be translated.
2336 # @param thePoint1 Start point of translation vector.
2337 # @param thePoint2 End point of translation vector.
2338 # @return New GEOM_Object, containing the translated object.
2340 # @ref tui_translation "Example 1"
2341 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
2342 def MakeTranslationTwoPoints(self,theObject, thePoint1, thePoint2):
2343 # Example: see GEOM_TestAll.py
2344 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
2345 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
2348 ## Translate the given object along the vector, specified by its components.
2349 # @param theObject The object to be translated.
2350 # @param theDX,theDY,theDZ Components of translation vector.
2351 # @return Translated GEOM_Object.
2353 # @ref tui_translation "Example"
2354 def TranslateDXDYDZ(self,theObject, theDX, theDY, theDZ):
2355 # Example: see GEOM_TestAll.py
2356 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
2357 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
2358 anObj.SetParameters(Parameters)
2359 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
2362 ## Translate the given object along the vector, specified
2363 # by its components, creating its copy before the translation.
2364 # @param theObject The object to be translated.
2365 # @param theDX,theDY,theDZ Components of translation vector.
2366 # @return New GEOM_Object, containing the translated object.
2368 # @ref tui_translation "Example"
2369 def MakeTranslation(self,theObject, theDX, theDY, theDZ):
2370 # Example: see GEOM_TestAll.py
2371 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
2372 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
2373 anObj.SetParameters(Parameters)
2374 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
2377 ## Translate the given object along the given vector,
2378 # creating its copy before the translation.
2379 # @param theObject The object to be translated.
2380 # @param theVector The translation vector.
2381 # @return New GEOM_Object, containing the translated object.
2383 # @ref tui_translation "Example"
2384 def MakeTranslationVector(self,theObject, theVector):
2385 # Example: see GEOM_TestAll.py
2386 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
2387 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
2390 ## Translate the given object along the given vector on given distance.
2391 # @param theObject The object to be translated.
2392 # @param theVector The translation vector.
2393 # @param theDistance The translation distance.
2394 # @param theCopy Flag used to translate object itself or create a copy.
2395 # @return Translated GEOM_Object.
2397 # @ref tui_translation "Example"
2398 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy):
2399 # Example: see GEOM_TestAll.py
2400 theDistance,Parameters = ParseParameters(theDistance)
2401 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
2402 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
2403 anObj.SetParameters(Parameters)
2406 ## Translate the given object along the given vector on given distance,
2407 # creating its copy before the translation.
2408 # @param theObject The object to be translated.
2409 # @param theVector The translation vector.
2410 # @param theDistance The translation distance.
2411 # @return New GEOM_Object, containing the translated object.
2413 # @ref tui_translation "Example"
2414 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance):
2415 # Example: see GEOM_TestAll.py
2416 theDistance,Parameters = ParseParameters(theDistance)
2417 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
2418 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
2419 anObj.SetParameters(Parameters)
2422 ## Rotate the given object around the given axis on the given angle.
2423 # @param theObject The object to be rotated.
2424 # @param theAxis Rotation axis.
2425 # @param theAngle Rotation angle in radians.
2426 # @return Rotated GEOM_Object.
2428 # @ref tui_rotation "Example"
2429 def Rotate(self,theObject, theAxis, theAngle):
2430 # Example: see GEOM_TestAll.py
2432 if isinstance(theAngle,str):
2434 theAngle, Parameters = ParseParameters(theAngle)
2436 theAngle = theAngle*math.pi/180.0
2437 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
2438 RaiseIfFailed("RotateCopy", self.TrsfOp)
2439 anObj.SetParameters(Parameters)
2442 ## Rotate the given object around the given axis
2443 # on the given angle, creating its copy before the rotatation.
2444 # @param theObject The object to be rotated.
2445 # @param theAxis Rotation axis.
2446 # @param theAngle Rotation angle in radians.
2447 # @return New GEOM_Object, containing the rotated object.
2449 # @ref tui_rotation "Example"
2450 def MakeRotation(self,theObject, theAxis, theAngle):
2451 # Example: see GEOM_TestAll.py
2453 if isinstance(theAngle,str):
2455 theAngle, Parameters = ParseParameters(theAngle)
2457 theAngle = theAngle*math.pi/180.0
2458 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
2459 RaiseIfFailed("RotateCopy", self.TrsfOp)
2460 anObj.SetParameters(Parameters)
2463 ## Rotate given object around vector perpendicular to plane
2464 # containing three points, creating its copy before the rotatation.
2465 # @param theObject The object to be rotated.
2466 # @param theCentPoint central point - the axis is the vector perpendicular to the plane
2467 # containing the three points.
2468 # @param thePoint1,thePoint2 - in a perpendicular plane of the axis.
2469 # @return New GEOM_Object, containing the rotated object.
2471 # @ref tui_rotation "Example"
2472 def MakeRotationThreePoints(self,theObject, theCentPoint, thePoint1, thePoint2):
2473 # Example: see GEOM_TestAll.py
2474 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
2475 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
2478 ## Scale the given object by the factor, creating its copy before the scaling.
2479 # @param theObject The object to be scaled.
2480 # @param thePoint Center point for scaling.
2481 # Passing None for it means scaling relatively the origin of global CS.
2482 # @param theFactor Scaling factor value.
2483 # @return New GEOM_Object, containing the scaled shape.
2485 # @ref tui_scale "Example"
2486 def MakeScaleTransform(self, theObject, thePoint, theFactor):
2487 # Example: see GEOM_TestAll.py
2488 theFactor, Parameters = ParseParameters(theFactor)
2489 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
2490 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
2491 anObj.SetParameters(Parameters)
2494 ## Scale the given object by different factors along coordinate axes,
2495 # creating its copy before the scaling.
2496 # @param theObject The object to be scaled.
2497 # @param thePoint Center point for scaling.
2498 # Passing None for it means scaling relatively the origin of global CS.
2499 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
2500 # @return New GEOM_Object, containing the scaled shape.
2502 # @ref swig_scale "Example"
2503 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ):
2504 # Example: see GEOM_TestAll.py
2505 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
2506 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
2507 theFactorX, theFactorY, theFactorZ)
2508 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
2509 anObj.SetParameters(Parameters)
2512 ## Create an object, symmetrical
2513 # to the given one relatively the given plane.
2514 # @param theObject The object to be mirrored.
2515 # @param thePlane Plane of symmetry.
2516 # @return New GEOM_Object, containing the mirrored shape.
2518 # @ref tui_mirror "Example"
2519 def MakeMirrorByPlane(self,theObject, thePlane):
2520 # Example: see GEOM_TestAll.py
2521 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
2522 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
2525 ## Create an object, symmetrical
2526 # to the given one relatively the given axis.
2527 # @param theObject The object to be mirrored.
2528 # @param theAxis Axis of symmetry.
2529 # @return New GEOM_Object, containing the mirrored shape.
2531 # @ref tui_mirror "Example"
2532 def MakeMirrorByAxis(self,theObject, theAxis):
2533 # Example: see GEOM_TestAll.py
2534 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
2535 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
2538 ## Create an object, symmetrical
2539 # to the given one relatively the given point.
2540 # @param theObject The object to be mirrored.
2541 # @param thePoint Point of symmetry.
2542 # @return New GEOM_Object, containing the mirrored shape.
2544 # @ref tui_mirror "Example"
2545 def MakeMirrorByPoint(self,theObject, thePoint):
2546 # Example: see GEOM_TestAll.py
2547 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
2548 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
2551 ## Modify the Location of the given object by LCS,
2552 # creating its copy before the setting.
2553 # @param theObject The object to be displaced.
2554 # @param theStartLCS Coordinate system to perform displacement from it.
2555 # If \a theStartLCS is NULL, displacement
2556 # will be performed from global CS.
2557 # If \a theObject itself is used as \a theStartLCS,
2558 # its location will be changed to \a theEndLCS.
2559 # @param theEndLCS Coordinate system to perform displacement to it.
2560 # @return New GEOM_Object, containing the displaced shape.
2562 # @ref tui_modify_location "Example"
2563 def MakePosition(self,theObject, theStartLCS, theEndLCS):
2564 # Example: see GEOM_TestAll.py
2565 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
2566 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
2569 ## Modify the Location of the given object by Path,
2570 # @param theObject The object to be displaced.
2571 # @param thePath Wire or Edge along that the object will be translated.
2572 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
2573 # @param theCopy is to create a copy objects if true.
2574 # @param theReverse - 0 for usual direction, 1 to reverse path direction.
2575 # @return New GEOM_Object, containing the displaced shape.
2577 # @ref tui_modify_location "Example"
2578 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
2579 # Example: see GEOM_TestAll.py
2580 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
2581 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
2584 ## Create new object as offset of the given one.
2585 # @param theObject The base object for the offset.
2586 # @param theOffset Offset value.
2587 # @return New GEOM_Object, containing the offset object.
2589 # @ref tui_offset "Example"
2590 def MakeOffset(self,theObject, theOffset):
2591 # Example: see GEOM_TestAll.py
2592 theOffset, Parameters = ParseParameters(theOffset)
2593 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
2594 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
2595 anObj.SetParameters(Parameters)
2598 # -----------------------------------------------------------------------------
2600 # -----------------------------------------------------------------------------
2602 ## Translate the given object along the given vector a given number times
2603 # @param theObject The object to be translated.
2604 # @param theVector Direction of the translation.
2605 # @param theStep Distance to translate on.
2606 # @param theNbTimes Quantity of translations to be done.
2607 # @return New GEOM_Object, containing compound of all
2608 # the shapes, obtained after each translation.
2610 # @ref tui_multi_translation "Example"
2611 def MakeMultiTranslation1D(self,theObject, theVector, theStep, theNbTimes):
2612 # Example: see GEOM_TestAll.py
2613 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
2614 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
2615 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
2616 anObj.SetParameters(Parameters)
2619 ## Conseqently apply two specified translations to theObject specified number of times.
2620 # @param theObject The object to be translated.
2621 # @param theVector1 Direction of the first translation.
2622 # @param theStep1 Step of the first translation.
2623 # @param theNbTimes1 Quantity of translations to be done along theVector1.
2624 # @param theVector2 Direction of the second translation.
2625 # @param theStep2 Step of the second translation.
2626 # @param theNbTimes2 Quantity of translations to be done along theVector2.
2627 # @return New GEOM_Object, containing compound of all
2628 # the shapes, obtained after each translation.
2630 # @ref tui_multi_translation "Example"
2631 def MakeMultiTranslation2D(self,theObject, theVector1, theStep1, theNbTimes1,
2632 theVector2, theStep2, theNbTimes2):
2633 # Example: see GEOM_TestAll.py
2634 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
2635 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
2636 theVector2, theStep2, theNbTimes2)
2637 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
2638 anObj.SetParameters(Parameters)
2641 ## Rotate the given object around the given axis a given number times.
2642 # Rotation angle will be 2*PI/theNbTimes.
2643 # @param theObject The object to be rotated.
2644 # @param theAxis The rotation axis.
2645 # @param theNbTimes Quantity of rotations to be done.
2646 # @return New GEOM_Object, containing compound of all the
2647 # shapes, obtained after each rotation.
2649 # @ref tui_multi_rotation "Example"
2650 def MultiRotate1D(self,theObject, theAxis, theNbTimes):
2651 # Example: see GEOM_TestAll.py
2652 theAxis, theNbTimes, Parameters = ParseParameters(theAxis, theNbTimes)
2653 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
2654 RaiseIfFailed("MultiRotate1D", self.TrsfOp)
2655 anObj.SetParameters(Parameters)
2658 ## Rotate the given object around the
2659 # given axis on the given angle a given number
2660 # times and multi-translate each rotation result.
2661 # Translation direction passes through center of gravity
2662 # of rotated shape and its projection on the rotation axis.
2663 # @param theObject The object to be rotated.
2664 # @param theAxis Rotation axis.
2665 # @param theAngle Rotation angle in graduces.
2666 # @param theNbTimes1 Quantity of rotations to be done.
2667 # @param theStep Translation distance.
2668 # @param theNbTimes2 Quantity of translations to be done.
2669 # @return New GEOM_Object, containing compound of all the
2670 # shapes, obtained after each transformation.
2672 # @ref tui_multi_rotation "Example"
2673 def MultiRotate2D(self,theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2):
2674 # Example: see GEOM_TestAll.py
2675 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
2676 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
2677 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
2678 anObj.SetParameters(Parameters)
2681 ## The same, as MultiRotate1D(), but axis is given by direction and point
2682 # @ref swig_MakeMultiRotation "Example"
2683 def MakeMultiRotation1D(self,aShape,aDir,aPoint,aNbTimes):
2684 # Example: see GEOM_TestOthers.py
2685 aVec = self.MakeLine(aPoint,aDir)
2686 anObj = self.MultiRotate1D(aShape,aVec,aNbTimes)
2689 ## The same, as MultiRotate2D(), but axis is given by direction and point
2690 # @ref swig_MakeMultiRotation "Example"
2691 def MakeMultiRotation2D(self,aShape,aDir,aPoint,anAngle,nbtimes1,aStep,nbtimes2):
2692 # Example: see GEOM_TestOthers.py
2693 aVec = self.MakeLine(aPoint,aDir)
2694 anObj = self.MultiRotate2D(aShape,aVec,anAngle,nbtimes1,aStep,nbtimes2)
2697 # end of l3_transform
2700 ## @addtogroup l3_local
2703 ## Perform a fillet on all edges of the given shape.
2704 # @param theShape Shape, to perform fillet on.
2705 # @param theR Fillet radius.
2706 # @return New GEOM_Object, containing the result shape.
2708 # @ref tui_fillet "Example 1"
2709 # \n @ref swig_MakeFilletAll "Example 2"
2710 def MakeFilletAll(self,theShape, theR):
2711 # Example: see GEOM_TestOthers.py
2712 theR,Parameters = ParseParameters(theR)
2713 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
2714 RaiseIfFailed("MakeFilletAll", self.LocalOp)
2715 anObj.SetParameters(Parameters)
2718 ## Perform a fillet on the specified edges/faces of the given shape
2719 # @param theShape Shape, to perform fillet on.
2720 # @param theR Fillet radius.
2721 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR>.
2722 # @param theListShapes Global indices of edges/faces to perform fillet on.
2723 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2724 # @return New GEOM_Object, containing the result shape.
2726 # @ref tui_fillet "Example"
2727 def MakeFillet(self,theShape, theR, theShapeType, theListShapes):
2728 # Example: see GEOM_TestAll.py
2729 theR,Parameters = ParseParameters(theR)
2731 if theShapeType == ShapeType["EDGE"]:
2732 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
2733 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
2735 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
2736 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
2737 anObj.SetParameters(Parameters)
2740 ## The same that MakeFillet but with two Fillet Radius R1 and R2
2741 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes):
2742 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
2744 if theShapeType == ShapeType["EDGE"]:
2745 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
2746 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
2748 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
2749 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
2750 anObj.SetParameters(Parameters)
2753 ## Perform a fillet on the specified edges of the given wire shape
2754 # @param theShape - Wire Shape(with planar edges) to perform fillet on.
2755 # @param theR - Fillet radius.
2756 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
2757 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2758 # @return New GEOM_Object, containing the result shape.
2760 # @ref tui_fillet1d "Example"
2761 def MakeFillet1D(self,theShape, theR, theListOfVertexes):
2762 # Example: see GEOM_TestAll.py
2763 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes)
2764 RaiseIfFailed("MakeFillet1D", self.LocalOp)
2767 ## Perform a fillet on the specified edges/faces of the given shape
2768 # @param theShape - Face Shape to perform fillet on.
2769 # @param theR - Fillet radius.
2770 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
2771 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2772 # @return New GEOM_Object, containing the result shape.
2774 # @ref tui_fillet2d "Example"
2775 def MakeFillet2D(self,theShape, theR, theListOfVertexes):
2776 # Example: see GEOM_TestAll.py
2777 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
2778 RaiseIfFailed("MakeFillet2D", self.LocalOp)
2781 ## Perform a fillet on the specified edges of the given shape
2782 # @param theShape - Wire Shape to perform fillet on.
2783 # @param theR - Fillet radius.
2784 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
2785 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2786 # \note The list of vertices could be empty,
2787 # in this case fillet will done done at all vertices in wire
2788 # @return New GEOM_Object, containing the result shape.
2790 # @ref tui_fillet2d "Example"
2791 def MakeFillet1D(self,theShape, theR, theListOfVertexes):
2792 # Example: see GEOM_TestAll.py
2793 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes)
2794 RaiseIfFailed("MakeFillet1D", self.LocalOp)
2797 ## Perform a symmetric chamfer on all edges of the given shape.
2798 # @param theShape Shape, to perform chamfer on.
2799 # @param theD Chamfer size along each face.
2800 # @return New GEOM_Object, containing the result shape.
2802 # @ref tui_chamfer "Example 1"
2803 # \n @ref swig_MakeChamferAll "Example 2"
2804 def MakeChamferAll(self,theShape, theD):
2805 # Example: see GEOM_TestOthers.py
2806 theD,Parameters = ParseParameters(theD)
2807 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
2808 RaiseIfFailed("MakeChamferAll", self.LocalOp)
2809 anObj.SetParameters(Parameters)
2812 ## Perform a chamfer on edges, common to the specified faces,
2813 # with distance D1 on the Face1
2814 # @param theShape Shape, to perform chamfer on.
2815 # @param theD1 Chamfer size along \a theFace1.
2816 # @param theD2 Chamfer size along \a theFace2.
2817 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
2818 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2819 # @return New GEOM_Object, containing the result shape.
2821 # @ref tui_chamfer "Example"
2822 def MakeChamferEdge(self,theShape, theD1, theD2, theFace1, theFace2):
2823 # Example: see GEOM_TestAll.py
2824 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
2825 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
2826 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
2827 anObj.SetParameters(Parameters)
2830 ## The Same that MakeChamferEdge but with params theD is chamfer length and
2831 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
2832 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2):
2834 if isinstance(theAngle,str):
2836 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
2838 theAngle = theAngle*math.pi/180.0
2839 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
2840 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
2841 anObj.SetParameters(Parameters)
2844 ## Perform a chamfer on all edges of the specified faces,
2845 # with distance D1 on the first specified face (if several for one edge)
2846 # @param theShape Shape, to perform chamfer on.
2847 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
2848 # connected to the edge, are in \a theFaces, \a theD1
2849 # will be get along face, which is nearer to \a theFaces beginning.
2850 # @param theD2 Chamfer size along another of two faces, connected to the edge.
2851 # @param theFaces Sequence of global indices of faces of \a theShape.
2852 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2853 # @return New GEOM_Object, containing the result shape.
2855 # @ref tui_chamfer "Example"
2856 def MakeChamferFaces(self,theShape, theD1, theD2, theFaces):
2857 # Example: see GEOM_TestAll.py
2858 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
2859 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
2860 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
2861 anObj.SetParameters(Parameters)
2864 ## The Same that MakeChamferFaces but with params theD is chamfer lenght and
2865 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
2867 # @ref swig_FilletChamfer "Example"
2868 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces):
2870 if isinstance(theAngle,str):
2872 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
2874 theAngle = theAngle*math.pi/180.0
2875 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
2876 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
2877 anObj.SetParameters(Parameters)
2880 ## Perform a chamfer on edges,
2881 # with distance D1 on the first specified face (if several for one edge)
2882 # @param theShape Shape, to perform chamfer on.
2883 # @param theD1,theD2 Chamfer size
2884 # @param theEdges Sequence of edges of \a theShape.
2885 # @return New GEOM_Object, containing the result shape.
2887 # @ref swig_FilletChamfer "Example"
2888 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges):
2889 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
2890 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
2891 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
2892 anObj.SetParameters(Parameters)
2895 ## The Same that MakeChamferEdges but with params theD is chamfer lenght and
2896 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
2897 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges):
2899 if isinstance(theAngle,str):
2901 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
2903 theAngle = theAngle*math.pi/180.0
2904 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
2905 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
2906 anObj.SetParameters(Parameters)
2909 ## Shortcut to MakeChamferEdge() and MakeChamferFaces()
2911 # @ref swig_MakeChamfer "Example"
2912 def MakeChamfer(self,aShape,d1,d2,aShapeType,ListShape):
2913 # Example: see GEOM_TestOthers.py
2915 if aShapeType == ShapeType["EDGE"]:
2916 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1])
2918 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape)
2924 ## @addtogroup l3_basic_op
2927 ## Perform an Archimde operation on the given shape with given parameters.
2928 # The object presenting the resulting face is returned.
2929 # @param theShape Shape to be put in water.
2930 # @param theWeight Weight og the shape.
2931 # @param theWaterDensity Density of the water.
2932 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
2933 # @return New GEOM_Object, containing a section of \a theShape
2934 # by a plane, corresponding to water level.
2936 # @ref tui_archimede "Example"
2937 def Archimede(self,theShape, theWeight, theWaterDensity, theMeshDeflection):
2938 # Example: see GEOM_TestAll.py
2939 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
2940 theWeight,theWaterDensity,theMeshDeflection)
2941 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
2942 RaiseIfFailed("MakeArchimede", self.LocalOp)
2943 anObj.SetParameters(Parameters)
2946 # end of l3_basic_op
2949 ## @addtogroup l2_measure
2952 ## Get point coordinates
2955 # @ref tui_measurement_tools_page "Example"
2956 def PointCoordinates(self,Point):
2957 # Example: see GEOM_TestMeasures.py
2958 aTuple = self.MeasuOp.PointCoordinates(Point)
2959 RaiseIfFailed("PointCoordinates", self.MeasuOp)
2962 ## Get summarized length of all wires,
2963 # area of surface and volume of the given shape.
2964 # @param theShape Shape to define properties of.
2965 # @return [theLength, theSurfArea, theVolume]
2966 # theLength: Summarized length of all wires of the given shape.
2967 # theSurfArea: Area of surface of the given shape.
2968 # theVolume: Volume of the given shape.
2970 # @ref tui_measurement_tools_page "Example"
2971 def BasicProperties(self,theShape):
2972 # Example: see GEOM_TestMeasures.py
2973 aTuple = self.MeasuOp.GetBasicProperties(theShape)
2974 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
2977 ## Get parameters of bounding box of the given shape
2978 # @param theShape Shape to obtain bounding box of.
2979 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
2980 # Xmin,Xmax: Limits of shape along OX axis.
2981 # Ymin,Ymax: Limits of shape along OY axis.
2982 # Zmin,Zmax: Limits of shape along OZ axis.
2984 # @ref tui_measurement_tools_page "Example"
2985 def BoundingBox(self,theShape):
2986 # Example: see GEOM_TestMeasures.py
2987 aTuple = self.MeasuOp.GetBoundingBox(theShape)
2988 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
2991 ## Get inertia matrix and moments of inertia of theShape.
2992 # @param theShape Shape to calculate inertia of.
2993 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
2994 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
2995 # Ix,Iy,Iz: Moments of inertia of the given shape.
2997 # @ref tui_measurement_tools_page "Example"
2998 def Inertia(self,theShape):
2999 # Example: see GEOM_TestMeasures.py
3000 aTuple = self.MeasuOp.GetInertia(theShape)
3001 RaiseIfFailed("GetInertia", self.MeasuOp)
3004 ## Get minimal distance between the given shapes.
3005 # @param theShape1,theShape2 Shapes to find minimal distance between.
3006 # @return Value of the minimal distance between the given shapes.
3008 # @ref tui_measurement_tools_page "Example"
3009 def MinDistance(self, theShape1, theShape2):
3010 # Example: see GEOM_TestMeasures.py
3011 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
3012 RaiseIfFailed("GetMinDistance", self.MeasuOp)
3015 ## Get minimal distance between the given shapes.
3016 # @param theShape1,theShape2 Shapes to find minimal distance between.
3017 # @return Value of the minimal distance between the given shapes.
3019 # @ref swig_all_measure "Example"
3020 def MinDistanceComponents(self, theShape1, theShape2):
3021 # Example: see GEOM_TestMeasures.py
3022 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
3023 RaiseIfFailed("GetMinDistance", self.MeasuOp)
3024 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
3027 ## Get angle between the given shapes in degrees.
3028 # @param theShape1,theShape2 Lines or linear edges to find angle between.
3029 # @return Value of the angle between the given shapes in degrees.
3031 # @ref tui_measurement_tools_page "Example"
3032 def GetAngle(self, theShape1, theShape2):
3033 # Example: see GEOM_TestMeasures.py
3034 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
3035 RaiseIfFailed("GetAngle", self.MeasuOp)
3037 ## Get angle between the given shapes in radians.
3038 # @param theShape1,theShape2 Lines or linear edges to find angle between.
3039 # @return Value of the angle between the given shapes in radians.
3041 # @ref tui_measurement_tools_page "Example"
3042 def GetAngleRadians(self, theShape1, theShape2):
3043 # Example: see GEOM_TestMeasures.py
3044 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
3045 RaiseIfFailed("GetAngle", self.MeasuOp)
3048 ## @name Curve Curvature Measurement
3049 # Methods for receiving radius of curvature of curves
3050 # in the given point
3053 ## Measure curvature of a curve at a point, set by parameter.
3054 # @ref swig_todo "Example"
3055 def CurveCurvatureByParam(self, theCurve, theParam):
3056 # Example: see GEOM_TestMeasures.py
3057 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
3058 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
3062 # @ref swig_todo "Example"
3063 def CurveCurvatureByPoint(self, theCurve, thePoint):
3064 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
3065 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
3069 ## @name Surface Curvature Measurement
3070 # Methods for receiving max and min radius of curvature of surfaces
3071 # in the given point
3075 ## @ref swig_todo "Example"
3076 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
3077 # Example: see GEOM_TestMeasures.py
3078 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
3079 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
3083 ## @ref swig_todo "Example"
3084 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
3085 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
3086 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
3090 ## @ref swig_todo "Example"
3091 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
3092 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
3093 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
3097 ## @ref swig_todo "Example"
3098 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
3099 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
3100 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
3104 ## Get min and max tolerances of sub-shapes of theShape
3105 # @param theShape Shape, to get tolerances of.
3106 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
3107 # FaceMin,FaceMax: Min and max tolerances of the faces.
3108 # EdgeMin,EdgeMax: Min and max tolerances of the edges.
3109 # VertMin,VertMax: Min and max tolerances of the vertices.
3111 # @ref tui_measurement_tools_page "Example"
3112 def Tolerance(self,theShape):
3113 # Example: see GEOM_TestMeasures.py
3114 aTuple = self.MeasuOp.GetTolerance(theShape)
3115 RaiseIfFailed("GetTolerance", self.MeasuOp)
3118 ## Obtain description of the given shape (number of sub-shapes of each type)
3119 # @param theShape Shape to be described.
3120 # @return Description of the given shape.
3122 # @ref tui_measurement_tools_page "Example"
3123 def WhatIs(self,theShape):
3124 # Example: see GEOM_TestMeasures.py
3125 aDescr = self.MeasuOp.WhatIs(theShape)
3126 RaiseIfFailed("WhatIs", self.MeasuOp)
3129 ## Get a point, situated at the centre of mass of theShape.
3130 # @param theShape Shape to define centre of mass of.
3131 # @return New GEOM_Object, containing the created point.
3133 # @ref tui_measurement_tools_page "Example"
3134 def MakeCDG(self,theShape):
3135 # Example: see GEOM_TestMeasures.py
3136 anObj = self.MeasuOp.GetCentreOfMass(theShape)
3137 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
3140 ## Get a normale to the given face. If the point is not given,
3141 # the normale is calculated at the center of mass.
3142 # @param theFace Face to define normale of.
3143 # @param theOptionalPoint Point to compute the normale at.
3144 # @return New GEOM_Object, containing the created vector.
3146 # @ref swig_todo "Example"
3147 def GetNormal(self, theFace, theOptionalPoint = None):
3148 # Example: see GEOM_TestMeasures.py
3149 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
3150 RaiseIfFailed("GetNormal", self.MeasuOp)
3153 ## Check a topology of the given shape.
3154 # @param theShape Shape to check validity of.
3155 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked,
3156 # if TRUE, the shape's geometry will be checked also.
3157 # @return TRUE, if the shape "seems to be valid".
3158 # If theShape is invalid, prints a description of problem.
3160 # @ref tui_measurement_tools_page "Example"
3161 def CheckShape(self,theShape, theIsCheckGeom = 0):
3162 # Example: see GEOM_TestMeasures.py
3164 (IsValid, Status) = self.MeasuOp.CheckShapeWithGeometry(theShape)
3165 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
3167 (IsValid, Status) = self.MeasuOp.CheckShape(theShape)
3168 RaiseIfFailed("CheckShape", self.MeasuOp)
3173 ## Get position (LCS) of theShape.
3175 # Origin of the LCS is situated at the shape's center of mass.
3176 # Axes of the LCS are obtained from shape's location or,
3177 # if the shape is a planar face, from position of its plane.
3179 # @param theShape Shape to calculate position of.
3180 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
3181 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
3182 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
3183 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
3185 # @ref swig_todo "Example"
3186 def GetPosition(self,theShape):
3187 # Example: see GEOM_TestMeasures.py
3188 aTuple = self.MeasuOp.GetPosition(theShape)
3189 RaiseIfFailed("GetPosition", self.MeasuOp)
3192 ## Get kind of theShape.
3194 # @param theShape Shape to get a kind of.
3195 # @return Returns a kind of shape in terms of <VAR>GEOM_IKindOfShape.shape_kind</VAR> enumeration
3196 # and a list of parameters, describing the shape.
3197 # @note Concrete meaning of each value, returned via \a theIntegers
3198 # or \a theDoubles list depends on the kind of the shape.
3199 # The full list of possible outputs is:
3201 # - geompy.kind.COMPOUND nb_solids nb_faces nb_edges nb_vertices
3202 # - geompy.kind.COMPSOLID nb_solids nb_faces nb_edges nb_vertices
3204 # - geompy.kind.SHELL geompy.info.CLOSED nb_faces nb_edges nb_vertices
3205 # - geompy.kind.SHELL geompy.info.UNCLOSED nb_faces nb_edges nb_vertices
3207 # - geompy.kind.WIRE geompy.info.CLOSED nb_edges nb_vertices
3208 # - geompy.kind.WIRE geompy.info.UNCLOSED nb_edges nb_vertices
3210 # - geompy.kind.SPHERE xc yc zc R
3211 # - geompy.kind.CYLINDER xb yb zb dx dy dz R H
3212 # - geompy.kind.BOX xc yc zc ax ay az
3213 # - geompy.kind.ROTATED_BOX xc yc zc zx zy zz xx xy xz ax ay az
3214 # - geompy.kind.TORUS xc yc zc dx dy dz R_1 R_2
3215 # - geompy.kind.CONE xb yb zb dx dy dz R_1 R_2 H
3216 # - geompy.kind.POLYHEDRON nb_faces nb_edges nb_vertices
3217 # - geompy.kind.SOLID nb_faces nb_edges nb_vertices
3219 # - geompy.kind.SPHERE2D xc yc zc R
3220 # - geompy.kind.CYLINDER2D xb yb zb dx dy dz R H
3221 # - geompy.kind.TORUS2D xc yc zc dx dy dz R_1 R_2
3222 # - geompy.kind.CONE2D xc yc zc dx dy dz R_1 R_2 H
3223 # - geompy.kind.DISK_CIRCLE xc yc zc dx dy dz R
3224 # - geompy.kind.DISK_ELLIPSE xc yc zc dx dy dz R_1 R_2
3225 # - geompy.kind.POLYGON xo yo zo dx dy dz nb_edges nb_vertices
3226 # - geompy.kind.PLANE xo yo zo dx dy dz
3227 # - geompy.kind.PLANAR xo yo zo dx dy dz nb_edges nb_vertices
3228 # - geompy.kind.FACE nb_edges nb_vertices
3230 # - geompy.kind.CIRCLE xc yc zc dx dy dz R
3231 # - geompy.kind.ARC_CIRCLE xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2
3232 # - geompy.kind.ELLIPSE xc yc zc dx dy dz R_1 R_2
3233 # - geompy.kind.ARC_ELLIPSE xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2
3234 # - geompy.kind.LINE xo yo zo dx dy dz
3235 # - geompy.kind.SEGMENT x1 y1 z1 x2 y2 z2
3236 # - geompy.kind.EDGE nb_vertices
3238 # - geompy.kind.VERTEX x y z
3240 # @ref swig_todo "Example"
3241 def KindOfShape(self,theShape):
3242 # Example: see GEOM_TestMeasures.py
3243 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
3244 RaiseIfFailed("KindOfShape", self.MeasuOp)
3246 aKind = aRoughTuple[0]
3247 anInts = aRoughTuple[1]
3248 aDbls = aRoughTuple[2]
3250 # Now there is no exception from this rule:
3251 aKindTuple = [aKind] + aDbls + anInts
3253 # If they are we will regroup parameters for such kind of shape.
3255 #if aKind == kind.SOME_KIND:
3256 # # SOME_KIND int int double int double double
3257 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
3264 ## @addtogroup l2_import_export
3267 ## Import a shape from the BREP or IGES or STEP file
3268 # (depends on given format) with given name.
3269 # @param theFileName The file, containing the shape.
3270 # @param theFormatName Specify format for the file reading.
3271 # Available formats can be obtained with InsertOp.ImportTranslators() method.
3272 # If format 'IGES_SCALE' is used instead 'IGES' length unit will be
3273 # set to 'meter' and result model will be scaled.
3274 # @return New GEOM_Object, containing the imported shape.
3276 # @ref swig_Import_Export "Example"
3277 def Import(self,theFileName, theFormatName):
3278 # Example: see GEOM_TestOthers.py
3279 anObj = self.InsertOp.Import(theFileName, theFormatName)
3280 RaiseIfFailed("Import", self.InsertOp)
3283 ## Shortcut to Import() for BREP format
3285 # @ref swig_Import_Export "Example"
3286 def ImportBREP(self,theFileName):
3287 # Example: see GEOM_TestOthers.py
3288 return self.Import(theFileName, "BREP")
3290 ## Shortcut to Import() for IGES format
3292 # @ref swig_Import_Export "Example"
3293 def ImportIGES(self,theFileName):
3294 # Example: see GEOM_TestOthers.py
3295 return self.Import(theFileName, "IGES")
3297 ## Return length unit from given IGES file
3299 # @ref swig_Import_Export "Example"
3300 def GetIGESUnit(self,theFileName):
3301 # Example: see GEOM_TestOthers.py
3302 anObj = self.InsertOp.Import(theFileName, "IGES_UNIT")
3303 #RaiseIfFailed("Import", self.InsertOp)
3304 # recieve name using returned vertex
3306 vertices = self.SubShapeAll(anObj,ShapeType["VERTEX"])
3308 p = self.PointCoordinates(vertices[0])
3309 if abs(p[0]-0.01) < 1.e-6:
3311 elif abs(p[0]-0.001) < 1.e-6:
3315 ## Shortcut to Import() for STEP format
3317 # @ref swig_Import_Export "Example"
3318 def ImportSTEP(self,theFileName):
3319 # Example: see GEOM_TestOthers.py
3320 return self.Import(theFileName, "STEP")
3322 ## Export the given shape into a file with given name.
3323 # @param theObject Shape to be stored in the file.
3324 # @param theFileName Name of the file to store the given shape in.
3325 # @param theFormatName Specify format for the shape storage.
3326 # Available formats can be obtained with InsertOp.ImportTranslators() method.
3328 # @ref swig_Import_Export "Example"
3329 def Export(self,theObject, theFileName, theFormatName):
3330 # Example: see GEOM_TestOthers.py
3331 self.InsertOp.Export(theObject, theFileName, theFormatName)
3332 if self.InsertOp.IsDone() == 0:
3333 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
3337 ## Shortcut to Export() for BREP format
3339 # @ref swig_Import_Export "Example"
3340 def ExportBREP(self,theObject, theFileName):
3341 # Example: see GEOM_TestOthers.py
3342 return self.Export(theObject, theFileName, "BREP")
3344 ## Shortcut to Export() for IGES format
3346 # @ref swig_Import_Export "Example"
3347 def ExportIGES(self,theObject, theFileName):
3348 # Example: see GEOM_TestOthers.py
3349 return self.Export(theObject, theFileName, "IGES")
3351 ## Shortcut to Export() for STEP format
3353 # @ref swig_Import_Export "Example"
3354 def ExportSTEP(self,theObject, theFileName):
3355 # Example: see GEOM_TestOthers.py
3356 return self.Export(theObject, theFileName, "STEP")
3358 # end of l2_import_export
3361 ## @addtogroup l3_blocks
3364 ## Create a quadrangle face from four edges. Order of Edges is not
3365 # important. It is not necessary that edges share the same vertex.
3366 # @param E1,E2,E3,E4 Edges for the face bound.
3367 # @return New GEOM_Object, containing the created face.
3369 # @ref tui_building_by_blocks_page "Example"
3370 def MakeQuad(self,E1, E2, E3, E4):
3371 # Example: see GEOM_Spanner.py
3372 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
3373 RaiseIfFailed("MakeQuad", self.BlocksOp)
3376 ## Create a quadrangle face on two edges.
3377 # The missing edges will be built by creating the shortest ones.
3378 # @param E1,E2 Two opposite edges for the face.
3379 # @return New GEOM_Object, containing the created face.
3381 # @ref tui_building_by_blocks_page "Example"
3382 def MakeQuad2Edges(self,E1, E2):
3383 # Example: see GEOM_Spanner.py
3384 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
3385 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
3388 ## Create a quadrangle face with specified corners.
3389 # The missing edges will be built by creating the shortest ones.
3390 # @param V1,V2,V3,V4 Corner vertices for the face.
3391 # @return New GEOM_Object, containing the created face.
3393 # @ref tui_building_by_blocks_page "Example 1"
3394 # \n @ref swig_MakeQuad4Vertices "Example 2"
3395 def MakeQuad4Vertices(self,V1, V2, V3, V4):
3396 # Example: see GEOM_Spanner.py
3397 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
3398 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
3401 ## Create a hexahedral solid, bounded by the six given faces. Order of
3402 # faces is not important. It is not necessary that Faces share the same edge.
3403 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
3404 # @return New GEOM_Object, containing the created solid.
3406 # @ref tui_building_by_blocks_page "Example 1"
3407 # \n @ref swig_MakeHexa "Example 2"
3408 def MakeHexa(self,F1, F2, F3, F4, F5, F6):
3409 # Example: see GEOM_Spanner.py
3410 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
3411 RaiseIfFailed("MakeHexa", self.BlocksOp)
3414 ## Create a hexahedral solid between two given faces.
3415 # The missing faces will be built by creating the smallest ones.
3416 # @param F1,F2 Two opposite faces for the hexahedral solid.
3417 # @return New GEOM_Object, containing the created solid.
3419 # @ref tui_building_by_blocks_page "Example 1"
3420 # \n @ref swig_MakeHexa2Faces "Example 2"
3421 def MakeHexa2Faces(self,F1, F2):
3422 # Example: see GEOM_Spanner.py
3423 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
3424 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
3430 ## @addtogroup l3_blocks_op
3433 ## Get a vertex, found in the given shape by its coordinates.
3434 # @param theShape Block or a compound of blocks.
3435 # @param theX,theY,theZ Coordinates of the sought vertex.
3436 # @param theEpsilon Maximum allowed distance between the resulting
3437 # vertex and point with the given coordinates.
3438 # @return New GEOM_Object, containing the found vertex.
3440 # @ref swig_GetPoint "Example"
3441 def GetPoint(self,theShape, theX, theY, theZ, theEpsilon):
3442 # Example: see GEOM_TestOthers.py
3443 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
3444 RaiseIfFailed("GetPoint", self.BlocksOp)
3447 ## Get an edge, found in the given shape by two given vertices.
3448 # @param theShape Block or a compound of blocks.
3449 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
3450 # @return New GEOM_Object, containing the found edge.
3452 # @ref swig_todo "Example"
3453 def GetEdge(self,theShape, thePoint1, thePoint2):
3454 # Example: see GEOM_Spanner.py
3455 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
3456 RaiseIfFailed("GetEdge", self.BlocksOp)
3459 ## Find an edge of the given shape, which has minimal distance to the given point.
3460 # @param theShape Block or a compound of blocks.
3461 # @param thePoint Point, close to the desired edge.
3462 # @return New GEOM_Object, containing the found edge.
3464 # @ref swig_GetEdgeNearPoint "Example"
3465 def GetEdgeNearPoint(self,theShape, thePoint):
3466 # Example: see GEOM_TestOthers.py
3467 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
3468 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
3471 ## Returns a face, found in the given shape by four given corner vertices.
3472 # @param theShape Block or a compound of blocks.
3473 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
3474 # @return New GEOM_Object, containing the found face.
3476 # @ref swig_todo "Example"
3477 def GetFaceByPoints(self,theShape, thePoint1, thePoint2, thePoint3, thePoint4):
3478 # Example: see GEOM_Spanner.py
3479 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
3480 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
3483 ## Get a face of block, found in the given shape by two given edges.
3484 # @param theShape Block or a compound of blocks.
3485 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
3486 # @return New GEOM_Object, containing the found face.
3488 # @ref swig_todo "Example"
3489 def GetFaceByEdges(self,theShape, theEdge1, theEdge2):
3490 # Example: see GEOM_Spanner.py
3491 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
3492 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
3495 ## Find a face, opposite to the given one in the given block.
3496 # @param theBlock Must be a hexahedral solid.
3497 # @param theFace Face of \a theBlock, opposite to the desired face.
3498 # @return New GEOM_Object, containing the found face.
3500 # @ref swig_GetOppositeFace "Example"
3501 def GetOppositeFace(self,theBlock, theFace):
3502 # Example: see GEOM_Spanner.py
3503 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
3504 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
3507 ## Find a face of the given shape, which has minimal distance to the given point.
3508 # @param theShape Block or a compound of blocks.
3509 # @param thePoint Point, close to the desired face.
3510 # @return New GEOM_Object, containing the found face.
3512 # @ref swig_GetFaceNearPoint "Example"
3513 def GetFaceNearPoint(self,theShape, thePoint):
3514 # Example: see GEOM_Spanner.py
3515 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
3516 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
3519 ## Find a face of block, whose outside normale has minimal angle with the given vector.
3520 # @param theBlock Block or a compound of blocks.
3521 # @param theVector Vector, close to the normale of the desired face.
3522 # @return New GEOM_Object, containing the found face.
3524 # @ref swig_todo "Example"
3525 def GetFaceByNormale(self, theBlock, theVector):
3526 # Example: see GEOM_Spanner.py
3527 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
3528 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
3531 # end of l3_blocks_op
3534 ## @addtogroup l4_blocks_measure
3537 ## Check, if the compound of blocks is given.
3538 # To be considered as a compound of blocks, the
3539 # given shape must satisfy the following conditions:
3540 # - Each element of the compound should be a Block (6 faces and 12 edges).
3541 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
3542 # - The compound should be connexe.
3543 # - The glue between two quadrangle faces should be applied.
3544 # @param theCompound The compound to check.
3545 # @return TRUE, if the given shape is a compound of blocks.
3546 # If theCompound is not valid, prints all discovered errors.
3548 # @ref tui_measurement_tools_page "Example 1"
3549 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
3550 def CheckCompoundOfBlocks(self,theCompound):
3551 # Example: see GEOM_Spanner.py
3552 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
3553 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
3555 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
3559 ## Remove all seam and degenerated edges from \a theShape.
3560 # Unite faces and edges, sharing one surface. It means that
3561 # this faces must have references to one C++ surface object (handle).
3562 # @param theShape The compound or single solid to remove irregular edges from.
3563 # @param theOptimumNbFaces If more than zero, unite faces only for those solids,
3564 # that have more than theOptimumNbFaces faces. If zero, unite faces always,
3565 # regardsless their quantity in the solid. If negative (the default value),
3566 # do not unite faces at all. For blocks repairing recommended value is 6.
3567 # @return Improved shape.
3569 # @ref swig_RemoveExtraEdges "Example"
3570 def RemoveExtraEdges(self,theShape,theOptimumNbFaces=-1):
3571 # Example: see GEOM_TestOthers.py
3572 anObj = self.BlocksOp.RemoveExtraEdges(theShape,theOptimumNbFaces)
3573 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
3576 ## Check, if the given shape is a blocks compound.
3577 # Fix all detected errors.
3578 # \note Single block can be also fixed by this method.
3579 # @param theShape The compound to check and improve.
3580 # @return Improved compound.
3582 # @ref swig_CheckAndImprove "Example"
3583 def CheckAndImprove(self,theShape):
3584 # Example: see GEOM_TestOthers.py
3585 anObj = self.BlocksOp.CheckAndImprove(theShape)
3586 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
3589 # end of l4_blocks_measure
3592 ## @addtogroup l3_blocks_op
3595 ## Get all the blocks, contained in the given compound.
3596 # @param theCompound The compound to explode.
3597 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
3598 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
3599 # \note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
3600 # @return List of GEOM_Objects, containing the retrieved blocks.
3602 # @ref tui_explode_on_blocks "Example 1"
3603 # \n @ref swig_MakeBlockExplode "Example 2"
3604 def MakeBlockExplode(self,theCompound, theMinNbFaces, theMaxNbFaces):
3605 # Example: see GEOM_TestOthers.py
3606 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
3607 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
3608 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
3610 anObj.SetParameters(Parameters)
3614 ## Find block, containing the given point inside its volume or on boundary.
3615 # @param theCompound Compound, to find block in.
3616 # @param thePoint Point, close to the desired block. If the point lays on
3617 # boundary between some blocks, we return block with nearest center.
3618 # @return New GEOM_Object, containing the found block.
3620 # @ref swig_todo "Example"
3621 def GetBlockNearPoint(self,theCompound, thePoint):
3622 # Example: see GEOM_Spanner.py
3623 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
3624 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
3627 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
3628 # @param theCompound Compound, to find block in.
3629 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
3630 # @return New GEOM_Object, containing the found block.
3632 # @ref swig_GetBlockByParts "Example"
3633 def GetBlockByParts(self,theCompound, theParts):
3634 # Example: see GEOM_TestOthers.py
3635 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
3636 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
3639 ## Return all blocks, containing all the elements, passed as the parts.
3640 # @param theCompound Compound, to find blocks in.
3641 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
3642 # @return List of GEOM_Objects, containing the found blocks.
3644 # @ref swig_todo "Example"
3645 def GetBlocksByParts(self,theCompound, theParts):
3646 # Example: see GEOM_Spanner.py
3647 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
3648 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
3651 ## Multi-transformate block and glue the result.
3652 # Transformation is defined so, as to superpose direction faces.
3653 # @param Block Hexahedral solid to be multi-transformed.
3654 # @param DirFace1 ID of First direction face.
3655 # @param DirFace2 ID of Second direction face.
3656 # @param NbTimes Quantity of transformations to be done.
3657 # \note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
3658 # @return New GEOM_Object, containing the result shape.
3660 # @ref tui_multi_transformation "Example"
3661 def MakeMultiTransformation1D(self,Block, DirFace1, DirFace2, NbTimes):
3662 # Example: see GEOM_Spanner.py
3663 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
3664 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
3665 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
3666 anObj.SetParameters(Parameters)
3669 ## Multi-transformate block and glue the result.
3670 # @param Block Hexahedral solid to be multi-transformed.
3671 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
3672 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
3673 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
3674 # @return New GEOM_Object, containing the result shape.
3676 # @ref tui_multi_transformation "Example"
3677 def MakeMultiTransformation2D(self,Block, DirFace1U, DirFace2U, NbTimesU,
3678 DirFace1V, DirFace2V, NbTimesV):
3679 # Example: see GEOM_Spanner.py
3680 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
3681 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
3682 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
3683 DirFace1V, DirFace2V, NbTimesV)
3684 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
3685 anObj.SetParameters(Parameters)
3688 ## Build all possible propagation groups.
3689 # Propagation group is a set of all edges, opposite to one (main)
3690 # edge of this group directly or through other opposite edges.
3691 # Notion of Opposite Edge make sence only on quadrangle face.
3692 # @param theShape Shape to build propagation groups on.
3693 # @return List of GEOM_Objects, each of them is a propagation group.
3695 # @ref swig_Propagate "Example"
3696 def Propagate(self,theShape):
3697 # Example: see GEOM_TestOthers.py
3698 listChains = self.BlocksOp.Propagate(theShape)
3699 RaiseIfFailed("Propagate", self.BlocksOp)
3702 # end of l3_blocks_op
3705 ## @addtogroup l3_groups
3708 ## Creates a new group which will store sub shapes of theMainShape
3709 # @param theMainShape is a GEOM object on which the group is selected
3710 # @param theShapeType defines a shape type of the group
3711 # @return a newly created GEOM group
3713 # @ref tui_working_with_groups_page "Example 1"
3714 # \n @ref swig_CreateGroup "Example 2"
3715 def CreateGroup(self,theMainShape, theShapeType):
3716 # Example: see GEOM_TestOthers.py
3717 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
3718 RaiseIfFailed("CreateGroup", self.GroupOp)
3721 ## Adds a sub object with ID theSubShapeId to the group
3722 # @param theGroup is a GEOM group to which the new sub shape is added
3723 # @param theSubShapeID is a sub shape ID in the main object.
3724 # \note Use method GetSubShapeID() to get an unique ID of the sub shape
3726 # @ref tui_working_with_groups_page "Example"
3727 def AddObject(self,theGroup, theSubShapeID):
3728 # Example: see GEOM_TestOthers.py
3729 self.GroupOp.AddObject(theGroup, theSubShapeID)
3730 RaiseIfFailed("AddObject", self.GroupOp)
3733 ## Removes a sub object with ID \a theSubShapeId from the group
3734 # @param theGroup is a GEOM group from which the new sub shape is removed
3735 # @param theSubShapeID is a sub shape ID in the main object.
3736 # \note Use method GetSubShapeID() to get an unique ID of the sub shape
3738 # @ref tui_working_with_groups_page "Example"
3739 def RemoveObject(self,theGroup, theSubShapeID):
3740 # Example: see GEOM_TestOthers.py
3741 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
3742 RaiseIfFailed("RemoveObject", self.GroupOp)
3745 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
3746 # @param theGroup is a GEOM group to which the new sub shapes are added.
3747 # @param theSubShapes is a list of sub shapes to be added.
3749 # @ref tui_working_with_groups_page "Example"
3750 def UnionList (self,theGroup, theSubShapes):
3751 # Example: see GEOM_TestOthers.py
3752 self.GroupOp.UnionList(theGroup, theSubShapes)
3753 RaiseIfFailed("UnionList", self.GroupOp)
3756 ## Works like the above method, but argument
3757 # theSubShapes here is a list of sub-shapes indices
3759 # @ref swig_UnionIDs "Example"
3760 def UnionIDs(self,theGroup, theSubShapes):
3761 # Example: see GEOM_TestOthers.py
3762 self.GroupOp.UnionIDs(theGroup, theSubShapes)
3763 RaiseIfFailed("UnionIDs", self.GroupOp)
3766 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
3767 # @param theGroup is a GEOM group from which the sub-shapes are removed.
3768 # @param theSubShapes is a list of sub-shapes to be removed.
3770 # @ref tui_working_with_groups_page "Example"
3771 def DifferenceList (self,theGroup, theSubShapes):
3772 # Example: see GEOM_TestOthers.py
3773 self.GroupOp.DifferenceList(theGroup, theSubShapes)
3774 RaiseIfFailed("DifferenceList", self.GroupOp)
3777 ## Works like the above method, but argument
3778 # theSubShapes here is a list of sub-shapes indices
3780 # @ref swig_DifferenceIDs "Example"
3781 def DifferenceIDs(self,theGroup, theSubShapes):
3782 # Example: see GEOM_TestOthers.py
3783 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
3784 RaiseIfFailed("DifferenceIDs", self.GroupOp)
3787 ## Returns a list of sub objects ID stored in the group
3788 # @param theGroup is a GEOM group for which a list of IDs is requested
3790 # @ref swig_GetObjectIDs "Example"
3791 def GetObjectIDs(self,theGroup):
3792 # Example: see GEOM_TestOthers.py
3793 ListIDs = self.GroupOp.GetObjects(theGroup)
3794 RaiseIfFailed("GetObjects", self.GroupOp)
3797 ## Returns a type of sub objects stored in the group
3798 # @param theGroup is a GEOM group which type is returned.
3800 # @ref swig_GetType "Example"
3801 def GetType(self,theGroup):
3802 # Example: see GEOM_TestOthers.py
3803 aType = self.GroupOp.GetType(theGroup)
3804 RaiseIfFailed("GetType", self.GroupOp)
3807 ## Returns a main shape associated with the group
3808 # @param theGroup is a GEOM group for which a main shape object is requested
3809 # @return a GEOM object which is a main shape for theGroup
3811 # @ref swig_GetMainShape "Example"
3812 def GetMainShape(self,theGroup):
3813 # Example: see GEOM_TestOthers.py
3814 anObj = self.GroupOp.GetMainShape(theGroup)
3815 RaiseIfFailed("GetMainShape", self.GroupOp)
3818 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
3819 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
3821 # @ref swig_todo "Example"
3822 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1):
3823 edges = self.SubShapeAll(theShape, ShapeType["EDGE"])
3826 Props = self.BasicProperties(edge)
3827 if min_length <= Props[0] and Props[0] <= max_length:
3828 if (not include_min) and (min_length == Props[0]):
3831 if (not include_max) and (Props[0] == max_length):
3834 edges_in_range.append(edge)
3836 if len(edges_in_range) <= 0:
3837 print "No edges found by given criteria"
3840 group_edges = self.CreateGroup(theShape, ShapeType["EDGE"])
3841 self.UnionList(group_edges, edges_in_range)
3845 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
3846 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
3848 # @ref swig_todo "Example"
3849 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
3850 nb_selected = sg.SelectedCount()
3852 print "Select a shape before calling this function, please."
3855 print "Only one shape must be selected"
3858 id_shape = sg.getSelected(0)
3859 shape = IDToObject( id_shape )
3861 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
3865 if include_min: left_str = " <= "
3866 if include_max: right_str = " <= "
3868 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
3869 + left_str + "length" + right_str + `max_length`)
3871 sg.updateObjBrowser(1)
3878 ## Create a copy of the given object
3879 # @ingroup l1_geompy_auxiliary
3881 # @ref swig_all_advanced "Example"
3882 def MakeCopy(self,theOriginal):
3883 # Example: see GEOM_TestAll.py
3884 anObj = self.InsertOp.MakeCopy(theOriginal)
3885 RaiseIfFailed("MakeCopy", self.InsertOp)
3888 ## Add Path to load python scripts from
3889 # @ingroup l1_geompy_auxiliary
3890 def addPath(self,Path):
3891 if (sys.path.count(Path) < 1):
3892 sys.path.append(Path)
3895 #Register the new proxy for GEOM_Gen
3896 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geompyDC)