1 # -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License.
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 # GEOM GEOM_SWIG : binding of C++ omplementaion with Python
22 # Author : Paul RASCLE, EDF
30 ## @defgroup l1_geompy_auxiliary Auxiliary data structures and methods
32 ## @defgroup l1_geompy_purpose All package methods, grouped by their purpose
34 ## @defgroup l2_import_export Importing/exporting geometrical objects
35 ## @defgroup l2_creating Creating geometrical objects
37 ## @defgroup l3_basic_go Creating Basic Geometric Objects
39 ## @defgroup l4_curves Creating Curves
42 ## @defgroup l3_3d_primitives Creating 3D Primitives
43 ## @defgroup l3_complex Creating Complex Objects
44 ## @defgroup l3_groups Working with groups
45 ## @defgroup l3_blocks Building by blocks
47 ## @defgroup l4_blocks_measure Check and Improve
50 ## @defgroup l3_sketcher Sketcher
51 ## @defgroup l3_advanced Creating Advanced Geometrical Objects
53 ## @defgroup l4_decompose Decompose objects
54 ## @defgroup l4_access Access to sub-shapes by their unique IDs inside the main shape
55 ## @defgroup l4_obtain Access to subshapes by a criteria
56 ## @defgroup l4_advanced Advanced objects creation functions
61 ## @defgroup l2_transforming Transforming geometrical objects
63 ## @defgroup l3_basic_op Basic Operations
64 ## @defgroup l3_boolean Boolean Operations
65 ## @defgroup l3_transform Transformation Operations
66 ## @defgroup l3_local Local Operations (Fillet and Chamfer)
67 ## @defgroup l3_blocks_op Blocks Operations
68 ## @defgroup l3_healing Repairing Operations
69 ## @defgroup l3_restore_ss Restore presentation parameters and a tree of subshapes
72 ## @defgroup l2_measure Using measurement tools
80 from salome_notebook import *
85 ## Enumeration ShapeType as a dictionary
86 # @ingroup l1_geompy_auxiliary
87 ShapeType = {"COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8}
89 ## Raise an Error, containing the Method_name, if Operation is Failed
90 ## @ingroup l1_geompy_auxiliary
91 def RaiseIfFailed (Method_name, Operation):
92 if Operation.IsDone() == 0 and Operation.GetErrorCode() != "NOT_FOUND_ANY":
93 raise RuntimeError, Method_name + " : " + Operation.GetErrorCode()
95 ## Return list of variables value from salome notebook
96 ## @ingroup l1_geompy_auxiliary
97 def ParseParameters(*parameters):
100 for parameter in parameters:
101 if isinstance(parameter, list):
102 lResults = ParseParameters(*parameter)
103 if len(lResults) > 0:
104 Result.append(lResults[:-1])
105 StringResult += lResults[-1].split(":")
109 if isinstance(parameter,str):
110 if notebook.isVariable(parameter):
111 Result.append(notebook.get(parameter))
113 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
116 Result.append(parameter)
118 StringResult.append(str(parameter))
122 Result.append(":".join(StringResult))
124 Result = ":".join(StringResult)
127 ## Return list of variables value from salome notebook
128 ## @ingroup l1_geompy_auxiliary
132 for parameter in list:
133 if isinstance(parameter,str) and notebook.isVariable(parameter):
134 Result.append(str(notebook.get(parameter)))
137 Result.append(str(parameter))
140 StringResult = StringResult + str(parameter)
141 StringResult = StringResult + ":"
143 StringResult = StringResult[:len(StringResult)-1]
144 return Result, StringResult
146 ## Return list of variables value from salome notebook
147 ## @ingroup l1_geompy_auxiliary
148 def ParseSketcherCommand(command):
151 sections = command.split(":")
152 for section in sections:
153 parameters = section.split(" ")
155 for parameter in parameters:
156 if paramIndex > 1 and parameter.find("'") != -1:
157 parameter = parameter.replace("'","")
158 if notebook.isVariable(parameter):
159 Result = Result + str(notebook.get(parameter)) + " "
162 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
166 Result = Result + str(parameter) + " "
169 StringResult = StringResult + parameter
170 StringResult = StringResult + ":"
172 paramIndex = paramIndex + 1
174 Result = Result[:len(Result)-1] + ":"
176 Result = Result[:len(Result)-1]
177 return Result, StringResult
179 ## Helper function which can be used to pack the passed string to the byte data.
180 ## Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
181 ## If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
184 ## val = PackData("10001110") # val = 0xAE
185 ## val = PackData("1") # val = 0x80
187 ## @param data unpacked data - a string containing '1' and '0' symbols
188 ## @return data packed to the byte stream
189 ## @ingroup l1_geompy_auxiliary
192 if len(data)%8: bytes += 1
194 for b in range(bytes):
195 d = data[b*8:(b+1)*8]
200 if d[i] == "1": val += 1
202 raise "Invalid symbol %s" % d[i]
209 ## Read bitmap texture from the text file.
210 ## In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
211 ## A zero symbol ('0') represents transparent pixel of the texture bitmap.
212 ## The function returns width and height of the pixmap in pixels and byte stream representing
213 ## texture bitmap itself.
215 ## This function can be used to read the texture to the byte stream in order to pass it to
216 ## the AddTexture() function of geompy class.
220 ## geompy.init_geom(salome.myStudy)
221 ## texture = geompy.readtexture('mytexture.dat')
222 ## texture = geompy.AddTexture(*texture)
223 ## obj.SetMarkerTexture(texture)
225 ## @param fname texture file name
226 ## @return sequence of tree values: texture's width, height in pixels and its byte stream
227 ## @ingroup l1_geompy_auxiliary
228 def ReadTexture(fname):
231 lines = [ l.strip() for l in f.readlines()]
234 if lines: maxlen = max([len(x) for x in lines])
236 if maxlen%8: lenbytes += 1
240 lenline = (len(line)/8+1)*8
243 lenline = (len(line)/8)*8
245 for i in range(lenline/8):
248 if i*8+j < len(line) and line[i*8+j] != "0": byte += "1"
251 bytedata += PackData(byte)
253 for i in range(lenline/8, lenbytes):
254 bytedata += PackData("0")
256 return lenbytes*8, len(lines), bytedata
261 ## Kinds of shape enumeration
262 # @ingroup l1_geompy_auxiliary
263 kind = GEOM.GEOM_IKindOfShape
265 ## Information about closed/unclosed state of shell or wire
266 # @ingroup l1_geompy_auxiliary
272 class geompyDC(GEOM._objref_GEOM_Gen):
275 GEOM._objref_GEOM_Gen.__init__(self)
276 self.myBuilder = None
295 ## @addtogroup l1_geompy_auxiliary
297 def init_geom(self,theStudy):
298 self.myStudy = theStudy
299 self.myStudyId = self.myStudy._get_StudyId()
300 self.myBuilder = self.myStudy.NewBuilder()
301 self.father = self.myStudy.FindComponent("GEOM")
302 if self.father is None:
303 self.father = self.myBuilder.NewComponent("GEOM")
304 A1 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributeName")
305 FName = A1._narrow(SALOMEDS.AttributeName)
306 FName.SetValue("Geometry")
307 A2 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributePixMap")
308 aPixmap = A2._narrow(SALOMEDS.AttributePixMap)
309 aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry")
310 self.myBuilder.DefineComponentInstance(self.father,self)
312 self.BasicOp = self.GetIBasicOperations (self.myStudyId)
313 self.CurvesOp = self.GetICurvesOperations (self.myStudyId)
314 self.PrimOp = self.GetI3DPrimOperations (self.myStudyId)
315 self.ShapesOp = self.GetIShapesOperations (self.myStudyId)
316 self.HealOp = self.GetIHealingOperations (self.myStudyId)
317 self.InsertOp = self.GetIInsertOperations (self.myStudyId)
318 self.BoolOp = self.GetIBooleanOperations (self.myStudyId)
319 self.TrsfOp = self.GetITransformOperations(self.myStudyId)
320 self.LocalOp = self.GetILocalOperations (self.myStudyId)
321 self.MeasuOp = self.GetIMeasureOperations (self.myStudyId)
322 self.BlocksOp = self.GetIBlocksOperations (self.myStudyId)
323 self.GroupOp = self.GetIGroupOperations (self.myStudyId)
324 self.AdvOp = self.GetIAdvancedOperations (self.myStudyId)
327 ## Get name for sub-shape aSubObj of shape aMainObj
329 # @ref swig_SubShapeAllSorted "Example"
330 def SubShapeName(self,aSubObj, aMainObj):
331 # Example: see GEOM_TestAll.py
333 #aSubId = orb.object_to_string(aSubObj)
334 #aMainId = orb.object_to_string(aMainObj)
335 #index = gg.getIndexTopology(aSubId, aMainId)
336 #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
337 index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
338 name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
341 ## Publish in study aShape with name aName
343 # \param aShape the shape to be published
344 # \param aName the name for the shape
345 # \param doRestoreSubShapes if True, finds and publishes also
346 # sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
347 # and published sub-shapes of arguments
348 # \param theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes for
349 # these arguments description
350 # \return study entry of the published shape in form of string
352 # @ref swig_MakeQuad4Vertices "Example"
353 def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
354 theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
355 # Example: see GEOM_TestAll.py
357 aSObject = self.AddInStudy(self.myStudy, aShape, aName, None)
358 if doRestoreSubShapes:
359 self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs,
360 theFindMethod, theInheritFirstArg, True )
362 print "addToStudy() failed"
364 return aShape.GetStudyEntry()
366 ## Publish in study aShape with name aName as sub-object of previously published aFather
368 # @ref swig_SubShapeAllSorted "Example"
369 def addToStudyInFather(self, aFather, aShape, aName):
370 # Example: see GEOM_TestAll.py
372 aSObject = self.AddInStudy(self.myStudy, aShape, aName, aFather)
374 print "addToStudyInFather() failed"
376 return aShape.GetStudyEntry()
378 # end of l1_geompy_auxiliary
381 ## @addtogroup l3_restore_ss
384 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
385 # To be used from python scripts out of geompy.addToStudy (non-default usage)
386 # \param theObject published GEOM object, arguments of which will be published
387 # \param theArgs list of GEOM_Object, operation arguments to be published.
388 # If this list is empty, all operation arguments will be published
389 # \param theFindMethod method to search subshapes, corresponding to arguments and
390 # their subshapes. Value from enumeration GEOM::find_shape_method.
391 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
392 # Do not publish subshapes in place of arguments, but only
393 # in place of subshapes of the first argument,
394 # because the whole shape corresponds to the first argument.
395 # Mainly to be used after transformations, but it also can be
396 # usefull after partition with one object shape, and some other
397 # operations, where only the first argument has to be considered.
398 # If theObject has only one argument shape, this flag is automatically
399 # considered as True, not regarding really passed value.
400 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
401 # and prefix "from_subshapes_of_" to names of partially restored subshapes.
402 # \return list of published sub-shapes
404 # @ref tui_restore_prs_params "Example"
405 def RestoreSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
406 theInheritFirstArg=False, theAddPrefix=True):
407 # Example: see GEOM_TestAll.py
408 return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
409 theFindMethod, theInheritFirstArg, theAddPrefix)
411 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
412 # To be used from python scripts out of geompy.addToStudy (non-default usage)
413 # \param theObject published GEOM object, arguments of which will be published
414 # \param theArgs list of GEOM_Object, operation arguments to be published.
415 # If this list is empty, all operation arguments will be published
416 # \param theFindMethod method to search subshapes, corresponding to arguments and
417 # their subshapes. Value from enumeration GEOM::find_shape_method.
418 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
419 # Do not publish subshapes in place of arguments, but only
420 # in place of subshapes of the first argument,
421 # because the whole shape corresponds to the first argument.
422 # Mainly to be used after transformations, but it also can be
423 # usefull after partition with one object shape, and some other
424 # operations, where only the first argument has to be considered.
425 # If theObject has only one argument shape, this flag is automatically
426 # considered as True, not regarding really passed value.
427 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
428 # and prefix "from_subshapes_of_" to names of partially restored subshapes.
429 # \return list of published sub-shapes
431 # @ref tui_restore_prs_params "Example"
432 def RestoreGivenSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
433 theInheritFirstArg=False, theAddPrefix=True):
434 # Example: see GEOM_TestAll.py
435 return self.RestoreGivenSubShapesO(self.myStudy, theObject, theArgs,
436 theFindMethod, theInheritFirstArg, theAddPrefix)
438 # end of l3_restore_ss
441 ## @addtogroup l3_basic_go
444 ## Create point by three coordinates.
445 # @param theX The X coordinate of the point.
446 # @param theY The Y coordinate of the point.
447 # @param theZ The Z coordinate of the point.
448 # @return New GEOM_Object, containing the created point.
450 # @ref tui_creation_point "Example"
451 def MakeVertex(self,theX, theY, theZ):
452 # Example: see GEOM_TestAll.py
453 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
454 anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
455 RaiseIfFailed("MakePointXYZ", self.BasicOp)
456 anObj.SetParameters(Parameters)
459 ## Create a point, distant from the referenced point
460 # on the given distances along the coordinate axes.
461 # @param theReference The referenced point.
462 # @param theX Displacement from the referenced point along OX axis.
463 # @param theY Displacement from the referenced point along OY axis.
464 # @param theZ Displacement from the referenced point along OZ axis.
465 # @return New GEOM_Object, containing the created point.
467 # @ref tui_creation_point "Example"
468 def MakeVertexWithRef(self,theReference, theX, theY, theZ):
469 # Example: see GEOM_TestAll.py
470 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
471 anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
472 RaiseIfFailed("MakePointWithReference", self.BasicOp)
473 anObj.SetParameters(Parameters)
476 ## Create a point, corresponding to the given parameter on the given curve.
477 # @param theRefCurve The referenced curve.
478 # @param theParameter Value of parameter on the referenced curve.
479 # @return New GEOM_Object, containing the created point.
481 # @ref tui_creation_point "Example"
482 def MakeVertexOnCurve(self,theRefCurve, theParameter):
483 # Example: see GEOM_TestAll.py
484 theParameter, Parameters = ParseParameters(theParameter)
485 anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter)
486 RaiseIfFailed("MakePointOnCurve", self.BasicOp)
487 anObj.SetParameters(Parameters)
490 ## Create a point by projection give coordinates on the given curve
491 # @param theRefCurve The referenced curve.
492 # @param theX X-coordinate in 3D space
493 # @param theY Y-coordinate in 3D space
494 # @param theZ Z-coordinate in 3D space
495 # @return New GEOM_Object, containing the created point.
497 # @ref tui_creation_point "Example"
498 def MakeVertexOnCurveByCoord(self,theRefCurve, theX, theY, theZ):
499 # Example: see GEOM_TestAll.py
500 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
501 anObj = self.BasicOp.MakePointOnCurveByCoord(theRefCurve, theX, theY, theZ)
502 RaiseIfFailed("MakeVertexOnCurveByCoord", self.BasicOp)
503 anObj.SetParameters(Parameters)
506 ## Create a point, corresponding to the given parameters on the
508 # @param theRefSurf The referenced surface.
509 # @param theUParameter Value of U-parameter on the referenced surface.
510 # @param theVParameter Value of V-parameter on the referenced surface.
511 # @return New GEOM_Object, containing the created point.
513 # @ref swig_MakeVertexOnSurface "Example"
514 def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter):
515 theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
516 # Example: see GEOM_TestAll.py
517 anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
518 RaiseIfFailed("MakePointOnSurface", self.BasicOp)
519 anObj.SetParameters(Parameters);
522 ## Create a point by projection give coordinates on the given surface
523 # @param theRefSurf The referenced surface.
524 # @param theX X-coordinate in 3D space
525 # @param theY Y-coordinate in 3D space
526 # @param theZ Z-coordinate in 3D space
527 # @return New GEOM_Object, containing the created point.
529 # @ref swig_MakeVertexOnSurfaceByCoord "Example"
530 def MakeVertexOnSurfaceByCoord(self, theRefSurf, theX, theY, theZ):
531 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
532 # Example: see GEOM_TestAll.py
533 anObj = self.BasicOp.MakePointOnSurfaceByCoord(theRefSurf, theX, theY, theZ)
534 RaiseIfFailed("MakeVertexOnSurfaceByCoord", self.BasicOp)
535 anObj.SetParameters(Parameters);
538 ## Create a point on intersection of two lines.
539 # @param theRefLine1, theRefLine2 The referenced lines.
540 # @return New GEOM_Object, containing the created point.
542 # @ref swig_MakeVertexOnLinesIntersection "Example"
543 def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2):
544 # Example: see GEOM_TestAll.py
545 anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
546 RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
549 ## Create a tangent, corresponding to the given parameter on the given curve.
550 # @param theRefCurve The referenced curve.
551 # @param theParameter Value of parameter on the referenced curve.
552 # @return New GEOM_Object, containing the created tangent.
554 # @ref swig_MakeTangentOnCurve "Example"
555 def MakeTangentOnCurve(self, theRefCurve, theParameter):
556 anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
557 RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
560 ## Create a tangent plane, corresponding to the given parameter on the given face.
561 # @param theFace The face for which tangent plane should be built.
562 # @param theParameterV vertical value of the center point (0.0 - 1.0).
563 # @param theParameterU horisontal value of the center point (0.0 - 1.0).
564 # @param theTrimSize the size of plane.
565 # @return New GEOM_Object, containing the created tangent.
567 # @ref swig_MakeTangentPlaneOnFace "Example"
568 def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize):
569 anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
570 RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
573 ## Create a vector with the given components.
574 # @param theDX X component of the vector.
575 # @param theDY Y component of the vector.
576 # @param theDZ Z component of the vector.
577 # @return New GEOM_Object, containing the created vector.
579 # @ref tui_creation_vector "Example"
580 def MakeVectorDXDYDZ(self,theDX, theDY, theDZ):
581 # Example: see GEOM_TestAll.py
582 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
583 anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
584 RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
585 anObj.SetParameters(Parameters)
588 ## Create a vector between two points.
589 # @param thePnt1 Start point for the vector.
590 # @param thePnt2 End point for the vector.
591 # @return New GEOM_Object, containing the created vector.
593 # @ref tui_creation_vector "Example"
594 def MakeVector(self,thePnt1, thePnt2):
595 # Example: see GEOM_TestAll.py
596 anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
597 RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
600 ## Create a line, passing through the given point
601 # and parrallel to the given direction
602 # @param thePnt Point. The resulting line will pass through it.
603 # @param theDir Direction. The resulting line will be parallel to it.
604 # @return New GEOM_Object, containing the created line.
606 # @ref tui_creation_line "Example"
607 def MakeLine(self,thePnt, theDir):
608 # Example: see GEOM_TestAll.py
609 anObj = self.BasicOp.MakeLine(thePnt, theDir)
610 RaiseIfFailed("MakeLine", self.BasicOp)
613 ## Create a line, passing through the given points
614 # @param thePnt1 First of two points, defining the line.
615 # @param thePnt2 Second of two points, defining the line.
616 # @return New GEOM_Object, containing the created line.
618 # @ref tui_creation_line "Example"
619 def MakeLineTwoPnt(self,thePnt1, thePnt2):
620 # Example: see GEOM_TestAll.py
621 anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
622 RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
625 ## Create a line on two faces intersection.
626 # @param theFace1 First of two faces, defining the line.
627 # @param theFace2 Second of two faces, defining the line.
628 # @return New GEOM_Object, containing the created line.
630 # @ref swig_MakeLineTwoFaces "Example"
631 def MakeLineTwoFaces(self, theFace1, theFace2):
632 # Example: see GEOM_TestAll.py
633 anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
634 RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
637 ## Create a plane, passing through the given point
638 # and normal to the given vector.
639 # @param thePnt Point, the plane has to pass through.
640 # @param theVec Vector, defining the plane normal direction.
641 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
642 # @return New GEOM_Object, containing the created plane.
644 # @ref tui_creation_plane "Example"
645 def MakePlane(self,thePnt, theVec, theTrimSize):
646 # Example: see GEOM_TestAll.py
647 theTrimSize, Parameters = ParseParameters(theTrimSize);
648 anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
649 RaiseIfFailed("MakePlanePntVec", self.BasicOp)
650 anObj.SetParameters(Parameters)
653 ## Create a plane, passing through the three given points
654 # @param thePnt1 First of three points, defining the plane.
655 # @param thePnt2 Second of three points, defining the plane.
656 # @param thePnt3 Fird of three points, defining the plane.
657 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
658 # @return New GEOM_Object, containing the created plane.
660 # @ref tui_creation_plane "Example"
661 def MakePlaneThreePnt(self,thePnt1, thePnt2, thePnt3, theTrimSize):
662 # Example: see GEOM_TestAll.py
663 theTrimSize, Parameters = ParseParameters(theTrimSize);
664 anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
665 RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
666 anObj.SetParameters(Parameters)
669 ## Create a plane, similar to the existing one, but with another size of representing face.
670 # @param theFace Referenced plane or LCS(Marker).
671 # @param theTrimSize New half size of a side of quadrangle face, representing the plane.
672 # @return New GEOM_Object, containing the created plane.
674 # @ref tui_creation_plane "Example"
675 def MakePlaneFace(self,theFace, theTrimSize):
676 # Example: see GEOM_TestAll.py
677 theTrimSize, Parameters = ParseParameters(theTrimSize);
678 anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
679 RaiseIfFailed("MakePlaneFace", self.BasicOp)
680 anObj.SetParameters(Parameters)
683 ## Create a plane, passing through the 2 vectors
684 # with center in a start point of the first vector.
685 # @param theVec1 Vector, defining center point and plane direction.
686 # @param theVec2 Vector, defining the plane normal direction.
687 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
688 # @return New GEOM_Object, containing the created plane.
690 # @ref tui_creation_plane "Example"
691 def MakePlane2Vec(self,theVec1, theVec2, theTrimSize):
692 # Example: see GEOM_TestAll.py
693 theTrimSize, Parameters = ParseParameters(theTrimSize);
694 anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
695 RaiseIfFailed("MakePlane2Vec", self.BasicOp)
696 anObj.SetParameters(Parameters)
699 ## Create a plane, based on a Local coordinate system.
700 # @param theLCS coordinate system, defining plane.
701 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
702 # @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
703 # @return New GEOM_Object, containing the created plane.
705 # @ref tui_creation_plane "Example"
706 def MakePlaneLCS(self,theLCS, theTrimSize, theOrientation):
707 # Example: see GEOM_TestAll.py
708 theTrimSize, Parameters = ParseParameters(theTrimSize);
709 anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
710 RaiseIfFailed("MakePlaneLCS", self.BasicOp)
711 anObj.SetParameters(Parameters)
714 ## Create a local coordinate system.
715 # @param OX,OY,OZ Three coordinates of coordinate system origin.
716 # @param XDX,XDY,XDZ Three components of OX direction
717 # @param YDX,YDY,YDZ Three components of OY direction
718 # @return New GEOM_Object, containing the created coordinate system.
720 # @ref swig_MakeMarker "Example"
721 def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ):
722 # Example: see GEOM_TestAll.py
723 OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
724 anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
725 RaiseIfFailed("MakeMarker", self.BasicOp)
726 anObj.SetParameters(Parameters)
729 ## Create a local coordinate system from shape.
730 # @param theShape The initial shape to detect the coordinate system.
731 # @return New GEOM_Object, containing the created coordinate system.
733 # @ref tui_creation_lcs "Example"
734 def MakeMarkerFromShape(self, theShape):
735 anObj = self.BasicOp.MakeMarkerFromShape(theShape)
736 RaiseIfFailed("MakeMarkerFromShape", self.BasicOp)
739 ## Create a local coordinate system from point and two vectors.
740 # @param theOrigin Point of coordinate system origin.
741 # @param theXVec Vector of X direction
742 # @param theYVec Vector of Y direction
743 # @return New GEOM_Object, containing the created coordinate system.
745 # @ref tui_creation_lcs "Example"
746 def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec):
747 anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec)
748 RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp)
754 ## @addtogroup l4_curves
757 ## Create an arc of circle, passing through three given points.
758 # @param thePnt1 Start point of the arc.
759 # @param thePnt2 Middle point of the arc.
760 # @param thePnt3 End point of the arc.
761 # @return New GEOM_Object, containing the created arc.
763 # @ref swig_MakeArc "Example"
764 def MakeArc(self,thePnt1, thePnt2, thePnt3):
765 # Example: see GEOM_TestAll.py
766 anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
767 RaiseIfFailed("MakeArc", self.CurvesOp)
770 ## Create an arc of circle from a center and 2 points.
771 # @param thePnt1 Center of the arc
772 # @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
773 # @param thePnt3 End point of the arc (Gives also a direction)
774 # @param theSense Orientation of the arc
775 # @return New GEOM_Object, containing the created arc.
777 # @ref swig_MakeArc "Example"
778 def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False):
779 # Example: see GEOM_TestAll.py
780 anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
781 RaiseIfFailed("MakeArcCenter", self.CurvesOp)
784 ## Create an arc of ellipse, of center and two points.
785 # @param theCenter Center of the arc.
786 # @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
787 # @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
788 # @return New GEOM_Object, containing the created arc.
790 # @ref swig_MakeArc "Example"
791 def MakeArcOfEllipse(self,theCenter, thePnt1, thePnt2):
792 # Example: see GEOM_TestAll.py
793 anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
794 RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
797 ## Create a circle with given center, normal vector and radius.
798 # @param thePnt Circle center.
799 # @param theVec Vector, normal to the plane of the circle.
800 # @param theR Circle radius.
801 # @return New GEOM_Object, containing the created circle.
803 # @ref tui_creation_circle "Example"
804 def MakeCircle(self, thePnt, theVec, theR):
805 # Example: see GEOM_TestAll.py
806 theR, Parameters = ParseParameters(theR)
807 anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
808 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
809 anObj.SetParameters(Parameters)
812 ## Create a circle with given radius.
813 # Center of the circle will be in the origin of global
814 # coordinate system and normal vector will be codirected with Z axis
815 # @param theR Circle radius.
816 # @return New GEOM_Object, containing the created circle.
817 def MakeCircleR(self, theR):
818 anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
819 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
822 ## Create a circle, passing through three given points
823 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
824 # @return New GEOM_Object, containing the created circle.
826 # @ref tui_creation_circle "Example"
827 def MakeCircleThreePnt(self,thePnt1, thePnt2, thePnt3):
828 # Example: see GEOM_TestAll.py
829 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
830 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
833 ## Create a circle, with given point1 as center,
834 # passing through the point2 as radius and laying in the plane,
835 # defined by all three given points.
836 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
837 # @return New GEOM_Object, containing the created circle.
839 # @ref swig_MakeCircle "Example"
840 def MakeCircleCenter2Pnt(self,thePnt1, thePnt2, thePnt3):
841 # Example: see GEOM_example6.py
842 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
843 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
846 ## Create an ellipse with given center, normal vector and radiuses.
847 # @param thePnt Ellipse center.
848 # @param theVec Vector, normal to the plane of the ellipse.
849 # @param theRMajor Major ellipse radius.
850 # @param theRMinor Minor ellipse radius.
851 # @param theVecMaj Vector, direction of the ellipse's main axis.
852 # @return New GEOM_Object, containing the created ellipse.
854 # @ref tui_creation_ellipse "Example"
855 def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None):
856 # Example: see GEOM_TestAll.py
857 theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
858 if theVecMaj is not None:
859 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
861 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
863 RaiseIfFailed("MakeEllipse", self.CurvesOp)
864 anObj.SetParameters(Parameters)
867 ## Create an ellipse with given radiuses.
868 # Center of the ellipse will be in the origin of global
869 # coordinate system and normal vector will be codirected with Z axis
870 # @param theRMajor Major ellipse radius.
871 # @param theRMinor Minor ellipse radius.
872 # @return New GEOM_Object, containing the created ellipse.
873 def MakeEllipseRR(self, theRMajor, theRMinor):
874 anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
875 RaiseIfFailed("MakeEllipse", self.CurvesOp)
878 ## Create a polyline on the set of points.
879 # @param thePoints Sequence of points for the polyline.
880 # @return New GEOM_Object, containing the created polyline.
882 # @ref tui_creation_curve "Example"
883 def MakePolyline(self,thePoints):
884 # Example: see GEOM_TestAll.py
885 anObj = self.CurvesOp.MakePolyline(thePoints)
886 RaiseIfFailed("MakePolyline", self.CurvesOp)
889 ## Create bezier curve on the set of points.
890 # @param thePoints Sequence of points for the bezier curve.
891 # @return New GEOM_Object, containing the created bezier curve.
893 # @ref tui_creation_curve "Example"
894 def MakeBezier(self,thePoints):
895 # Example: see GEOM_TestAll.py
896 anObj = self.CurvesOp.MakeSplineBezier(thePoints)
897 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
900 ## Create B-Spline curve on the set of points.
901 # @param thePoints Sequence of points for the B-Spline curve.
902 # @param theIsClosed If True, build a closed curve.
903 # @return New GEOM_Object, containing the created B-Spline curve.
905 # @ref tui_creation_curve "Example"
906 def MakeInterpol(self, thePoints, theIsClosed=False):
907 # Example: see GEOM_TestAll.py
908 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed)
909 RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
915 ## @addtogroup l3_sketcher
918 ## Create a sketcher (wire or face), following the textual description,
919 # passed through <VAR>theCommand</VAR> argument. \n
920 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
921 # Format of the description string have to be the following:
923 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
926 # - x1, y1 are coordinates of the first sketcher point (zero by default),
928 # - "R angle" : Set the direction by angle
929 # - "D dx dy" : Set the direction by DX & DY
932 # - "TT x y" : Create segment by point at X & Y
933 # - "T dx dy" : Create segment by point with DX & DY
934 # - "L length" : Create segment by direction & Length
935 # - "IX x" : Create segment by direction & Intersect. X
936 # - "IY y" : Create segment by direction & Intersect. Y
939 # - "C radius length" : Create arc by direction, radius and length(in degree)
942 # - "WW" : Close Wire (to finish)
943 # - "WF" : Close Wire and build face (to finish)
945 # @param theCommand String, defining the sketcher in local
946 # coordinates of the working plane.
947 # @param theWorkingPlane Nine double values, defining origin,
948 # OZ and OX directions of the working plane.
949 # @return New GEOM_Object, containing the created wire.
951 # @ref tui_sketcher_page "Example"
952 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0]):
953 # Example: see GEOM_TestAll.py
954 theCommand,Parameters = ParseSketcherCommand(theCommand)
955 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
956 RaiseIfFailed("MakeSketcher", self.CurvesOp)
957 anObj.SetParameters(Parameters)
960 ## Create a sketcher (wire or face), following the textual description,
961 # passed through <VAR>theCommand</VAR> argument. \n
962 # For format of the description string see the previous method.\n
963 # @param theCommand String, defining the sketcher in local
964 # coordinates of the working plane.
965 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
966 # @return New GEOM_Object, containing the created wire.
968 # @ref tui_sketcher_page "Example"
969 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane):
970 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
971 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
974 ## Create a sketcher wire, following the numerical description,
975 # passed through <VAR>theCoordinates</VAR> argument. \n
976 # @param theCoordinates double values, defining points to create a wire,
978 # @return New GEOM_Object, containing the created wire.
980 # @ref tui_sketcher_page "Example"
981 def Make3DSketcher(self, theCoordinates):
982 theCoordinates,Parameters = ParseParameters(theCoordinates)
983 anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
984 RaiseIfFailed("Make3DSketcher", self.CurvesOp)
985 anObj.SetParameters(Parameters)
991 ## @addtogroup l3_3d_primitives
994 ## Create a box by coordinates of two opposite vertices.
996 # @ref tui_creation_box "Example"
997 def MakeBox(self,x1,y1,z1,x2,y2,z2):
998 # Example: see GEOM_TestAll.py
999 pnt1 = self.MakeVertex(x1,y1,z1)
1000 pnt2 = self.MakeVertex(x2,y2,z2)
1001 return self.MakeBoxTwoPnt(pnt1,pnt2)
1003 ## Create a box with specified dimensions along the coordinate axes
1004 # and with edges, parallel to the coordinate axes.
1005 # Center of the box will be at point (DX/2, DY/2, DZ/2).
1006 # @param theDX Length of Box edges, parallel to OX axis.
1007 # @param theDY Length of Box edges, parallel to OY axis.
1008 # @param theDZ Length of Box edges, parallel to OZ axis.
1009 # @return New GEOM_Object, containing the created box.
1011 # @ref tui_creation_box "Example"
1012 def MakeBoxDXDYDZ(self,theDX, theDY, theDZ):
1013 # Example: see GEOM_TestAll.py
1014 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1015 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
1016 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
1017 anObj.SetParameters(Parameters)
1020 ## Create a box with two specified opposite vertices,
1021 # and with edges, parallel to the coordinate axes
1022 # @param thePnt1 First of two opposite vertices.
1023 # @param thePnt2 Second of two opposite vertices.
1024 # @return New GEOM_Object, containing the created box.
1026 # @ref tui_creation_box "Example"
1027 def MakeBoxTwoPnt(self,thePnt1, thePnt2):
1028 # Example: see GEOM_TestAll.py
1029 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
1030 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
1033 ## Create a face with specified dimensions along OX-OY coordinate axes,
1034 # with edges, parallel to this coordinate axes.
1035 # @param theH height of Face.
1036 # @param theW width of Face.
1037 # @param theOrientation orientation belong axis OXY OYZ OZX
1038 # @return New GEOM_Object, containing the created face.
1040 # @ref tui_creation_face "Example"
1041 def MakeFaceHW(self,theH, theW, theOrientation):
1042 # Example: see GEOM_TestAll.py
1043 theH,theW,Parameters = ParseParameters(theH, theW)
1044 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
1045 RaiseIfFailed("MakeFaceHW", self.PrimOp)
1046 anObj.SetParameters(Parameters)
1049 ## Create a face from another plane and two sizes,
1050 # vertical size and horisontal size.
1051 # @param theObj Normale vector to the creating face or
1053 # @param theH Height (vertical size).
1054 # @param theW Width (horisontal size).
1055 # @return New GEOM_Object, containing the created face.
1057 # @ref tui_creation_face "Example"
1058 def MakeFaceObjHW(self, theObj, theH, theW):
1059 # Example: see GEOM_TestAll.py
1060 theH,theW,Parameters = ParseParameters(theH, theW)
1061 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
1062 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
1063 anObj.SetParameters(Parameters)
1066 ## Create a disk with given center, normal vector and radius.
1067 # @param thePnt Disk center.
1068 # @param theVec Vector, normal to the plane of the disk.
1069 # @param theR Disk radius.
1070 # @return New GEOM_Object, containing the created disk.
1072 # @ref tui_creation_disk "Example"
1073 def MakeDiskPntVecR(self,thePnt, theVec, theR):
1074 # Example: see GEOM_TestAll.py
1075 theR,Parameters = ParseParameters(theR)
1076 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
1077 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
1078 anObj.SetParameters(Parameters)
1081 ## Create a disk, passing through three given points
1082 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
1083 # @return New GEOM_Object, containing the created disk.
1085 # @ref tui_creation_disk "Example"
1086 def MakeDiskThreePnt(self,thePnt1, thePnt2, thePnt3):
1087 # Example: see GEOM_TestAll.py
1088 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
1089 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
1092 ## Create a disk with specified dimensions along OX-OY coordinate axes.
1093 # @param theR Radius of Face.
1094 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
1095 # @return New GEOM_Object, containing the created disk.
1097 # @ref tui_creation_face "Example"
1098 def MakeDiskR(self,theR, theOrientation):
1099 # Example: see GEOM_TestAll.py
1100 theR,Parameters = ParseParameters(theR)
1101 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
1102 RaiseIfFailed("MakeDiskR", self.PrimOp)
1103 anObj.SetParameters(Parameters)
1106 ## Create a cylinder with given base point, axis, radius and height.
1107 # @param thePnt Central point of cylinder base.
1108 # @param theAxis Cylinder axis.
1109 # @param theR Cylinder radius.
1110 # @param theH Cylinder height.
1111 # @return New GEOM_Object, containing the created cylinder.
1113 # @ref tui_creation_cylinder "Example"
1114 def MakeCylinder(self,thePnt, theAxis, theR, theH):
1115 # Example: see GEOM_TestAll.py
1116 theR,theH,Parameters = ParseParameters(theR, theH)
1117 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
1118 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
1119 anObj.SetParameters(Parameters)
1122 ## Create a cylinder with given radius and height at
1123 # the origin of coordinate system. Axis of the cylinder
1124 # will be collinear to the OZ axis of the coordinate system.
1125 # @param theR Cylinder radius.
1126 # @param theH Cylinder height.
1127 # @return New GEOM_Object, containing the created cylinder.
1129 # @ref tui_creation_cylinder "Example"
1130 def MakeCylinderRH(self,theR, theH):
1131 # Example: see GEOM_TestAll.py
1132 theR,theH,Parameters = ParseParameters(theR, theH)
1133 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
1134 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
1135 anObj.SetParameters(Parameters)
1138 ## Create a sphere with given center and radius.
1139 # @param thePnt Sphere center.
1140 # @param theR Sphere radius.
1141 # @return New GEOM_Object, containing the created sphere.
1143 # @ref tui_creation_sphere "Example"
1144 def MakeSpherePntR(self, thePnt, theR):
1145 # Example: see GEOM_TestAll.py
1146 theR,Parameters = ParseParameters(theR)
1147 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
1148 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
1149 anObj.SetParameters(Parameters)
1152 ## Create a sphere with given center and radius.
1153 # @param x,y,z Coordinates of sphere center.
1154 # @param theR Sphere radius.
1155 # @return New GEOM_Object, containing the created sphere.
1157 # @ref tui_creation_sphere "Example"
1158 def MakeSphere(self, x, y, z, theR):
1159 # Example: see GEOM_TestAll.py
1160 point = self.MakeVertex(x, y, z)
1161 anObj = self.MakeSpherePntR(point, theR)
1164 ## Create a sphere with given radius at the origin of coordinate system.
1165 # @param theR Sphere radius.
1166 # @return New GEOM_Object, containing the created sphere.
1168 # @ref tui_creation_sphere "Example"
1169 def MakeSphereR(self, theR):
1170 # Example: see GEOM_TestAll.py
1171 theR,Parameters = ParseParameters(theR)
1172 anObj = self.PrimOp.MakeSphereR(theR)
1173 RaiseIfFailed("MakeSphereR", self.PrimOp)
1174 anObj.SetParameters(Parameters)
1177 ## Create a cone with given base point, axis, height and radiuses.
1178 # @param thePnt Central point of the first cone base.
1179 # @param theAxis Cone axis.
1180 # @param theR1 Radius of the first cone base.
1181 # @param theR2 Radius of the second cone base.
1182 # \note If both radiuses are non-zero, the cone will be truncated.
1183 # \note If the radiuses are equal, a cylinder will be created instead.
1184 # @param theH Cone height.
1185 # @return New GEOM_Object, containing the created cone.
1187 # @ref tui_creation_cone "Example"
1188 def MakeCone(self,thePnt, theAxis, theR1, theR2, theH):
1189 # Example: see GEOM_TestAll.py
1190 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
1191 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
1192 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
1193 anObj.SetParameters(Parameters)
1196 ## Create a cone with given height and radiuses at
1197 # the origin of coordinate system. Axis of the cone will
1198 # be collinear to the OZ axis of the coordinate system.
1199 # @param theR1 Radius of the first cone base.
1200 # @param theR2 Radius of the second cone base.
1201 # \note If both radiuses are non-zero, the cone will be truncated.
1202 # \note If the radiuses are equal, a cylinder will be created instead.
1203 # @param theH Cone height.
1204 # @return New GEOM_Object, containing the created cone.
1206 # @ref tui_creation_cone "Example"
1207 def MakeConeR1R2H(self,theR1, theR2, theH):
1208 # Example: see GEOM_TestAll.py
1209 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
1210 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
1211 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
1212 anObj.SetParameters(Parameters)
1215 ## Create a torus with given center, normal vector and radiuses.
1216 # @param thePnt Torus central point.
1217 # @param theVec Torus axis of symmetry.
1218 # @param theRMajor Torus major radius.
1219 # @param theRMinor Torus minor radius.
1220 # @return New GEOM_Object, containing the created torus.
1222 # @ref tui_creation_torus "Example"
1223 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor):
1224 # Example: see GEOM_TestAll.py
1225 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
1226 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
1227 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
1228 anObj.SetParameters(Parameters)
1231 ## Create a torus with given radiuses at the origin of coordinate system.
1232 # @param theRMajor Torus major radius.
1233 # @param theRMinor Torus minor radius.
1234 # @return New GEOM_Object, containing the created torus.
1236 # @ref tui_creation_torus "Example"
1237 def MakeTorusRR(self, theRMajor, theRMinor):
1238 # Example: see GEOM_TestAll.py
1239 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
1240 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
1241 RaiseIfFailed("MakeTorusRR", self.PrimOp)
1242 anObj.SetParameters(Parameters)
1245 # end of l3_3d_primitives
1248 ## @addtogroup l3_complex
1251 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
1252 # @param theBase Base shape to be extruded.
1253 # @param thePoint1 First end of extrusion vector.
1254 # @param thePoint2 Second end of extrusion vector.
1255 # @return New GEOM_Object, containing the created prism.
1257 # @ref tui_creation_prism "Example"
1258 def MakePrism(self, theBase, thePoint1, thePoint2):
1259 # Example: see GEOM_TestAll.py
1260 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
1261 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
1264 ## Create a shape by extrusion of the base shape along the vector,
1265 # i.e. all the space, transfixed by the base shape during its translation
1266 # along the vector on the given distance.
1267 # @param theBase Base shape to be extruded.
1268 # @param theVec Direction of extrusion.
1269 # @param theH Prism dimension along theVec.
1270 # @return New GEOM_Object, containing the created prism.
1272 # @ref tui_creation_prism "Example"
1273 def MakePrismVecH(self, theBase, theVec, theH):
1274 # Example: see GEOM_TestAll.py
1275 theH,Parameters = ParseParameters(theH)
1276 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
1277 RaiseIfFailed("MakePrismVecH", self.PrimOp)
1278 anObj.SetParameters(Parameters)
1281 ## Create a shape by extrusion of the base shape along the vector,
1282 # i.e. all the space, transfixed by the base shape during its translation
1283 # along the vector on the given distance in 2 Ways (forward/backward) .
1284 # @param theBase Base shape to be extruded.
1285 # @param theVec Direction of extrusion.
1286 # @param theH Prism dimension along theVec in forward direction.
1287 # @return New GEOM_Object, containing the created prism.
1289 # @ref tui_creation_prism "Example"
1290 def MakePrismVecH2Ways(self, theBase, theVec, theH):
1291 # Example: see GEOM_TestAll.py
1292 theH,Parameters = ParseParameters(theH)
1293 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
1294 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
1295 anObj.SetParameters(Parameters)
1298 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
1299 # @param theBase Base shape to be extruded.
1300 # @param theDX, theDY, theDZ Directions of extrusion.
1301 # @return New GEOM_Object, containing the created prism.
1303 # @ref tui_creation_prism "Example"
1304 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ):
1305 # Example: see GEOM_TestAll.py
1306 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1307 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
1308 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
1309 anObj.SetParameters(Parameters)
1312 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
1313 # i.e. all the space, transfixed by the base shape during its translation
1314 # along the vector on the given distance in 2 Ways (forward/backward) .
1315 # @param theBase Base shape to be extruded.
1316 # @param theDX, theDY, theDZ Directions of extrusion.
1317 # @return New GEOM_Object, containing the created prism.
1319 # @ref tui_creation_prism "Example"
1320 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ):
1321 # Example: see GEOM_TestAll.py
1322 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1323 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
1324 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
1325 anObj.SetParameters(Parameters)
1328 ## Create a shape by revolution of the base shape around the axis
1329 # on the given angle, i.e. all the space, transfixed by the base
1330 # shape during its rotation around the axis on the given angle.
1331 # @param theBase Base shape to be rotated.
1332 # @param theAxis Rotation axis.
1333 # @param theAngle Rotation angle in radians.
1334 # @return New GEOM_Object, containing the created revolution.
1336 # @ref tui_creation_revolution "Example"
1337 def MakeRevolution(self, theBase, theAxis, theAngle):
1338 # Example: see GEOM_TestAll.py
1339 theAngle,Parameters = ParseParameters(theAngle)
1340 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
1341 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
1342 anObj.SetParameters(Parameters)
1345 ## The Same Revolution but in both ways forward&backward.
1346 def MakeRevolution2Ways(self, theBase, theAxis, theAngle):
1347 theAngle,Parameters = ParseParameters(theAngle)
1348 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
1349 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
1350 anObj.SetParameters(Parameters)
1353 ## Create a filling from the given compound of contours.
1354 # @param theShape the compound of contours
1355 # @param theMinDeg a minimal degree of BSpline surface to create
1356 # @param theMaxDeg a maximal degree of BSpline surface to create
1357 # @param theTol2D a 2d tolerance to be reached
1358 # @param theTol3D a 3d tolerance to be reached
1359 # @param theNbIter a number of iteration of approximation algorithm
1360 # @param theMethod Kind of method to perform filling operation:
1361 # 0 - Default - standard behaviour
1362 # 1 - Use edges orientation - orientation of edges are
1363 # used: if edge is reversed curve from this edge
1364 # is reversed before using in filling algorithm.
1365 # 2 - Auto-correct orientation - change orientation
1366 # of curves using minimization of sum of distances
1367 # between ends points of edges.
1368 # @param isApprox if True, BSpline curves are generated in the process
1369 # of surface construction. By default it is False, that means
1370 # the surface is created using Besier curves. The usage of
1371 # Approximation makes the algorithm work slower, but allows
1372 # building the surface for rather complex cases
1373 # @return New GEOM_Object, containing the created filling surface.
1375 # @ref tui_creation_filling "Example"
1376 def MakeFilling(self, theShape, theMinDeg, theMaxDeg, theTol2D,
1377 theTol3D, theNbIter, theMethod=GEOM.FOM_Default, isApprox=0):
1378 # Example: see GEOM_TestAll.py
1379 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
1380 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
1381 theTol2D, theTol3D, theNbIter,
1382 theMethod, isApprox)
1383 RaiseIfFailed("MakeFilling", self.PrimOp)
1384 anObj.SetParameters(Parameters)
1387 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
1388 # @param theSeqSections - set of specified sections.
1389 # @param theModeSolid - mode defining building solid or shell
1390 # @param thePreci - precision 3D used for smoothing by default 1.e-6
1391 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
1392 # @return New GEOM_Object, containing the created shell or solid.
1394 # @ref swig_todo "Example"
1395 def MakeThruSections(self,theSeqSections,theModeSolid,thePreci,theRuled):
1396 # Example: see GEOM_TestAll.py
1397 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
1398 RaiseIfFailed("MakeThruSections", self.PrimOp)
1401 ## Create a shape by extrusion of the base shape along
1402 # the path shape. The path shape can be a wire or an edge.
1403 # @param theBase Base shape to be extruded.
1404 # @param thePath Path shape to extrude the base shape along it.
1405 # @return New GEOM_Object, containing the created pipe.
1407 # @ref tui_creation_pipe "Example"
1408 def MakePipe(self,theBase, thePath):
1409 # Example: see GEOM_TestAll.py
1410 anObj = self.PrimOp.MakePipe(theBase, thePath)
1411 RaiseIfFailed("MakePipe", self.PrimOp)
1414 ## Create a shape by extrusion of the profile shape along
1415 # the path shape. The path shape can be a wire or an edge.
1416 # the several profiles can be specified in the several locations of path.
1417 # @param theSeqBases - list of Bases shape to be extruded.
1418 # @param theLocations - list of locations on the path corresponding
1419 # specified list of the Bases shapes. Number of locations
1420 # should be equal to number of bases or list of locations can be empty.
1421 # @param thePath - Path shape to extrude the base shape along it.
1422 # @param theWithContact - the mode defining that the section is translated to be in
1423 # contact with the spine.
1424 # @param theWithCorrection - defining that the section is rotated to be
1425 # orthogonal to the spine tangent in the correspondent point
1426 # @return New GEOM_Object, containing the created pipe.
1428 # @ref tui_creation_pipe_with_diff_sec "Example"
1429 def MakePipeWithDifferentSections(self, theSeqBases,
1430 theLocations, thePath,
1431 theWithContact, theWithCorrection):
1432 anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
1433 theLocations, thePath,
1434 theWithContact, theWithCorrection)
1435 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
1438 ## Create a shape by extrusion of the profile shape along
1439 # the path shape. The path shape can be a wire or a edge.
1440 # the several profiles can be specified in the several locations of path.
1441 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
1442 # shell or face. If number of faces in neighbour sections
1443 # aren't coincided result solid between such sections will
1444 # be created using external boundaries of this shells.
1445 # @param theSeqSubBases - list of corresponding subshapes of section shapes.
1446 # This list is used for searching correspondences between
1447 # faces in the sections. Size of this list must be equal
1448 # to size of list of base shapes.
1449 # @param theLocations - list of locations on the path corresponding
1450 # specified list of the Bases shapes. Number of locations
1451 # should be equal to number of bases. First and last
1452 # locations must be coincided with first and last vertexes
1453 # of path correspondingly.
1454 # @param thePath - Path shape to extrude the base shape along it.
1455 # @param theWithContact - the mode defining that the section is translated to be in
1456 # contact with the spine.
1457 # @param theWithCorrection - defining that the section is rotated to be
1458 # orthogonal to the spine tangent in the correspondent point
1459 # @return New GEOM_Object, containing the created solids.
1461 # @ref tui_creation_pipe_with_shell_sec "Example"
1462 def MakePipeWithShellSections(self,theSeqBases, theSeqSubBases,
1463 theLocations, thePath,
1464 theWithContact, theWithCorrection):
1465 anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
1466 theLocations, thePath,
1467 theWithContact, theWithCorrection)
1468 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
1471 ## Create a shape by extrusion of the profile shape along
1472 # the path shape. This function is used only for debug pipe
1473 # functionality - it is a version of previous function
1474 # (MakePipeWithShellSections(...)) which give a possibility to
1475 # recieve information about creating pipe between each pair of
1476 # sections step by step.
1477 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
1478 theLocations, thePath,
1479 theWithContact, theWithCorrection):
1481 nbsect = len(theSeqBases)
1482 nbsubsect = len(theSeqSubBases)
1483 #print "nbsect = ",nbsect
1484 for i in range(1,nbsect):
1486 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
1487 tmpLocations = [ theLocations[i-1], theLocations[i] ]
1489 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
1490 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
1491 tmpLocations, thePath,
1492 theWithContact, theWithCorrection)
1493 if self.PrimOp.IsDone() == 0:
1494 print "Problems with pipe creation between ",i," and ",i+1," sections"
1495 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
1498 print "Pipe between ",i," and ",i+1," sections is OK"
1503 resc = self.MakeCompound(res)
1504 #resc = self.MakeSewing(res, 0.001)
1505 #print "resc: ",resc
1508 ## Create solids between given sections
1509 # @param theSeqBases - list of sections (shell or face).
1510 # @param theLocations - list of corresponding vertexes
1511 # @return New GEOM_Object, containing the created solids.
1513 # @ref tui_creation_pipe_without_path "Example"
1514 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations):
1515 anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
1516 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
1519 ## Create a shape by extrusion of the base shape along
1520 # the path shape with constant bi-normal direction along the given vector.
1521 # The path shape can be a wire or an edge.
1522 # @param theBase Base shape to be extruded.
1523 # @param thePath Path shape to extrude the base shape along it.
1524 # @param theVec Vector defines a constant binormal direction to keep the
1525 # same angle beetween the direction and the sections
1526 # along the sweep surface.
1527 # @return New GEOM_Object, containing the created pipe.
1529 # @ref tui_creation_pipe "Example"
1530 def MakePipeBiNormalAlongVector(self,theBase, thePath, theVec):
1531 # Example: see GEOM_TestAll.py
1532 anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
1533 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
1539 ## @addtogroup l3_advanced
1542 ## Create a linear edge with specified ends.
1543 # @param thePnt1 Point for the first end of edge.
1544 # @param thePnt2 Point for the second end of edge.
1545 # @return New GEOM_Object, containing the created edge.
1547 # @ref tui_creation_edge "Example"
1548 def MakeEdge(self,thePnt1, thePnt2):
1549 # Example: see GEOM_TestAll.py
1550 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
1551 RaiseIfFailed("MakeEdge", self.ShapesOp)
1554 ## Create a wire from the set of edges and wires.
1555 # @param theEdgesAndWires List of edges and/or wires.
1556 # @param theTolerance Maximum distance between vertices, that will be merged.
1557 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
1558 # @return New GEOM_Object, containing the created wire.
1560 # @ref tui_creation_wire "Example"
1561 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07):
1562 # Example: see GEOM_TestAll.py
1563 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
1564 RaiseIfFailed("MakeWire", self.ShapesOp)
1567 ## Create a face on the given wire.
1568 # @param theWire closed Wire or Edge to build the face on.
1569 # @param isPlanarWanted If TRUE, only planar face will be built.
1570 # If impossible, NULL object will be returned.
1571 # @return New GEOM_Object, containing the created face.
1573 # @ref tui_creation_face "Example"
1574 def MakeFace(self,theWire, isPlanarWanted):
1575 # Example: see GEOM_TestAll.py
1576 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
1577 RaiseIfFailed("MakeFace", self.ShapesOp)
1580 ## Create a face on the given wires set.
1581 # @param theWires List of closed wires or edges to build the face on.
1582 # @param isPlanarWanted If TRUE, only planar face will be built.
1583 # If impossible, NULL object will be returned.
1584 # @return New GEOM_Object, containing the created face.
1586 # @ref tui_creation_face "Example"
1587 def MakeFaceWires(self,theWires, isPlanarWanted):
1588 # Example: see GEOM_TestAll.py
1589 anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
1590 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
1593 ## Shortcut to MakeFaceWires()
1595 # @ref tui_creation_face "Example 1"
1596 # \n @ref swig_MakeFaces "Example 2"
1597 def MakeFaces(self,theWires, isPlanarWanted):
1598 # Example: see GEOM_TestOthers.py
1599 anObj = self.MakeFaceWires(theWires, isPlanarWanted)
1602 ## Create a shell from the set of faces and shells.
1603 # @param theFacesAndShells List of faces and/or shells.
1604 # @return New GEOM_Object, containing the created shell.
1606 # @ref tui_creation_shell "Example"
1607 def MakeShell(self,theFacesAndShells):
1608 # Example: see GEOM_TestAll.py
1609 anObj = self.ShapesOp.MakeShell(theFacesAndShells)
1610 RaiseIfFailed("MakeShell", self.ShapesOp)
1613 ## Create a solid, bounded by the given shells.
1614 # @param theShells Sequence of bounding shells.
1615 # @return New GEOM_Object, containing the created solid.
1617 # @ref tui_creation_solid "Example"
1618 def MakeSolid(self,theShells):
1619 # Example: see GEOM_TestAll.py
1620 anObj = self.ShapesOp.MakeSolidShells(theShells)
1621 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
1624 ## Create a compound of the given shapes.
1625 # @param theShapes List of shapes to put in compound.
1626 # @return New GEOM_Object, containing the created compound.
1628 # @ref tui_creation_compound "Example"
1629 def MakeCompound(self,theShapes):
1630 # Example: see GEOM_TestAll.py
1631 anObj = self.ShapesOp.MakeCompound(theShapes)
1632 RaiseIfFailed("MakeCompound", self.ShapesOp)
1635 # end of l3_advanced
1638 ## @addtogroup l2_measure
1641 ## Gives quantity of faces in the given shape.
1642 # @param theShape Shape to count faces of.
1643 # @return Quantity of faces.
1645 # @ref swig_NumberOf "Example"
1646 def NumberOfFaces(self, theShape):
1647 # Example: see GEOM_TestOthers.py
1648 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
1649 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
1652 ## Gives quantity of edges in the given shape.
1653 # @param theShape Shape to count edges of.
1654 # @return Quantity of edges.
1656 # @ref swig_NumberOf "Example"
1657 def NumberOfEdges(self, theShape):
1658 # Example: see GEOM_TestOthers.py
1659 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
1660 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
1663 ## Gives quantity of subshapes of type theShapeType in the given shape.
1664 # @param theShape Shape to count subshapes of.
1665 # @param theShapeType Type of subshapes to count.
1666 # @return Quantity of subshapes of given type.
1668 # @ref swig_NumberOf "Example"
1669 def NumberOfSubShapes(self, theShape, theShapeType):
1670 # Example: see GEOM_TestOthers.py
1671 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
1672 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
1675 ## Gives quantity of solids in the given shape.
1676 # @param theShape Shape to count solids in.
1677 # @return Quantity of solids.
1679 # @ref swig_NumberOf "Example"
1680 def NumberOfSolids(self, theShape):
1681 # Example: see GEOM_TestOthers.py
1682 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, ShapeType["SOLID"])
1683 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
1689 ## @addtogroup l3_healing
1692 ## Reverses an orientation the given shape.
1693 # @param theShape Shape to be reversed.
1694 # @return The reversed copy of theShape.
1696 # @ref swig_ChangeOrientation "Example"
1697 def ChangeOrientation(self,theShape):
1698 # Example: see GEOM_TestAll.py
1699 anObj = self.ShapesOp.ChangeOrientation(theShape)
1700 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
1703 ## Shortcut to ChangeOrientation()
1705 # @ref swig_OrientationChange "Example"
1706 def OrientationChange(self,theShape):
1707 # Example: see GEOM_TestOthers.py
1708 anObj = self.ChangeOrientation(theShape)
1714 ## @addtogroup l4_obtain
1717 ## Retrieve all free faces from the given shape.
1718 # Free face is a face, which is not shared between two shells of the shape.
1719 # @param theShape Shape to find free faces in.
1720 # @return List of IDs of all free faces, contained in theShape.
1722 # @ref tui_measurement_tools_page "Example"
1723 def GetFreeFacesIDs(self,theShape):
1724 # Example: see GEOM_TestOthers.py
1725 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
1726 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
1729 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
1730 # @param theShape1 Shape to find sub-shapes in.
1731 # @param theShape2 Shape to find shared sub-shapes with.
1732 # @param theShapeType Type of sub-shapes to be retrieved.
1733 # @return List of sub-shapes of theShape1, shared with theShape2.
1735 # @ref swig_GetSharedShapes "Example"
1736 def GetSharedShapes(self,theShape1, theShape2, theShapeType):
1737 # Example: see GEOM_TestOthers.py
1738 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
1739 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
1742 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
1743 # situated relatively the specified plane by the certain way,
1744 # defined through <VAR>theState</VAR> parameter.
1745 # @param theShape Shape to find sub-shapes of.
1746 # @param theShapeType Type of sub-shapes to be retrieved.
1747 # @param theAx1 Vector (or line, or linear edge), specifying normal
1748 # direction and location of the plane to find shapes on.
1749 # @param theState The state of the subshapes to find. It can be one of
1750 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1751 # @return List of all found sub-shapes.
1753 # @ref swig_GetShapesOnPlane "Example"
1754 def GetShapesOnPlane(self,theShape, theShapeType, theAx1, theState):
1755 # Example: see GEOM_TestOthers.py
1756 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
1757 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
1760 ## Works like the above method, but returns list of sub-shapes indices
1762 # @ref swig_GetShapesOnPlaneIDs "Example"
1763 def GetShapesOnPlaneIDs(self,theShape, theShapeType, theAx1, theState):
1764 # Example: see GEOM_TestOthers.py
1765 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
1766 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
1769 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
1770 # situated relatively the specified plane by the certain way,
1771 # defined through <VAR>theState</VAR> parameter.
1772 # @param theShape Shape to find sub-shapes of.
1773 # @param theShapeType Type of sub-shapes to be retrieved.
1774 # @param theAx1 Vector (or line, or linear edge), specifying normal
1775 # direction of the plane to find shapes on.
1776 # @param thePnt Point specifying location of the plane to find shapes on.
1777 # @param theState The state of the subshapes to find. It can be one of
1778 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1779 # @return List of all found sub-shapes.
1781 # @ref swig_GetShapesOnPlaneWithLocation "Example"
1782 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState):
1783 # Example: see GEOM_TestOthers.py
1784 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
1785 theAx1, thePnt, theState)
1786 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
1789 ## Works like the above method, but returns list of sub-shapes indices
1791 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
1792 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
1793 # Example: see GEOM_TestOthers.py
1794 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
1795 theAx1, thePnt, theState)
1796 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
1799 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1800 # the specified cylinder by the certain way, defined through \a theState parameter.
1801 # @param theShape Shape to find sub-shapes of.
1802 # @param theShapeType Type of sub-shapes to be retrieved.
1803 # @param theAxis Vector (or line, or linear edge), specifying
1804 # axis of the cylinder to find shapes on.
1805 # @param theRadius Radius of the cylinder to find shapes on.
1806 # @param theState The state of the subshapes to find. It can be one of
1807 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1808 # @return List of all found sub-shapes.
1810 # @ref swig_GetShapesOnCylinder "Example"
1811 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState):
1812 # Example: see GEOM_TestOthers.py
1813 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
1814 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
1817 ## Works like the above method, but returns list of sub-shapes indices
1819 # @ref swig_GetShapesOnCylinderIDs "Example"
1820 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
1821 # Example: see GEOM_TestOthers.py
1822 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
1823 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
1826 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1827 # the specified cylinder by the certain way, defined through \a theState parameter.
1828 # @param theShape Shape to find sub-shapes of.
1829 # @param theShapeType Type of sub-shapes to be retrieved.
1830 # @param theAxis Vector (or line, or linear edge), specifying
1831 # axis of the cylinder to find shapes on.
1832 # @param thePnt Point specifying location of the bottom of the cylinder.
1833 # @param theRadius Radius of the cylinder to find shapes on.
1834 # @param theState The state of the subshapes to find. It can be one of
1835 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1836 # @return List of all found sub-shapes.
1838 # @ref swig_GetShapesOnCylinderWithLocation "Example"
1839 def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
1840 # Example: see GEOM_TestOthers.py
1841 aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
1842 RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
1845 ## Works like the above method, but returns list of sub-shapes indices
1847 # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
1848 def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
1849 # Example: see GEOM_TestOthers.py
1850 aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
1851 RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
1854 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1855 # the specified sphere by the certain way, defined through \a theState parameter.
1856 # @param theShape Shape to find sub-shapes of.
1857 # @param theShapeType Type of sub-shapes to be retrieved.
1858 # @param theCenter Point, specifying center of the sphere to find shapes on.
1859 # @param theRadius Radius of the sphere to find shapes on.
1860 # @param theState The state of the subshapes to find. It can be one of
1861 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1862 # @return List of all found sub-shapes.
1864 # @ref swig_GetShapesOnSphere "Example"
1865 def GetShapesOnSphere(self,theShape, theShapeType, theCenter, theRadius, theState):
1866 # Example: see GEOM_TestOthers.py
1867 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
1868 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
1871 ## Works like the above method, but returns list of sub-shapes indices
1873 # @ref swig_GetShapesOnSphereIDs "Example"
1874 def GetShapesOnSphereIDs(self,theShape, theShapeType, theCenter, theRadius, theState):
1875 # Example: see GEOM_TestOthers.py
1876 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
1877 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
1880 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1881 # the specified quadrangle by the certain way, defined through \a theState parameter.
1882 # @param theShape Shape to find sub-shapes of.
1883 # @param theShapeType Type of sub-shapes to be retrieved.
1884 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
1885 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
1886 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
1887 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
1888 # @param theState The state of the subshapes to find. It can be one of
1889 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1890 # @return List of all found sub-shapes.
1892 # @ref swig_GetShapesOnQuadrangle "Example"
1893 def GetShapesOnQuadrangle(self, theShape, theShapeType,
1894 theTopLeftPoint, theTopRigthPoint,
1895 theBottomLeftPoint, theBottomRigthPoint, theState):
1896 # Example: see GEOM_TestOthers.py
1897 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
1898 theTopLeftPoint, theTopRigthPoint,
1899 theBottomLeftPoint, theBottomRigthPoint, theState)
1900 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
1903 ## Works like the above method, but returns list of sub-shapes indices
1905 # @ref swig_GetShapesOnQuadrangleIDs "Example"
1906 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
1907 theTopLeftPoint, theTopRigthPoint,
1908 theBottomLeftPoint, theBottomRigthPoint, theState):
1909 # Example: see GEOM_TestOthers.py
1910 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
1911 theTopLeftPoint, theTopRigthPoint,
1912 theBottomLeftPoint, theBottomRigthPoint, theState)
1913 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
1916 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1917 # the specified \a theBox by the certain way, defined through \a theState parameter.
1918 # @param theBox Shape for relative comparing.
1919 # @param theShape Shape to find sub-shapes of.
1920 # @param theShapeType Type of sub-shapes to be retrieved.
1921 # @param theState The state of the subshapes to find. It can be one of
1922 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1923 # @return List of all found sub-shapes.
1925 # @ref swig_GetShapesOnBox "Example"
1926 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState):
1927 # Example: see GEOM_TestOthers.py
1928 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
1929 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
1932 ## Works like the above method, but returns list of sub-shapes indices
1934 # @ref swig_GetShapesOnBoxIDs "Example"
1935 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
1936 # Example: see GEOM_TestOthers.py
1937 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
1938 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
1941 ## Find in \a theShape all sub-shapes of type \a theShapeType,
1942 # situated relatively the specified \a theCheckShape by the
1943 # certain way, defined through \a theState parameter.
1944 # @param theCheckShape Shape for relative comparing. It must be a solid.
1945 # @param theShape Shape to find sub-shapes of.
1946 # @param theShapeType Type of sub-shapes to be retrieved.
1947 # @param theState The state of the subshapes to find. It can be one of
1948 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1949 # @return List of all found sub-shapes.
1951 # @ref swig_GetShapesOnShape "Example"
1952 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState):
1953 # Example: see GEOM_TestOthers.py
1954 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
1955 theShapeType, theState)
1956 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
1959 ## Works like the above method, but returns result as compound
1961 # @ref swig_GetShapesOnShapeAsCompound "Example"
1962 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState):
1963 # Example: see GEOM_TestOthers.py
1964 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
1965 theShapeType, theState)
1966 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
1969 ## Works like the above method, but returns list of sub-shapes indices
1971 # @ref swig_GetShapesOnShapeIDs "Example"
1972 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
1973 # Example: see GEOM_TestOthers.py
1974 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
1975 theShapeType, theState)
1976 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
1979 ## Get sub-shape(s) of theShapeWhere, which are
1980 # coincident with \a theShapeWhat or could be a part of it.
1981 # @param theShapeWhere Shape to find sub-shapes of.
1982 # @param theShapeWhat Shape, specifying what to find.
1983 # @return Group of all found sub-shapes or a single found sub-shape.
1985 # @ref swig_GetInPlace "Example"
1986 def GetInPlace(self,theShapeWhere, theShapeWhat):
1987 # Example: see GEOM_TestOthers.py
1988 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
1989 RaiseIfFailed("GetInPlace", self.ShapesOp)
1992 ## Get sub-shape(s) of \a theShapeWhere, which are
1993 # coincident with \a theShapeWhat or could be a part of it.
1995 # Implementation of this method is based on a saved history of an operation,
1996 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
1997 # arguments (an argument shape or a sub-shape of an argument shape).
1998 # The operation could be the Partition or one of boolean operations,
1999 # performed on simple shapes (not on compounds).
2001 # @param theShapeWhere Shape to find sub-shapes of.
2002 # @param theShapeWhat Shape, specifying what to find (must be in the
2003 # building history of the ShapeWhere).
2004 # @return Group of all found sub-shapes or a single found sub-shape.
2006 # @ref swig_GetInPlace "Example"
2007 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat):
2008 # Example: see GEOM_TestOthers.py
2009 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
2010 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
2013 ## Get sub-shape of theShapeWhere, which is
2014 # equal to \a theShapeWhat.
2015 # @param theShapeWhere Shape to find sub-shape of.
2016 # @param theShapeWhat Shape, specifying what to find.
2017 # @return New GEOM_Object for found sub-shape.
2019 # @ref swig_GetSame "Example"
2020 def GetSame(self,theShapeWhere, theShapeWhat):
2021 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
2022 RaiseIfFailed("GetSame", self.ShapesOp)
2028 ## @addtogroup l4_access
2031 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
2032 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
2034 # @ref swig_all_decompose "Example"
2035 def GetSubShape(self, aShape, ListOfID):
2036 # Example: see GEOM_TestAll.py
2037 anObj = self.AddSubShape(aShape,ListOfID)
2040 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
2042 # @ref swig_all_decompose "Example"
2043 def GetSubShapeID(self, aShape, aSubShape):
2044 # Example: see GEOM_TestAll.py
2045 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
2046 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
2052 ## @addtogroup l4_decompose
2055 ## Explode a shape on subshapes of a given type.
2056 # @param aShape Shape to be exploded.
2057 # @param aType Type of sub-shapes to be retrieved.
2058 # @return List of sub-shapes of type theShapeType, contained in theShape.
2060 # @ref swig_all_decompose "Example"
2061 def SubShapeAll(self, aShape, aType):
2062 # Example: see GEOM_TestAll.py
2063 ListObj = self.ShapesOp.MakeExplode(aShape,aType,0)
2064 RaiseIfFailed("MakeExplode", self.ShapesOp)
2067 ## Explode a shape on subshapes of a given type.
2068 # @param aShape Shape to be exploded.
2069 # @param aType Type of sub-shapes to be retrieved.
2070 # @return List of IDs of sub-shapes.
2072 # @ref swig_all_decompose "Example"
2073 def SubShapeAllIDs(self, aShape, aType):
2074 ListObj = self.ShapesOp.SubShapeAllIDs(aShape,aType,0)
2075 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
2078 ## Explode a shape on subshapes of a given type.
2079 # Sub-shapes will be sorted by coordinates of their gravity centers.
2080 # @param aShape Shape to be exploded.
2081 # @param aType Type of sub-shapes to be retrieved.
2082 # @return List of sub-shapes of type theShapeType, contained in theShape.
2084 # @ref swig_SubShapeAllSorted "Example"
2085 def SubShapeAllSorted(self, aShape, aType):
2086 # Example: see GEOM_TestAll.py
2087 ListObj = self.ShapesOp.MakeExplode(aShape,aType,1)
2088 RaiseIfFailed("MakeExplode", self.ShapesOp)
2091 ## Explode a shape on subshapes of a given type.
2092 # Sub-shapes will be sorted by coordinates of their gravity centers.
2093 # @param aShape Shape to be exploded.
2094 # @param aType Type of sub-shapes to be retrieved.
2095 # @return List of IDs of sub-shapes.
2097 # @ref swig_all_decompose "Example"
2098 def SubShapeAllSortedIDs(self, aShape, aType):
2099 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape,aType,1)
2100 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
2103 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
2104 # selected by they indices in list of all sub-shapes of type <VAR>aType</VAR>.
2105 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
2107 # @ref swig_all_decompose "Example"
2108 def SubShape(self, aShape, aType, ListOfInd):
2109 # Example: see GEOM_TestAll.py
2111 AllShapeList = self.SubShapeAll(aShape, aType)
2112 for ind in ListOfInd:
2113 ListOfIDs.append(self.GetSubShapeID(aShape, AllShapeList[ind - 1]))
2114 anObj = self.GetSubShape(aShape, ListOfIDs)
2117 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
2118 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
2119 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
2121 # @ref swig_all_decompose "Example"
2122 def SubShapeSorted(self,aShape, aType, ListOfInd):
2123 # Example: see GEOM_TestAll.py
2125 AllShapeList = self.SubShapeAllSorted(aShape, aType)
2126 for ind in ListOfInd:
2127 ListOfIDs.append(self.GetSubShapeID(aShape, AllShapeList[ind - 1]))
2128 anObj = self.GetSubShape(aShape, ListOfIDs)
2131 # end of l4_decompose
2134 ## @addtogroup l3_healing
2137 ## Apply a sequence of Shape Healing operators to the given object.
2138 # @param theShape Shape to be processed.
2139 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
2140 # @param theParameters List of names of parameters
2141 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
2142 # @param theValues List of values of parameters, in the same order
2143 # as parameters are listed in <VAR>theParameters</VAR> list.
2144 # @return New GEOM_Object, containing processed shape.
2146 # @ref tui_shape_processing "Example"
2147 def ProcessShape(self, theShape, theOperators, theParameters, theValues):
2148 # Example: see GEOM_TestHealing.py
2149 theValues,Parameters = ParseList(theValues)
2150 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
2151 # To avoid script failure in case of good argument shape
2152 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
2154 RaiseIfFailed("ProcessShape", self.HealOp)
2155 for string in (theOperators + theParameters):
2156 Parameters = ":" + Parameters
2158 anObj.SetParameters(Parameters)
2161 ## Remove faces from the given object (shape).
2162 # @param theObject Shape to be processed.
2163 # @param theFaces Indices of faces to be removed, if EMPTY then the method
2164 # removes ALL faces of the given object.
2165 # @return New GEOM_Object, containing processed shape.
2167 # @ref tui_suppress_faces "Example"
2168 def SuppressFaces(self,theObject, theFaces):
2169 # Example: see GEOM_TestHealing.py
2170 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
2171 RaiseIfFailed("SuppressFaces", self.HealOp)
2174 ## Sewing of some shapes into single shape.
2176 # @ref tui_sewing "Example"
2177 def MakeSewing(self, ListShape, theTolerance):
2178 # Example: see GEOM_TestHealing.py
2179 comp = self.MakeCompound(ListShape)
2180 anObj = self.Sew(comp, theTolerance)
2183 ## Sewing of the given object.
2184 # @param theObject Shape to be processed.
2185 # @param theTolerance Required tolerance value.
2186 # @return New GEOM_Object, containing processed shape.
2187 def Sew(self, theObject, theTolerance):
2188 # Example: see MakeSewing() above
2189 theTolerance,Parameters = ParseParameters(theTolerance)
2190 anObj = self.HealOp.Sew(theObject, theTolerance)
2191 RaiseIfFailed("Sew", self.HealOp)
2192 anObj.SetParameters(Parameters)
2195 ## Remove internal wires and edges from the given object (face).
2196 # @param theObject Shape to be processed.
2197 # @param theWires Indices of wires to be removed, if EMPTY then the method
2198 # removes ALL internal wires of the given object.
2199 # @return New GEOM_Object, containing processed shape.
2201 # @ref tui_suppress_internal_wires "Example"
2202 def SuppressInternalWires(self,theObject, theWires):
2203 # Example: see GEOM_TestHealing.py
2204 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
2205 RaiseIfFailed("RemoveIntWires", self.HealOp)
2208 ## Remove internal closed contours (holes) from the given object.
2209 # @param theObject Shape to be processed.
2210 # @param theWires Indices of wires to be removed, if EMPTY then the method
2211 # removes ALL internal holes of the given object
2212 # @return New GEOM_Object, containing processed shape.
2214 # @ref tui_suppress_holes "Example"
2215 def SuppressHoles(self,theObject, theWires):
2216 # Example: see GEOM_TestHealing.py
2217 anObj = self.HealOp.FillHoles(theObject, theWires)
2218 RaiseIfFailed("FillHoles", self.HealOp)
2221 ## Close an open wire.
2222 # @param theObject Shape to be processed.
2223 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
2224 # if -1, then <VAR>theObject</VAR> itself is a wire.
2225 # @param isCommonVertex If TRUE : closure by creation of a common vertex,
2226 # If FALS : closure by creation of an edge between ends.
2227 # @return New GEOM_Object, containing processed shape.
2229 # @ref tui_close_contour "Example"
2230 def CloseContour(self,theObject, theWires, isCommonVertex):
2231 # Example: see GEOM_TestHealing.py
2232 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
2233 RaiseIfFailed("CloseContour", self.HealOp)
2236 ## Addition of a point to a given edge object.
2237 # @param theObject Shape to be processed.
2238 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
2239 # if -1, then theObject itself is the edge.
2240 # @param theValue Value of parameter on edge or length parameter,
2241 # depending on \a isByParameter.
2242 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1],
2243 # if FALSE : \a theValue is treated as a length parameter [0..1]
2244 # @return New GEOM_Object, containing processed shape.
2246 # @ref tui_add_point_on_edge "Example"
2247 def DivideEdge(self,theObject, theEdgeIndex, theValue, isByParameter):
2248 # Example: see GEOM_TestHealing.py
2249 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
2250 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
2251 RaiseIfFailed("DivideEdge", self.HealOp)
2252 anObj.SetParameters(Parameters)
2255 ## Change orientation of the given object. Updates given shape.
2256 # @param theObject Shape to be processed.
2258 # @ref swig_todo "Example"
2259 def ChangeOrientationShell(self,theObject):
2260 theObject = self.HealOp.ChangeOrientation(theObject)
2261 RaiseIfFailed("ChangeOrientation", self.HealOp)
2264 ## Change orientation of the given object.
2265 # @param theObject Shape to be processed.
2266 # @return New GEOM_Object, containing processed shape.
2268 # @ref swig_todo "Example"
2269 def ChangeOrientationShellCopy(self,theObject):
2270 anObj = self.HealOp.ChangeOrientationCopy(theObject)
2271 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
2274 ## Get a list of wires (wrapped in GEOM_Object-s),
2275 # that constitute a free boundary of the given shape.
2276 # @param theObject Shape to get free boundary of.
2277 # @return [status, theClosedWires, theOpenWires]
2278 # status: FALSE, if an error(s) occured during the method execution.
2279 # theClosedWires: Closed wires on the free boundary of the given shape.
2280 # theOpenWires: Open wires on the free boundary of the given shape.
2282 # @ref tui_measurement_tools_page "Example"
2283 def GetFreeBoundary(self,theObject):
2284 # Example: see GEOM_TestHealing.py
2285 anObj = self.HealOp.GetFreeBoundary(theObject)
2286 RaiseIfFailed("GetFreeBoundary", self.HealOp)
2289 ## Replace coincident faces in theShape by one face.
2290 # @param theShape Initial shape.
2291 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
2292 # @param doKeepNonSolids If FALSE, only solids will present in the result,
2293 # otherwise all initial shapes.
2294 # @return New GEOM_Object, containing a copy of theShape without coincident faces.
2296 # @ref tui_glue_faces "Example"
2297 def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True):
2298 # Example: see GEOM_Spanner.py
2299 theTolerance,Parameters = ParseParameters(theTolerance)
2300 anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
2302 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
2303 anObj.SetParameters(Parameters)
2306 ## Find coincident faces in theShape for possible gluing.
2307 # @param theShape Initial shape.
2308 # @param theTolerance Maximum distance between faces,
2309 # which can be considered as coincident.
2312 # @ref swig_todo "Example"
2313 def GetGlueFaces(self, theShape, theTolerance):
2314 # Example: see GEOM_Spanner.py
2315 anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
2316 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
2319 ## Replace coincident faces in theShape by one face
2320 # in compliance with given list of faces
2321 # @param theShape Initial shape.
2322 # @param theTolerance Maximum distance between faces,
2323 # which can be considered as coincident.
2324 # @param theFaces List of faces for gluing.
2325 # @param doKeepNonSolids If FALSE, only solids will present in the result,
2326 # otherwise all initial shapes.
2327 # @return New GEOM_Object, containing a copy of theShape
2328 # without some faces.
2330 # @ref swig_todo "Example"
2331 def MakeGlueFacesByList(self, theShape, theTolerance, theFaces, doKeepNonSolids=True):
2332 # Example: see GEOM_Spanner.py
2333 anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces, doKeepNonSolids)
2335 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
2341 ## @addtogroup l3_boolean Boolean Operations
2344 # -----------------------------------------------------------------------------
2345 # Boolean (Common, Cut, Fuse, Section)
2346 # -----------------------------------------------------------------------------
2348 ## Perform one of boolean operations on two given shapes.
2349 # @param theShape1 First argument for boolean operation.
2350 # @param theShape2 Second argument for boolean operation.
2351 # @param theOperation Indicates the operation to be done:
2352 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
2353 # @return New GEOM_Object, containing the result shape.
2355 # @ref tui_fuse "Example"
2356 def MakeBoolean(self,theShape1, theShape2, theOperation):
2357 # Example: see GEOM_TestAll.py
2358 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation)
2359 RaiseIfFailed("MakeBoolean", self.BoolOp)
2362 ## Shortcut to MakeBoolean(s1, s2, 1)
2364 # @ref tui_common "Example 1"
2365 # \n @ref swig_MakeCommon "Example 2"
2366 def MakeCommon(self, s1, s2):
2367 # Example: see GEOM_TestOthers.py
2368 return self.MakeBoolean(s1, s2, 1)
2370 ## Shortcut to MakeBoolean(s1, s2, 2)
2372 # @ref tui_cut "Example 1"
2373 # \n @ref swig_MakeCommon "Example 2"
2374 def MakeCut(self, s1, s2):
2375 # Example: see GEOM_TestOthers.py
2376 return self.MakeBoolean(s1, s2, 2)
2378 ## Shortcut to MakeBoolean(s1, s2, 3)
2380 # @ref tui_fuse "Example 1"
2381 # \n @ref swig_MakeCommon "Example 2"
2382 def MakeFuse(self, s1, s2):
2383 # Example: see GEOM_TestOthers.py
2384 return self.MakeBoolean(s1, s2, 3)
2386 ## Shortcut to MakeBoolean(s1, s2, 4)
2388 # @ref tui_section "Example 1"
2389 # \n @ref swig_MakeCommon "Example 2"
2390 def MakeSection(self, s1, s2):
2391 # Example: see GEOM_TestOthers.py
2392 return self.MakeBoolean(s1, s2, 4)
2397 ## @addtogroup l3_basic_op
2400 ## Perform partition operation.
2401 # @param ListShapes Shapes to be intersected.
2402 # @param ListTools Shapes to intersect theShapes.
2403 # !!!NOTE: Each compound from ListShapes and ListTools will be exploded
2404 # in order to avoid possible intersection between shapes from
2406 # @param Limit Type of resulting shapes (corresponding to TopAbs_ShapeEnum).
2407 # @param KeepNonlimitShapes: if this parameter == 0, then only shapes of
2408 # target type (equal to Limit) are kept in the result,
2409 # else standalone shapes of lower dimension
2410 # are kept also (if they exist).
2412 # After implementation new version of PartitionAlgo (October 2006)
2413 # other parameters are ignored by current functionality. They are kept
2414 # in this function only for support old versions.
2415 # Ignored parameters:
2416 # @param ListKeepInside Shapes, outside which the results will be deleted.
2417 # Each shape from theKeepInside must belong to theShapes also.
2418 # @param ListRemoveInside Shapes, inside which the results will be deleted.
2419 # Each shape from theRemoveInside must belong to theShapes also.
2420 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
2421 # @param ListMaterials Material indices for each shape. Make sence,
2422 # only if theRemoveWebs is TRUE.
2424 # @return New GEOM_Object, containing the result shapes.
2426 # @ref tui_partition "Example"
2427 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
2428 Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
2429 KeepNonlimitShapes=0):
2430 # Example: see GEOM_TestAll.py
2431 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
2432 ListKeepInside, ListRemoveInside,
2433 Limit, RemoveWebs, ListMaterials,
2434 KeepNonlimitShapes);
2435 RaiseIfFailed("MakePartition", self.BoolOp)
2438 ## Perform partition operation.
2439 # This method may be useful if it is needed to make a partition for
2440 # compound contains nonintersected shapes. Performance will be better
2441 # since intersection between shapes from compound is not performed.
2443 # Description of all parameters as in previous method MakePartition()
2445 # !!!NOTE: Passed compounds (via ListShapes or via ListTools)
2446 # have to consist of nonintersecting shapes.
2448 # @return New GEOM_Object, containing the result shapes.
2450 # @ref swig_todo "Example"
2451 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
2452 ListKeepInside=[], ListRemoveInside=[],
2453 Limit=ShapeType["SHAPE"], RemoveWebs=0,
2454 ListMaterials=[], KeepNonlimitShapes=0):
2455 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
2456 ListKeepInside, ListRemoveInside,
2457 Limit, RemoveWebs, ListMaterials,
2458 KeepNonlimitShapes);
2459 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
2462 ## Shortcut to MakePartition()
2464 # @ref tui_partition "Example 1"
2465 # \n @ref swig_Partition "Example 2"
2466 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
2467 Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
2468 KeepNonlimitShapes=0):
2469 # Example: see GEOM_TestOthers.py
2470 anObj = self.MakePartition(ListShapes, ListTools,
2471 ListKeepInside, ListRemoveInside,
2472 Limit, RemoveWebs, ListMaterials,
2473 KeepNonlimitShapes);
2476 ## Perform partition of the Shape with the Plane
2477 # @param theShape Shape to be intersected.
2478 # @param thePlane Tool shape, to intersect theShape.
2479 # @return New GEOM_Object, containing the result shape.
2481 # @ref tui_partition "Example"
2482 def MakeHalfPartition(self,theShape, thePlane):
2483 # Example: see GEOM_TestAll.py
2484 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
2485 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
2488 # end of l3_basic_op
2491 ## @addtogroup l3_transform
2494 ## Translate the given object along the vector, specified
2495 # by its end points, creating its copy before the translation.
2496 # @param theObject The object to be translated.
2497 # @param thePoint1 Start point of translation vector.
2498 # @param thePoint2 End point of translation vector.
2499 # @return New GEOM_Object, containing the translated object.
2501 # @ref tui_translation "Example 1"
2502 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
2503 def MakeTranslationTwoPoints(self,theObject, thePoint1, thePoint2):
2504 # Example: see GEOM_TestAll.py
2505 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
2506 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
2509 ## Translate the given object along the vector, specified by its components.
2510 # @param theObject The object to be translated.
2511 # @param theDX,theDY,theDZ Components of translation vector.
2512 # @return Translated GEOM_Object.
2514 # @ref tui_translation "Example"
2515 def TranslateDXDYDZ(self,theObject, theDX, theDY, theDZ):
2516 # Example: see GEOM_TestAll.py
2517 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
2518 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
2519 anObj.SetParameters(Parameters)
2520 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
2523 ## Translate the given object along the vector, specified
2524 # by its components, creating its copy before the translation.
2525 # @param theObject The object to be translated.
2526 # @param theDX,theDY,theDZ Components of translation vector.
2527 # @return New GEOM_Object, containing the translated object.
2529 # @ref tui_translation "Example"
2530 def MakeTranslation(self,theObject, theDX, theDY, theDZ):
2531 # Example: see GEOM_TestAll.py
2532 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
2533 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
2534 anObj.SetParameters(Parameters)
2535 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
2538 ## Translate the given object along the given vector,
2539 # creating its copy before the translation.
2540 # @param theObject The object to be translated.
2541 # @param theVector The translation vector.
2542 # @return New GEOM_Object, containing the translated object.
2544 # @ref tui_translation "Example"
2545 def MakeTranslationVector(self,theObject, theVector):
2546 # Example: see GEOM_TestAll.py
2547 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
2548 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
2551 ## Translate the given object along the given vector on given distance.
2552 # @param theObject The object to be translated.
2553 # @param theVector The translation vector.
2554 # @param theDistance The translation distance.
2555 # @param theCopy Flag used to translate object itself or create a copy.
2556 # @return Translated GEOM_Object.
2558 # @ref tui_translation "Example"
2559 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy):
2560 # Example: see GEOM_TestAll.py
2561 theDistance,Parameters = ParseParameters(theDistance)
2562 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
2563 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
2564 anObj.SetParameters(Parameters)
2567 ## Translate the given object along the given vector on given distance,
2568 # creating its copy before the translation.
2569 # @param theObject The object to be translated.
2570 # @param theVector The translation vector.
2571 # @param theDistance The translation distance.
2572 # @return New GEOM_Object, containing the translated object.
2574 # @ref tui_translation "Example"
2575 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance):
2576 # Example: see GEOM_TestAll.py
2577 theDistance,Parameters = ParseParameters(theDistance)
2578 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
2579 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
2580 anObj.SetParameters(Parameters)
2583 ## Rotate the given object around the given axis on the given angle.
2584 # @param theObject The object to be rotated.
2585 # @param theAxis Rotation axis.
2586 # @param theAngle Rotation angle in radians.
2587 # @return Rotated GEOM_Object.
2589 # @ref tui_rotation "Example"
2590 def Rotate(self,theObject, theAxis, theAngle):
2591 # Example: see GEOM_TestAll.py
2593 if isinstance(theAngle,str):
2595 theAngle, Parameters = ParseParameters(theAngle)
2597 theAngle = theAngle*math.pi/180.0
2598 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
2599 RaiseIfFailed("RotateCopy", self.TrsfOp)
2600 anObj.SetParameters(Parameters)
2603 ## Rotate the given object around the given axis
2604 # on the given angle, creating its copy before the rotatation.
2605 # @param theObject The object to be rotated.
2606 # @param theAxis Rotation axis.
2607 # @param theAngle Rotation angle in radians.
2608 # @return New GEOM_Object, containing the rotated object.
2610 # @ref tui_rotation "Example"
2611 def MakeRotation(self,theObject, theAxis, theAngle):
2612 # Example: see GEOM_TestAll.py
2614 if isinstance(theAngle,str):
2616 theAngle, Parameters = ParseParameters(theAngle)
2618 theAngle = theAngle*math.pi/180.0
2619 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
2620 RaiseIfFailed("RotateCopy", self.TrsfOp)
2621 anObj.SetParameters(Parameters)
2624 ## Rotate given object around vector perpendicular to plane
2625 # containing three points, creating its copy before the rotatation.
2626 # @param theObject The object to be rotated.
2627 # @param theCentPoint central point - the axis is the vector perpendicular to the plane
2628 # containing the three points.
2629 # @param thePoint1,thePoint2 - in a perpendicular plane of the axis.
2630 # @return New GEOM_Object, containing the rotated object.
2632 # @ref tui_rotation "Example"
2633 def MakeRotationThreePoints(self,theObject, theCentPoint, thePoint1, thePoint2):
2634 # Example: see GEOM_TestAll.py
2635 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
2636 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
2639 ## Scale the given object by the factor, creating its copy before the scaling.
2640 # @param theObject The object to be scaled.
2641 # @param thePoint Center point for scaling.
2642 # Passing None for it means scaling relatively the origin of global CS.
2643 # @param theFactor Scaling factor value.
2644 # @return New GEOM_Object, containing the scaled shape.
2646 # @ref tui_scale "Example"
2647 def MakeScaleTransform(self, theObject, thePoint, theFactor):
2648 # Example: see GEOM_TestAll.py
2649 theFactor, Parameters = ParseParameters(theFactor)
2650 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
2651 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
2652 anObj.SetParameters(Parameters)
2655 ## Scale the given object by different factors along coordinate axes,
2656 # creating its copy before the scaling.
2657 # @param theObject The object to be scaled.
2658 # @param thePoint Center point for scaling.
2659 # Passing None for it means scaling relatively the origin of global CS.
2660 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
2661 # @return New GEOM_Object, containing the scaled shape.
2663 # @ref swig_scale "Example"
2664 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ):
2665 # Example: see GEOM_TestAll.py
2666 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
2667 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
2668 theFactorX, theFactorY, theFactorZ)
2669 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
2670 anObj.SetParameters(Parameters)
2673 ## Create an object, symmetrical
2674 # to the given one relatively the given plane.
2675 # @param theObject The object to be mirrored.
2676 # @param thePlane Plane of symmetry.
2677 # @return New GEOM_Object, containing the mirrored shape.
2679 # @ref tui_mirror "Example"
2680 def MakeMirrorByPlane(self,theObject, thePlane):
2681 # Example: see GEOM_TestAll.py
2682 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
2683 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
2686 ## Create an object, symmetrical
2687 # to the given one relatively the given axis.
2688 # @param theObject The object to be mirrored.
2689 # @param theAxis Axis of symmetry.
2690 # @return New GEOM_Object, containing the mirrored shape.
2692 # @ref tui_mirror "Example"
2693 def MakeMirrorByAxis(self,theObject, theAxis):
2694 # Example: see GEOM_TestAll.py
2695 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
2696 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
2699 ## Create an object, symmetrical
2700 # to the given one relatively the given point.
2701 # @param theObject The object to be mirrored.
2702 # @param thePoint Point of symmetry.
2703 # @return New GEOM_Object, containing the mirrored shape.
2705 # @ref tui_mirror "Example"
2706 def MakeMirrorByPoint(self,theObject, thePoint):
2707 # Example: see GEOM_TestAll.py
2708 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
2709 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
2712 ## Modify the Location of the given object by LCS,
2713 # creating its copy before the setting.
2714 # @param theObject The object to be displaced.
2715 # @param theStartLCS Coordinate system to perform displacement from it.
2716 # If \a theStartLCS is NULL, displacement
2717 # will be performed from global CS.
2718 # If \a theObject itself is used as \a theStartLCS,
2719 # its location will be changed to \a theEndLCS.
2720 # @param theEndLCS Coordinate system to perform displacement to it.
2721 # @return New GEOM_Object, containing the displaced shape.
2723 # @ref tui_modify_location "Example"
2724 def MakePosition(self,theObject, theStartLCS, theEndLCS):
2725 # Example: see GEOM_TestAll.py
2726 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
2727 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
2730 ## Modify the Location of the given object by Path,
2731 # @param theObject The object to be displaced.
2732 # @param thePath Wire or Edge along that the object will be translated.
2733 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
2734 # @param theCopy is to create a copy objects if true.
2735 # @param theReverse - 0 for usual direction, 1 to reverse path direction.
2736 # @return New GEOM_Object, containing the displaced shape.
2738 # @ref tui_modify_location "Example"
2739 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
2740 # Example: see GEOM_TestAll.py
2741 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
2742 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
2745 ## Create new object as offset of the given one.
2746 # @param theObject The base object for the offset.
2747 # @param theOffset Offset value.
2748 # @return New GEOM_Object, containing the offset object.
2750 # @ref tui_offset "Example"
2751 def MakeOffset(self,theObject, theOffset):
2752 # Example: see GEOM_TestAll.py
2753 theOffset, Parameters = ParseParameters(theOffset)
2754 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
2755 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
2756 anObj.SetParameters(Parameters)
2759 # -----------------------------------------------------------------------------
2761 # -----------------------------------------------------------------------------
2763 ## Translate the given object along the given vector a given number times
2764 # @param theObject The object to be translated.
2765 # @param theVector Direction of the translation.
2766 # @param theStep Distance to translate on.
2767 # @param theNbTimes Quantity of translations to be done.
2768 # @return New GEOM_Object, containing compound of all
2769 # the shapes, obtained after each translation.
2771 # @ref tui_multi_translation "Example"
2772 def MakeMultiTranslation1D(self,theObject, theVector, theStep, theNbTimes):
2773 # Example: see GEOM_TestAll.py
2774 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
2775 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
2776 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
2777 anObj.SetParameters(Parameters)
2780 ## Conseqently apply two specified translations to theObject specified number of times.
2781 # @param theObject The object to be translated.
2782 # @param theVector1 Direction of the first translation.
2783 # @param theStep1 Step of the first translation.
2784 # @param theNbTimes1 Quantity of translations to be done along theVector1.
2785 # @param theVector2 Direction of the second translation.
2786 # @param theStep2 Step of the second translation.
2787 # @param theNbTimes2 Quantity of translations to be done along theVector2.
2788 # @return New GEOM_Object, containing compound of all
2789 # the shapes, obtained after each translation.
2791 # @ref tui_multi_translation "Example"
2792 def MakeMultiTranslation2D(self,theObject, theVector1, theStep1, theNbTimes1,
2793 theVector2, theStep2, theNbTimes2):
2794 # Example: see GEOM_TestAll.py
2795 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
2796 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
2797 theVector2, theStep2, theNbTimes2)
2798 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
2799 anObj.SetParameters(Parameters)
2802 ## Rotate the given object around the given axis a given number times.
2803 # Rotation angle will be 2*PI/theNbTimes.
2804 # @param theObject The object to be rotated.
2805 # @param theAxis The rotation axis.
2806 # @param theNbTimes Quantity of rotations to be done.
2807 # @return New GEOM_Object, containing compound of all the
2808 # shapes, obtained after each rotation.
2810 # @ref tui_multi_rotation "Example"
2811 def MultiRotate1D(self,theObject, theAxis, theNbTimes):
2812 # Example: see GEOM_TestAll.py
2813 theAxis, theNbTimes, Parameters = ParseParameters(theAxis, theNbTimes)
2814 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
2815 RaiseIfFailed("MultiRotate1D", self.TrsfOp)
2816 anObj.SetParameters(Parameters)
2819 ## Rotate the given object around the
2820 # given axis on the given angle a given number
2821 # times and multi-translate each rotation result.
2822 # Translation direction passes through center of gravity
2823 # of rotated shape and its projection on the rotation axis.
2824 # @param theObject The object to be rotated.
2825 # @param theAxis Rotation axis.
2826 # @param theAngle Rotation angle in graduces.
2827 # @param theNbTimes1 Quantity of rotations to be done.
2828 # @param theStep Translation distance.
2829 # @param theNbTimes2 Quantity of translations to be done.
2830 # @return New GEOM_Object, containing compound of all the
2831 # shapes, obtained after each transformation.
2833 # @ref tui_multi_rotation "Example"
2834 def MultiRotate2D(self,theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2):
2835 # Example: see GEOM_TestAll.py
2836 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
2837 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
2838 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
2839 anObj.SetParameters(Parameters)
2842 ## The same, as MultiRotate1D(), but axis is given by direction and point
2843 # @ref swig_MakeMultiRotation "Example"
2844 def MakeMultiRotation1D(self,aShape,aDir,aPoint,aNbTimes):
2845 # Example: see GEOM_TestOthers.py
2846 aVec = self.MakeLine(aPoint,aDir)
2847 anObj = self.MultiRotate1D(aShape,aVec,aNbTimes)
2850 ## The same, as MultiRotate2D(), but axis is given by direction and point
2851 # @ref swig_MakeMultiRotation "Example"
2852 def MakeMultiRotation2D(self,aShape,aDir,aPoint,anAngle,nbtimes1,aStep,nbtimes2):
2853 # Example: see GEOM_TestOthers.py
2854 aVec = self.MakeLine(aPoint,aDir)
2855 anObj = self.MultiRotate2D(aShape,aVec,anAngle,nbtimes1,aStep,nbtimes2)
2858 # end of l3_transform
2861 ## @addtogroup l3_local
2864 ## Perform a fillet on all edges of the given shape.
2865 # @param theShape Shape, to perform fillet on.
2866 # @param theR Fillet radius.
2867 # @return New GEOM_Object, containing the result shape.
2869 # @ref tui_fillet "Example 1"
2870 # \n @ref swig_MakeFilletAll "Example 2"
2871 def MakeFilletAll(self,theShape, theR):
2872 # Example: see GEOM_TestOthers.py
2873 theR,Parameters = ParseParameters(theR)
2874 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
2875 RaiseIfFailed("MakeFilletAll", self.LocalOp)
2876 anObj.SetParameters(Parameters)
2879 ## Perform a fillet on the specified edges/faces of the given shape
2880 # @param theShape Shape, to perform fillet on.
2881 # @param theR Fillet radius.
2882 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR>.
2883 # @param theListShapes Global indices of edges/faces to perform fillet on.
2884 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2885 # @return New GEOM_Object, containing the result shape.
2887 # @ref tui_fillet "Example"
2888 def MakeFillet(self,theShape, theR, theShapeType, theListShapes):
2889 # Example: see GEOM_TestAll.py
2890 theR,Parameters = ParseParameters(theR)
2892 if theShapeType == ShapeType["EDGE"]:
2893 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
2894 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
2896 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
2897 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
2898 anObj.SetParameters(Parameters)
2901 ## The same that MakeFillet but with two Fillet Radius R1 and R2
2902 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes):
2903 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
2905 if theShapeType == ShapeType["EDGE"]:
2906 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
2907 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
2909 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
2910 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
2911 anObj.SetParameters(Parameters)
2914 ## Perform a fillet on the specified edges of the given shape
2915 # @param theShape - Wire Shape to perform fillet on.
2916 # @param theR - Fillet radius.
2917 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
2918 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2919 # \note The list of vertices could be empty,
2920 # in this case fillet will done done at all vertices in wire
2921 # @return New GEOM_Object, containing the result shape.
2923 # @ref tui_fillet2d "Example"
2924 def MakeFillet1D(self,theShape, theR, theListOfVertexes):
2925 # Example: see GEOM_TestAll.py
2926 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes)
2927 RaiseIfFailed("MakeFillet1D", self.LocalOp)
2930 ## Perform a fillet on the specified edges/faces of the given shape
2931 # @param theShape - Face Shape to perform fillet on.
2932 # @param theR - Fillet radius.
2933 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
2934 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2935 # @return New GEOM_Object, containing the result shape.
2937 # @ref tui_fillet2d "Example"
2938 def MakeFillet2D(self,theShape, theR, theListOfVertexes):
2939 # Example: see GEOM_TestAll.py
2940 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
2941 RaiseIfFailed("MakeFillet2D", self.LocalOp)
2944 ## Perform a symmetric chamfer on all edges of the given shape.
2945 # @param theShape Shape, to perform chamfer on.
2946 # @param theD Chamfer size along each face.
2947 # @return New GEOM_Object, containing the result shape.
2949 # @ref tui_chamfer "Example 1"
2950 # \n @ref swig_MakeChamferAll "Example 2"
2951 def MakeChamferAll(self,theShape, theD):
2952 # Example: see GEOM_TestOthers.py
2953 theD,Parameters = ParseParameters(theD)
2954 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
2955 RaiseIfFailed("MakeChamferAll", self.LocalOp)
2956 anObj.SetParameters(Parameters)
2959 ## Perform a chamfer on edges, common to the specified faces,
2960 # with distance D1 on the Face1
2961 # @param theShape Shape, to perform chamfer on.
2962 # @param theD1 Chamfer size along \a theFace1.
2963 # @param theD2 Chamfer size along \a theFace2.
2964 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
2965 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2966 # @return New GEOM_Object, containing the result shape.
2968 # @ref tui_chamfer "Example"
2969 def MakeChamferEdge(self,theShape, theD1, theD2, theFace1, theFace2):
2970 # Example: see GEOM_TestAll.py
2971 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
2972 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
2973 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
2974 anObj.SetParameters(Parameters)
2977 ## The Same that MakeChamferEdge but with params theD is chamfer length and
2978 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
2979 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2):
2981 if isinstance(theAngle,str):
2983 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
2985 theAngle = theAngle*math.pi/180.0
2986 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
2987 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
2988 anObj.SetParameters(Parameters)
2991 ## Perform a chamfer on all edges of the specified faces,
2992 # with distance D1 on the first specified face (if several for one edge)
2993 # @param theShape Shape, to perform chamfer on.
2994 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
2995 # connected to the edge, are in \a theFaces, \a theD1
2996 # will be get along face, which is nearer to \a theFaces beginning.
2997 # @param theD2 Chamfer size along another of two faces, connected to the edge.
2998 # @param theFaces Sequence of global indices of faces of \a theShape.
2999 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
3000 # @return New GEOM_Object, containing the result shape.
3002 # @ref tui_chamfer "Example"
3003 def MakeChamferFaces(self,theShape, theD1, theD2, theFaces):
3004 # Example: see GEOM_TestAll.py
3005 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
3006 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
3007 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
3008 anObj.SetParameters(Parameters)
3011 ## The Same that MakeChamferFaces but with params theD is chamfer lenght and
3012 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
3014 # @ref swig_FilletChamfer "Example"
3015 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces):
3017 if isinstance(theAngle,str):
3019 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
3021 theAngle = theAngle*math.pi/180.0
3022 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
3023 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
3024 anObj.SetParameters(Parameters)
3027 ## Perform a chamfer on edges,
3028 # with distance D1 on the first specified face (if several for one edge)
3029 # @param theShape Shape, to perform chamfer on.
3030 # @param theD1,theD2 Chamfer size
3031 # @param theEdges Sequence of edges of \a theShape.
3032 # @return New GEOM_Object, containing the result shape.
3034 # @ref swig_FilletChamfer "Example"
3035 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges):
3036 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
3037 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
3038 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
3039 anObj.SetParameters(Parameters)
3042 ## The Same that MakeChamferEdges but with params theD is chamfer lenght and
3043 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
3044 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges):
3046 if isinstance(theAngle,str):
3048 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
3050 theAngle = theAngle*math.pi/180.0
3051 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
3052 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
3053 anObj.SetParameters(Parameters)
3056 ## Shortcut to MakeChamferEdge() and MakeChamferFaces()
3058 # @ref swig_MakeChamfer "Example"
3059 def MakeChamfer(self,aShape,d1,d2,aShapeType,ListShape):
3060 # Example: see GEOM_TestOthers.py
3062 if aShapeType == ShapeType["EDGE"]:
3063 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1])
3065 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape)
3071 ## @addtogroup l3_basic_op
3074 ## Perform an Archimde operation on the given shape with given parameters.
3075 # The object presenting the resulting face is returned.
3076 # @param theShape Shape to be put in water.
3077 # @param theWeight Weight og the shape.
3078 # @param theWaterDensity Density of the water.
3079 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
3080 # @return New GEOM_Object, containing a section of \a theShape
3081 # by a plane, corresponding to water level.
3083 # @ref tui_archimede "Example"
3084 def Archimede(self,theShape, theWeight, theWaterDensity, theMeshDeflection):
3085 # Example: see GEOM_TestAll.py
3086 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
3087 theWeight,theWaterDensity,theMeshDeflection)
3088 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
3089 RaiseIfFailed("MakeArchimede", self.LocalOp)
3090 anObj.SetParameters(Parameters)
3093 # end of l3_basic_op
3096 ## @addtogroup l2_measure
3099 ## Get point coordinates
3102 # @ref tui_measurement_tools_page "Example"
3103 def PointCoordinates(self,Point):
3104 # Example: see GEOM_TestMeasures.py
3105 aTuple = self.MeasuOp.PointCoordinates(Point)
3106 RaiseIfFailed("PointCoordinates", self.MeasuOp)
3109 ## Get summarized length of all wires,
3110 # area of surface and volume of the given shape.
3111 # @param theShape Shape to define properties of.
3112 # @return [theLength, theSurfArea, theVolume]
3113 # theLength: Summarized length of all wires of the given shape.
3114 # theSurfArea: Area of surface of the given shape.
3115 # theVolume: Volume of the given shape.
3117 # @ref tui_measurement_tools_page "Example"
3118 def BasicProperties(self,theShape):
3119 # Example: see GEOM_TestMeasures.py
3120 aTuple = self.MeasuOp.GetBasicProperties(theShape)
3121 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
3124 ## Get parameters of bounding box of the given shape
3125 # @param theShape Shape to obtain bounding box of.
3126 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
3127 # Xmin,Xmax: Limits of shape along OX axis.
3128 # Ymin,Ymax: Limits of shape along OY axis.
3129 # Zmin,Zmax: Limits of shape along OZ axis.
3131 # @ref tui_measurement_tools_page "Example"
3132 def BoundingBox(self,theShape):
3133 # Example: see GEOM_TestMeasures.py
3134 aTuple = self.MeasuOp.GetBoundingBox(theShape)
3135 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
3138 ## Get inertia matrix and moments of inertia of theShape.
3139 # @param theShape Shape to calculate inertia of.
3140 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
3141 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
3142 # Ix,Iy,Iz: Moments of inertia of the given shape.
3144 # @ref tui_measurement_tools_page "Example"
3145 def Inertia(self,theShape):
3146 # Example: see GEOM_TestMeasures.py
3147 aTuple = self.MeasuOp.GetInertia(theShape)
3148 RaiseIfFailed("GetInertia", self.MeasuOp)
3151 ## Get minimal distance between the given shapes.
3152 # @param theShape1,theShape2 Shapes to find minimal distance between.
3153 # @return Value of the minimal distance between the given shapes.
3155 # @ref tui_measurement_tools_page "Example"
3156 def MinDistance(self, theShape1, theShape2):
3157 # Example: see GEOM_TestMeasures.py
3158 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
3159 RaiseIfFailed("GetMinDistance", self.MeasuOp)
3162 ## Get minimal distance between the given shapes.
3163 # @param theShape1,theShape2 Shapes to find minimal distance between.
3164 # @return Value of the minimal distance between the given shapes.
3166 # @ref swig_all_measure "Example"
3167 def MinDistanceComponents(self, theShape1, theShape2):
3168 # Example: see GEOM_TestMeasures.py
3169 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
3170 RaiseIfFailed("GetMinDistance", self.MeasuOp)
3171 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
3174 ## Get angle between the given shapes in degrees.
3175 # @param theShape1,theShape2 Lines or linear edges to find angle between.
3176 # @return Value of the angle between the given shapes in degrees.
3178 # @ref tui_measurement_tools_page "Example"
3179 def GetAngle(self, theShape1, theShape2):
3180 # Example: see GEOM_TestMeasures.py
3181 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
3182 RaiseIfFailed("GetAngle", self.MeasuOp)
3184 ## Get angle between the given shapes in radians.
3185 # @param theShape1,theShape2 Lines or linear edges to find angle between.
3186 # @return Value of the angle between the given shapes in radians.
3188 # @ref tui_measurement_tools_page "Example"
3189 def GetAngleRadians(self, theShape1, theShape2):
3190 # Example: see GEOM_TestMeasures.py
3191 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
3192 RaiseIfFailed("GetAngle", self.MeasuOp)
3195 ## @name Curve Curvature Measurement
3196 # Methods for receiving radius of curvature of curves
3197 # in the given point
3200 ## Measure curvature of a curve at a point, set by parameter.
3201 # @ref swig_todo "Example"
3202 def CurveCurvatureByParam(self, theCurve, theParam):
3203 # Example: see GEOM_TestMeasures.py
3204 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
3205 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
3209 # @ref swig_todo "Example"
3210 def CurveCurvatureByPoint(self, theCurve, thePoint):
3211 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
3212 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
3216 ## @name Surface Curvature Measurement
3217 # Methods for receiving max and min radius of curvature of surfaces
3218 # in the given point
3222 ## @ref swig_todo "Example"
3223 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
3224 # Example: see GEOM_TestMeasures.py
3225 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
3226 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
3230 ## @ref swig_todo "Example"
3231 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
3232 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
3233 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
3237 ## @ref swig_todo "Example"
3238 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
3239 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
3240 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
3244 ## @ref swig_todo "Example"
3245 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
3246 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
3247 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
3251 ## Get min and max tolerances of sub-shapes of theShape
3252 # @param theShape Shape, to get tolerances of.
3253 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
3254 # FaceMin,FaceMax: Min and max tolerances of the faces.
3255 # EdgeMin,EdgeMax: Min and max tolerances of the edges.
3256 # VertMin,VertMax: Min and max tolerances of the vertices.
3258 # @ref tui_measurement_tools_page "Example"
3259 def Tolerance(self,theShape):
3260 # Example: see GEOM_TestMeasures.py
3261 aTuple = self.MeasuOp.GetTolerance(theShape)
3262 RaiseIfFailed("GetTolerance", self.MeasuOp)
3265 ## Obtain description of the given shape (number of sub-shapes of each type)
3266 # @param theShape Shape to be described.
3267 # @return Description of the given shape.
3269 # @ref tui_measurement_tools_page "Example"
3270 def WhatIs(self,theShape):
3271 # Example: see GEOM_TestMeasures.py
3272 aDescr = self.MeasuOp.WhatIs(theShape)
3273 RaiseIfFailed("WhatIs", self.MeasuOp)
3276 ## Get a point, situated at the centre of mass of theShape.
3277 # @param theShape Shape to define centre of mass of.
3278 # @return New GEOM_Object, containing the created point.
3280 # @ref tui_measurement_tools_page "Example"
3281 def MakeCDG(self,theShape):
3282 # Example: see GEOM_TestMeasures.py
3283 anObj = self.MeasuOp.GetCentreOfMass(theShape)
3284 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
3287 ## Get a vertex subshape by index depended with orientation.
3288 # @param theShape Shape to find subshape.
3289 # @param theIndex Index to find vertex by this index.
3290 # @return New GEOM_Object, containing the created vertex.
3292 # @ref tui_measurement_tools_page "Example"
3293 def GetVertexByIndex(self,theShape, theIndex):
3294 # Example: see GEOM_TestMeasures.py
3295 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
3296 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
3299 ## Get the first vertex of wire/edge depended orientation.
3300 # @param theShape Shape to find first vertex.
3301 # @return New GEOM_Object, containing the created vertex.
3303 # @ref tui_measurement_tools_page "Example"
3304 def GetFirstVertex(self,theShape):
3305 # Example: see GEOM_TestMeasures.py
3306 anObj = self.GetVertexByIndex(theShape, 0)
3307 RaiseIfFailed("GetFirstVertex", self.MeasuOp)
3310 ## Get the last vertex of wire/edge depended orientation.
3311 # @param theShape Shape to find last vertex.
3312 # @return New GEOM_Object, containing the created vertex.
3314 # @ref tui_measurement_tools_page "Example"
3315 def GetLastVertex(self,theShape):
3316 # Example: see GEOM_TestMeasures.py
3317 nb_vert = self.ShapesOp.NumberOfSubShapes(theShape, ShapeType["VERTEX"])
3318 anObj = self.GetVertexByIndex(theShape, (nb_vert-1))
3319 RaiseIfFailed("GetLastVertex", self.MeasuOp)
3322 ## Get a normale to the given face. If the point is not given,
3323 # the normale is calculated at the center of mass.
3324 # @param theFace Face to define normale of.
3325 # @param theOptionalPoint Point to compute the normale at.
3326 # @return New GEOM_Object, containing the created vector.
3328 # @ref swig_todo "Example"
3329 def GetNormal(self, theFace, theOptionalPoint = None):
3330 # Example: see GEOM_TestMeasures.py
3331 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
3332 RaiseIfFailed("GetNormal", self.MeasuOp)
3335 ## Check a topology of the given shape.
3336 # @param theShape Shape to check validity of.
3337 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked,
3338 # if TRUE, the shape's geometry will be checked also.
3339 # @return TRUE, if the shape "seems to be valid".
3340 # If theShape is invalid, prints a description of problem.
3342 # @ref tui_measurement_tools_page "Example"
3343 def CheckShape(self,theShape, theIsCheckGeom = 0):
3344 # Example: see GEOM_TestMeasures.py
3346 (IsValid, Status) = self.MeasuOp.CheckShapeWithGeometry(theShape)
3347 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
3349 (IsValid, Status) = self.MeasuOp.CheckShape(theShape)
3350 RaiseIfFailed("CheckShape", self.MeasuOp)
3355 ## Get position (LCS) of theShape.
3357 # Origin of the LCS is situated at the shape's center of mass.
3358 # Axes of the LCS are obtained from shape's location or,
3359 # if the shape is a planar face, from position of its plane.
3361 # @param theShape Shape to calculate position of.
3362 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
3363 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
3364 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
3365 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
3367 # @ref swig_todo "Example"
3368 def GetPosition(self,theShape):
3369 # Example: see GEOM_TestMeasures.py
3370 aTuple = self.MeasuOp.GetPosition(theShape)
3371 RaiseIfFailed("GetPosition", self.MeasuOp)
3374 ## Get kind of theShape.
3376 # @param theShape Shape to get a kind of.
3377 # @return Returns a kind of shape in terms of <VAR>GEOM_IKindOfShape.shape_kind</VAR> enumeration
3378 # and a list of parameters, describing the shape.
3379 # @note Concrete meaning of each value, returned via \a theIntegers
3380 # or \a theDoubles list depends on the kind of the shape.
3381 # The full list of possible outputs is:
3383 # - geompy.kind.COMPOUND nb_solids nb_faces nb_edges nb_vertices
3384 # - geompy.kind.COMPSOLID nb_solids nb_faces nb_edges nb_vertices
3386 # - geompy.kind.SHELL geompy.info.CLOSED nb_faces nb_edges nb_vertices
3387 # - geompy.kind.SHELL geompy.info.UNCLOSED nb_faces nb_edges nb_vertices
3389 # - geompy.kind.WIRE geompy.info.CLOSED nb_edges nb_vertices
3390 # - geompy.kind.WIRE geompy.info.UNCLOSED nb_edges nb_vertices
3392 # - geompy.kind.SPHERE xc yc zc R
3393 # - geompy.kind.CYLINDER xb yb zb dx dy dz R H
3394 # - geompy.kind.BOX xc yc zc ax ay az
3395 # - geompy.kind.ROTATED_BOX xc yc zc zx zy zz xx xy xz ax ay az
3396 # - geompy.kind.TORUS xc yc zc dx dy dz R_1 R_2
3397 # - geompy.kind.CONE xb yb zb dx dy dz R_1 R_2 H
3398 # - geompy.kind.POLYHEDRON nb_faces nb_edges nb_vertices
3399 # - geompy.kind.SOLID nb_faces nb_edges nb_vertices
3401 # - geompy.kind.SPHERE2D xc yc zc R
3402 # - geompy.kind.CYLINDER2D xb yb zb dx dy dz R H
3403 # - geompy.kind.TORUS2D xc yc zc dx dy dz R_1 R_2
3404 # - geompy.kind.CONE2D xc yc zc dx dy dz R_1 R_2 H
3405 # - geompy.kind.DISK_CIRCLE xc yc zc dx dy dz R
3406 # - geompy.kind.DISK_ELLIPSE xc yc zc dx dy dz R_1 R_2
3407 # - geompy.kind.POLYGON xo yo zo dx dy dz nb_edges nb_vertices
3408 # - geompy.kind.PLANE xo yo zo dx dy dz
3409 # - geompy.kind.PLANAR xo yo zo dx dy dz nb_edges nb_vertices
3410 # - geompy.kind.FACE nb_edges nb_vertices
3412 # - geompy.kind.CIRCLE xc yc zc dx dy dz R
3413 # - geompy.kind.ARC_CIRCLE xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2
3414 # - geompy.kind.ELLIPSE xc yc zc dx dy dz R_1 R_2
3415 # - geompy.kind.ARC_ELLIPSE xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2
3416 # - geompy.kind.LINE xo yo zo dx dy dz
3417 # - geompy.kind.SEGMENT x1 y1 z1 x2 y2 z2
3418 # - geompy.kind.EDGE nb_vertices
3420 # - geompy.kind.VERTEX x y z
3422 # @ref swig_todo "Example"
3423 def KindOfShape(self,theShape):
3424 # Example: see GEOM_TestMeasures.py
3425 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
3426 RaiseIfFailed("KindOfShape", self.MeasuOp)
3428 aKind = aRoughTuple[0]
3429 anInts = aRoughTuple[1]
3430 aDbls = aRoughTuple[2]
3432 # Now there is no exception from this rule:
3433 aKindTuple = [aKind] + aDbls + anInts
3435 # If they are we will regroup parameters for such kind of shape.
3437 #if aKind == kind.SOME_KIND:
3438 # # SOME_KIND int int double int double double
3439 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
3446 ## @addtogroup l2_import_export
3449 ## Import a shape from the BREP or IGES or STEP file
3450 # (depends on given format) with given name.
3451 # @param theFileName The file, containing the shape.
3452 # @param theFormatName Specify format for the file reading.
3453 # Available formats can be obtained with InsertOp.ImportTranslators() method.
3454 # If format 'IGES_SCALE' is used instead 'IGES' length unit will be
3455 # set to 'meter' and result model will be scaled.
3456 # @return New GEOM_Object, containing the imported shape.
3458 # @ref swig_Import_Export "Example"
3459 def Import(self,theFileName, theFormatName):
3460 # Example: see GEOM_TestOthers.py
3461 anObj = self.InsertOp.Import(theFileName, theFormatName)
3462 RaiseIfFailed("Import", self.InsertOp)
3465 ## Shortcut to Import() for BREP format
3467 # @ref swig_Import_Export "Example"
3468 def ImportBREP(self,theFileName):
3469 # Example: see GEOM_TestOthers.py
3470 return self.Import(theFileName, "BREP")
3472 ## Shortcut to Import() for IGES format
3474 # @ref swig_Import_Export "Example"
3475 def ImportIGES(self,theFileName):
3476 # Example: see GEOM_TestOthers.py
3477 return self.Import(theFileName, "IGES")
3479 ## Return length unit from given IGES file
3481 # @ref swig_Import_Export "Example"
3482 def GetIGESUnit(self,theFileName):
3483 # Example: see GEOM_TestOthers.py
3484 anObj = self.InsertOp.Import(theFileName, "IGES_UNIT")
3485 #RaiseIfFailed("Import", self.InsertOp)
3486 # recieve name using returned vertex
3488 vertices = self.SubShapeAll(anObj,ShapeType["VERTEX"])
3490 p = self.PointCoordinates(vertices[0])
3491 if abs(p[0]-0.01) < 1.e-6:
3493 elif abs(p[0]-0.001) < 1.e-6:
3497 ## Shortcut to Import() for STEP format
3499 # @ref swig_Import_Export "Example"
3500 def ImportSTEP(self,theFileName):
3501 # Example: see GEOM_TestOthers.py
3502 return self.Import(theFileName, "STEP")
3504 ## Export the given shape into a file with given name.
3505 # @param theObject Shape to be stored in the file.
3506 # @param theFileName Name of the file to store the given shape in.
3507 # @param theFormatName Specify format for the shape storage.
3508 # Available formats can be obtained with InsertOp.ImportTranslators() method.
3510 # @ref swig_Import_Export "Example"
3511 def Export(self,theObject, theFileName, theFormatName):
3512 # Example: see GEOM_TestOthers.py
3513 self.InsertOp.Export(theObject, theFileName, theFormatName)
3514 if self.InsertOp.IsDone() == 0:
3515 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
3519 ## Shortcut to Export() for BREP format
3521 # @ref swig_Import_Export "Example"
3522 def ExportBREP(self,theObject, theFileName):
3523 # Example: see GEOM_TestOthers.py
3524 return self.Export(theObject, theFileName, "BREP")
3526 ## Shortcut to Export() for IGES format
3528 # @ref swig_Import_Export "Example"
3529 def ExportIGES(self,theObject, theFileName):
3530 # Example: see GEOM_TestOthers.py
3531 return self.Export(theObject, theFileName, "IGES")
3533 ## Shortcut to Export() for STEP format
3535 # @ref swig_Import_Export "Example"
3536 def ExportSTEP(self,theObject, theFileName):
3537 # Example: see GEOM_TestOthers.py
3538 return self.Export(theObject, theFileName, "STEP")
3540 # end of l2_import_export
3543 ## @addtogroup l3_blocks
3546 ## Create a quadrangle face from four edges. Order of Edges is not
3547 # important. It is not necessary that edges share the same vertex.
3548 # @param E1,E2,E3,E4 Edges for the face bound.
3549 # @return New GEOM_Object, containing the created face.
3551 # @ref tui_building_by_blocks_page "Example"
3552 def MakeQuad(self,E1, E2, E3, E4):
3553 # Example: see GEOM_Spanner.py
3554 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
3555 RaiseIfFailed("MakeQuad", self.BlocksOp)
3558 ## Create a quadrangle face on two edges.
3559 # The missing edges will be built by creating the shortest ones.
3560 # @param E1,E2 Two opposite edges for the face.
3561 # @return New GEOM_Object, containing the created face.
3563 # @ref tui_building_by_blocks_page "Example"
3564 def MakeQuad2Edges(self,E1, E2):
3565 # Example: see GEOM_Spanner.py
3566 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
3567 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
3570 ## Create a quadrangle face with specified corners.
3571 # The missing edges will be built by creating the shortest ones.
3572 # @param V1,V2,V3,V4 Corner vertices for the face.
3573 # @return New GEOM_Object, containing the created face.
3575 # @ref tui_building_by_blocks_page "Example 1"
3576 # \n @ref swig_MakeQuad4Vertices "Example 2"
3577 def MakeQuad4Vertices(self,V1, V2, V3, V4):
3578 # Example: see GEOM_Spanner.py
3579 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
3580 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
3583 ## Create a hexahedral solid, bounded by the six given faces. Order of
3584 # faces is not important. It is not necessary that Faces share the same edge.
3585 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
3586 # @return New GEOM_Object, containing the created solid.
3588 # @ref tui_building_by_blocks_page "Example 1"
3589 # \n @ref swig_MakeHexa "Example 2"
3590 def MakeHexa(self,F1, F2, F3, F4, F5, F6):
3591 # Example: see GEOM_Spanner.py
3592 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
3593 RaiseIfFailed("MakeHexa", self.BlocksOp)
3596 ## Create a hexahedral solid between two given faces.
3597 # The missing faces will be built by creating the smallest ones.
3598 # @param F1,F2 Two opposite faces for the hexahedral solid.
3599 # @return New GEOM_Object, containing the created solid.
3601 # @ref tui_building_by_blocks_page "Example 1"
3602 # \n @ref swig_MakeHexa2Faces "Example 2"
3603 def MakeHexa2Faces(self,F1, F2):
3604 # Example: see GEOM_Spanner.py
3605 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
3606 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
3612 ## @addtogroup l3_blocks_op
3615 ## Get a vertex, found in the given shape by its coordinates.
3616 # @param theShape Block or a compound of blocks.
3617 # @param theX,theY,theZ Coordinates of the sought vertex.
3618 # @param theEpsilon Maximum allowed distance between the resulting
3619 # vertex and point with the given coordinates.
3620 # @return New GEOM_Object, containing the found vertex.
3622 # @ref swig_GetPoint "Example"
3623 def GetPoint(self,theShape, theX, theY, theZ, theEpsilon):
3624 # Example: see GEOM_TestOthers.py
3625 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
3626 RaiseIfFailed("GetPoint", self.BlocksOp)
3629 ## Get an edge, found in the given shape by two given vertices.
3630 # @param theShape Block or a compound of blocks.
3631 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
3632 # @return New GEOM_Object, containing the found edge.
3634 # @ref swig_todo "Example"
3635 def GetEdge(self,theShape, thePoint1, thePoint2):
3636 # Example: see GEOM_Spanner.py
3637 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
3638 RaiseIfFailed("GetEdge", self.BlocksOp)
3641 ## Find an edge of the given shape, which has minimal distance to the given point.
3642 # @param theShape Block or a compound of blocks.
3643 # @param thePoint Point, close to the desired edge.
3644 # @return New GEOM_Object, containing the found edge.
3646 # @ref swig_GetEdgeNearPoint "Example"
3647 def GetEdgeNearPoint(self,theShape, thePoint):
3648 # Example: see GEOM_TestOthers.py
3649 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
3650 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
3653 ## Returns a face, found in the given shape by four given corner vertices.
3654 # @param theShape Block or a compound of blocks.
3655 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
3656 # @return New GEOM_Object, containing the found face.
3658 # @ref swig_todo "Example"
3659 def GetFaceByPoints(self,theShape, thePoint1, thePoint2, thePoint3, thePoint4):
3660 # Example: see GEOM_Spanner.py
3661 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
3662 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
3665 ## Get a face of block, found in the given shape by two given edges.
3666 # @param theShape Block or a compound of blocks.
3667 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
3668 # @return New GEOM_Object, containing the found face.
3670 # @ref swig_todo "Example"
3671 def GetFaceByEdges(self,theShape, theEdge1, theEdge2):
3672 # Example: see GEOM_Spanner.py
3673 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
3674 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
3677 ## Find a face, opposite to the given one in the given block.
3678 # @param theBlock Must be a hexahedral solid.
3679 # @param theFace Face of \a theBlock, opposite to the desired face.
3680 # @return New GEOM_Object, containing the found face.
3682 # @ref swig_GetOppositeFace "Example"
3683 def GetOppositeFace(self,theBlock, theFace):
3684 # Example: see GEOM_Spanner.py
3685 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
3686 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
3689 ## Find a face of the given shape, which has minimal distance to the given point.
3690 # @param theShape Block or a compound of blocks.
3691 # @param thePoint Point, close to the desired face.
3692 # @return New GEOM_Object, containing the found face.
3694 # @ref swig_GetFaceNearPoint "Example"
3695 def GetFaceNearPoint(self,theShape, thePoint):
3696 # Example: see GEOM_Spanner.py
3697 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
3698 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
3701 ## Find a face of block, whose outside normale has minimal angle with the given vector.
3702 # @param theBlock Block or a compound of blocks.
3703 # @param theVector Vector, close to the normale of the desired face.
3704 # @return New GEOM_Object, containing the found face.
3706 # @ref swig_todo "Example"
3707 def GetFaceByNormale(self, theBlock, theVector):
3708 # Example: see GEOM_Spanner.py
3709 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
3710 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
3713 # end of l3_blocks_op
3716 ## @addtogroup l4_blocks_measure
3719 ## Check, if the compound of blocks is given.
3720 # To be considered as a compound of blocks, the
3721 # given shape must satisfy the following conditions:
3722 # - Each element of the compound should be a Block (6 faces and 12 edges).
3723 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
3724 # - The compound should be connexe.
3725 # - The glue between two quadrangle faces should be applied.
3726 # @param theCompound The compound to check.
3727 # @return TRUE, if the given shape is a compound of blocks.
3728 # If theCompound is not valid, prints all discovered errors.
3730 # @ref tui_measurement_tools_page "Example 1"
3731 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
3732 def CheckCompoundOfBlocks(self,theCompound):
3733 # Example: see GEOM_Spanner.py
3734 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
3735 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
3737 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
3741 ## Remove all seam and degenerated edges from \a theShape.
3742 # Unite faces and edges, sharing one surface. It means that
3743 # this faces must have references to one C++ surface object (handle).
3744 # @param theShape The compound or single solid to remove irregular edges from.
3745 # @param doUnionFaces If True, then unite faces. If False (the default value),
3746 # do not unite faces.
3747 # @return Improved shape.
3749 # @ref swig_RemoveExtraEdges "Example"
3750 def RemoveExtraEdges(self, theShape, doUnionFaces=False):
3751 # Example: see GEOM_TestOthers.py
3752 nbFacesOptimum = -1 # -1 means do not unite faces
3753 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
3754 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
3755 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
3758 ## Check, if the given shape is a blocks compound.
3759 # Fix all detected errors.
3760 # \note Single block can be also fixed by this method.
3761 # @param theShape The compound to check and improve.
3762 # @return Improved compound.
3764 # @ref swig_CheckAndImprove "Example"
3765 def CheckAndImprove(self,theShape):
3766 # Example: see GEOM_TestOthers.py
3767 anObj = self.BlocksOp.CheckAndImprove(theShape)
3768 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
3771 # end of l4_blocks_measure
3774 ## @addtogroup l3_blocks_op
3777 ## Get all the blocks, contained in the given compound.
3778 # @param theCompound The compound to explode.
3779 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
3780 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
3781 # \note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
3782 # @return List of GEOM_Objects, containing the retrieved blocks.
3784 # @ref tui_explode_on_blocks "Example 1"
3785 # \n @ref swig_MakeBlockExplode "Example 2"
3786 def MakeBlockExplode(self,theCompound, theMinNbFaces, theMaxNbFaces):
3787 # Example: see GEOM_TestOthers.py
3788 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
3789 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
3790 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
3792 anObj.SetParameters(Parameters)
3796 ## Find block, containing the given point inside its volume or on boundary.
3797 # @param theCompound Compound, to find block in.
3798 # @param thePoint Point, close to the desired block. If the point lays on
3799 # boundary between some blocks, we return block with nearest center.
3800 # @return New GEOM_Object, containing the found block.
3802 # @ref swig_todo "Example"
3803 def GetBlockNearPoint(self,theCompound, thePoint):
3804 # Example: see GEOM_Spanner.py
3805 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
3806 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
3809 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
3810 # @param theCompound Compound, to find block in.
3811 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
3812 # @return New GEOM_Object, containing the found block.
3814 # @ref swig_GetBlockByParts "Example"
3815 def GetBlockByParts(self,theCompound, theParts):
3816 # Example: see GEOM_TestOthers.py
3817 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
3818 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
3821 ## Return all blocks, containing all the elements, passed as the parts.
3822 # @param theCompound Compound, to find blocks in.
3823 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
3824 # @return List of GEOM_Objects, containing the found blocks.
3826 # @ref swig_todo "Example"
3827 def GetBlocksByParts(self,theCompound, theParts):
3828 # Example: see GEOM_Spanner.py
3829 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
3830 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
3833 ## Multi-transformate block and glue the result.
3834 # Transformation is defined so, as to superpose direction faces.
3835 # @param Block Hexahedral solid to be multi-transformed.
3836 # @param DirFace1 ID of First direction face.
3837 # @param DirFace2 ID of Second direction face.
3838 # @param NbTimes Quantity of transformations to be done.
3839 # \note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
3840 # @return New GEOM_Object, containing the result shape.
3842 # @ref tui_multi_transformation "Example"
3843 def MakeMultiTransformation1D(self,Block, DirFace1, DirFace2, NbTimes):
3844 # Example: see GEOM_Spanner.py
3845 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
3846 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
3847 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
3848 anObj.SetParameters(Parameters)
3851 ## Multi-transformate block and glue the result.
3852 # @param Block Hexahedral solid to be multi-transformed.
3853 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
3854 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
3855 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
3856 # @return New GEOM_Object, containing the result shape.
3858 # @ref tui_multi_transformation "Example"
3859 def MakeMultiTransformation2D(self,Block, DirFace1U, DirFace2U, NbTimesU,
3860 DirFace1V, DirFace2V, NbTimesV):
3861 # Example: see GEOM_Spanner.py
3862 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
3863 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
3864 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
3865 DirFace1V, DirFace2V, NbTimesV)
3866 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
3867 anObj.SetParameters(Parameters)
3870 ## Build all possible propagation groups.
3871 # Propagation group is a set of all edges, opposite to one (main)
3872 # edge of this group directly or through other opposite edges.
3873 # Notion of Opposite Edge make sence only on quadrangle face.
3874 # @param theShape Shape to build propagation groups on.
3875 # @return List of GEOM_Objects, each of them is a propagation group.
3877 # @ref swig_Propagate "Example"
3878 def Propagate(self,theShape):
3879 # Example: see GEOM_TestOthers.py
3880 listChains = self.BlocksOp.Propagate(theShape)
3881 RaiseIfFailed("Propagate", self.BlocksOp)
3884 # end of l3_blocks_op
3887 ## @addtogroup l3_groups
3890 ## Creates a new group which will store sub shapes of theMainShape
3891 # @param theMainShape is a GEOM object on which the group is selected
3892 # @param theShapeType defines a shape type of the group
3893 # @return a newly created GEOM group
3895 # @ref tui_working_with_groups_page "Example 1"
3896 # \n @ref swig_CreateGroup "Example 2"
3897 def CreateGroup(self,theMainShape, theShapeType):
3898 # Example: see GEOM_TestOthers.py
3899 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
3900 RaiseIfFailed("CreateGroup", self.GroupOp)
3903 ## Adds a sub object with ID theSubShapeId to the group
3904 # @param theGroup is a GEOM group to which the new sub shape is added
3905 # @param theSubShapeID is a sub shape ID in the main object.
3906 # \note Use method GetSubShapeID() to get an unique ID of the sub shape
3908 # @ref tui_working_with_groups_page "Example"
3909 def AddObject(self,theGroup, theSubShapeID):
3910 # Example: see GEOM_TestOthers.py
3911 self.GroupOp.AddObject(theGroup, theSubShapeID)
3912 RaiseIfFailed("AddObject", self.GroupOp)
3915 ## Removes a sub object with ID \a theSubShapeId from the group
3916 # @param theGroup is a GEOM group from which the new sub shape is removed
3917 # @param theSubShapeID is a sub shape ID in the main object.
3918 # \note Use method GetSubShapeID() to get an unique ID of the sub shape
3920 # @ref tui_working_with_groups_page "Example"
3921 def RemoveObject(self,theGroup, theSubShapeID):
3922 # Example: see GEOM_TestOthers.py
3923 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
3924 RaiseIfFailed("RemoveObject", self.GroupOp)
3927 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
3928 # @param theGroup is a GEOM group to which the new sub shapes are added.
3929 # @param theSubShapes is a list of sub shapes to be added.
3931 # @ref tui_working_with_groups_page "Example"
3932 def UnionList (self,theGroup, theSubShapes):
3933 # Example: see GEOM_TestOthers.py
3934 self.GroupOp.UnionList(theGroup, theSubShapes)
3935 RaiseIfFailed("UnionList", self.GroupOp)
3938 ## Works like the above method, but argument
3939 # theSubShapes here is a list of sub-shapes indices
3941 # @ref swig_UnionIDs "Example"
3942 def UnionIDs(self,theGroup, theSubShapes):
3943 # Example: see GEOM_TestOthers.py
3944 self.GroupOp.UnionIDs(theGroup, theSubShapes)
3945 RaiseIfFailed("UnionIDs", self.GroupOp)
3948 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
3949 # @param theGroup is a GEOM group from which the sub-shapes are removed.
3950 # @param theSubShapes is a list of sub-shapes to be removed.
3952 # @ref tui_working_with_groups_page "Example"
3953 def DifferenceList (self,theGroup, theSubShapes):
3954 # Example: see GEOM_TestOthers.py
3955 self.GroupOp.DifferenceList(theGroup, theSubShapes)
3956 RaiseIfFailed("DifferenceList", self.GroupOp)
3959 ## Works like the above method, but argument
3960 # theSubShapes here is a list of sub-shapes indices
3962 # @ref swig_DifferenceIDs "Example"
3963 def DifferenceIDs(self,theGroup, theSubShapes):
3964 # Example: see GEOM_TestOthers.py
3965 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
3966 RaiseIfFailed("DifferenceIDs", self.GroupOp)
3969 ## Returns a list of sub objects ID stored in the group
3970 # @param theGroup is a GEOM group for which a list of IDs is requested
3972 # @ref swig_GetObjectIDs "Example"
3973 def GetObjectIDs(self,theGroup):
3974 # Example: see GEOM_TestOthers.py
3975 ListIDs = self.GroupOp.GetObjects(theGroup)
3976 RaiseIfFailed("GetObjects", self.GroupOp)
3979 ## Returns a type of sub objects stored in the group
3980 # @param theGroup is a GEOM group which type is returned.
3982 # @ref swig_GetType "Example"
3983 def GetType(self,theGroup):
3984 # Example: see GEOM_TestOthers.py
3985 aType = self.GroupOp.GetType(theGroup)
3986 RaiseIfFailed("GetType", self.GroupOp)
3989 ## Convert a type of geom object from id to string value
3990 # @param theId is a GEOM obect type id.
3992 # @ref swig_GetType "Example"
3993 def ShapeIdToType(self, theId):
4067 return "FREE_BOUNDS"
4075 return "THRUSECTIONS"
4077 return "COMPOUNDFILTER"
4079 return "SHAPES_ON_SHAPE"
4081 return "ELLIPSE_ARC"
4088 return "Shape Id not exist."
4090 ## Returns a main shape associated with the group
4091 # @param theGroup is a GEOM group for which a main shape object is requested
4092 # @return a GEOM object which is a main shape for theGroup
4094 # @ref swig_GetMainShape "Example"
4095 def GetMainShape(self,theGroup):
4096 # Example: see GEOM_TestOthers.py
4097 anObj = self.GroupOp.GetMainShape(theGroup)
4098 RaiseIfFailed("GetMainShape", self.GroupOp)
4101 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
4102 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
4104 # @ref swig_todo "Example"
4105 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1):
4106 edges = self.SubShapeAll(theShape, ShapeType["EDGE"])
4109 Props = self.BasicProperties(edge)
4110 if min_length <= Props[0] and Props[0] <= max_length:
4111 if (not include_min) and (min_length == Props[0]):
4114 if (not include_max) and (Props[0] == max_length):
4117 edges_in_range.append(edge)
4119 if len(edges_in_range) <= 0:
4120 print "No edges found by given criteria"
4123 group_edges = self.CreateGroup(theShape, ShapeType["EDGE"])
4124 self.UnionList(group_edges, edges_in_range)
4128 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
4129 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
4131 # @ref swig_todo "Example"
4132 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
4133 nb_selected = sg.SelectedCount()
4135 print "Select a shape before calling this function, please."
4138 print "Only one shape must be selected"
4141 id_shape = sg.getSelected(0)
4142 shape = IDToObject( id_shape )
4144 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
4148 if include_min: left_str = " <= "
4149 if include_max: right_str = " <= "
4151 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
4152 + left_str + "length" + right_str + `max_length`)
4154 sg.updateObjBrowser(1)
4161 ## @addtogroup l4_advanced
4164 ## Create a T-shape object with specified caracteristics for the main
4165 # and the incident pipes (radius, width, half-length).
4166 # The extremities of the main pipe are located on junctions points P1 and P2.
4167 # The extremity of the incident pipe is located on junction point P3.
4168 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
4169 # the main plane of the T-shape is XOY.
4170 # @param theR1 Internal radius of main pipe
4171 # @param theW1 Width of main pipe
4172 # @param theL1 Half-length of main pipe
4173 # @param theR2 Internal radius of incident pipe (R2 < R1)
4174 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
4175 # @param theL2 Half-length of incident pipe
4176 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
4177 # @param theP1 1st junction point of main pipe
4178 # @param theP2 2nd junction point of main pipe
4179 # @param theP3 Junction point of incident pipe
4180 # @return List of GEOM_Objects, containing the created shape and propagation groups.
4182 # @ref tui_creation_pipetshape "Example"
4183 def MakePipeTShape(self, theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh=True, theP1=None, theP2=None, theP3=None):
4184 theR1, theW1, theL1, theR2, theW2, theL2, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2)
4185 if (theP1 and theP2 and theP3):
4186 anObj = self.AdvOp.MakePipeTShapeWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh, theP1, theP2, theP3)
4188 anObj = self.AdvOp.MakePipeTShape(theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh)
4189 RaiseIfFailed("MakePipeTShape", self.AdvOp)
4190 if Parameters: anObj[0].SetParameters(Parameters)
4193 ## Create a T-shape object with chamfer and with specified caracteristics for the main
4194 # and the incident pipes (radius, width, half-length). The chamfer is
4195 # created on the junction of the pipes.
4196 # The extremities of the main pipe are located on junctions points P1 and P2.
4197 # The extremity of the incident pipe is located on junction point P3.
4198 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
4199 # the main plane of the T-shape is XOY.
4200 # @param theR1 Internal radius of main pipe
4201 # @param theW1 Width of main pipe
4202 # @param theL1 Half-length of main pipe
4203 # @param theR2 Internal radius of incident pipe (R2 < R1)
4204 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
4205 # @param theL2 Half-length of incident pipe
4206 # @param theH Height of the chamfer.
4207 # @param theW Width of the chamfer.
4208 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
4209 # @param theP1 1st junction point of main pipe
4210 # @param theP2 2nd junction point of main pipe
4211 # @param theP3 Junction point of incident pipe
4212 # @return List of GEOM_Objects, containing the created shape and propagation groups.
4214 # @ref tui_creation_pipetshape "Example"
4215 def MakePipeTShapeChamfer(self, theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh=True, theP1=None, theP2=None, theP3=None):
4216 theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW)
4217 if (theP1 and theP2 and theP3):
4218 anObj = self.AdvOp.MakePipeTShapeChamferWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh, theP1, theP2, theP3)
4220 anObj = self.AdvOp.MakePipeTShapeChamfer(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh)
4221 RaiseIfFailed("MakePipeTShapeChamfer", self.AdvOp)
4222 if Parameters: anObj[0].SetParameters(Parameters)
4225 ## Create a T-shape object with fillet and with specified caracteristics for the main
4226 # and the incident pipes (radius, width, half-length). The fillet is
4227 # created on the junction of the pipes.
4228 # The extremities of the main pipe are located on junctions points P1 and P2.
4229 # The extremity of the incident pipe is located on junction point P3.
4230 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
4231 # the main plane of the T-shape is XOY.
4232 # @param theR1 Internal radius of main pipe
4233 # @param theW1 Width of main pipe
4234 # @param theL1 Half-length of main pipe
4235 # @param theR2 Internal radius of incident pipe (R2 < R1)
4236 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
4237 # @param theL2 Half-length of incident pipe
4238 # @param theRF Radius of curvature of fillet.
4239 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
4240 # @param theP1 1st junction point of main pipe
4241 # @param theP2 2nd junction point of main pipe
4242 # @param theP3 Junction point of incident pipe
4243 # @return List of GEOM_Objects, containing the created shape and propagation groups.
4245 # @ref tui_creation_pipetshape "Example"
4246 def MakePipeTShapeFillet(self, theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh=True, theP1=None, theP2=None, theP3=None):
4247 theR1, theW1, theL1, theR2, theW2, theL2, theRF, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theRF)
4248 if (theP1 and theP2 and theP3):
4249 anObj = self.AdvOp.MakePipeTShapeFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh, theP1, theP2, theP3)
4251 anObj = self.AdvOp.MakePipeTShapeFillet(theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh)
4252 RaiseIfFailed("MakePipeTShapeFillet", self.AdvOp)
4253 if Parameters: anObj[0].SetParameters(Parameters)
4256 #@@ insert new functions before this line @@ do not remove this line @@#
4258 # end of l4_advanced
4261 ## Create a copy of the given object
4262 # @ingroup l1_geompy_auxiliary
4264 # @ref swig_all_advanced "Example"
4265 def MakeCopy(self,theOriginal):
4266 # Example: see GEOM_TestAll.py
4267 anObj = self.InsertOp.MakeCopy(theOriginal)
4268 RaiseIfFailed("MakeCopy", self.InsertOp)
4271 ## Add Path to load python scripts from
4272 # @ingroup l1_geompy_auxiliary
4273 def addPath(self,Path):
4274 if (sys.path.count(Path) < 1):
4275 sys.path.append(Path)
4279 ## Load marker texture from the file
4280 # @param Path a path to the texture file
4281 # @return unique texture identifier
4282 # @ingroup l1_geompy_auxiliary
4283 def LoadTexture(self, Path):
4284 # Example: see GEOM_TestAll.py
4285 ID = self.InsertOp.LoadTexture(Path)
4286 RaiseIfFailed("LoadTexture", self.InsertOp)
4289 ## Add marker texture. @a Width and @a Height parameters
4290 # specify width and height of the texture in pixels.
4291 # If @a RowData is @c True, @a Texture parameter should represent texture data
4292 # packed into the byte array. If @a RowData is @c False (default), @a Texture
4293 # parameter should be unpacked string, in which '1' symbols represent opaque
4294 # pixels and '0' represent transparent pixels of the texture bitmap.
4296 # @param Width texture width in pixels
4297 # @param Height texture height in pixels
4298 # @param Texture texture data
4299 # @param RowData if @c True, @a Texture data are packed in the byte stream
4300 # @ingroup l1_geompy_auxiliary
4301 def AddTexture(self, Width, Height, Texture, RowData=False):
4302 # Example: see GEOM_TestAll.py
4303 if not RowData: Texture = PackData(Texture)
4304 ID = self.InsertOp.AddTexture(Width, Height, Texture)
4305 RaiseIfFailed("AddTexture", self.InsertOp)
4309 #Register the new proxy for GEOM_Gen
4310 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geompyDC)