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_decompose_d Decompose objects deprecated methods
55 ## @defgroup l4_access Access to sub-shapes by their unique IDs inside the main shape
56 ## @defgroup l4_obtain Access to subshapes by a criteria
57 ## @defgroup l4_advanced Advanced objects creation functions
62 ## @defgroup l2_transforming Transforming geometrical objects
64 ## @defgroup l3_basic_op Basic Operations
65 ## @defgroup l3_boolean Boolean Operations
66 ## @defgroup l3_transform Transformation Operations
67 ## @defgroup l3_local Local Operations (Fillet and Chamfer)
68 ## @defgroup l3_blocks_op Blocks Operations
69 ## @defgroup l3_healing Repairing Operations
70 ## @defgroup l3_restore_ss Restore presentation parameters and a tree of subshapes
73 ## @defgroup l2_measure Using measurement tools
81 from salome_notebook import *
86 ## Enumeration ShapeType as a dictionary
87 # @ingroup l1_geompy_auxiliary
88 ShapeType = {"AUTO":-1, "COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8}
90 ## Raise an Error, containing the Method_name, if Operation is Failed
91 ## @ingroup l1_geompy_auxiliary
92 def RaiseIfFailed (Method_name, Operation):
93 if Operation.IsDone() == 0 and Operation.GetErrorCode() != "NOT_FOUND_ANY":
94 raise RuntimeError, Method_name + " : " + Operation.GetErrorCode()
96 ## Return list of variables value from salome notebook
97 ## @ingroup l1_geompy_auxiliary
98 def ParseParameters(*parameters):
101 for parameter in parameters:
102 if isinstance(parameter, list):
103 lResults = ParseParameters(*parameter)
104 if len(lResults) > 0:
105 Result.append(lResults[:-1])
106 StringResult += lResults[-1].split(":")
110 if isinstance(parameter,str):
111 if notebook.isVariable(parameter):
112 Result.append(notebook.get(parameter))
114 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
117 Result.append(parameter)
119 StringResult.append(str(parameter))
123 Result.append(":".join(StringResult))
125 Result = ":".join(StringResult)
128 ## Return list of variables value from salome notebook
129 ## @ingroup l1_geompy_auxiliary
133 for parameter in list:
134 if isinstance(parameter,str) and notebook.isVariable(parameter):
135 Result.append(str(notebook.get(parameter)))
138 Result.append(str(parameter))
141 StringResult = StringResult + str(parameter)
142 StringResult = StringResult + ":"
144 StringResult = StringResult[:len(StringResult)-1]
145 return Result, StringResult
147 ## Return list of variables value from salome notebook
148 ## @ingroup l1_geompy_auxiliary
149 def ParseSketcherCommand(command):
152 sections = command.split(":")
153 for section in sections:
154 parameters = section.split(" ")
156 for parameter in parameters:
157 if paramIndex > 1 and parameter.find("'") != -1:
158 parameter = parameter.replace("'","")
159 if notebook.isVariable(parameter):
160 Result = Result + str(notebook.get(parameter)) + " "
163 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
167 Result = Result + str(parameter) + " "
170 StringResult = StringResult + parameter
171 StringResult = StringResult + ":"
173 paramIndex = paramIndex + 1
175 Result = Result[:len(Result)-1] + ":"
177 Result = Result[:len(Result)-1]
178 return Result, StringResult
180 ## Helper function which can be used to pack the passed string to the byte data.
181 ## Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
182 ## If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
185 ## val = PackData("10001110") # val = 0xAE
186 ## val = PackData("1") # val = 0x80
188 ## @param data unpacked data - a string containing '1' and '0' symbols
189 ## @return data packed to the byte stream
190 ## @ingroup l1_geompy_auxiliary
193 if len(data)%8: bytes += 1
195 for b in range(bytes):
196 d = data[b*8:(b+1)*8]
201 if d[i] == "1": val += 1
203 raise "Invalid symbol %s" % d[i]
210 ## Read bitmap texture from the text file.
211 ## In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
212 ## A zero symbol ('0') represents transparent pixel of the texture bitmap.
213 ## The function returns width and height of the pixmap in pixels and byte stream representing
214 ## texture bitmap itself.
216 ## This function can be used to read the texture to the byte stream in order to pass it to
217 ## the AddTexture() function of geompy class.
221 ## geompy.init_geom(salome.myStudy)
222 ## texture = geompy.readtexture('mytexture.dat')
223 ## texture = geompy.AddTexture(*texture)
224 ## obj.SetMarkerTexture(texture)
226 ## @param fname texture file name
227 ## @return sequence of tree values: texture's width, height in pixels and its byte stream
228 ## @ingroup l1_geompy_auxiliary
229 def ReadTexture(fname):
232 lines = [ l.strip() for l in f.readlines()]
235 if lines: maxlen = max([len(x) for x in lines])
237 if maxlen%8: lenbytes += 1
241 lenline = (len(line)/8+1)*8
244 lenline = (len(line)/8)*8
246 for i in range(lenline/8):
249 if i*8+j < len(line) and line[i*8+j] != "0": byte += "1"
252 bytedata += PackData(byte)
254 for i in range(lenline/8, lenbytes):
255 bytedata += PackData("0")
257 return lenbytes*8, len(lines), bytedata
262 ## Returns a long value from enumeration type
263 # Can be used for CORBA enumerator types like GEOM.shape_type
264 # @ingroup l1_geompy_auxiliary
265 def EnumToLong(theItem):
267 if hasattr(theItem, "_v"): ret = theItem._v
270 ## Kinds of shape enumeration
271 # @ingroup l1_geompy_auxiliary
272 kind = GEOM.GEOM_IKindOfShape
274 ## Information about closed/unclosed state of shell or wire
275 # @ingroup l1_geompy_auxiliary
281 class geompyDC(GEOM._objref_GEOM_Gen):
284 GEOM._objref_GEOM_Gen.__init__(self)
285 self.myBuilder = None
304 ## @addtogroup l1_geompy_auxiliary
306 def init_geom(self,theStudy):
307 self.myStudy = theStudy
308 self.myStudyId = self.myStudy._get_StudyId()
309 self.myBuilder = self.myStudy.NewBuilder()
310 self.father = self.myStudy.FindComponent("GEOM")
311 if self.father is None:
312 self.father = self.myBuilder.NewComponent("GEOM")
313 A1 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributeName")
314 FName = A1._narrow(SALOMEDS.AttributeName)
315 FName.SetValue("Geometry")
316 A2 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributePixMap")
317 aPixmap = A2._narrow(SALOMEDS.AttributePixMap)
318 aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry")
319 self.myBuilder.DefineComponentInstance(self.father,self)
321 self.BasicOp = self.GetIBasicOperations (self.myStudyId)
322 self.CurvesOp = self.GetICurvesOperations (self.myStudyId)
323 self.PrimOp = self.GetI3DPrimOperations (self.myStudyId)
324 self.ShapesOp = self.GetIShapesOperations (self.myStudyId)
325 self.HealOp = self.GetIHealingOperations (self.myStudyId)
326 self.InsertOp = self.GetIInsertOperations (self.myStudyId)
327 self.BoolOp = self.GetIBooleanOperations (self.myStudyId)
328 self.TrsfOp = self.GetITransformOperations(self.myStudyId)
329 self.LocalOp = self.GetILocalOperations (self.myStudyId)
330 self.MeasuOp = self.GetIMeasureOperations (self.myStudyId)
331 self.BlocksOp = self.GetIBlocksOperations (self.myStudyId)
332 self.GroupOp = self.GetIGroupOperations (self.myStudyId)
333 self.AdvOp = self.GetIAdvancedOperations (self.myStudyId)
336 ## Get name for sub-shape aSubObj of shape aMainObj
338 # @ref swig_SubShapeAllSorted "Example"
339 def SubShapeName(self,aSubObj, aMainObj):
340 # Example: see GEOM_TestAll.py
342 #aSubId = orb.object_to_string(aSubObj)
343 #aMainId = orb.object_to_string(aMainObj)
344 #index = gg.getIndexTopology(aSubId, aMainId)
345 #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
346 index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
347 name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
350 ## Publish in study aShape with name aName
352 # \param aShape the shape to be published
353 # \param aName the name for the shape
354 # \param doRestoreSubShapes if True, finds and publishes also
355 # sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
356 # and published sub-shapes of arguments
357 # \param theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes for
358 # these arguments description
359 # \return study entry of the published shape in form of string
361 # @ref swig_MakeQuad4Vertices "Example"
362 def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
363 theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
364 # Example: see GEOM_TestAll.py
366 aSObject = self.AddInStudy(self.myStudy, aShape, aName, None)
367 if doRestoreSubShapes:
368 self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs,
369 theFindMethod, theInheritFirstArg, True )
371 print "addToStudy() failed"
373 return aShape.GetStudyEntry()
375 ## Publish in study aShape with name aName as sub-object of previously published aFather
377 # @ref swig_SubShapeAllSorted "Example"
378 def addToStudyInFather(self, aFather, aShape, aName):
379 # Example: see GEOM_TestAll.py
381 aSObject = self.AddInStudy(self.myStudy, aShape, aName, aFather)
383 print "addToStudyInFather() failed"
385 return aShape.GetStudyEntry()
387 ## Unpublish object in study
389 def hideInStudy(self, obj):
390 ior = salome.orb.object_to_string(obj)
391 aSObject = self.myStudy.FindObjectIOR(ior)
392 if aSObject is not None:
393 genericAttribute = self.myBuilder.FindOrCreateAttribute(aSObject, "AttributeDrawable")
394 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
395 drwAttribute.SetDrawable(False)
398 # end of l1_geompy_auxiliary
401 ## @addtogroup l3_restore_ss
404 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
405 # To be used from python scripts out of geompy.addToStudy (non-default usage)
406 # \param theObject published GEOM object, arguments of which will be published
407 # \param theArgs list of GEOM_Object, operation arguments to be published.
408 # If this list is empty, all operation arguments will be published
409 # \param theFindMethod method to search subshapes, corresponding to arguments and
410 # their subshapes. Value from enumeration GEOM::find_shape_method.
411 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
412 # Do not publish subshapes in place of arguments, but only
413 # in place of subshapes of the first argument,
414 # because the whole shape corresponds to the first argument.
415 # Mainly to be used after transformations, but it also can be
416 # usefull after partition with one object shape, and some other
417 # operations, where only the first argument has to be considered.
418 # If theObject has only one argument shape, this flag is automatically
419 # considered as True, not regarding really passed value.
420 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
421 # and prefix "from_subshapes_of_" to names of partially restored subshapes.
422 # \return list of published sub-shapes
424 # @ref tui_restore_prs_params "Example"
425 def RestoreSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
426 theInheritFirstArg=False, theAddPrefix=True):
427 # Example: see GEOM_TestAll.py
428 return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
429 theFindMethod, theInheritFirstArg, theAddPrefix)
431 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
432 # To be used from python scripts out of geompy.addToStudy (non-default usage)
433 # \param theObject published GEOM object, arguments of which will be published
434 # \param theArgs list of GEOM_Object, operation arguments to be published.
435 # If this list is empty, all operation arguments will be published
436 # \param theFindMethod method to search subshapes, corresponding to arguments and
437 # their subshapes. Value from enumeration GEOM::find_shape_method.
438 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
439 # Do not publish subshapes in place of arguments, but only
440 # in place of subshapes of the first argument,
441 # because the whole shape corresponds to the first argument.
442 # Mainly to be used after transformations, but it also can be
443 # usefull after partition with one object shape, and some other
444 # operations, where only the first argument has to be considered.
445 # If theObject has only one argument shape, this flag is automatically
446 # considered as True, not regarding really passed value.
447 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
448 # and prefix "from_subshapes_of_" to names of partially restored subshapes.
449 # \return list of published sub-shapes
451 # @ref tui_restore_prs_params "Example"
452 def RestoreGivenSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
453 theInheritFirstArg=False, theAddPrefix=True):
454 # Example: see GEOM_TestAll.py
455 return self.RestoreGivenSubShapesO(self.myStudy, theObject, theArgs,
456 theFindMethod, theInheritFirstArg, theAddPrefix)
458 # end of l3_restore_ss
461 ## @addtogroup l3_basic_go
464 ## Create point by three coordinates.
465 # @param theX The X coordinate of the point.
466 # @param theY The Y coordinate of the point.
467 # @param theZ The Z coordinate of the point.
468 # @return New GEOM_Object, containing the created point.
470 # @ref tui_creation_point "Example"
471 def MakeVertex(self, theX, theY, theZ):
472 # Example: see GEOM_TestAll.py
473 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
474 anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
475 RaiseIfFailed("MakePointXYZ", self.BasicOp)
476 anObj.SetParameters(Parameters)
479 ## Create a point, distant from the referenced point
480 # on the given distances along the coordinate axes.
481 # @param theReference The referenced point.
482 # @param theX Displacement from the referenced point along OX axis.
483 # @param theY Displacement from the referenced point along OY axis.
484 # @param theZ Displacement from the referenced point along OZ axis.
485 # @return New GEOM_Object, containing the created point.
487 # @ref tui_creation_point "Example"
488 def MakeVertexWithRef(self,theReference, theX, theY, theZ):
489 # Example: see GEOM_TestAll.py
490 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
491 anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
492 RaiseIfFailed("MakePointWithReference", self.BasicOp)
493 anObj.SetParameters(Parameters)
496 ## Create a point, corresponding to the given parameter on the given curve.
497 # @param theRefCurve The referenced curve.
498 # @param theParameter Value of parameter on the referenced curve.
499 # @return New GEOM_Object, containing the created point.
501 # @ref tui_creation_point "Example"
502 def MakeVertexOnCurve(self,theRefCurve, theParameter):
503 # Example: see GEOM_TestAll.py
504 theParameter, Parameters = ParseParameters(theParameter)
505 anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter)
506 RaiseIfFailed("MakePointOnCurve", self.BasicOp)
507 anObj.SetParameters(Parameters)
510 ## Create a point by projection give coordinates on the given curve
511 # @param theRefCurve The referenced curve.
512 # @param theX X-coordinate in 3D space
513 # @param theY Y-coordinate in 3D space
514 # @param theZ Z-coordinate in 3D space
515 # @return New GEOM_Object, containing the created point.
517 # @ref tui_creation_point "Example"
518 def MakeVertexOnCurveByCoord(self,theRefCurve, theX, theY, theZ):
519 # Example: see GEOM_TestAll.py
520 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
521 anObj = self.BasicOp.MakePointOnCurveByCoord(theRefCurve, theX, theY, theZ)
522 RaiseIfFailed("MakeVertexOnCurveByCoord", self.BasicOp)
523 anObj.SetParameters(Parameters)
526 ## Create a point, corresponding to the given length on the given curve.
527 # @param theRefCurve The referenced curve.
528 # @param theLength Length on the referenced curve. It can be negative.
529 # @param theStartPoint Point allowing to choose the direction for the calculation
530 # of the length. If None, start from the first point of theRefCurve.
531 # @return New GEOM_Object, containing the created point.
533 # @ref tui_creation_point "Example"
534 def MakeVertexOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None):
535 # Example: see GEOM_TestAll.py
536 theLength, Parameters = ParseParameters(theLength)
537 anObj = self.BasicOp.MakePointOnCurveByLength(theRefCurve, theLength, theStartPoint)
538 RaiseIfFailed("MakePointOnCurveByLength", self.BasicOp)
539 anObj.SetParameters(Parameters)
542 ## Create a point, corresponding to the given parameters on the
544 # @param theRefSurf The referenced surface.
545 # @param theUParameter Value of U-parameter on the referenced surface.
546 # @param theVParameter Value of V-parameter on the referenced surface.
547 # @return New GEOM_Object, containing the created point.
549 # @ref swig_MakeVertexOnSurface "Example"
550 def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter):
551 theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
552 # Example: see GEOM_TestAll.py
553 anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
554 RaiseIfFailed("MakePointOnSurface", self.BasicOp)
555 anObj.SetParameters(Parameters);
558 ## Create a point by projection give coordinates on the given surface
559 # @param theRefSurf The referenced surface.
560 # @param theX X-coordinate in 3D space
561 # @param theY Y-coordinate in 3D space
562 # @param theZ Z-coordinate in 3D space
563 # @return New GEOM_Object, containing the created point.
565 # @ref swig_MakeVertexOnSurfaceByCoord "Example"
566 def MakeVertexOnSurfaceByCoord(self, theRefSurf, theX, theY, theZ):
567 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
568 # Example: see GEOM_TestAll.py
569 anObj = self.BasicOp.MakePointOnSurfaceByCoord(theRefSurf, theX, theY, theZ)
570 RaiseIfFailed("MakeVertexOnSurfaceByCoord", self.BasicOp)
571 anObj.SetParameters(Parameters);
574 ## Create a point on intersection of two lines.
575 # @param theRefLine1, theRefLine2 The referenced lines.
576 # @return New GEOM_Object, containing the created point.
578 # @ref swig_MakeVertexOnLinesIntersection "Example"
579 def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2):
580 # Example: see GEOM_TestAll.py
581 anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
582 RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
585 ## Create a tangent, corresponding to the given parameter on the given curve.
586 # @param theRefCurve The referenced curve.
587 # @param theParameter Value of parameter on the referenced curve.
588 # @return New GEOM_Object, containing the created tangent.
590 # @ref swig_MakeTangentOnCurve "Example"
591 def MakeTangentOnCurve(self, theRefCurve, theParameter):
592 anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
593 RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
596 ## Create a tangent plane, corresponding to the given parameter on the given face.
597 # @param theFace The face for which tangent plane should be built.
598 # @param theParameterV vertical value of the center point (0.0 - 1.0).
599 # @param theParameterU horisontal value of the center point (0.0 - 1.0).
600 # @param theTrimSize the size of plane.
601 # @return New GEOM_Object, containing the created tangent.
603 # @ref swig_MakeTangentPlaneOnFace "Example"
604 def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize):
605 anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
606 RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
609 ## Create a vector with the given components.
610 # @param theDX X component of the vector.
611 # @param theDY Y component of the vector.
612 # @param theDZ Z component of the vector.
613 # @return New GEOM_Object, containing the created vector.
615 # @ref tui_creation_vector "Example"
616 def MakeVectorDXDYDZ(self,theDX, theDY, theDZ):
617 # Example: see GEOM_TestAll.py
618 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
619 anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
620 RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
621 anObj.SetParameters(Parameters)
624 ## Create a vector between two points.
625 # @param thePnt1 Start point for the vector.
626 # @param thePnt2 End point for the vector.
627 # @return New GEOM_Object, containing the created vector.
629 # @ref tui_creation_vector "Example"
630 def MakeVector(self,thePnt1, thePnt2):
631 # Example: see GEOM_TestAll.py
632 anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
633 RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
636 ## Create a line, passing through the given point
637 # and parrallel to the given direction
638 # @param thePnt Point. The resulting line will pass through it.
639 # @param theDir Direction. The resulting line will be parallel to it.
640 # @return New GEOM_Object, containing the created line.
642 # @ref tui_creation_line "Example"
643 def MakeLine(self,thePnt, theDir):
644 # Example: see GEOM_TestAll.py
645 anObj = self.BasicOp.MakeLine(thePnt, theDir)
646 RaiseIfFailed("MakeLine", self.BasicOp)
649 ## Create a line, passing through the given points
650 # @param thePnt1 First of two points, defining the line.
651 # @param thePnt2 Second of two points, defining the line.
652 # @return New GEOM_Object, containing the created line.
654 # @ref tui_creation_line "Example"
655 def MakeLineTwoPnt(self,thePnt1, thePnt2):
656 # Example: see GEOM_TestAll.py
657 anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
658 RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
661 ## Create a line on two faces intersection.
662 # @param theFace1 First of two faces, defining the line.
663 # @param theFace2 Second of two faces, defining the line.
664 # @return New GEOM_Object, containing the created line.
666 # @ref swig_MakeLineTwoFaces "Example"
667 def MakeLineTwoFaces(self, theFace1, theFace2):
668 # Example: see GEOM_TestAll.py
669 anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
670 RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
673 ## Create a plane, passing through the given point
674 # and normal to the given vector.
675 # @param thePnt Point, the plane has to pass through.
676 # @param theVec Vector, defining the plane normal direction.
677 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
678 # @return New GEOM_Object, containing the created plane.
680 # @ref tui_creation_plane "Example"
681 def MakePlane(self,thePnt, theVec, theTrimSize):
682 # Example: see GEOM_TestAll.py
683 theTrimSize, Parameters = ParseParameters(theTrimSize);
684 anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
685 RaiseIfFailed("MakePlanePntVec", self.BasicOp)
686 anObj.SetParameters(Parameters)
689 ## Create a plane, passing through the three given points
690 # @param thePnt1 First of three points, defining the plane.
691 # @param thePnt2 Second of three points, defining the plane.
692 # @param thePnt3 Fird of three points, defining the plane.
693 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
694 # @return New GEOM_Object, containing the created plane.
696 # @ref tui_creation_plane "Example"
697 def MakePlaneThreePnt(self,thePnt1, thePnt2, thePnt3, theTrimSize):
698 # Example: see GEOM_TestAll.py
699 theTrimSize, Parameters = ParseParameters(theTrimSize);
700 anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
701 RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
702 anObj.SetParameters(Parameters)
705 ## Create a plane, similar to the existing one, but with another size of representing face.
706 # @param theFace Referenced plane or LCS(Marker).
707 # @param theTrimSize New half size of a side of quadrangle face, representing the plane.
708 # @return New GEOM_Object, containing the created plane.
710 # @ref tui_creation_plane "Example"
711 def MakePlaneFace(self,theFace, theTrimSize):
712 # Example: see GEOM_TestAll.py
713 theTrimSize, Parameters = ParseParameters(theTrimSize);
714 anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
715 RaiseIfFailed("MakePlaneFace", self.BasicOp)
716 anObj.SetParameters(Parameters)
719 ## Create a plane, passing through the 2 vectors
720 # with center in a start point of the first vector.
721 # @param theVec1 Vector, defining center point and plane direction.
722 # @param theVec2 Vector, defining the plane normal direction.
723 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
724 # @return New GEOM_Object, containing the created plane.
726 # @ref tui_creation_plane "Example"
727 def MakePlane2Vec(self,theVec1, theVec2, theTrimSize):
728 # Example: see GEOM_TestAll.py
729 theTrimSize, Parameters = ParseParameters(theTrimSize);
730 anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
731 RaiseIfFailed("MakePlane2Vec", self.BasicOp)
732 anObj.SetParameters(Parameters)
735 ## Create a plane, based on a Local coordinate system.
736 # @param theLCS coordinate system, defining plane.
737 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
738 # @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
739 # @return New GEOM_Object, containing the created plane.
741 # @ref tui_creation_plane "Example"
742 def MakePlaneLCS(self,theLCS, theTrimSize, theOrientation):
743 # Example: see GEOM_TestAll.py
744 theTrimSize, Parameters = ParseParameters(theTrimSize);
745 anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
746 RaiseIfFailed("MakePlaneLCS", self.BasicOp)
747 anObj.SetParameters(Parameters)
750 ## Create a local coordinate system.
751 # @param OX,OY,OZ Three coordinates of coordinate system origin.
752 # @param XDX,XDY,XDZ Three components of OX direction
753 # @param YDX,YDY,YDZ Three components of OY direction
754 # @return New GEOM_Object, containing the created coordinate system.
756 # @ref swig_MakeMarker "Example"
757 def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ):
758 # Example: see GEOM_TestAll.py
759 OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
760 anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
761 RaiseIfFailed("MakeMarker", self.BasicOp)
762 anObj.SetParameters(Parameters)
765 ## Create a local coordinate system from shape.
766 # @param theShape The initial shape to detect the coordinate system.
767 # @return New GEOM_Object, containing the created coordinate system.
769 # @ref tui_creation_lcs "Example"
770 def MakeMarkerFromShape(self, theShape):
771 anObj = self.BasicOp.MakeMarkerFromShape(theShape)
772 RaiseIfFailed("MakeMarkerFromShape", self.BasicOp)
775 ## Create a local coordinate system from point and two vectors.
776 # @param theOrigin Point of coordinate system origin.
777 # @param theXVec Vector of X direction
778 # @param theYVec Vector of Y direction
779 # @return New GEOM_Object, containing the created coordinate system.
781 # @ref tui_creation_lcs "Example"
782 def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec):
783 anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec)
784 RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp)
790 ## @addtogroup l4_curves
793 ## Create an arc of circle, passing through three given points.
794 # @param thePnt1 Start point of the arc.
795 # @param thePnt2 Middle point of the arc.
796 # @param thePnt3 End point of the arc.
797 # @return New GEOM_Object, containing the created arc.
799 # @ref swig_MakeArc "Example"
800 def MakeArc(self,thePnt1, thePnt2, thePnt3):
801 # Example: see GEOM_TestAll.py
802 anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
803 RaiseIfFailed("MakeArc", self.CurvesOp)
806 ## Create an arc of circle from a center and 2 points.
807 # @param thePnt1 Center of the arc
808 # @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
809 # @param thePnt3 End point of the arc (Gives also a direction)
810 # @param theSense Orientation of the arc
811 # @return New GEOM_Object, containing the created arc.
813 # @ref swig_MakeArc "Example"
814 def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False):
815 # Example: see GEOM_TestAll.py
816 anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
817 RaiseIfFailed("MakeArcCenter", self.CurvesOp)
820 ## Create an arc of ellipse, of center and two points.
821 # @param theCenter Center of the arc.
822 # @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
823 # @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
824 # @return New GEOM_Object, containing the created arc.
826 # @ref swig_MakeArc "Example"
827 def MakeArcOfEllipse(self,theCenter, thePnt1, thePnt2):
828 # Example: see GEOM_TestAll.py
829 anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
830 RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
833 ## Create a circle with given center, normal vector and radius.
834 # @param thePnt Circle center.
835 # @param theVec Vector, normal to the plane of the circle.
836 # @param theR Circle radius.
837 # @return New GEOM_Object, containing the created circle.
839 # @ref tui_creation_circle "Example"
840 def MakeCircle(self, thePnt, theVec, theR):
841 # Example: see GEOM_TestAll.py
842 theR, Parameters = ParseParameters(theR)
843 anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
844 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
845 anObj.SetParameters(Parameters)
848 ## Create a circle with given radius.
849 # Center of the circle will be in the origin of global
850 # coordinate system and normal vector will be codirected with Z axis
851 # @param theR Circle radius.
852 # @return New GEOM_Object, containing the created circle.
853 def MakeCircleR(self, theR):
854 anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
855 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
858 ## Create a circle, passing through three given points
859 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
860 # @return New GEOM_Object, containing the created circle.
862 # @ref tui_creation_circle "Example"
863 def MakeCircleThreePnt(self,thePnt1, thePnt2, thePnt3):
864 # Example: see GEOM_TestAll.py
865 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
866 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
869 ## Create a circle, with given point1 as center,
870 # passing through the point2 as radius and laying in the plane,
871 # defined by all three given points.
872 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
873 # @return New GEOM_Object, containing the created circle.
875 # @ref swig_MakeCircle "Example"
876 def MakeCircleCenter2Pnt(self,thePnt1, thePnt2, thePnt3):
877 # Example: see GEOM_example6.py
878 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
879 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
882 ## Create an ellipse with given center, normal vector and radiuses.
883 # @param thePnt Ellipse center.
884 # @param theVec Vector, normal to the plane of the ellipse.
885 # @param theRMajor Major ellipse radius.
886 # @param theRMinor Minor ellipse radius.
887 # @param theVecMaj Vector, direction of the ellipse's main axis.
888 # @return New GEOM_Object, containing the created ellipse.
890 # @ref tui_creation_ellipse "Example"
891 def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None):
892 # Example: see GEOM_TestAll.py
893 theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
894 if theVecMaj is not None:
895 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
897 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
899 RaiseIfFailed("MakeEllipse", self.CurvesOp)
900 anObj.SetParameters(Parameters)
903 ## Create an ellipse with given radiuses.
904 # Center of the ellipse will be in the origin of global
905 # coordinate system and normal vector will be codirected with Z axis
906 # @param theRMajor Major ellipse radius.
907 # @param theRMinor Minor ellipse radius.
908 # @return New GEOM_Object, containing the created ellipse.
909 def MakeEllipseRR(self, theRMajor, theRMinor):
910 anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
911 RaiseIfFailed("MakeEllipse", self.CurvesOp)
914 ## Create a polyline on the set of points.
915 # @param thePoints Sequence of points for the polyline.
916 # @param theIsClosed If True, build a closed wire.
917 # @return New GEOM_Object, containing the created polyline.
919 # @ref tui_creation_curve "Example"
920 def MakePolyline(self, thePoints, theIsClosed=False):
921 # Example: see GEOM_TestAll.py
922 anObj = self.CurvesOp.MakePolyline(thePoints, theIsClosed)
923 RaiseIfFailed("MakePolyline", self.CurvesOp)
926 ## Create bezier curve on the set of points.
927 # @param thePoints Sequence of points for the bezier curve.
928 # @param theIsClosed If True, build a closed curve.
929 # @return New GEOM_Object, containing the created bezier curve.
931 # @ref tui_creation_curve "Example"
932 def MakeBezier(self, thePoints, theIsClosed=False):
933 # Example: see GEOM_TestAll.py
934 anObj = self.CurvesOp.MakeSplineBezier(thePoints, theIsClosed)
935 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
938 ## Create B-Spline curve on the set of points.
939 # @param thePoints Sequence of points for the B-Spline curve.
940 # @param theIsClosed If True, build a closed curve.
941 # @param theDoReordering If TRUE, the algo does not follow the order of
942 # \a thePoints but searches for the closest vertex.
943 # @return New GEOM_Object, containing the created B-Spline curve.
945 # @ref tui_creation_curve "Example"
946 def MakeInterpol(self, thePoints, theIsClosed=False, theDoReordering=False):
947 # Example: see GEOM_TestAll.py
948 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed, theDoReordering)
949 RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
955 ## @addtogroup l3_sketcher
958 ## Create a sketcher (wire or face), following the textual description,
959 # passed through <VAR>theCommand</VAR> argument. \n
960 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
961 # Format of the description string have to be the following:
963 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
966 # - x1, y1 are coordinates of the first sketcher point (zero by default),
968 # - "R angle" : Set the direction by angle
969 # - "D dx dy" : Set the direction by DX & DY
972 # - "TT x y" : Create segment by point at X & Y
973 # - "T dx dy" : Create segment by point with DX & DY
974 # - "L length" : Create segment by direction & Length
975 # - "IX x" : Create segment by direction & Intersect. X
976 # - "IY y" : Create segment by direction & Intersect. Y
979 # - "C radius length" : Create arc by direction, radius and length(in degree)
980 # - "AA x y": Create arc by point at X & Y
981 # - "A dx dy" : Create arc by point with DX & DY
982 # - "A dx dy" : Create arc by point with DX & DY
983 # - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
984 # - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
985 # - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
986 # - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
989 # - "WW" : Close Wire (to finish)
990 # - "WF" : Close Wire and build face (to finish)
993 # - Flag1 (= reverse) is 0 or 2 ...
994 # - if 0 the drawn arc is the one of lower angle (< Pi)
995 # - if 2 the drawn arc ius the one of greater angle (> Pi)
998 # - Flag2 (= control tolerance) is 0 or 1 ...
999 # - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
1000 # - if 1 the wire is built only if the end point is on the arc
1001 # with a tolerance of 10^-7 on the distance else the creation fails
1003 # @param theCommand String, defining the sketcher in local
1004 # coordinates of the working plane.
1005 # @param theWorkingPlane Nine double values, defining origin,
1006 # OZ and OX directions of the working plane.
1007 # @return New GEOM_Object, containing the created wire.
1009 # @ref tui_sketcher_page "Example"
1010 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0]):
1011 # Example: see GEOM_TestAll.py
1012 theCommand,Parameters = ParseSketcherCommand(theCommand)
1013 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
1014 RaiseIfFailed("MakeSketcher", self.CurvesOp)
1015 anObj.SetParameters(Parameters)
1018 ## Create a sketcher (wire or face), following the textual description,
1019 # passed through <VAR>theCommand</VAR> argument. \n
1020 # For format of the description string see the previous method.\n
1021 # @param theCommand String, defining the sketcher in local
1022 # coordinates of the working plane.
1023 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
1024 # @return New GEOM_Object, containing the created wire.
1026 # @ref tui_sketcher_page "Example"
1027 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane):
1028 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
1029 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
1032 ## Create a sketcher wire, following the numerical description,
1033 # passed through <VAR>theCoordinates</VAR> argument. \n
1034 # @param theCoordinates double values, defining points to create a wire,
1036 # @return New GEOM_Object, containing the created wire.
1038 # @ref tui_sketcher_page "Example"
1039 def Make3DSketcher(self, theCoordinates):
1040 theCoordinates,Parameters = ParseParameters(theCoordinates)
1041 anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
1042 RaiseIfFailed("Make3DSketcher", self.CurvesOp)
1043 anObj.SetParameters(Parameters)
1046 # end of l3_sketcher
1049 ## @addtogroup l3_3d_primitives
1052 ## Create a box by coordinates of two opposite vertices.
1054 # @ref tui_creation_box "Example"
1055 def MakeBox(self,x1,y1,z1,x2,y2,z2):
1056 # Example: see GEOM_TestAll.py
1057 pnt1 = self.MakeVertex(x1,y1,z1)
1058 pnt2 = self.MakeVertex(x2,y2,z2)
1059 return self.MakeBoxTwoPnt(pnt1,pnt2)
1061 ## Create a box with specified dimensions along the coordinate axes
1062 # and with edges, parallel to the coordinate axes.
1063 # Center of the box will be at point (DX/2, DY/2, DZ/2).
1064 # @param theDX Length of Box edges, parallel to OX axis.
1065 # @param theDY Length of Box edges, parallel to OY axis.
1066 # @param theDZ Length of Box edges, parallel to OZ axis.
1067 # @return New GEOM_Object, containing the created box.
1069 # @ref tui_creation_box "Example"
1070 def MakeBoxDXDYDZ(self,theDX, theDY, theDZ):
1071 # Example: see GEOM_TestAll.py
1072 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1073 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
1074 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
1075 anObj.SetParameters(Parameters)
1078 ## Create a box with two specified opposite vertices,
1079 # and with edges, parallel to the coordinate axes
1080 # @param thePnt1 First of two opposite vertices.
1081 # @param thePnt2 Second of two opposite vertices.
1082 # @return New GEOM_Object, containing the created box.
1084 # @ref tui_creation_box "Example"
1085 def MakeBoxTwoPnt(self,thePnt1, thePnt2):
1086 # Example: see GEOM_TestAll.py
1087 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
1088 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
1091 ## Create a face with specified dimensions along OX-OY coordinate axes,
1092 # with edges, parallel to this coordinate axes.
1093 # @param theH height of Face.
1094 # @param theW width of Face.
1095 # @param theOrientation orientation belong axis OXY OYZ OZX
1096 # @return New GEOM_Object, containing the created face.
1098 # @ref tui_creation_face "Example"
1099 def MakeFaceHW(self,theH, theW, theOrientation):
1100 # Example: see GEOM_TestAll.py
1101 theH,theW,Parameters = ParseParameters(theH, theW)
1102 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
1103 RaiseIfFailed("MakeFaceHW", self.PrimOp)
1104 anObj.SetParameters(Parameters)
1107 ## Create a face from another plane and two sizes,
1108 # vertical size and horisontal size.
1109 # @param theObj Normale vector to the creating face or
1111 # @param theH Height (vertical size).
1112 # @param theW Width (horisontal size).
1113 # @return New GEOM_Object, containing the created face.
1115 # @ref tui_creation_face "Example"
1116 def MakeFaceObjHW(self, theObj, theH, theW):
1117 # Example: see GEOM_TestAll.py
1118 theH,theW,Parameters = ParseParameters(theH, theW)
1119 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
1120 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
1121 anObj.SetParameters(Parameters)
1124 ## Create a disk with given center, normal vector and radius.
1125 # @param thePnt Disk center.
1126 # @param theVec Vector, normal to the plane of the disk.
1127 # @param theR Disk radius.
1128 # @return New GEOM_Object, containing the created disk.
1130 # @ref tui_creation_disk "Example"
1131 def MakeDiskPntVecR(self,thePnt, theVec, theR):
1132 # Example: see GEOM_TestAll.py
1133 theR,Parameters = ParseParameters(theR)
1134 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
1135 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
1136 anObj.SetParameters(Parameters)
1139 ## Create a disk, passing through three given points
1140 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
1141 # @return New GEOM_Object, containing the created disk.
1143 # @ref tui_creation_disk "Example"
1144 def MakeDiskThreePnt(self,thePnt1, thePnt2, thePnt3):
1145 # Example: see GEOM_TestAll.py
1146 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
1147 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
1150 ## Create a disk with specified dimensions along OX-OY coordinate axes.
1151 # @param theR Radius of Face.
1152 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
1153 # @return New GEOM_Object, containing the created disk.
1155 # @ref tui_creation_face "Example"
1156 def MakeDiskR(self,theR, theOrientation):
1157 # Example: see GEOM_TestAll.py
1158 theR,Parameters = ParseParameters(theR)
1159 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
1160 RaiseIfFailed("MakeDiskR", self.PrimOp)
1161 anObj.SetParameters(Parameters)
1164 ## Create a cylinder with given base point, axis, radius and height.
1165 # @param thePnt Central point of cylinder base.
1166 # @param theAxis Cylinder axis.
1167 # @param theR Cylinder radius.
1168 # @param theH Cylinder height.
1169 # @return New GEOM_Object, containing the created cylinder.
1171 # @ref tui_creation_cylinder "Example"
1172 def MakeCylinder(self,thePnt, theAxis, theR, theH):
1173 # Example: see GEOM_TestAll.py
1174 theR,theH,Parameters = ParseParameters(theR, theH)
1175 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
1176 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
1177 anObj.SetParameters(Parameters)
1180 ## Create a cylinder with given radius and height at
1181 # the origin of coordinate system. Axis of the cylinder
1182 # will be collinear to the OZ axis of the coordinate system.
1183 # @param theR Cylinder radius.
1184 # @param theH Cylinder height.
1185 # @return New GEOM_Object, containing the created cylinder.
1187 # @ref tui_creation_cylinder "Example"
1188 def MakeCylinderRH(self,theR, theH):
1189 # Example: see GEOM_TestAll.py
1190 theR,theH,Parameters = ParseParameters(theR, theH)
1191 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
1192 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
1193 anObj.SetParameters(Parameters)
1196 ## Create a sphere with given center and radius.
1197 # @param thePnt Sphere center.
1198 # @param theR Sphere radius.
1199 # @return New GEOM_Object, containing the created sphere.
1201 # @ref tui_creation_sphere "Example"
1202 def MakeSpherePntR(self, thePnt, theR):
1203 # Example: see GEOM_TestAll.py
1204 theR,Parameters = ParseParameters(theR)
1205 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
1206 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
1207 anObj.SetParameters(Parameters)
1210 ## Create a sphere with given center and radius.
1211 # @param x,y,z Coordinates of sphere center.
1212 # @param theR Sphere radius.
1213 # @return New GEOM_Object, containing the created sphere.
1215 # @ref tui_creation_sphere "Example"
1216 def MakeSphere(self, x, y, z, theR):
1217 # Example: see GEOM_TestAll.py
1218 point = self.MakeVertex(x, y, z)
1219 anObj = self.MakeSpherePntR(point, theR)
1222 ## Create a sphere with given radius at the origin of coordinate system.
1223 # @param theR Sphere radius.
1224 # @return New GEOM_Object, containing the created sphere.
1226 # @ref tui_creation_sphere "Example"
1227 def MakeSphereR(self, theR):
1228 # Example: see GEOM_TestAll.py
1229 theR,Parameters = ParseParameters(theR)
1230 anObj = self.PrimOp.MakeSphereR(theR)
1231 RaiseIfFailed("MakeSphereR", self.PrimOp)
1232 anObj.SetParameters(Parameters)
1235 ## Create a cone with given base point, axis, height and radiuses.
1236 # @param thePnt Central point of the first cone base.
1237 # @param theAxis Cone axis.
1238 # @param theR1 Radius of the first cone base.
1239 # @param theR2 Radius of the second cone base.
1240 # \note If both radiuses are non-zero, the cone will be truncated.
1241 # \note If the radiuses are equal, a cylinder will be created instead.
1242 # @param theH Cone height.
1243 # @return New GEOM_Object, containing the created cone.
1245 # @ref tui_creation_cone "Example"
1246 def MakeCone(self,thePnt, theAxis, theR1, theR2, theH):
1247 # Example: see GEOM_TestAll.py
1248 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
1249 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
1250 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
1251 anObj.SetParameters(Parameters)
1254 ## Create a cone with given height and radiuses at
1255 # the origin of coordinate system. Axis of the cone will
1256 # be collinear to the OZ axis of the coordinate system.
1257 # @param theR1 Radius of the first cone base.
1258 # @param theR2 Radius of the second cone base.
1259 # \note If both radiuses are non-zero, the cone will be truncated.
1260 # \note If the radiuses are equal, a cylinder will be created instead.
1261 # @param theH Cone height.
1262 # @return New GEOM_Object, containing the created cone.
1264 # @ref tui_creation_cone "Example"
1265 def MakeConeR1R2H(self,theR1, theR2, theH):
1266 # Example: see GEOM_TestAll.py
1267 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
1268 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
1269 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
1270 anObj.SetParameters(Parameters)
1273 ## Create a torus with given center, normal vector and radiuses.
1274 # @param thePnt Torus central point.
1275 # @param theVec Torus axis of symmetry.
1276 # @param theRMajor Torus major radius.
1277 # @param theRMinor Torus minor radius.
1278 # @return New GEOM_Object, containing the created torus.
1280 # @ref tui_creation_torus "Example"
1281 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor):
1282 # Example: see GEOM_TestAll.py
1283 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
1284 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
1285 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
1286 anObj.SetParameters(Parameters)
1289 ## Create a torus with given radiuses at the origin of coordinate system.
1290 # @param theRMajor Torus major radius.
1291 # @param theRMinor Torus minor radius.
1292 # @return New GEOM_Object, containing the created torus.
1294 # @ref tui_creation_torus "Example"
1295 def MakeTorusRR(self, theRMajor, theRMinor):
1296 # Example: see GEOM_TestAll.py
1297 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
1298 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
1299 RaiseIfFailed("MakeTorusRR", self.PrimOp)
1300 anObj.SetParameters(Parameters)
1303 # end of l3_3d_primitives
1306 ## @addtogroup l3_complex
1309 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
1310 # @param theBase Base shape to be extruded.
1311 # @param thePoint1 First end of extrusion vector.
1312 # @param thePoint2 Second end of extrusion vector.
1313 # @param theScaleFactor Use it to make prism with scaled second base.
1314 # Nagative value means not scaled second base.
1315 # @return New GEOM_Object, containing the created prism.
1317 # @ref tui_creation_prism "Example"
1318 def MakePrism(self, theBase, thePoint1, thePoint2, theScaleFactor = -1.0):
1319 # Example: see GEOM_TestAll.py
1322 if theScaleFactor > 0:
1323 theScaleFactor,Parameters = ParseParameters(theScaleFactor)
1324 anObj = self.PrimOp.MakePrismTwoPntWithScaling(theBase, thePoint1, thePoint2, theScaleFactor)
1326 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
1327 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
1328 anObj.SetParameters(Parameters)
1331 ## Create a shape by extrusion of the base shape along a
1332 # vector, defined by two points, in 2 Ways (forward/backward).
1333 # @param theBase Base shape to be extruded.
1334 # @param thePoint1 First end of extrusion vector.
1335 # @param thePoint2 Second end of extrusion vector.
1336 # @return New GEOM_Object, containing the created prism.
1338 # @ref tui_creation_prism "Example"
1339 def MakePrism2Ways(self, theBase, thePoint1, thePoint2):
1340 # Example: see GEOM_TestAll.py
1341 anObj = self.PrimOp.MakePrismTwoPnt2Ways(theBase, thePoint1, thePoint2)
1342 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
1345 ## Create a shape by extrusion of the base shape along the vector,
1346 # i.e. all the space, transfixed by the base shape during its translation
1347 # along the vector on the given distance.
1348 # @param theBase Base shape to be extruded.
1349 # @param theVec Direction of extrusion.
1350 # @param theH Prism dimension along theVec.
1351 # @param theScaleFactor Use it to make prism with scaled second base.
1352 # Nagative value means not scaled second base.
1353 # @return New GEOM_Object, containing the created prism.
1355 # @ref tui_creation_prism "Example"
1356 def MakePrismVecH(self, theBase, theVec, theH, theScaleFactor = -1.0):
1357 # Example: see GEOM_TestAll.py
1360 if theScaleFactor > 0:
1361 theH,theScaleFactor,Parameters = ParseParameters(theH,theScaleFactor)
1362 anObj = self.PrimOp.MakePrismVecHWithScaling(theBase, theVec, theH, theScaleFactor)
1364 theH,Parameters = ParseParameters(theH)
1365 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
1366 RaiseIfFailed("MakePrismVecH", self.PrimOp)
1367 anObj.SetParameters(Parameters)
1370 ## Create a shape by extrusion of the base shape along the vector,
1371 # i.e. all the space, transfixed by the base shape during its translation
1372 # along the vector on the given distance in 2 Ways (forward/backward).
1373 # @param theBase Base shape to be extruded.
1374 # @param theVec Direction of extrusion.
1375 # @param theH Prism dimension along theVec in forward direction.
1376 # @return New GEOM_Object, containing the created prism.
1378 # @ref tui_creation_prism "Example"
1379 def MakePrismVecH2Ways(self, theBase, theVec, theH):
1380 # Example: see GEOM_TestAll.py
1381 theH,Parameters = ParseParameters(theH)
1382 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
1383 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
1384 anObj.SetParameters(Parameters)
1387 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
1388 # @param theBase Base shape to be extruded.
1389 # @param theDX, theDY, theDZ Directions of extrusion.
1390 # @param theScaleFactor Use it to make prism with scaled second base.
1391 # Nagative value means not scaled second base.
1392 # @return New GEOM_Object, containing the created prism.
1394 # @ref tui_creation_prism "Example"
1395 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ, theScaleFactor = -1.0):
1396 # Example: see GEOM_TestAll.py
1399 if theScaleFactor > 0:
1400 theDX,theDY,theDZ,theScaleFactor,Parameters = ParseParameters(theDX, theDY, theDZ, theScaleFactor)
1401 anObj = self.PrimOp.MakePrismDXDYDZWithScaling(theBase, theDX, theDY, theDZ, theScaleFactor)
1403 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1404 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
1405 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
1406 anObj.SetParameters(Parameters)
1409 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
1410 # i.e. all the space, transfixed by the base shape during its translation
1411 # along the vector on the given distance in 2 Ways (forward/backward).
1412 # @param theBase Base shape to be extruded.
1413 # @param theDX, theDY, theDZ Directions of extrusion.
1414 # @return New GEOM_Object, containing the created prism.
1416 # @ref tui_creation_prism "Example"
1417 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ):
1418 # Example: see GEOM_TestAll.py
1419 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1420 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
1421 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
1422 anObj.SetParameters(Parameters)
1425 ## Create a shape by revolution of the base shape around the axis
1426 # on the given angle, i.e. all the space, transfixed by the base
1427 # shape during its rotation around the axis on the given angle.
1428 # @param theBase Base shape to be rotated.
1429 # @param theAxis Rotation axis.
1430 # @param theAngle Rotation angle in radians.
1431 # @return New GEOM_Object, containing the created revolution.
1433 # @ref tui_creation_revolution "Example"
1434 def MakeRevolution(self, theBase, theAxis, theAngle):
1435 # Example: see GEOM_TestAll.py
1436 theAngle,Parameters = ParseParameters(theAngle)
1437 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
1438 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
1439 anObj.SetParameters(Parameters)
1442 ## The Same Revolution but in both ways forward&backward.
1443 def MakeRevolution2Ways(self, theBase, theAxis, theAngle):
1444 theAngle,Parameters = ParseParameters(theAngle)
1445 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
1446 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
1447 anObj.SetParameters(Parameters)
1450 ## Create a filling from the given compound of contours.
1451 # @param theShape the compound of contours
1452 # @param theMinDeg a minimal degree of BSpline surface to create
1453 # @param theMaxDeg a maximal degree of BSpline surface to create
1454 # @param theTol2D a 2d tolerance to be reached
1455 # @param theTol3D a 3d tolerance to be reached
1456 # @param theNbIter a number of iteration of approximation algorithm
1457 # @param theMethod Kind of method to perform filling operation:
1458 # GEOM.FOM_Default - Default - standard behaviour
1459 # /GEOM.FOM_UseOri - Use edges orientation - orientation of edges is
1460 # used: if the edge is reversed, the curve from this edge
1461 # is reversed before using it in the filling algorithm.
1462 # /GEOM.FOM_AutoCorrect - Auto-correct orientation - changes the orientation
1463 # of the curves using minimization of sum of distances
1464 # between the end points of the edges.
1465 # @param isApprox if True, BSpline curves are generated in the process
1466 # of surface construction. By default it is False, that means
1467 # the surface is created using Besier curves. The usage of
1468 # Approximation makes the algorithm work slower, but allows
1469 # building the surface for rather complex cases
1470 # @return New GEOM_Object, containing the created filling surface.
1472 # @ref tui_creation_filling "Example"
1473 def MakeFilling(self, theShape, theMinDeg, theMaxDeg, theTol2D,
1474 theTol3D, theNbIter, theMethod=GEOM.FOM_Default, isApprox=0):
1475 # Example: see GEOM_TestAll.py
1476 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
1477 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
1478 theTol2D, theTol3D, theNbIter,
1479 theMethod, isApprox)
1480 RaiseIfFailed("MakeFilling", self.PrimOp)
1481 anObj.SetParameters(Parameters)
1484 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
1485 # @param theSeqSections - set of specified sections.
1486 # @param theModeSolid - mode defining building solid or shell
1487 # @param thePreci - precision 3D used for smoothing by default 1.e-6
1488 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
1489 # @return New GEOM_Object, containing the created shell or solid.
1491 # @ref swig_todo "Example"
1492 def MakeThruSections(self,theSeqSections,theModeSolid,thePreci,theRuled):
1493 # Example: see GEOM_TestAll.py
1494 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
1495 RaiseIfFailed("MakeThruSections", self.PrimOp)
1498 ## Create a shape by extrusion of the base shape along
1499 # the path shape. The path shape can be a wire or an edge.
1500 # @param theBase Base shape to be extruded.
1501 # @param thePath Path shape to extrude the base shape along it.
1502 # @return New GEOM_Object, containing the created pipe.
1504 # @ref tui_creation_pipe "Example"
1505 def MakePipe(self,theBase, thePath):
1506 # Example: see GEOM_TestAll.py
1507 anObj = self.PrimOp.MakePipe(theBase, thePath)
1508 RaiseIfFailed("MakePipe", self.PrimOp)
1511 ## Create a shape by extrusion of the profile shape along
1512 # the path shape. The path shape can be a wire or an edge.
1513 # the several profiles can be specified in the several locations of path.
1514 # @param theSeqBases - list of Bases shape to be extruded.
1515 # @param theLocations - list of locations on the path corresponding
1516 # specified list of the Bases shapes. Number of locations
1517 # should be equal to number of bases or list of locations can be empty.
1518 # @param thePath - Path shape to extrude the base shape along it.
1519 # @param theWithContact - the mode defining that the section is translated to be in
1520 # contact with the spine.
1521 # @param theWithCorrection - defining that the section is rotated to be
1522 # orthogonal to the spine tangent in the correspondent point
1523 # @return New GEOM_Object, containing the created pipe.
1525 # @ref tui_creation_pipe_with_diff_sec "Example"
1526 def MakePipeWithDifferentSections(self, theSeqBases,
1527 theLocations, thePath,
1528 theWithContact, theWithCorrection):
1529 anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
1530 theLocations, thePath,
1531 theWithContact, theWithCorrection)
1532 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
1535 ## Create a shape by extrusion of the profile shape along
1536 # the path shape. The path shape can be a wire or a edge.
1537 # the several profiles can be specified in the several locations of path.
1538 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
1539 # shell or face. If number of faces in neighbour sections
1540 # aren't coincided result solid between such sections will
1541 # be created using external boundaries of this shells.
1542 # @param theSeqSubBases - list of corresponding subshapes of section shapes.
1543 # This list is used for searching correspondences between
1544 # faces in the sections. Size of this list must be equal
1545 # to size of list of base shapes.
1546 # @param theLocations - list of locations on the path corresponding
1547 # specified list of the Bases shapes. Number of locations
1548 # should be equal to number of bases. First and last
1549 # locations must be coincided with first and last vertexes
1550 # of path correspondingly.
1551 # @param thePath - Path shape to extrude the base shape along it.
1552 # @param theWithContact - the mode defining that the section is translated to be in
1553 # contact with the spine.
1554 # @param theWithCorrection - defining that the section is rotated to be
1555 # orthogonal to the spine tangent in the correspondent point
1556 # @return New GEOM_Object, containing the created solids.
1558 # @ref tui_creation_pipe_with_shell_sec "Example"
1559 def MakePipeWithShellSections(self,theSeqBases, theSeqSubBases,
1560 theLocations, thePath,
1561 theWithContact, theWithCorrection):
1562 anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
1563 theLocations, thePath,
1564 theWithContact, theWithCorrection)
1565 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
1568 ## Create a shape by extrusion of the profile shape along
1569 # the path shape. This function is used only for debug pipe
1570 # functionality - it is a version of previous function
1571 # (MakePipeWithShellSections(...)) which give a possibility to
1572 # recieve information about creating pipe between each pair of
1573 # sections step by step.
1574 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
1575 theLocations, thePath,
1576 theWithContact, theWithCorrection):
1578 nbsect = len(theSeqBases)
1579 nbsubsect = len(theSeqSubBases)
1580 #print "nbsect = ",nbsect
1581 for i in range(1,nbsect):
1583 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
1584 tmpLocations = [ theLocations[i-1], theLocations[i] ]
1586 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
1587 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
1588 tmpLocations, thePath,
1589 theWithContact, theWithCorrection)
1590 if self.PrimOp.IsDone() == 0:
1591 print "Problems with pipe creation between ",i," and ",i+1," sections"
1592 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
1595 print "Pipe between ",i," and ",i+1," sections is OK"
1600 resc = self.MakeCompound(res)
1601 #resc = self.MakeSewing(res, 0.001)
1602 #print "resc: ",resc
1605 ## Create solids between given sections
1606 # @param theSeqBases - list of sections (shell or face).
1607 # @param theLocations - list of corresponding vertexes
1608 # @return New GEOM_Object, containing the created solids.
1610 # @ref tui_creation_pipe_without_path "Example"
1611 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations):
1612 anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
1613 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
1616 ## Create a shape by extrusion of the base shape along
1617 # the path shape with constant bi-normal direction along the given vector.
1618 # The path shape can be a wire or an edge.
1619 # @param theBase Base shape to be extruded.
1620 # @param thePath Path shape to extrude the base shape along it.
1621 # @param theVec Vector defines a constant binormal direction to keep the
1622 # same angle beetween the direction and the sections
1623 # along the sweep surface.
1624 # @return New GEOM_Object, containing the created pipe.
1626 # @ref tui_creation_pipe "Example"
1627 def MakePipeBiNormalAlongVector(self,theBase, thePath, theVec):
1628 # Example: see GEOM_TestAll.py
1629 anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
1630 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
1636 ## @addtogroup l3_advanced
1639 ## Create a linear edge with specified ends.
1640 # @param thePnt1 Point for the first end of edge.
1641 # @param thePnt2 Point for the second end of edge.
1642 # @return New GEOM_Object, containing the created edge.
1644 # @ref tui_creation_edge "Example"
1645 def MakeEdge(self,thePnt1, thePnt2):
1646 # Example: see GEOM_TestAll.py
1647 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
1648 RaiseIfFailed("MakeEdge", self.ShapesOp)
1651 ## Create a new edge, corresponding to the given length on the given curve.
1652 # @param theRefCurve The referenced curve (edge).
1653 # @param theLength Length on the referenced curve. It can be negative.
1654 # @param theStartPoint Any point can be selected for it, the new edge will begin
1655 # at the end of \a theRefCurve, close to the selected point.
1656 # If None, start from the first point of \a theRefCurve.
1657 # @return New GEOM_Object, containing the created edge.
1659 # @ref tui_creation_edge "Example"
1660 def MakeEdgeOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None):
1661 # Example: see GEOM_TestAll.py
1662 theLength, Parameters = ParseParameters(theLength)
1663 anObj = self.ShapesOp.MakeEdgeOnCurveByLength(theRefCurve, theLength, theStartPoint)
1664 RaiseIfFailed("MakeEdgeOnCurveByLength", self.ShapesOp)
1665 anObj.SetParameters(Parameters)
1668 ## Create an edge from specified wire.
1669 # @param theWire source Wire.
1670 # @param theLinearTolerance linear tolerance value.
1671 # @param theAngularTolerance angular tolerance value.
1672 # @return New GEOM_Object, containing the created edge.
1674 # @ref tui_creation_edge "Example"
1675 def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12):
1676 # Example: see GEOM_TestAll.py
1677 anObj = self.ShapesOp.MakeEdgeWire(theWire, theLinearTolerance, theAngularTolerance)
1678 RaiseIfFailed("MakeEdgeWire", self.ShapesOp)
1681 ## Create a wire from the set of edges and wires.
1682 # @param theEdgesAndWires List of edges and/or wires.
1683 # @param theTolerance Maximum distance between vertices, that will be merged.
1684 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
1685 # @return New GEOM_Object, containing the created wire.
1687 # @ref tui_creation_wire "Example"
1688 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07):
1689 # Example: see GEOM_TestAll.py
1690 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
1691 RaiseIfFailed("MakeWire", self.ShapesOp)
1694 ## Create a face on the given wire.
1695 # @param theWire closed Wire or Edge to build the face on.
1696 # @param isPlanarWanted If TRUE, only planar face will be built.
1697 # If impossible, NULL object will be returned.
1698 # @return New GEOM_Object, containing the created face.
1700 # @ref tui_creation_face "Example"
1701 def MakeFace(self,theWire, isPlanarWanted):
1702 # Example: see GEOM_TestAll.py
1703 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
1704 RaiseIfFailed("MakeFace", self.ShapesOp)
1707 ## Create a face on the given wires set.
1708 # @param theWires List of closed wires or edges to build the face on.
1709 # @param isPlanarWanted If TRUE, only planar face will be built.
1710 # If impossible, NULL object will be returned.
1711 # @return New GEOM_Object, containing the created face.
1713 # @ref tui_creation_face "Example"
1714 def MakeFaceWires(self,theWires, isPlanarWanted):
1715 # Example: see GEOM_TestAll.py
1716 anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
1717 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
1720 ## Shortcut to MakeFaceWires()
1722 # @ref tui_creation_face "Example 1"
1723 # \n @ref swig_MakeFaces "Example 2"
1724 def MakeFaces(self,theWires, isPlanarWanted):
1725 # Example: see GEOM_TestOthers.py
1726 anObj = self.MakeFaceWires(theWires, isPlanarWanted)
1729 ## Create a shell from the set of faces and shells.
1730 # @param theFacesAndShells List of faces and/or shells.
1731 # @return New GEOM_Object, containing the created shell.
1733 # @ref tui_creation_shell "Example"
1734 def MakeShell(self,theFacesAndShells):
1735 # Example: see GEOM_TestAll.py
1736 anObj = self.ShapesOp.MakeShell(theFacesAndShells)
1737 RaiseIfFailed("MakeShell", self.ShapesOp)
1740 ## Create a solid, bounded by the given shells.
1741 # @param theShells Sequence of bounding shells.
1742 # @return New GEOM_Object, containing the created solid.
1744 # @ref tui_creation_solid "Example"
1745 def MakeSolid(self,theShells):
1746 # Example: see GEOM_TestAll.py
1747 anObj = self.ShapesOp.MakeSolidShells(theShells)
1748 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
1751 ## Create a compound of the given shapes.
1752 # @param theShapes List of shapes to put in compound.
1753 # @return New GEOM_Object, containing the created compound.
1755 # @ref tui_creation_compound "Example"
1756 def MakeCompound(self,theShapes):
1757 # Example: see GEOM_TestAll.py
1758 anObj = self.ShapesOp.MakeCompound(theShapes)
1759 RaiseIfFailed("MakeCompound", self.ShapesOp)
1762 # end of l3_advanced
1765 ## @addtogroup l2_measure
1768 ## Gives quantity of faces in the given shape.
1769 # @param theShape Shape to count faces of.
1770 # @return Quantity of faces.
1772 # @ref swig_NumberOf "Example"
1773 def NumberOfFaces(self, theShape):
1774 # Example: see GEOM_TestOthers.py
1775 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
1776 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
1779 ## Gives quantity of edges in the given shape.
1780 # @param theShape Shape to count edges of.
1781 # @return Quantity of edges.
1783 # @ref swig_NumberOf "Example"
1784 def NumberOfEdges(self, theShape):
1785 # Example: see GEOM_TestOthers.py
1786 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
1787 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
1790 ## Gives quantity of subshapes of type theShapeType in the given shape.
1791 # @param theShape Shape to count subshapes of.
1792 # @param theShapeType Type of subshapes to count.
1793 # @return Quantity of subshapes of given type.
1795 # @ref swig_NumberOf "Example"
1796 def NumberOfSubShapes(self, theShape, theShapeType):
1797 # Example: see GEOM_TestOthers.py
1798 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
1799 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
1802 ## Gives quantity of solids in the given shape.
1803 # @param theShape Shape to count solids in.
1804 # @return Quantity of solids.
1806 # @ref swig_NumberOf "Example"
1807 def NumberOfSolids(self, theShape):
1808 # Example: see GEOM_TestOthers.py
1809 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, ShapeType["SOLID"])
1810 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
1816 ## @addtogroup l3_healing
1819 ## Reverses an orientation the given shape.
1820 # @param theShape Shape to be reversed.
1821 # @return The reversed copy of theShape.
1823 # @ref swig_ChangeOrientation "Example"
1824 def ChangeOrientation(self,theShape):
1825 # Example: see GEOM_TestAll.py
1826 anObj = self.ShapesOp.ChangeOrientation(theShape)
1827 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
1830 ## Shortcut to ChangeOrientation()
1832 # @ref swig_OrientationChange "Example"
1833 def OrientationChange(self,theShape):
1834 # Example: see GEOM_TestOthers.py
1835 anObj = self.ChangeOrientation(theShape)
1841 ## @addtogroup l4_obtain
1844 ## Retrieve all free faces from the given shape.
1845 # Free face is a face, which is not shared between two shells of the shape.
1846 # @param theShape Shape to find free faces in.
1847 # @return List of IDs of all free faces, contained in theShape.
1849 # @ref tui_measurement_tools_page "Example"
1850 def GetFreeFacesIDs(self,theShape):
1851 # Example: see GEOM_TestOthers.py
1852 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
1853 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
1856 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
1857 # @param theShape1 Shape to find sub-shapes in.
1858 # @param theShape2 Shape to find shared sub-shapes with.
1859 # @param theShapeType Type of sub-shapes to be retrieved.
1860 # @return List of sub-shapes of theShape1, shared with theShape2.
1862 # @ref swig_GetSharedShapes "Example"
1863 def GetSharedShapes(self,theShape1, theShape2, theShapeType):
1864 # Example: see GEOM_TestOthers.py
1865 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
1866 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
1869 ## Get all sub-shapes, shared by all shapes in the list <VAR>theShapes</VAR>.
1870 # @param theShapes Shapes to find common sub-shapes of.
1871 # @param theShapeType Type of sub-shapes to be retrieved.
1872 # @return List of objects, that are sub-shapes of all given shapes.
1874 # @ref swig_GetSharedShapes "Example"
1875 def GetSharedShapesMulti(self, theShapes, theShapeType):
1876 # Example: see GEOM_TestOthers.py
1877 aList = self.ShapesOp.GetSharedShapesMulti(theShapes, theShapeType)
1878 RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
1881 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
1882 # situated relatively the specified plane by the certain way,
1883 # defined through <VAR>theState</VAR> parameter.
1884 # @param theShape Shape to find sub-shapes of.
1885 # @param theShapeType Type of sub-shapes to be retrieved.
1886 # @param theAx1 Vector (or line, or linear edge), specifying normal
1887 # direction and location of the plane to find shapes on.
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_GetShapesOnPlane "Example"
1893 def GetShapesOnPlane(self,theShape, theShapeType, theAx1, theState):
1894 # Example: see GEOM_TestOthers.py
1895 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
1896 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
1899 ## Works like the above method, but returns list of sub-shapes indices
1901 # @ref swig_GetShapesOnPlaneIDs "Example"
1902 def GetShapesOnPlaneIDs(self,theShape, theShapeType, theAx1, theState):
1903 # Example: see GEOM_TestOthers.py
1904 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
1905 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
1908 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
1909 # situated relatively the specified plane by the certain way,
1910 # defined through <VAR>theState</VAR> parameter.
1911 # @param theShape Shape to find sub-shapes of.
1912 # @param theShapeType Type of sub-shapes to be retrieved.
1913 # @param theAx1 Vector (or line, or linear edge), specifying normal
1914 # direction of the plane to find shapes on.
1915 # @param thePnt Point specifying location of the plane to find shapes on.
1916 # @param theState The state of the subshapes to find. It can be one of
1917 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1918 # @return List of all found sub-shapes.
1920 # @ref swig_GetShapesOnPlaneWithLocation "Example"
1921 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState):
1922 # Example: see GEOM_TestOthers.py
1923 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
1924 theAx1, thePnt, theState)
1925 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
1928 ## Works like the above method, but returns list of sub-shapes indices
1930 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
1931 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
1932 # Example: see GEOM_TestOthers.py
1933 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
1934 theAx1, thePnt, theState)
1935 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
1938 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1939 # the specified cylinder by the certain way, defined through \a theState parameter.
1940 # @param theShape Shape to find sub-shapes of.
1941 # @param theShapeType Type of sub-shapes to be retrieved.
1942 # @param theAxis Vector (or line, or linear edge), specifying
1943 # axis of the cylinder to find shapes on.
1944 # @param theRadius Radius of the cylinder to find shapes on.
1945 # @param theState The state of the subshapes to find. It can be one of
1946 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1947 # @return List of all found sub-shapes.
1949 # @ref swig_GetShapesOnCylinder "Example"
1950 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState):
1951 # Example: see GEOM_TestOthers.py
1952 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
1953 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
1956 ## Works like the above method, but returns list of sub-shapes indices
1958 # @ref swig_GetShapesOnCylinderIDs "Example"
1959 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
1960 # Example: see GEOM_TestOthers.py
1961 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
1962 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
1965 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1966 # the specified cylinder by the certain way, defined through \a theState parameter.
1967 # @param theShape Shape to find sub-shapes of.
1968 # @param theShapeType Type of sub-shapes to be retrieved.
1969 # @param theAxis Vector (or line, or linear edge), specifying
1970 # axis of the cylinder to find shapes on.
1971 # @param thePnt Point specifying location of the bottom of the cylinder.
1972 # @param theRadius Radius of the cylinder to find shapes on.
1973 # @param theState The state of the subshapes to find. It can be one of
1974 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1975 # @return List of all found sub-shapes.
1977 # @ref swig_GetShapesOnCylinderWithLocation "Example"
1978 def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
1979 # Example: see GEOM_TestOthers.py
1980 aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
1981 RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
1984 ## Works like the above method, but returns list of sub-shapes indices
1986 # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
1987 def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
1988 # Example: see GEOM_TestOthers.py
1989 aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
1990 RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
1993 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1994 # the specified sphere by the certain way, defined through \a theState parameter.
1995 # @param theShape Shape to find sub-shapes of.
1996 # @param theShapeType Type of sub-shapes to be retrieved.
1997 # @param theCenter Point, specifying center of the sphere to find shapes on.
1998 # @param theRadius Radius of the sphere to find shapes on.
1999 # @param theState The state of the subshapes to find. It can be one of
2000 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
2001 # @return List of all found sub-shapes.
2003 # @ref swig_GetShapesOnSphere "Example"
2004 def GetShapesOnSphere(self,theShape, theShapeType, theCenter, theRadius, theState):
2005 # Example: see GEOM_TestOthers.py
2006 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
2007 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
2010 ## Works like the above method, but returns list of sub-shapes indices
2012 # @ref swig_GetShapesOnSphereIDs "Example"
2013 def GetShapesOnSphereIDs(self,theShape, theShapeType, theCenter, theRadius, theState):
2014 # Example: see GEOM_TestOthers.py
2015 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
2016 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
2019 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
2020 # the specified quadrangle by the certain way, defined through \a theState parameter.
2021 # @param theShape Shape to find sub-shapes of.
2022 # @param theShapeType Type of sub-shapes to be retrieved.
2023 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
2024 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
2025 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
2026 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
2027 # @param theState The state of the subshapes to find. It can be one of
2028 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
2029 # @return List of all found sub-shapes.
2031 # @ref swig_GetShapesOnQuadrangle "Example"
2032 def GetShapesOnQuadrangle(self, theShape, theShapeType,
2033 theTopLeftPoint, theTopRigthPoint,
2034 theBottomLeftPoint, theBottomRigthPoint, theState):
2035 # Example: see GEOM_TestOthers.py
2036 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
2037 theTopLeftPoint, theTopRigthPoint,
2038 theBottomLeftPoint, theBottomRigthPoint, theState)
2039 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
2042 ## Works like the above method, but returns list of sub-shapes indices
2044 # @ref swig_GetShapesOnQuadrangleIDs "Example"
2045 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
2046 theTopLeftPoint, theTopRigthPoint,
2047 theBottomLeftPoint, theBottomRigthPoint, theState):
2048 # Example: see GEOM_TestOthers.py
2049 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
2050 theTopLeftPoint, theTopRigthPoint,
2051 theBottomLeftPoint, theBottomRigthPoint, theState)
2052 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
2055 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
2056 # the specified \a theBox by the certain way, defined through \a theState parameter.
2057 # @param theBox Shape for relative comparing.
2058 # @param theShape Shape to find sub-shapes of.
2059 # @param theShapeType Type of sub-shapes to be retrieved.
2060 # @param theState The state of the subshapes to find. It can be one of
2061 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
2062 # @return List of all found sub-shapes.
2064 # @ref swig_GetShapesOnBox "Example"
2065 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState):
2066 # Example: see GEOM_TestOthers.py
2067 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
2068 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
2071 ## Works like the above method, but returns list of sub-shapes indices
2073 # @ref swig_GetShapesOnBoxIDs "Example"
2074 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
2075 # Example: see GEOM_TestOthers.py
2076 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
2077 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
2080 ## Find in \a theShape all sub-shapes of type \a theShapeType,
2081 # situated relatively the specified \a theCheckShape by the
2082 # certain way, defined through \a theState parameter.
2083 # @param theCheckShape Shape for relative comparing. It must be a solid.
2084 # @param theShape Shape to find sub-shapes of.
2085 # @param theShapeType Type of sub-shapes to be retrieved.
2086 # @param theState The state of the subshapes to find. It can be one of
2087 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
2088 # @return List of all found sub-shapes.
2090 # @ref swig_GetShapesOnShape "Example"
2091 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState):
2092 # Example: see GEOM_TestOthers.py
2093 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
2094 theShapeType, theState)
2095 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
2098 ## Works like the above method, but returns result as compound
2100 # @ref swig_GetShapesOnShapeAsCompound "Example"
2101 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState):
2102 # Example: see GEOM_TestOthers.py
2103 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
2104 theShapeType, theState)
2105 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
2108 ## Works like the above method, but returns list of sub-shapes indices
2110 # @ref swig_GetShapesOnShapeIDs "Example"
2111 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
2112 # Example: see GEOM_TestOthers.py
2113 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
2114 theShapeType, theState)
2115 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
2118 ## Get sub-shape(s) of theShapeWhere, which are
2119 # coincident with \a theShapeWhat or could be a part of it.
2120 # @param theShapeWhere Shape to find sub-shapes of.
2121 # @param theShapeWhat Shape, specifying what to find.
2122 # @return Group of all found sub-shapes or a single found sub-shape.
2124 # @note This function has a restriction on argument shapes.
2125 # If \a theShapeWhere has curved parts with significantly
2126 # outstanding centres (i.e. the mass centre of a part is closer to
2127 # \a theShapeWhat than to the part), such parts will not be found.
2128 # @image html get_in_place_lost_part.png
2130 # @ref swig_GetInPlace "Example"
2131 def GetInPlace(self, theShapeWhere, theShapeWhat):
2132 # Example: see GEOM_TestOthers.py
2133 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
2134 RaiseIfFailed("GetInPlace", self.ShapesOp)
2137 ## Get sub-shape(s) of \a theShapeWhere, which are
2138 # coincident with \a theShapeWhat or could be a part of it.
2140 # Implementation of this method is based on a saved history of an operation,
2141 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
2142 # arguments (an argument shape or a sub-shape of an argument shape).
2143 # The operation could be the Partition or one of boolean operations,
2144 # performed on simple shapes (not on compounds).
2146 # @param theShapeWhere Shape to find sub-shapes of.
2147 # @param theShapeWhat Shape, specifying what to find (must be in the
2148 # building history of the ShapeWhere).
2149 # @return Group of all found sub-shapes or a single found sub-shape.
2151 # @ref swig_GetInPlace "Example"
2152 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat):
2153 # Example: see GEOM_TestOthers.py
2154 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
2155 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
2158 ## Get sub-shape of theShapeWhere, which is
2159 # equal to \a theShapeWhat.
2160 # @param theShapeWhere Shape to find sub-shape of.
2161 # @param theShapeWhat Shape, specifying what to find.
2162 # @return New GEOM_Object for found sub-shape.
2164 # @ref swig_GetSame "Example"
2165 def GetSame(self,theShapeWhere, theShapeWhat):
2166 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
2167 RaiseIfFailed("GetSame", self.ShapesOp)
2173 ## @addtogroup l4_access
2176 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
2177 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
2179 # @ref swig_all_decompose "Example"
2180 def GetSubShape(self, aShape, ListOfID):
2181 # Example: see GEOM_TestAll.py
2182 anObj = self.AddSubShape(aShape,ListOfID)
2185 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
2187 # @ref swig_all_decompose "Example"
2188 def GetSubShapeID(self, aShape, aSubShape):
2189 # Example: see GEOM_TestAll.py
2190 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
2191 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
2197 ## @addtogroup l4_decompose
2200 ## Get all sub-shapes and groups of \a theShape,
2201 # that were created already by any other methods.
2202 # @param theShape Any shape.
2203 # @param theGroupsOnly If this parameter is TRUE, only groups will be
2204 # returned, else all found sub-shapes and groups.
2205 # @return List of existing sub-objects of \a theShape.
2207 # @ref swig_all_decompose "Example"
2208 def GetExistingSubObjects(self, theShape, theGroupsOnly = False):
2209 # Example: see GEOM_TestAll.py
2210 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, theGroupsOnly)
2211 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
2214 ## Get all groups of \a theShape,
2215 # that were created already by any other methods.
2216 # @param theShape Any shape.
2217 # @return List of existing groups of \a theShape.
2219 # @ref swig_all_decompose "Example"
2220 def GetGroups(self, theShape):
2221 # Example: see GEOM_TestAll.py
2222 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, True)
2223 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
2226 ## Explode a shape on subshapes of a given type.
2227 # If the shape itself matches the type, it is also returned.
2228 # @param aShape Shape to be exploded.
2229 # @param aType Type of sub-shapes to be retrieved.
2230 # @return List of sub-shapes of type theShapeType, contained in theShape.
2232 # @ref swig_all_decompose "Example"
2233 def SubShapeAll(self, aShape, aType):
2234 # Example: see GEOM_TestAll.py
2235 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, aType, False)
2236 RaiseIfFailed("SubShapeAll", self.ShapesOp)
2239 ## Explode a shape on subshapes of a given type.
2240 # @param aShape Shape to be exploded.
2241 # @param aType Type of sub-shapes to be retrieved.
2242 # @return List of IDs of sub-shapes.
2244 # @ref swig_all_decompose "Example"
2245 def SubShapeAllIDs(self, aShape, aType):
2246 ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, aType, False)
2247 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
2250 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
2251 # selected by they indices in list of all sub-shapes of type <VAR>aType</VAR>.
2252 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
2254 # @ref swig_all_decompose "Example"
2255 def SubShape(self, aShape, aType, ListOfInd):
2256 # Example: see GEOM_TestAll.py
2258 AllShapeIDsList = self.SubShapeAllIDs(aShape, aType)
2259 for ind in ListOfInd:
2260 ListOfIDs.append(AllShapeIDsList[ind - 1])
2261 anObj = self.GetSubShape(aShape, ListOfIDs)
2264 ## Explode a shape on subshapes of a given type.
2265 # Sub-shapes will be sorted by coordinates of their gravity centers.
2266 # If the shape itself matches the type, it is also returned.
2267 # @param aShape Shape to be exploded.
2268 # @param aType Type of sub-shapes to be retrieved.
2269 # @return List of sub-shapes of type theShapeType, contained in theShape.
2271 # @ref swig_SubShapeAllSorted "Example"
2272 def SubShapeAllSortedCentres(self, aShape, aType):
2273 # Example: see GEOM_TestAll.py
2274 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, aType, True)
2275 RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
2278 ## Explode a shape on subshapes of a given type.
2279 # Sub-shapes will be sorted by coordinates of their gravity centers.
2280 # @param aShape Shape to be exploded.
2281 # @param aType Type of sub-shapes to be retrieved.
2282 # @return List of IDs of sub-shapes.
2284 # @ref swig_all_decompose "Example"
2285 def SubShapeAllSortedCentresIDs(self, aShape, aType):
2286 ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, aType, True)
2287 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
2290 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
2291 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
2292 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
2294 # @ref swig_all_decompose "Example"
2295 def SubShapeSortedCentres(self, aShape, aType, ListOfInd):
2296 # Example: see GEOM_TestAll.py
2298 AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, aType)
2299 for ind in ListOfInd:
2300 ListOfIDs.append(AllShapeIDsList[ind - 1])
2301 anObj = self.GetSubShape(aShape, ListOfIDs)
2304 ## Extract shapes (excluding the main shape) of given type.
2305 # @param aShape The shape.
2306 # @param aType The shape type.
2307 # @param isSorted Boolean flag to switch sorting on/off.
2308 # @return List of sub-shapes of type aType, contained in aShape.
2310 # @ref swig_FilletChamfer "Example"
2311 def ExtractShapes(self, aShape, aType, isSorted = False):
2312 # Example: see GEOM_TestAll.py
2313 ListObj = self.ShapesOp.ExtractSubShapes(aShape, aType, isSorted)
2314 RaiseIfFailed("ExtractSubShapes", self.ShapesOp)
2317 # end of l4_decompose
2320 ## @addtogroup l4_decompose_d
2323 ## Deprecated method
2324 # It works like SubShapeAllSortedCentres, but wrongly
2325 # defines centres of faces, shells and solids.
2326 def SubShapeAllSorted(self, aShape, aType):
2327 ListObj = self.ShapesOp.MakeExplode(aShape, aType, True)
2328 RaiseIfFailed("MakeExplode", self.ShapesOp)
2331 ## Deprecated method
2332 # It works like SubShapeAllSortedCentresIDs, but wrongly
2333 # defines centres of faces, shells and solids.
2334 def SubShapeAllSortedIDs(self, aShape, aType):
2335 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, aType, True)
2336 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
2339 ## Deprecated method
2340 # It works like SubShapeSortedCentres, but has a bug
2341 # (wrongly defines centres of faces, shells and solids).
2342 def SubShapeSorted(self, aShape, aType, ListOfInd):
2344 AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, aType)
2345 for ind in ListOfInd:
2346 ListOfIDs.append(AllShapeIDsList[ind - 1])
2347 anObj = self.GetSubShape(aShape, ListOfIDs)
2350 # end of l4_decompose_d
2353 ## @addtogroup l3_healing
2356 ## Apply a sequence of Shape Healing operators to the given object.
2357 # @param theShape Shape to be processed.
2358 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
2359 # @param theParameters List of names of parameters
2360 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
2361 # @param theValues List of values of parameters, in the same order
2362 # as parameters are listed in <VAR>theParameters</VAR> list.
2363 # @return New GEOM_Object, containing processed shape.
2365 # @ref tui_shape_processing "Example"
2366 def ProcessShape(self, theShape, theOperators, theParameters, theValues):
2367 # Example: see GEOM_TestHealing.py
2368 theValues,Parameters = ParseList(theValues)
2369 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
2370 # To avoid script failure in case of good argument shape
2371 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
2373 RaiseIfFailed("ProcessShape", self.HealOp)
2374 for string in (theOperators + theParameters):
2375 Parameters = ":" + Parameters
2377 anObj.SetParameters(Parameters)
2380 ## Remove faces from the given object (shape).
2381 # @param theObject Shape to be processed.
2382 # @param theFaces Indices of faces to be removed, if EMPTY then the method
2383 # removes ALL faces of the given object.
2384 # @return New GEOM_Object, containing processed shape.
2386 # @ref tui_suppress_faces "Example"
2387 def SuppressFaces(self,theObject, theFaces):
2388 # Example: see GEOM_TestHealing.py
2389 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
2390 RaiseIfFailed("SuppressFaces", self.HealOp)
2393 ## Sewing of some shapes into single shape.
2395 # @ref tui_sewing "Example"
2396 def MakeSewing(self, ListShape, theTolerance):
2397 # Example: see GEOM_TestHealing.py
2398 comp = self.MakeCompound(ListShape)
2399 anObj = self.Sew(comp, theTolerance)
2402 ## Sewing of the given object.
2403 # @param theObject Shape to be processed.
2404 # @param theTolerance Required tolerance value.
2405 # @return New GEOM_Object, containing processed shape.
2406 def Sew(self, theObject, theTolerance):
2407 # Example: see MakeSewing() above
2408 theTolerance,Parameters = ParseParameters(theTolerance)
2409 anObj = self.HealOp.Sew(theObject, theTolerance)
2410 RaiseIfFailed("Sew", self.HealOp)
2411 anObj.SetParameters(Parameters)
2414 ## Remove internal wires and edges from the given object (face).
2415 # @param theObject Shape to be processed.
2416 # @param theWires Indices of wires to be removed, if EMPTY then the method
2417 # removes ALL internal wires of the given object.
2418 # @return New GEOM_Object, containing processed shape.
2420 # @ref tui_suppress_internal_wires "Example"
2421 def SuppressInternalWires(self,theObject, theWires):
2422 # Example: see GEOM_TestHealing.py
2423 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
2424 RaiseIfFailed("RemoveIntWires", self.HealOp)
2427 ## Remove internal closed contours (holes) from the given object.
2428 # @param theObject Shape to be processed.
2429 # @param theWires Indices of wires to be removed, if EMPTY then the method
2430 # removes ALL internal holes of the given object
2431 # @return New GEOM_Object, containing processed shape.
2433 # @ref tui_suppress_holes "Example"
2434 def SuppressHoles(self,theObject, theWires):
2435 # Example: see GEOM_TestHealing.py
2436 anObj = self.HealOp.FillHoles(theObject, theWires)
2437 RaiseIfFailed("FillHoles", self.HealOp)
2440 ## Close an open wire.
2441 # @param theObject Shape to be processed.
2442 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
2443 # if [ ], then <VAR>theObject</VAR> itself is a wire.
2444 # @param isCommonVertex If True : closure by creation of a common vertex,
2445 # If False : closure by creation of an edge between ends.
2446 # @return New GEOM_Object, containing processed shape.
2448 # @ref tui_close_contour "Example"
2449 def CloseContour(self,theObject, theWires, isCommonVertex):
2450 # Example: see GEOM_TestHealing.py
2451 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
2452 RaiseIfFailed("CloseContour", self.HealOp)
2455 ## Addition of a point to a given edge object.
2456 # @param theObject Shape to be processed.
2457 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
2458 # if -1, then theObject itself is the edge.
2459 # @param theValue Value of parameter on edge or length parameter,
2460 # depending on \a isByParameter.
2461 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1],
2462 # if FALSE : \a theValue is treated as a length parameter [0..1]
2463 # @return New GEOM_Object, containing processed shape.
2465 # @ref tui_add_point_on_edge "Example"
2466 def DivideEdge(self,theObject, theEdgeIndex, theValue, isByParameter):
2467 # Example: see GEOM_TestHealing.py
2468 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
2469 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
2470 RaiseIfFailed("DivideEdge", self.HealOp)
2471 anObj.SetParameters(Parameters)
2474 ## Change orientation of the given object. Updates given shape.
2475 # @param theObject Shape to be processed.
2477 # @ref swig_todo "Example"
2478 def ChangeOrientationShell(self,theObject):
2479 theObject = self.HealOp.ChangeOrientation(theObject)
2480 RaiseIfFailed("ChangeOrientation", self.HealOp)
2483 ## Change orientation of the given object.
2484 # @param theObject Shape to be processed.
2485 # @return New GEOM_Object, containing processed shape.
2487 # @ref swig_todo "Example"
2488 def ChangeOrientationShellCopy(self, theObject):
2489 anObj = self.HealOp.ChangeOrientationCopy(theObject)
2490 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
2493 ## Try to limit tolerance of the given object by value \a theTolerance.
2494 # @param theObject Shape to be processed.
2495 # @param theTolerance Required tolerance value.
2496 # @return New GEOM_Object, containing processed shape.
2498 # @ref tui_limit_tolerance "Example"
2499 def LimitTolerance(self, theObject, theTolerance = 1e-07):
2500 anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
2501 RaiseIfFailed("LimitTolerance", self.HealOp)
2504 ## Get a list of wires (wrapped in GEOM_Object-s),
2505 # that constitute a free boundary of the given shape.
2506 # @param theObject Shape to get free boundary of.
2507 # @return [status, theClosedWires, theOpenWires]
2508 # status: FALSE, if an error(s) occured during the method execution.
2509 # theClosedWires: Closed wires on the free boundary of the given shape.
2510 # theOpenWires: Open wires on the free boundary of the given shape.
2512 # @ref tui_measurement_tools_page "Example"
2513 def GetFreeBoundary(self, theObject):
2514 # Example: see GEOM_TestHealing.py
2515 anObj = self.HealOp.GetFreeBoundary(theObject)
2516 RaiseIfFailed("GetFreeBoundary", self.HealOp)
2519 ## Replace coincident faces in theShape by one face.
2520 # @param theShape Initial shape.
2521 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
2522 # @param doKeepNonSolids If FALSE, only solids will present in the result,
2523 # otherwise all initial shapes.
2524 # @return New GEOM_Object, containing a copy of theShape without coincident faces.
2526 # @ref tui_glue_faces "Example"
2527 def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True):
2528 # Example: see GEOM_Spanner.py
2529 theTolerance,Parameters = ParseParameters(theTolerance)
2530 anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
2532 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
2533 anObj.SetParameters(Parameters)
2536 ## Find coincident faces in theShape for possible gluing.
2537 # @param theShape Initial shape.
2538 # @param theTolerance Maximum distance between faces,
2539 # which can be considered as coincident.
2542 # @ref swig_todo "Example"
2543 def GetGlueFaces(self, theShape, theTolerance):
2544 # Example: see GEOM_Spanner.py
2545 anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
2546 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
2549 ## Replace coincident faces in theShape by one face
2550 # in compliance with given list of faces
2551 # @param theShape Initial shape.
2552 # @param theTolerance Maximum distance between faces,
2553 # which can be considered as coincident.
2554 # @param theFaces List of faces for gluing.
2555 # @param doKeepNonSolids If FALSE, only solids will present in the result,
2556 # otherwise all initial shapes.
2557 # @return New GEOM_Object, containing a copy of theShape
2558 # without some faces.
2560 # @ref swig_todo "Example"
2561 def MakeGlueFacesByList(self, theShape, theTolerance, theFaces, doKeepNonSolids=True):
2562 # Example: see GEOM_Spanner.py
2563 anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces, doKeepNonSolids)
2565 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
2571 ## @addtogroup l3_boolean Boolean Operations
2574 # -----------------------------------------------------------------------------
2575 # Boolean (Common, Cut, Fuse, Section)
2576 # -----------------------------------------------------------------------------
2578 ## Perform one of boolean operations on two given shapes.
2579 # @param theShape1 First argument for boolean operation.
2580 # @param theShape2 Second argument for boolean operation.
2581 # @param theOperation Indicates the operation to be done:
2582 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
2583 # @return New GEOM_Object, containing the result shape.
2585 # @ref tui_fuse "Example"
2586 def MakeBoolean(self,theShape1, theShape2, theOperation):
2587 # Example: see GEOM_TestAll.py
2588 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation)
2589 RaiseIfFailed("MakeBoolean", self.BoolOp)
2592 ## Shortcut to MakeBoolean(s1, s2, 1)
2594 # @ref tui_common "Example 1"
2595 # \n @ref swig_MakeCommon "Example 2"
2596 def MakeCommon(self, s1, s2):
2597 # Example: see GEOM_TestOthers.py
2598 return self.MakeBoolean(s1, s2, 1)
2600 ## Shortcut to MakeBoolean(s1, s2, 2)
2602 # @ref tui_cut "Example 1"
2603 # \n @ref swig_MakeCommon "Example 2"
2604 def MakeCut(self, s1, s2):
2605 # Example: see GEOM_TestOthers.py
2606 return self.MakeBoolean(s1, s2, 2)
2608 ## Shortcut to MakeBoolean(s1, s2, 3)
2610 # @ref tui_fuse "Example 1"
2611 # \n @ref swig_MakeCommon "Example 2"
2612 def MakeFuse(self, s1, s2):
2613 # Example: see GEOM_TestOthers.py
2614 return self.MakeBoolean(s1, s2, 3)
2616 ## Shortcut to MakeBoolean(s1, s2, 4)
2618 # @ref tui_section "Example 1"
2619 # \n @ref swig_MakeCommon "Example 2"
2620 def MakeSection(self, s1, s2):
2621 # Example: see GEOM_TestOthers.py
2622 return self.MakeBoolean(s1, s2, 4)
2627 ## @addtogroup l3_basic_op
2630 ## Perform partition operation.
2631 # @param ListShapes Shapes to be intersected.
2632 # @param ListTools Shapes to intersect theShapes.
2633 # !!!NOTE: Each compound from ListShapes and ListTools will be exploded
2634 # in order to avoid possible intersection between shapes from
2636 # @param Limit Type of resulting shapes (corresponding to TopAbs_ShapeEnum).
2637 # If this parameter is set to -1 ("Auto"), most appropriate shape limit
2638 # type will be detected automatically.
2639 # @param KeepNonlimitShapes: if this parameter == 0, then only shapes of
2640 # target type (equal to Limit) are kept in the result,
2641 # else standalone shapes of lower dimension
2642 # are kept also (if they exist).
2644 # After implementation new version of PartitionAlgo (October 2006)
2645 # other parameters are ignored by current functionality. They are kept
2646 # in this function only for support old versions.
2647 # Ignored parameters:
2648 # @param ListKeepInside Shapes, outside which the results will be deleted.
2649 # Each shape from theKeepInside must belong to theShapes also.
2650 # @param ListRemoveInside Shapes, inside which the results will be deleted.
2651 # Each shape from theRemoveInside must belong to theShapes also.
2652 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
2653 # @param ListMaterials Material indices for each shape. Make sence,
2654 # only if theRemoveWebs is TRUE.
2656 # @return New GEOM_Object, containing the result shapes.
2658 # @ref tui_partition "Example"
2659 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
2660 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
2661 KeepNonlimitShapes=0):
2662 # Example: see GEOM_TestAll.py
2663 if Limit == ShapeType["AUTO"]:
2664 # automatic detection of the most appropriate shape limit type
2666 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
2667 Limit = EnumToLong(lim)
2669 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
2670 ListKeepInside, ListRemoveInside,
2671 Limit, RemoveWebs, ListMaterials,
2672 KeepNonlimitShapes);
2673 RaiseIfFailed("MakePartition", self.BoolOp)
2676 ## Perform partition operation.
2677 # This method may be useful if it is needed to make a partition for
2678 # compound contains nonintersected shapes. Performance will be better
2679 # since intersection between shapes from compound is not performed.
2681 # Description of all parameters as in previous method MakePartition()
2683 # !!!NOTE: Passed compounds (via ListShapes or via ListTools)
2684 # have to consist of nonintersecting shapes.
2686 # @return New GEOM_Object, containing the result shapes.
2688 # @ref swig_todo "Example"
2689 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
2690 ListKeepInside=[], ListRemoveInside=[],
2691 Limit=ShapeType["AUTO"], RemoveWebs=0,
2692 ListMaterials=[], KeepNonlimitShapes=0):
2693 if Limit == ShapeType["AUTO"]:
2694 # automatic detection of the most appropriate shape limit type
2696 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
2697 Limit = EnumToLong(lim)
2699 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
2700 ListKeepInside, ListRemoveInside,
2701 Limit, RemoveWebs, ListMaterials,
2702 KeepNonlimitShapes);
2703 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
2706 ## Shortcut to MakePartition()
2708 # @ref tui_partition "Example 1"
2709 # \n @ref swig_Partition "Example 2"
2710 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
2711 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
2712 KeepNonlimitShapes=0):
2713 # Example: see GEOM_TestOthers.py
2714 anObj = self.MakePartition(ListShapes, ListTools,
2715 ListKeepInside, ListRemoveInside,
2716 Limit, RemoveWebs, ListMaterials,
2717 KeepNonlimitShapes);
2720 ## Perform partition of the Shape with the Plane
2721 # @param theShape Shape to be intersected.
2722 # @param thePlane Tool shape, to intersect theShape.
2723 # @return New GEOM_Object, containing the result shape.
2725 # @ref tui_partition "Example"
2726 def MakeHalfPartition(self,theShape, thePlane):
2727 # Example: see GEOM_TestAll.py
2728 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
2729 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
2732 # end of l3_basic_op
2735 ## @addtogroup l3_transform
2738 ## Translate the given object along the vector, specified
2739 # by its end points, creating its copy before the translation.
2740 # @param theObject The object to be translated.
2741 # @param thePoint1 Start point of translation vector.
2742 # @param thePoint2 End point of translation vector.
2743 # @return New GEOM_Object, containing the translated object.
2745 # @ref tui_translation "Example 1"
2746 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
2747 def MakeTranslationTwoPoints(self,theObject, thePoint1, thePoint2):
2748 # Example: see GEOM_TestAll.py
2749 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
2750 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
2753 ## Translate the given object along the vector, specified by its components.
2754 # @param theObject The object to be translated.
2755 # @param theDX,theDY,theDZ Components of translation vector.
2756 # @return Translated GEOM_Object.
2758 # @ref tui_translation "Example"
2759 def TranslateDXDYDZ(self,theObject, theDX, theDY, theDZ):
2760 # Example: see GEOM_TestAll.py
2761 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
2762 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
2763 anObj.SetParameters(Parameters)
2764 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
2767 ## Translate the given object along the vector, specified
2768 # by its components, creating its copy before the translation.
2769 # @param theObject The object to be translated.
2770 # @param theDX,theDY,theDZ Components of translation vector.
2771 # @return New GEOM_Object, containing the translated object.
2773 # @ref tui_translation "Example"
2774 def MakeTranslation(self,theObject, theDX, theDY, theDZ):
2775 # Example: see GEOM_TestAll.py
2776 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
2777 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
2778 anObj.SetParameters(Parameters)
2779 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
2782 ## Translate the given object along the given vector,
2783 # creating its copy before the translation.
2784 # @param theObject The object to be translated.
2785 # @param theVector The translation vector.
2786 # @return New GEOM_Object, containing the translated object.
2788 # @ref tui_translation "Example"
2789 def MakeTranslationVector(self,theObject, theVector):
2790 # Example: see GEOM_TestAll.py
2791 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
2792 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
2795 ## Translate the given object along the given vector on given distance.
2796 # @param theObject The object to be translated.
2797 # @param theVector The translation vector.
2798 # @param theDistance The translation distance.
2799 # @param theCopy Flag used to translate object itself or create a copy.
2800 # @return Translated GEOM_Object.
2802 # @ref tui_translation "Example"
2803 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy):
2804 # Example: see GEOM_TestAll.py
2805 theDistance,Parameters = ParseParameters(theDistance)
2806 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
2807 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
2808 anObj.SetParameters(Parameters)
2811 ## Translate the given object along the given vector on given distance,
2812 # creating its copy before the translation.
2813 # @param theObject The object to be translated.
2814 # @param theVector The translation vector.
2815 # @param theDistance The translation distance.
2816 # @return New GEOM_Object, containing the translated object.
2818 # @ref tui_translation "Example"
2819 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance):
2820 # Example: see GEOM_TestAll.py
2821 theDistance,Parameters = ParseParameters(theDistance)
2822 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
2823 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
2824 anObj.SetParameters(Parameters)
2827 ## Rotate the given object around the given axis on the given angle.
2828 # @param theObject The object to be rotated.
2829 # @param theAxis Rotation axis.
2830 # @param theAngle Rotation angle in radians.
2831 # @return Rotated GEOM_Object.
2833 # @ref tui_rotation "Example"
2834 def Rotate(self,theObject, theAxis, theAngle):
2835 # Example: see GEOM_TestAll.py
2837 if isinstance(theAngle,str):
2839 theAngle, Parameters = ParseParameters(theAngle)
2841 theAngle = theAngle*math.pi/180.0
2842 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
2843 RaiseIfFailed("RotateCopy", self.TrsfOp)
2844 anObj.SetParameters(Parameters)
2847 ## Rotate the given object around the given axis
2848 # on the given angle, creating its copy before the rotatation.
2849 # @param theObject The object to be rotated.
2850 # @param theAxis Rotation axis.
2851 # @param theAngle Rotation angle in radians.
2852 # @return New GEOM_Object, containing the rotated object.
2854 # @ref tui_rotation "Example"
2855 def MakeRotation(self,theObject, theAxis, theAngle):
2856 # Example: see GEOM_TestAll.py
2858 if isinstance(theAngle,str):
2860 theAngle, Parameters = ParseParameters(theAngle)
2862 theAngle = theAngle*math.pi/180.0
2863 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
2864 RaiseIfFailed("RotateCopy", self.TrsfOp)
2865 anObj.SetParameters(Parameters)
2868 ## Rotate given object around vector perpendicular to plane
2869 # containing three points, creating its copy before the rotatation.
2870 # @param theObject The object to be rotated.
2871 # @param theCentPoint central point - the axis is the vector perpendicular to the plane
2872 # containing the three points.
2873 # @param thePoint1,thePoint2 - in a perpendicular plane of the axis.
2874 # @return New GEOM_Object, containing the rotated object.
2876 # @ref tui_rotation "Example"
2877 def MakeRotationThreePoints(self,theObject, theCentPoint, thePoint1, thePoint2):
2878 # Example: see GEOM_TestAll.py
2879 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
2880 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
2883 ## Scale the given object by the factor, creating its copy before the scaling.
2884 # @param theObject The object to be scaled.
2885 # @param thePoint Center point for scaling.
2886 # Passing None for it means scaling relatively the origin of global CS.
2887 # @param theFactor Scaling factor value.
2888 # @return New GEOM_Object, containing the scaled shape.
2890 # @ref tui_scale "Example"
2891 def MakeScaleTransform(self, theObject, thePoint, theFactor):
2892 # Example: see GEOM_TestAll.py
2893 theFactor, Parameters = ParseParameters(theFactor)
2894 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
2895 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
2896 anObj.SetParameters(Parameters)
2899 ## Scale the given object by different factors along coordinate axes,
2900 # creating its copy before the scaling.
2901 # @param theObject The object to be scaled.
2902 # @param thePoint Center point for scaling.
2903 # Passing None for it means scaling relatively the origin of global CS.
2904 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
2905 # @return New GEOM_Object, containing the scaled shape.
2907 # @ref swig_scale "Example"
2908 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ):
2909 # Example: see GEOM_TestAll.py
2910 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
2911 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
2912 theFactorX, theFactorY, theFactorZ)
2913 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
2914 anObj.SetParameters(Parameters)
2917 ## Create an object, symmetrical
2918 # to the given one relatively the given plane.
2919 # @param theObject The object to be mirrored.
2920 # @param thePlane Plane of symmetry.
2921 # @return New GEOM_Object, containing the mirrored shape.
2923 # @ref tui_mirror "Example"
2924 def MakeMirrorByPlane(self,theObject, thePlane):
2925 # Example: see GEOM_TestAll.py
2926 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
2927 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
2930 ## Create an object, symmetrical
2931 # to the given one relatively the given axis.
2932 # @param theObject The object to be mirrored.
2933 # @param theAxis Axis of symmetry.
2934 # @return New GEOM_Object, containing the mirrored shape.
2936 # @ref tui_mirror "Example"
2937 def MakeMirrorByAxis(self,theObject, theAxis):
2938 # Example: see GEOM_TestAll.py
2939 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
2940 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
2943 ## Create an object, symmetrical
2944 # to the given one relatively the given point.
2945 # @param theObject The object to be mirrored.
2946 # @param thePoint Point of symmetry.
2947 # @return New GEOM_Object, containing the mirrored shape.
2949 # @ref tui_mirror "Example"
2950 def MakeMirrorByPoint(self,theObject, thePoint):
2951 # Example: see GEOM_TestAll.py
2952 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
2953 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
2956 ## Modify the Location of the given object by LCS,
2957 # creating its copy before the setting.
2958 # @param theObject The object to be displaced.
2959 # @param theStartLCS Coordinate system to perform displacement from it.
2960 # If \a theStartLCS is NULL, displacement
2961 # will be performed from global CS.
2962 # If \a theObject itself is used as \a theStartLCS,
2963 # its location will be changed to \a theEndLCS.
2964 # @param theEndLCS Coordinate system to perform displacement to it.
2965 # @return New GEOM_Object, containing the displaced shape.
2967 # @ref tui_modify_location "Example"
2968 def MakePosition(self,theObject, theStartLCS, theEndLCS):
2969 # Example: see GEOM_TestAll.py
2970 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
2971 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
2974 ## Modify the Location of the given object by Path,
2975 # @param theObject The object to be displaced.
2976 # @param thePath Wire or Edge along that the object will be translated.
2977 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
2978 # @param theCopy is to create a copy objects if true.
2979 # @param theReverse - 0 for usual direction, 1 to reverse path direction.
2980 # @return New GEOM_Object, containing the displaced shape.
2982 # @ref tui_modify_location "Example"
2983 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
2984 # Example: see GEOM_TestAll.py
2985 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
2986 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
2989 ## Create new object as offset of the given one.
2990 # @param theObject The base object for the offset.
2991 # @param theOffset Offset value.
2992 # @return New GEOM_Object, containing the offset object.
2994 # @ref tui_offset "Example"
2995 def MakeOffset(self,theObject, theOffset):
2996 # Example: see GEOM_TestAll.py
2997 theOffset, Parameters = ParseParameters(theOffset)
2998 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
2999 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
3000 anObj.SetParameters(Parameters)
3003 # -----------------------------------------------------------------------------
3005 # -----------------------------------------------------------------------------
3007 ## Translate the given object along the given vector a given number times
3008 # @param theObject The object to be translated.
3009 # @param theVector Direction of the translation.
3010 # @param theStep Distance to translate on.
3011 # @param theNbTimes Quantity of translations to be done.
3012 # @return New GEOM_Object, containing compound of all
3013 # the shapes, obtained after each translation.
3015 # @ref tui_multi_translation "Example"
3016 def MakeMultiTranslation1D(self,theObject, theVector, theStep, theNbTimes):
3017 # Example: see GEOM_TestAll.py
3018 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
3019 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
3020 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
3021 anObj.SetParameters(Parameters)
3024 ## Conseqently apply two specified translations to theObject specified number of times.
3025 # @param theObject The object to be translated.
3026 # @param theVector1 Direction of the first translation.
3027 # @param theStep1 Step of the first translation.
3028 # @param theNbTimes1 Quantity of translations to be done along theVector1.
3029 # @param theVector2 Direction of the second translation.
3030 # @param theStep2 Step of the second translation.
3031 # @param theNbTimes2 Quantity of translations to be done along theVector2.
3032 # @return New GEOM_Object, containing compound of all
3033 # the shapes, obtained after each translation.
3035 # @ref tui_multi_translation "Example"
3036 def MakeMultiTranslation2D(self,theObject, theVector1, theStep1, theNbTimes1,
3037 theVector2, theStep2, theNbTimes2):
3038 # Example: see GEOM_TestAll.py
3039 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
3040 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
3041 theVector2, theStep2, theNbTimes2)
3042 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
3043 anObj.SetParameters(Parameters)
3046 ## Rotate the given object around the given axis a given number times.
3047 # Rotation angle will be 2*PI/theNbTimes.
3048 # @param theObject The object to be rotated.
3049 # @param theAxis The rotation axis.
3050 # @param theNbTimes Quantity of rotations to be done.
3051 # @return New GEOM_Object, containing compound of all the
3052 # shapes, obtained after each rotation.
3054 # @ref tui_multi_rotation "Example"
3055 def MultiRotate1D(self,theObject, theAxis, theNbTimes):
3056 # Example: see GEOM_TestAll.py
3057 theAxis, theNbTimes, Parameters = ParseParameters(theAxis, theNbTimes)
3058 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
3059 RaiseIfFailed("MultiRotate1D", self.TrsfOp)
3060 anObj.SetParameters(Parameters)
3063 ## Rotate the given object around the
3064 # given axis on the given angle a given number
3065 # times and multi-translate each rotation result.
3066 # Translation direction passes through center of gravity
3067 # of rotated shape and its projection on the rotation axis.
3068 # @param theObject The object to be rotated.
3069 # @param theAxis Rotation axis.
3070 # @param theAngle Rotation angle in graduces.
3071 # @param theNbTimes1 Quantity of rotations to be done.
3072 # @param theStep Translation distance.
3073 # @param theNbTimes2 Quantity of translations to be done.
3074 # @return New GEOM_Object, containing compound of all the
3075 # shapes, obtained after each transformation.
3077 # @ref tui_multi_rotation "Example"
3078 def MultiRotate2D(self,theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2):
3079 # Example: see GEOM_TestAll.py
3080 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
3081 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
3082 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
3083 anObj.SetParameters(Parameters)
3086 ## The same, as MultiRotate1D(), but axis is given by direction and point
3087 # @ref swig_MakeMultiRotation "Example"
3088 def MakeMultiRotation1D(self,aShape,aDir,aPoint,aNbTimes):
3089 # Example: see GEOM_TestOthers.py
3090 aVec = self.MakeLine(aPoint,aDir)
3091 anObj = self.MultiRotate1D(aShape,aVec,aNbTimes)
3094 ## The same, as MultiRotate2D(), but axis is given by direction and point
3095 # @ref swig_MakeMultiRotation "Example"
3096 def MakeMultiRotation2D(self,aShape,aDir,aPoint,anAngle,nbtimes1,aStep,nbtimes2):
3097 # Example: see GEOM_TestOthers.py
3098 aVec = self.MakeLine(aPoint,aDir)
3099 anObj = self.MultiRotate2D(aShape,aVec,anAngle,nbtimes1,aStep,nbtimes2)
3102 # end of l3_transform
3105 ## @addtogroup l3_local
3108 ## Perform a fillet on all edges of the given shape.
3109 # @param theShape Shape, to perform fillet on.
3110 # @param theR Fillet radius.
3111 # @return New GEOM_Object, containing the result shape.
3113 # @ref tui_fillet "Example 1"
3114 # \n @ref swig_MakeFilletAll "Example 2"
3115 def MakeFilletAll(self,theShape, theR):
3116 # Example: see GEOM_TestOthers.py
3117 theR,Parameters = ParseParameters(theR)
3118 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
3119 RaiseIfFailed("MakeFilletAll", self.LocalOp)
3120 anObj.SetParameters(Parameters)
3123 ## Perform a fillet on the specified edges/faces of the given shape
3124 # @param theShape Shape, to perform fillet on.
3125 # @param theR Fillet radius.
3126 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR>.
3127 # @param theListShapes Global indices of edges/faces to perform fillet on.
3128 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
3129 # @return New GEOM_Object, containing the result shape.
3131 # @ref tui_fillet "Example"
3132 def MakeFillet(self,theShape, theR, theShapeType, theListShapes):
3133 # Example: see GEOM_TestAll.py
3134 theR,Parameters = ParseParameters(theR)
3136 if theShapeType == ShapeType["EDGE"]:
3137 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
3138 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
3140 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
3141 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
3142 anObj.SetParameters(Parameters)
3145 ## The same that MakeFillet but with two Fillet Radius R1 and R2
3146 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes):
3147 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
3149 if theShapeType == ShapeType["EDGE"]:
3150 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
3151 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
3153 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
3154 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
3155 anObj.SetParameters(Parameters)
3158 ## Perform a fillet on the specified edges of the given shape
3159 # @param theShape - Wire Shape to perform fillet on.
3160 # @param theR - Fillet radius.
3161 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
3162 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
3163 # \note The list of vertices could be empty,
3164 # in this case fillet will done done at all vertices in wire
3165 # @return New GEOM_Object, containing the result shape.
3167 # @ref tui_fillet2d "Example"
3168 def MakeFillet1D(self,theShape, theR, theListOfVertexes):
3169 # Example: see GEOM_TestAll.py
3170 theR,Parameters = ParseParameters(theR)
3171 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes)
3172 RaiseIfFailed("MakeFillet1D", self.LocalOp)
3173 anObj.SetParameters(Parameters)
3176 ## Perform a fillet on the specified edges/faces of the given shape
3177 # @param theShape - Face Shape to perform fillet on.
3178 # @param theR - Fillet radius.
3179 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
3180 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
3181 # @return New GEOM_Object, containing the result shape.
3183 # @ref tui_fillet2d "Example"
3184 def MakeFillet2D(self,theShape, theR, theListOfVertexes):
3185 # Example: see GEOM_TestAll.py
3186 theR,Parameters = ParseParameters(theR)
3187 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
3188 RaiseIfFailed("MakeFillet2D", self.LocalOp)
3189 anObj.SetParameters(Parameters)
3192 ## Perform a symmetric chamfer on all edges of the given shape.
3193 # @param theShape Shape, to perform chamfer on.
3194 # @param theD Chamfer size along each face.
3195 # @return New GEOM_Object, containing the result shape.
3197 # @ref tui_chamfer "Example 1"
3198 # \n @ref swig_MakeChamferAll "Example 2"
3199 def MakeChamferAll(self,theShape, theD):
3200 # Example: see GEOM_TestOthers.py
3201 theD,Parameters = ParseParameters(theD)
3202 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
3203 RaiseIfFailed("MakeChamferAll", self.LocalOp)
3204 anObj.SetParameters(Parameters)
3207 ## Perform a chamfer on edges, common to the specified faces,
3208 # with distance D1 on the Face1
3209 # @param theShape Shape, to perform chamfer on.
3210 # @param theD1 Chamfer size along \a theFace1.
3211 # @param theD2 Chamfer size along \a theFace2.
3212 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
3213 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
3214 # @return New GEOM_Object, containing the result shape.
3216 # @ref tui_chamfer "Example"
3217 def MakeChamferEdge(self,theShape, theD1, theD2, theFace1, theFace2):
3218 # Example: see GEOM_TestAll.py
3219 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
3220 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
3221 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
3222 anObj.SetParameters(Parameters)
3225 ## The Same that MakeChamferEdge but with params theD is chamfer length and
3226 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
3227 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2):
3229 if isinstance(theAngle,str):
3231 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
3233 theAngle = theAngle*math.pi/180.0
3234 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
3235 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
3236 anObj.SetParameters(Parameters)
3239 ## Perform a chamfer on all edges of the specified faces,
3240 # with distance D1 on the first specified face (if several for one edge)
3241 # @param theShape Shape, to perform chamfer on.
3242 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
3243 # connected to the edge, are in \a theFaces, \a theD1
3244 # will be get along face, which is nearer to \a theFaces beginning.
3245 # @param theD2 Chamfer size along another of two faces, connected to the edge.
3246 # @param theFaces Sequence of global indices of faces of \a theShape.
3247 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
3248 # @return New GEOM_Object, containing the result shape.
3250 # @ref tui_chamfer "Example"
3251 def MakeChamferFaces(self,theShape, theD1, theD2, theFaces):
3252 # Example: see GEOM_TestAll.py
3253 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
3254 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
3255 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
3256 anObj.SetParameters(Parameters)
3259 ## The Same that MakeChamferFaces but with params theD is chamfer lenght and
3260 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
3262 # @ref swig_FilletChamfer "Example"
3263 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces):
3265 if isinstance(theAngle,str):
3267 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
3269 theAngle = theAngle*math.pi/180.0
3270 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
3271 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
3272 anObj.SetParameters(Parameters)
3275 ## Perform a chamfer on edges,
3276 # with distance D1 on the first specified face (if several for one edge)
3277 # @param theShape Shape, to perform chamfer on.
3278 # @param theD1,theD2 Chamfer size
3279 # @param theEdges Sequence of edges of \a theShape.
3280 # @return New GEOM_Object, containing the result shape.
3282 # @ref swig_FilletChamfer "Example"
3283 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges):
3284 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
3285 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
3286 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
3287 anObj.SetParameters(Parameters)
3290 ## The Same that MakeChamferEdges but with params theD is chamfer lenght and
3291 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
3292 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges):
3294 if isinstance(theAngle,str):
3296 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
3298 theAngle = theAngle*math.pi/180.0
3299 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
3300 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
3301 anObj.SetParameters(Parameters)
3304 ## Shortcut to MakeChamferEdge() and MakeChamferFaces()
3306 # @ref swig_MakeChamfer "Example"
3307 def MakeChamfer(self,aShape,d1,d2,aShapeType,ListShape):
3308 # Example: see GEOM_TestOthers.py
3310 if aShapeType == ShapeType["EDGE"]:
3311 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1])
3313 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape)
3319 ## @addtogroup l3_basic_op
3322 ## Perform an Archimde operation on the given shape with given parameters.
3323 # The object presenting the resulting face is returned.
3324 # @param theShape Shape to be put in water.
3325 # @param theWeight Weight og the shape.
3326 # @param theWaterDensity Density of the water.
3327 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
3328 # @return New GEOM_Object, containing a section of \a theShape
3329 # by a plane, corresponding to water level.
3331 # @ref tui_archimede "Example"
3332 def Archimede(self,theShape, theWeight, theWaterDensity, theMeshDeflection):
3333 # Example: see GEOM_TestAll.py
3334 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
3335 theWeight,theWaterDensity,theMeshDeflection)
3336 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
3337 RaiseIfFailed("MakeArchimede", self.LocalOp)
3338 anObj.SetParameters(Parameters)
3341 # end of l3_basic_op
3344 ## @addtogroup l2_measure
3347 ## Get point coordinates
3350 # @ref tui_measurement_tools_page "Example"
3351 def PointCoordinates(self,Point):
3352 # Example: see GEOM_TestMeasures.py
3353 aTuple = self.MeasuOp.PointCoordinates(Point)
3354 RaiseIfFailed("PointCoordinates", self.MeasuOp)
3357 ## Get summarized length of all wires,
3358 # area of surface and volume of the given shape.
3359 # @param theShape Shape to define properties of.
3360 # @return [theLength, theSurfArea, theVolume]
3361 # theLength: Summarized length of all wires of the given shape.
3362 # theSurfArea: Area of surface of the given shape.
3363 # theVolume: Volume of the given shape.
3365 # @ref tui_measurement_tools_page "Example"
3366 def BasicProperties(self,theShape):
3367 # Example: see GEOM_TestMeasures.py
3368 aTuple = self.MeasuOp.GetBasicProperties(theShape)
3369 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
3372 ## Get parameters of bounding box of the given shape
3373 # @param theShape Shape to obtain bounding box of.
3374 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
3375 # Xmin,Xmax: Limits of shape along OX axis.
3376 # Ymin,Ymax: Limits of shape along OY axis.
3377 # Zmin,Zmax: Limits of shape along OZ axis.
3379 # @ref tui_measurement_tools_page "Example"
3380 def BoundingBox(self,theShape):
3381 # Example: see GEOM_TestMeasures.py
3382 aTuple = self.MeasuOp.GetBoundingBox(theShape)
3383 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
3386 ## Get inertia matrix and moments of inertia of theShape.
3387 # @param theShape Shape to calculate inertia of.
3388 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
3389 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
3390 # Ix,Iy,Iz: Moments of inertia of the given shape.
3392 # @ref tui_measurement_tools_page "Example"
3393 def Inertia(self,theShape):
3394 # Example: see GEOM_TestMeasures.py
3395 aTuple = self.MeasuOp.GetInertia(theShape)
3396 RaiseIfFailed("GetInertia", self.MeasuOp)
3399 ## Get if coords are included in the shape (ST_IN or ST_ON)
3400 # @param theShape Shape
3401 # @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
3402 # @param tolerance to be used (default is 1.0e-7)
3403 # @return list_of_boolean = [res1, res2, ...]
3404 def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
3405 return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
3407 ## Get minimal distance between the given shapes.
3408 # @param theShape1,theShape2 Shapes to find minimal distance between.
3409 # @return Value of the minimal distance between the given shapes.
3411 # @ref tui_measurement_tools_page "Example"
3412 def MinDistance(self, theShape1, theShape2):
3413 # Example: see GEOM_TestMeasures.py
3414 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
3415 RaiseIfFailed("GetMinDistance", self.MeasuOp)
3418 ## Get minimal distance between the given shapes.
3419 # @param theShape1,theShape2 Shapes to find minimal distance between.
3420 # @return Value of the minimal distance between the given shapes.
3422 # @ref swig_all_measure "Example"
3423 def MinDistanceComponents(self, theShape1, theShape2):
3424 # Example: see GEOM_TestMeasures.py
3425 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
3426 RaiseIfFailed("GetMinDistance", self.MeasuOp)
3427 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
3430 ## Get angle between the given shapes in degrees.
3431 # @param theShape1,theShape2 Lines or linear edges to find angle between.
3432 # @return Value of the angle between the given shapes in degrees.
3434 # @ref tui_measurement_tools_page "Example"
3435 def GetAngle(self, theShape1, theShape2):
3436 # Example: see GEOM_TestMeasures.py
3437 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
3438 RaiseIfFailed("GetAngle", self.MeasuOp)
3440 ## Get angle between the given shapes in radians.
3441 # @param theShape1,theShape2 Lines or linear edges to find angle between.
3442 # @return Value of the angle between the given shapes in radians.
3444 # @ref tui_measurement_tools_page "Example"
3445 def GetAngleRadians(self, theShape1, theShape2):
3446 # Example: see GEOM_TestMeasures.py
3447 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
3448 RaiseIfFailed("GetAngle", self.MeasuOp)
3451 ## @name Curve Curvature Measurement
3452 # Methods for receiving radius of curvature of curves
3453 # in the given point
3456 ## Measure curvature of a curve at a point, set by parameter.
3457 # @ref swig_todo "Example"
3458 def CurveCurvatureByParam(self, theCurve, theParam):
3459 # Example: see GEOM_TestMeasures.py
3460 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
3461 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
3465 # @ref swig_todo "Example"
3466 def CurveCurvatureByPoint(self, theCurve, thePoint):
3467 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
3468 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
3472 ## @name Surface Curvature Measurement
3473 # Methods for receiving max and min radius of curvature of surfaces
3474 # in the given point
3478 ## @ref swig_todo "Example"
3479 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
3480 # Example: see GEOM_TestMeasures.py
3481 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
3482 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
3486 ## @ref swig_todo "Example"
3487 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
3488 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
3489 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
3493 ## @ref swig_todo "Example"
3494 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
3495 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
3496 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
3500 ## @ref swig_todo "Example"
3501 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
3502 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
3503 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
3507 ## Get min and max tolerances of sub-shapes of theShape
3508 # @param theShape Shape, to get tolerances of.
3509 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
3510 # FaceMin,FaceMax: Min and max tolerances of the faces.
3511 # EdgeMin,EdgeMax: Min and max tolerances of the edges.
3512 # VertMin,VertMax: Min and max tolerances of the vertices.
3514 # @ref tui_measurement_tools_page "Example"
3515 def Tolerance(self,theShape):
3516 # Example: see GEOM_TestMeasures.py
3517 aTuple = self.MeasuOp.GetTolerance(theShape)
3518 RaiseIfFailed("GetTolerance", self.MeasuOp)
3521 ## Obtain description of the given shape (number of sub-shapes of each type)
3522 # @param theShape Shape to be described.
3523 # @return Description of the given shape.
3525 # @ref tui_measurement_tools_page "Example"
3526 def WhatIs(self,theShape):
3527 # Example: see GEOM_TestMeasures.py
3528 aDescr = self.MeasuOp.WhatIs(theShape)
3529 RaiseIfFailed("WhatIs", self.MeasuOp)
3532 ## Obtain quantity of shapes of the given type in \a theShape.
3533 # If \a theShape is of type \a theType, it is also counted.
3534 # @param theShape Shape to be described.
3535 # @return Quantity of shapes of type \a theType in \a theShape.
3537 # @ref tui_measurement_tools_page "Example"
3538 def NbShapes (self, theShape, theType):
3539 # Example: see GEOM_TestMeasures.py
3540 listSh = self.SubShapeAllIDs(theShape, theType)
3542 t = EnumToLong(theShape.GetShapeType())
3543 theType = EnumToLong(theType)
3549 ## Obtain quantity of shapes of each type in \a theShape.
3550 # The \a theShape is also counted.
3551 # @param theShape Shape to be described.
3552 # @return Dictionary of shape types with bound quantities of shapes.
3554 # @ref tui_measurement_tools_page "Example"
3555 def ShapeInfo (self, theShape):
3556 # Example: see GEOM_TestMeasures.py
3558 for typeSh in ShapeType:
3559 if typeSh in ( "AUTO", "SHAPE" ): continue
3560 listSh = self.SubShapeAllIDs(theShape, ShapeType[typeSh])
3562 if EnumToLong(theShape.GetShapeType()) == ShapeType[typeSh]:
3569 ## Get a point, situated at the centre of mass of theShape.
3570 # @param theShape Shape to define centre of mass of.
3571 # @return New GEOM_Object, containing the created point.
3573 # @ref tui_measurement_tools_page "Example"
3574 def MakeCDG(self,theShape):
3575 # Example: see GEOM_TestMeasures.py
3576 anObj = self.MeasuOp.GetCentreOfMass(theShape)
3577 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
3580 ## Get a vertex subshape by index depended with orientation.
3581 # @param theShape Shape to find subshape.
3582 # @param theIndex Index to find vertex by this index.
3583 # @return New GEOM_Object, containing the created vertex.
3585 # @ref tui_measurement_tools_page "Example"
3586 def GetVertexByIndex(self,theShape, theIndex):
3587 # Example: see GEOM_TestMeasures.py
3588 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
3589 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
3592 ## Get the first vertex of wire/edge depended orientation.
3593 # @param theShape Shape to find first vertex.
3594 # @return New GEOM_Object, containing the created vertex.
3596 # @ref tui_measurement_tools_page "Example"
3597 def GetFirstVertex(self,theShape):
3598 # Example: see GEOM_TestMeasures.py
3599 anObj = self.GetVertexByIndex(theShape, 0)
3600 RaiseIfFailed("GetFirstVertex", self.MeasuOp)
3603 ## Get the last vertex of wire/edge depended orientation.
3604 # @param theShape Shape to find last vertex.
3605 # @return New GEOM_Object, containing the created vertex.
3607 # @ref tui_measurement_tools_page "Example"
3608 def GetLastVertex(self,theShape):
3609 # Example: see GEOM_TestMeasures.py
3610 nb_vert = self.ShapesOp.NumberOfSubShapes(theShape, ShapeType["VERTEX"])
3611 anObj = self.GetVertexByIndex(theShape, (nb_vert-1))
3612 RaiseIfFailed("GetLastVertex", self.MeasuOp)
3615 ## Get a normale to the given face. If the point is not given,
3616 # the normale is calculated at the center of mass.
3617 # @param theFace Face to define normale of.
3618 # @param theOptionalPoint Point to compute the normale at.
3619 # @return New GEOM_Object, containing the created vector.
3621 # @ref swig_todo "Example"
3622 def GetNormal(self, theFace, theOptionalPoint = None):
3623 # Example: see GEOM_TestMeasures.py
3624 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
3625 RaiseIfFailed("GetNormal", self.MeasuOp)
3628 ## Check a topology of the given shape.
3629 # @param theShape Shape to check validity of.
3630 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked,
3631 # if TRUE, the shape's geometry will be checked also.
3632 # @return TRUE, if the shape "seems to be valid".
3633 # If theShape is invalid, prints a description of problem.
3635 # @ref tui_measurement_tools_page "Example"
3636 def CheckShape(self,theShape, theIsCheckGeom = 0):
3637 # Example: see GEOM_TestMeasures.py
3639 (IsValid, Status) = self.MeasuOp.CheckShapeWithGeometry(theShape)
3640 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
3642 (IsValid, Status) = self.MeasuOp.CheckShape(theShape)
3643 RaiseIfFailed("CheckShape", self.MeasuOp)
3648 ## Get position (LCS) of theShape.
3650 # Origin of the LCS is situated at the shape's center of mass.
3651 # Axes of the LCS are obtained from shape's location or,
3652 # if the shape is a planar face, from position of its plane.
3654 # @param theShape Shape to calculate position of.
3655 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
3656 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
3657 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
3658 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
3660 # @ref swig_todo "Example"
3661 def GetPosition(self,theShape):
3662 # Example: see GEOM_TestMeasures.py
3663 aTuple = self.MeasuOp.GetPosition(theShape)
3664 RaiseIfFailed("GetPosition", self.MeasuOp)
3667 ## Get kind of theShape.
3669 # @param theShape Shape to get a kind of.
3670 # @return Returns a kind of shape in terms of <VAR>GEOM_IKindOfShape.shape_kind</VAR> enumeration
3671 # and a list of parameters, describing the shape.
3672 # @note Concrete meaning of each value, returned via \a theIntegers
3673 # or \a theDoubles list depends on the kind of the shape.
3674 # The full list of possible outputs is:
3676 # - geompy.kind.COMPOUND nb_solids nb_faces nb_edges nb_vertices
3677 # - geompy.kind.COMPSOLID nb_solids nb_faces nb_edges nb_vertices
3679 # - geompy.kind.SHELL geompy.info.CLOSED nb_faces nb_edges nb_vertices
3680 # - geompy.kind.SHELL geompy.info.UNCLOSED nb_faces nb_edges nb_vertices
3682 # - geompy.kind.WIRE geompy.info.CLOSED nb_edges nb_vertices
3683 # - geompy.kind.WIRE geompy.info.UNCLOSED nb_edges nb_vertices
3685 # - geompy.kind.SPHERE xc yc zc R
3686 # - geompy.kind.CYLINDER xb yb zb dx dy dz R H
3687 # - geompy.kind.BOX xc yc zc ax ay az
3688 # - geompy.kind.ROTATED_BOX xc yc zc zx zy zz xx xy xz ax ay az
3689 # - geompy.kind.TORUS xc yc zc dx dy dz R_1 R_2
3690 # - geompy.kind.CONE xb yb zb dx dy dz R_1 R_2 H
3691 # - geompy.kind.POLYHEDRON nb_faces nb_edges nb_vertices
3692 # - geompy.kind.SOLID nb_faces nb_edges nb_vertices
3694 # - geompy.kind.SPHERE2D xc yc zc R
3695 # - geompy.kind.CYLINDER2D xb yb zb dx dy dz R H
3696 # - geompy.kind.TORUS2D xc yc zc dx dy dz R_1 R_2
3697 # - geompy.kind.CONE2D xc yc zc dx dy dz R_1 R_2 H
3698 # - geompy.kind.DISK_CIRCLE xc yc zc dx dy dz R
3699 # - geompy.kind.DISK_ELLIPSE xc yc zc dx dy dz R_1 R_2
3700 # - geompy.kind.POLYGON xo yo zo dx dy dz nb_edges nb_vertices
3701 # - geompy.kind.PLANE xo yo zo dx dy dz
3702 # - geompy.kind.PLANAR xo yo zo dx dy dz nb_edges nb_vertices
3703 # - geompy.kind.FACE nb_edges nb_vertices
3705 # - geompy.kind.CIRCLE xc yc zc dx dy dz R
3706 # - geompy.kind.ARC_CIRCLE xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2
3707 # - geompy.kind.ELLIPSE xc yc zc dx dy dz R_1 R_2
3708 # - geompy.kind.ARC_ELLIPSE xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2
3709 # - geompy.kind.LINE xo yo zo dx dy dz
3710 # - geompy.kind.SEGMENT x1 y1 z1 x2 y2 z2
3711 # - geompy.kind.EDGE nb_vertices
3713 # - geompy.kind.VERTEX x y z
3715 # @ref swig_todo "Example"
3716 def KindOfShape(self,theShape):
3717 # Example: see GEOM_TestMeasures.py
3718 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
3719 RaiseIfFailed("KindOfShape", self.MeasuOp)
3721 aKind = aRoughTuple[0]
3722 anInts = aRoughTuple[1]
3723 aDbls = aRoughTuple[2]
3725 # Now there is no exception from this rule:
3726 aKindTuple = [aKind] + aDbls + anInts
3728 # If they are we will regroup parameters for such kind of shape.
3730 #if aKind == kind.SOME_KIND:
3731 # # SOME_KIND int int double int double double
3732 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
3739 ## @addtogroup l2_import_export
3742 ## Import a shape from the BREP or IGES or STEP file
3743 # (depends on given format) with given name.
3744 # @param theFileName The file, containing the shape.
3745 # @param theFormatName Specify format for the file reading.
3746 # Available formats can be obtained with InsertOp.ImportTranslators() method.
3747 # If format 'IGES_SCALE' is used instead 'IGES' length unit will be
3748 # set to 'meter' and result model will be scaled.
3749 # @return New GEOM_Object, containing the imported shape.
3751 # @ref swig_Import_Export "Example"
3752 def ImportFile(self,theFileName, theFormatName):
3753 # Example: see GEOM_TestOthers.py
3754 anObj = self.InsertOp.ImportFile(theFileName, theFormatName)
3755 RaiseIfFailed("Import", self.InsertOp)
3758 ## Deprecated analog of ImportFile
3759 def Import(self,theFileName, theFormatName):
3760 print "WARNING: Function Import is deprecated, use ImportFile instead"
3761 anObj = self.InsertOp.ImportFile(theFileName, theFormatName)
3762 RaiseIfFailed("Import", self.InsertOp)
3765 ## Shortcut to ImportFile() for BREP format
3767 # @ref swig_Import_Export "Example"
3768 def ImportBREP(self,theFileName):
3769 # Example: see GEOM_TestOthers.py
3770 return self.ImportFile(theFileName, "BREP")
3772 ## Shortcut to ImportFile() for IGES format
3774 # @ref swig_Import_Export "Example"
3775 def ImportIGES(self,theFileName):
3776 # Example: see GEOM_TestOthers.py
3777 return self.ImportFile(theFileName, "IGES")
3779 ## Return length unit from given IGES file
3781 # @ref swig_Import_Export "Example"
3782 def GetIGESUnit(self,theFileName):
3783 # Example: see GEOM_TestOthers.py
3784 anObj = self.InsertOp.ImportFile(theFileName, "IGES_UNIT")
3785 #RaiseIfFailed("Import", self.InsertOp)
3786 # recieve name using returned vertex
3788 if anObj.GetShapeType() == GEOM.VERTEX:
3791 vertices = self.SubShapeAll(anObj,ShapeType["VERTEX"])
3793 p = self.PointCoordinates(vertices[0])
3794 if abs(p[0]-0.01) < 1.e-6:
3796 elif abs(p[0]-0.001) < 1.e-6:
3800 ## Shortcut to ImportFile() for STEP format
3802 # @ref swig_Import_Export "Example"
3803 def ImportSTEP(self,theFileName):
3804 # Example: see GEOM_TestOthers.py
3805 return self.ImportFile(theFileName, "STEP")
3807 ## Export the given shape into a file with given name.
3808 # @param theObject Shape to be stored in the file.
3809 # @param theFileName Name of the file to store the given shape in.
3810 # @param theFormatName Specify format for the shape storage.
3811 # Available formats can be obtained with InsertOp.ImportTranslators() method.
3813 # @ref swig_Import_Export "Example"
3814 def Export(self,theObject, theFileName, theFormatName):
3815 # Example: see GEOM_TestOthers.py
3816 self.InsertOp.Export(theObject, theFileName, theFormatName)
3817 if self.InsertOp.IsDone() == 0:
3818 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
3822 ## Shortcut to Export() for BREP format
3824 # @ref swig_Import_Export "Example"
3825 def ExportBREP(self,theObject, theFileName):
3826 # Example: see GEOM_TestOthers.py
3827 return self.Export(theObject, theFileName, "BREP")
3829 ## Shortcut to Export() for IGES format
3831 # @ref swig_Import_Export "Example"
3832 def ExportIGES(self,theObject, theFileName):
3833 # Example: see GEOM_TestOthers.py
3834 return self.Export(theObject, theFileName, "IGES")
3836 ## Shortcut to Export() for STEP format
3838 # @ref swig_Import_Export "Example"
3839 def ExportSTEP(self,theObject, theFileName):
3840 # Example: see GEOM_TestOthers.py
3841 return self.Export(theObject, theFileName, "STEP")
3843 # end of l2_import_export
3846 ## @addtogroup l3_blocks
3849 ## Create a quadrangle face from four edges. Order of Edges is not
3850 # important. It is not necessary that edges share the same vertex.
3851 # @param E1,E2,E3,E4 Edges for the face bound.
3852 # @return New GEOM_Object, containing the created face.
3854 # @ref tui_building_by_blocks_page "Example"
3855 def MakeQuad(self,E1, E2, E3, E4):
3856 # Example: see GEOM_Spanner.py
3857 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
3858 RaiseIfFailed("MakeQuad", self.BlocksOp)
3861 ## Create a quadrangle face on two edges.
3862 # The missing edges will be built by creating the shortest ones.
3863 # @param E1,E2 Two opposite edges for the face.
3864 # @return New GEOM_Object, containing the created face.
3866 # @ref tui_building_by_blocks_page "Example"
3867 def MakeQuad2Edges(self,E1, E2):
3868 # Example: see GEOM_Spanner.py
3869 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
3870 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
3873 ## Create a quadrangle face with specified corners.
3874 # The missing edges will be built by creating the shortest ones.
3875 # @param V1,V2,V3,V4 Corner vertices for the face.
3876 # @return New GEOM_Object, containing the created face.
3878 # @ref tui_building_by_blocks_page "Example 1"
3879 # \n @ref swig_MakeQuad4Vertices "Example 2"
3880 def MakeQuad4Vertices(self,V1, V2, V3, V4):
3881 # Example: see GEOM_Spanner.py
3882 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
3883 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
3886 ## Create a hexahedral solid, bounded by the six given faces. Order of
3887 # faces is not important. It is not necessary that Faces share the same edge.
3888 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
3889 # @return New GEOM_Object, containing the created solid.
3891 # @ref tui_building_by_blocks_page "Example 1"
3892 # \n @ref swig_MakeHexa "Example 2"
3893 def MakeHexa(self,F1, F2, F3, F4, F5, F6):
3894 # Example: see GEOM_Spanner.py
3895 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
3896 RaiseIfFailed("MakeHexa", self.BlocksOp)
3899 ## Create a hexahedral solid between two given faces.
3900 # The missing faces will be built by creating the smallest ones.
3901 # @param F1,F2 Two opposite faces for the hexahedral solid.
3902 # @return New GEOM_Object, containing the created solid.
3904 # @ref tui_building_by_blocks_page "Example 1"
3905 # \n @ref swig_MakeHexa2Faces "Example 2"
3906 def MakeHexa2Faces(self,F1, F2):
3907 # Example: see GEOM_Spanner.py
3908 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
3909 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
3915 ## @addtogroup l3_blocks_op
3918 ## Get a vertex, found in the given shape by its coordinates.
3919 # @param theShape Block or a compound of blocks.
3920 # @param theX,theY,theZ Coordinates of the sought vertex.
3921 # @param theEpsilon Maximum allowed distance between the resulting
3922 # vertex and point with the given coordinates.
3923 # @return New GEOM_Object, containing the found vertex.
3925 # @ref swig_GetPoint "Example"
3926 def GetPoint(self, theShape, theX, theY, theZ, theEpsilon):
3927 # Example: see GEOM_TestOthers.py
3928 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
3929 RaiseIfFailed("GetPoint", self.BlocksOp)
3932 ## Find a vertex of the given shape, which has minimal distance to the given point.
3933 # @param theShape Any shape.
3934 # @param thePoint Point, close to the desired vertex.
3935 # @return New GEOM_Object, containing the found vertex.
3937 # @ref swig_GetVertexNearPoint "Example"
3938 def GetVertexNearPoint(self, theShape, thePoint):
3939 # Example: see GEOM_TestOthers.py
3940 anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
3941 RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
3944 ## Get an edge, found in the given shape by two given vertices.
3945 # @param theShape Block or a compound of blocks.
3946 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
3947 # @return New GEOM_Object, containing the found edge.
3949 # @ref swig_GetEdge "Example"
3950 def GetEdge(self, theShape, thePoint1, thePoint2):
3951 # Example: see GEOM_Spanner.py
3952 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
3953 RaiseIfFailed("GetEdge", self.BlocksOp)
3956 ## Find an edge of the given shape, which has minimal distance to the given point.
3957 # @param theShape Block or a compound of blocks.
3958 # @param thePoint Point, close to the desired edge.
3959 # @return New GEOM_Object, containing the found edge.
3961 # @ref swig_GetEdgeNearPoint "Example"
3962 def GetEdgeNearPoint(self, theShape, thePoint):
3963 # Example: see GEOM_TestOthers.py
3964 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
3965 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
3968 ## Returns a face, found in the given shape by four given corner vertices.
3969 # @param theShape Block or a compound of blocks.
3970 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
3971 # @return New GEOM_Object, containing the found face.
3973 # @ref swig_todo "Example"
3974 def GetFaceByPoints(self,theShape, thePoint1, thePoint2, thePoint3, thePoint4):
3975 # Example: see GEOM_Spanner.py
3976 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
3977 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
3980 ## Get a face of block, found in the given shape by two given edges.
3981 # @param theShape Block or a compound of blocks.
3982 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
3983 # @return New GEOM_Object, containing the found face.
3985 # @ref swig_todo "Example"
3986 def GetFaceByEdges(self,theShape, theEdge1, theEdge2):
3987 # Example: see GEOM_Spanner.py
3988 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
3989 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
3992 ## Find a face, opposite to the given one in the given block.
3993 # @param theBlock Must be a hexahedral solid.
3994 # @param theFace Face of \a theBlock, opposite to the desired face.
3995 # @return New GEOM_Object, containing the found face.
3997 # @ref swig_GetOppositeFace "Example"
3998 def GetOppositeFace(self,theBlock, theFace):
3999 # Example: see GEOM_Spanner.py
4000 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
4001 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
4004 ## Find a face of the given shape, which has minimal distance to the given point.
4005 # @param theShape Block or a compound of blocks.
4006 # @param thePoint Point, close to the desired face.
4007 # @return New GEOM_Object, containing the found face.
4009 # @ref swig_GetFaceNearPoint "Example"
4010 def GetFaceNearPoint(self, theShape, thePoint):
4011 # Example: see GEOM_Spanner.py
4012 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
4013 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
4016 ## Find a face of block, whose outside normale has minimal angle with the given vector.
4017 # @param theBlock Block or a compound of blocks.
4018 # @param theVector Vector, close to the normale of the desired face.
4019 # @return New GEOM_Object, containing the found face.
4021 # @ref swig_todo "Example"
4022 def GetFaceByNormale(self, theBlock, theVector):
4023 # Example: see GEOM_Spanner.py
4024 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
4025 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
4028 ## Find all subshapes of type \a theShapeType of the given shape,
4029 # which have minimal distance to the given point.
4030 # @param theShape Any shape.
4031 # @param thePoint Point, close to the desired shape.
4032 # @param theShapeType Defines what kind of subshapes is searched.
4033 # @param theTolerance The tolerance for distances comparison. All shapes
4034 # with distances to the given point in interval
4035 # [minimal_distance, minimal_distance + theTolerance] will be gathered.
4036 # @return New GEOM_Object, containing a group of all found shapes.
4038 # @ref swig_GetShapesNearPoint "Example"
4039 def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07):
4040 # Example: see GEOM_TestOthers.py
4041 anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
4042 RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
4045 # end of l3_blocks_op
4048 ## @addtogroup l4_blocks_measure
4051 ## Check, if the compound of blocks is given.
4052 # To be considered as a compound of blocks, the
4053 # given shape must satisfy the following conditions:
4054 # - Each element of the compound should be a Block (6 faces and 12 edges).
4055 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
4056 # - The compound should be connexe.
4057 # - The glue between two quadrangle faces should be applied.
4058 # @param theCompound The compound to check.
4059 # @return TRUE, if the given shape is a compound of blocks.
4060 # If theCompound is not valid, prints all discovered errors.
4062 # @ref tui_measurement_tools_page "Example 1"
4063 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
4064 def CheckCompoundOfBlocks(self,theCompound):
4065 # Example: see GEOM_Spanner.py
4066 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
4067 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
4069 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
4073 ## Remove all seam and degenerated edges from \a theShape.
4074 # Unite faces and edges, sharing one surface. It means that
4075 # this faces must have references to one C++ surface object (handle).
4076 # @param theShape The compound or single solid to remove irregular edges from.
4077 # @param doUnionFaces If True, then unite faces. If False (the default value),
4078 # do not unite faces.
4079 # @return Improved shape.
4081 # @ref swig_RemoveExtraEdges "Example"
4082 def RemoveExtraEdges(self, theShape, doUnionFaces=False):
4083 # Example: see GEOM_TestOthers.py
4084 nbFacesOptimum = -1 # -1 means do not unite faces
4085 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
4086 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
4087 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
4090 ## Check, if the given shape is a blocks compound.
4091 # Fix all detected errors.
4092 # \note Single block can be also fixed by this method.
4093 # @param theShape The compound to check and improve.
4094 # @return Improved compound.
4096 # @ref swig_CheckAndImprove "Example"
4097 def CheckAndImprove(self,theShape):
4098 # Example: see GEOM_TestOthers.py
4099 anObj = self.BlocksOp.CheckAndImprove(theShape)
4100 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
4103 # end of l4_blocks_measure
4106 ## @addtogroup l3_blocks_op
4109 ## Get all the blocks, contained in the given compound.
4110 # @param theCompound The compound to explode.
4111 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
4112 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
4113 # \note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
4114 # @return List of GEOM_Objects, containing the retrieved blocks.
4116 # @ref tui_explode_on_blocks "Example 1"
4117 # \n @ref swig_MakeBlockExplode "Example 2"
4118 def MakeBlockExplode(self,theCompound, theMinNbFaces, theMaxNbFaces):
4119 # Example: see GEOM_TestOthers.py
4120 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
4121 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
4122 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
4124 anObj.SetParameters(Parameters)
4128 ## Find block, containing the given point inside its volume or on boundary.
4129 # @param theCompound Compound, to find block in.
4130 # @param thePoint Point, close to the desired block. If the point lays on
4131 # boundary between some blocks, we return block with nearest center.
4132 # @return New GEOM_Object, containing the found block.
4134 # @ref swig_todo "Example"
4135 def GetBlockNearPoint(self,theCompound, thePoint):
4136 # Example: see GEOM_Spanner.py
4137 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
4138 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
4141 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
4142 # @param theCompound Compound, to find block in.
4143 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
4144 # @return New GEOM_Object, containing the found block.
4146 # @ref swig_GetBlockByParts "Example"
4147 def GetBlockByParts(self,theCompound, theParts):
4148 # Example: see GEOM_TestOthers.py
4149 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
4150 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
4153 ## Return all blocks, containing all the elements, passed as the parts.
4154 # @param theCompound Compound, to find blocks in.
4155 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
4156 # @return List of GEOM_Objects, containing the found blocks.
4158 # @ref swig_todo "Example"
4159 def GetBlocksByParts(self,theCompound, theParts):
4160 # Example: see GEOM_Spanner.py
4161 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
4162 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
4165 ## Multi-transformate block and glue the result.
4166 # Transformation is defined so, as to superpose direction faces.
4167 # @param Block Hexahedral solid to be multi-transformed.
4168 # @param DirFace1 ID of First direction face.
4169 # @param DirFace2 ID of Second direction face.
4170 # @param NbTimes Quantity of transformations to be done.
4171 # \note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
4172 # @return New GEOM_Object, containing the result shape.
4174 # @ref tui_multi_transformation "Example"
4175 def MakeMultiTransformation1D(self,Block, DirFace1, DirFace2, NbTimes):
4176 # Example: see GEOM_Spanner.py
4177 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
4178 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
4179 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
4180 anObj.SetParameters(Parameters)
4183 ## Multi-transformate block and glue the result.
4184 # @param Block Hexahedral solid to be multi-transformed.
4185 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
4186 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
4187 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
4188 # @return New GEOM_Object, containing the result shape.
4190 # @ref tui_multi_transformation "Example"
4191 def MakeMultiTransformation2D(self,Block, DirFace1U, DirFace2U, NbTimesU,
4192 DirFace1V, DirFace2V, NbTimesV):
4193 # Example: see GEOM_Spanner.py
4194 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
4195 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
4196 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
4197 DirFace1V, DirFace2V, NbTimesV)
4198 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
4199 anObj.SetParameters(Parameters)
4202 ## Build all possible propagation groups.
4203 # Propagation group is a set of all edges, opposite to one (main)
4204 # edge of this group directly or through other opposite edges.
4205 # Notion of Opposite Edge make sence only on quadrangle face.
4206 # @param theShape Shape to build propagation groups on.
4207 # @return List of GEOM_Objects, each of them is a propagation group.
4209 # @ref swig_Propagate "Example"
4210 def Propagate(self,theShape):
4211 # Example: see GEOM_TestOthers.py
4212 listChains = self.BlocksOp.Propagate(theShape)
4213 RaiseIfFailed("Propagate", self.BlocksOp)
4216 # end of l3_blocks_op
4219 ## @addtogroup l3_groups
4222 ## Creates a new group which will store sub shapes of theMainShape
4223 # @param theMainShape is a GEOM object on which the group is selected
4224 # @param theShapeType defines a shape type of the group
4225 # @return a newly created GEOM group
4227 # @ref tui_working_with_groups_page "Example 1"
4228 # \n @ref swig_CreateGroup "Example 2"
4229 def CreateGroup(self,theMainShape, theShapeType):
4230 # Example: see GEOM_TestOthers.py
4231 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
4232 RaiseIfFailed("CreateGroup", self.GroupOp)
4235 ## Adds a sub object with ID theSubShapeId to the group
4236 # @param theGroup is a GEOM group to which the new sub shape is added
4237 # @param theSubShapeID is a sub shape ID in the main object.
4238 # \note Use method GetSubShapeID() to get an unique ID of the sub shape
4240 # @ref tui_working_with_groups_page "Example"
4241 def AddObject(self,theGroup, theSubShapeID):
4242 # Example: see GEOM_TestOthers.py
4243 self.GroupOp.AddObject(theGroup, theSubShapeID)
4244 if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
4245 RaiseIfFailed("AddObject", self.GroupOp)
4249 ## Removes a sub object with ID \a theSubShapeId from the group
4250 # @param theGroup is a GEOM group from which the new sub shape is removed
4251 # @param theSubShapeID is a sub shape ID in the main object.
4252 # \note Use method GetSubShapeID() to get an unique ID of the sub shape
4254 # @ref tui_working_with_groups_page "Example"
4255 def RemoveObject(self,theGroup, theSubShapeID):
4256 # Example: see GEOM_TestOthers.py
4257 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
4258 RaiseIfFailed("RemoveObject", self.GroupOp)
4261 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
4262 # @param theGroup is a GEOM group to which the new sub shapes are added.
4263 # @param theSubShapes is a list of sub shapes to be added.
4265 # @ref tui_working_with_groups_page "Example"
4266 def UnionList (self,theGroup, theSubShapes):
4267 # Example: see GEOM_TestOthers.py
4268 self.GroupOp.UnionList(theGroup, theSubShapes)
4269 RaiseIfFailed("UnionList", self.GroupOp)
4272 ## Works like the above method, but argument
4273 # theSubShapes here is a list of sub-shapes indices
4275 # @ref swig_UnionIDs "Example"
4276 def UnionIDs(self,theGroup, theSubShapes):
4277 # Example: see GEOM_TestOthers.py
4278 self.GroupOp.UnionIDs(theGroup, theSubShapes)
4279 RaiseIfFailed("UnionIDs", self.GroupOp)
4282 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
4283 # @param theGroup is a GEOM group from which the sub-shapes are removed.
4284 # @param theSubShapes is a list of sub-shapes to be removed.
4286 # @ref tui_working_with_groups_page "Example"
4287 def DifferenceList (self,theGroup, theSubShapes):
4288 # Example: see GEOM_TestOthers.py
4289 self.GroupOp.DifferenceList(theGroup, theSubShapes)
4290 RaiseIfFailed("DifferenceList", self.GroupOp)
4293 ## Works like the above method, but argument
4294 # theSubShapes here is a list of sub-shapes indices
4296 # @ref swig_DifferenceIDs "Example"
4297 def DifferenceIDs(self,theGroup, theSubShapes):
4298 # Example: see GEOM_TestOthers.py
4299 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
4300 RaiseIfFailed("DifferenceIDs", self.GroupOp)
4303 ## Returns a list of sub objects ID stored in the group
4304 # @param theGroup is a GEOM group for which a list of IDs is requested
4306 # @ref swig_GetObjectIDs "Example"
4307 def GetObjectIDs(self,theGroup):
4308 # Example: see GEOM_TestOthers.py
4309 ListIDs = self.GroupOp.GetObjects(theGroup)
4310 RaiseIfFailed("GetObjects", self.GroupOp)
4313 ## Returns a type of sub objects stored in the group
4314 # @param theGroup is a GEOM group which type is returned.
4316 # @ref swig_GetType "Example"
4317 def GetType(self,theGroup):
4318 # Example: see GEOM_TestOthers.py
4319 aType = self.GroupOp.GetType(theGroup)
4320 RaiseIfFailed("GetType", self.GroupOp)
4323 ## Convert a type of geom object from id to string value
4324 # @param theId is a GEOM obect type id.
4326 # @ref swig_GetType "Example"
4327 def ShapeIdToType(self, theId):
4401 return "FREE_BOUNDS"
4409 return "THRUSECTIONS"
4411 return "COMPOUNDFILTER"
4413 return "SHAPES_ON_SHAPE"
4415 return "ELLIPSE_ARC"
4422 return "Shape Id not exist."
4424 ## Returns a main shape associated with the group
4425 # @param theGroup is a GEOM group for which a main shape object is requested
4426 # @return a GEOM object which is a main shape for theGroup
4428 # @ref swig_GetMainShape "Example"
4429 def GetMainShape(self,theGroup):
4430 # Example: see GEOM_TestOthers.py
4431 anObj = self.GroupOp.GetMainShape(theGroup)
4432 RaiseIfFailed("GetMainShape", self.GroupOp)
4435 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
4436 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
4438 # @ref swig_todo "Example"
4439 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1):
4440 edges = self.SubShapeAll(theShape, ShapeType["EDGE"])
4443 Props = self.BasicProperties(edge)
4444 if min_length <= Props[0] and Props[0] <= max_length:
4445 if (not include_min) and (min_length == Props[0]):
4448 if (not include_max) and (Props[0] == max_length):
4451 edges_in_range.append(edge)
4453 if len(edges_in_range) <= 0:
4454 print "No edges found by given criteria"
4457 group_edges = self.CreateGroup(theShape, ShapeType["EDGE"])
4458 self.UnionList(group_edges, edges_in_range)
4462 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
4463 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
4465 # @ref swig_todo "Example"
4466 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
4467 nb_selected = sg.SelectedCount()
4469 print "Select a shape before calling this function, please."
4472 print "Only one shape must be selected"
4475 id_shape = sg.getSelected(0)
4476 shape = IDToObject( id_shape )
4478 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
4482 if include_min: left_str = " <= "
4483 if include_max: right_str = " <= "
4485 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
4486 + left_str + "length" + right_str + `max_length`)
4488 sg.updateObjBrowser(1)
4495 ## @addtogroup l4_advanced
4498 ## Create a T-shape object with specified caracteristics for the main
4499 # and the incident pipes (radius, width, half-length).
4500 # The extremities of the main pipe are located on junctions points P1 and P2.
4501 # The extremity of the incident pipe is located on junction point P3.
4502 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
4503 # the main plane of the T-shape is XOY.
4504 # @param theR1 Internal radius of main pipe
4505 # @param theW1 Width of main pipe
4506 # @param theL1 Half-length of main pipe
4507 # @param theR2 Internal radius of incident pipe (R2 < R1)
4508 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
4509 # @param theL2 Half-length of incident pipe
4510 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
4511 # @param theP1 1st junction point of main pipe
4512 # @param theP2 2nd junction point of main pipe
4513 # @param theP3 Junction point of incident pipe
4514 # @return List of GEOM_Objects, containing the created shape and propagation groups.
4516 # @ref tui_creation_pipetshape "Example"
4517 def MakePipeTShape(self, theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh=True, theP1=None, theP2=None, theP3=None):
4518 theR1, theW1, theL1, theR2, theW2, theL2, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2)
4519 if (theP1 and theP2 and theP3):
4520 anObj = self.AdvOp.MakePipeTShapeWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh, theP1, theP2, theP3)
4522 anObj = self.AdvOp.MakePipeTShape(theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh)
4523 RaiseIfFailed("MakePipeTShape", self.AdvOp)
4524 if Parameters: anObj[0].SetParameters(Parameters)
4527 ## Create a T-shape object with chamfer and with specified caracteristics for the main
4528 # and the incident pipes (radius, width, half-length). The chamfer is
4529 # created on the junction of the pipes.
4530 # The extremities of the main pipe are located on junctions points P1 and P2.
4531 # The extremity of the incident pipe is located on junction point P3.
4532 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
4533 # the main plane of the T-shape is XOY.
4534 # @param theR1 Internal radius of main pipe
4535 # @param theW1 Width of main pipe
4536 # @param theL1 Half-length of main pipe
4537 # @param theR2 Internal radius of incident pipe (R2 < R1)
4538 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
4539 # @param theL2 Half-length of incident pipe
4540 # @param theH Height of the chamfer.
4541 # @param theW Width of the chamfer.
4542 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
4543 # @param theP1 1st junction point of main pipe
4544 # @param theP2 2nd junction point of main pipe
4545 # @param theP3 Junction point of incident pipe
4546 # @return List of GEOM_Objects, containing the created shape and propagation groups.
4548 # @ref tui_creation_pipetshape "Example"
4549 def MakePipeTShapeChamfer(self, theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh=True, theP1=None, theP2=None, theP3=None):
4550 theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW)
4551 if (theP1 and theP2 and theP3):
4552 anObj = self.AdvOp.MakePipeTShapeChamferWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh, theP1, theP2, theP3)
4554 anObj = self.AdvOp.MakePipeTShapeChamfer(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh)
4555 RaiseIfFailed("MakePipeTShapeChamfer", self.AdvOp)
4556 if Parameters: anObj[0].SetParameters(Parameters)
4559 ## Create a T-shape object with fillet and with specified caracteristics for the main
4560 # and the incident pipes (radius, width, half-length). The fillet is
4561 # created on the junction of the pipes.
4562 # The extremities of the main pipe are located on junctions points P1 and P2.
4563 # The extremity of the incident pipe is located on junction point P3.
4564 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
4565 # the main plane of the T-shape is XOY.
4566 # @param theR1 Internal radius of main pipe
4567 # @param theW1 Width of main pipe
4568 # @param theL1 Half-length of main pipe
4569 # @param theR2 Internal radius of incident pipe (R2 < R1)
4570 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
4571 # @param theL2 Half-length of incident pipe
4572 # @param theRF Radius of curvature of fillet.
4573 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
4574 # @param theP1 1st junction point of main pipe
4575 # @param theP2 2nd junction point of main pipe
4576 # @param theP3 Junction point of incident pipe
4577 # @return List of GEOM_Objects, containing the created shape and propagation groups.
4579 # @ref tui_creation_pipetshape "Example"
4580 def MakePipeTShapeFillet(self, theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh=True, theP1=None, theP2=None, theP3=None):
4581 theR1, theW1, theL1, theR2, theW2, theL2, theRF, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theRF)
4582 if (theP1 and theP2 and theP3):
4583 anObj = self.AdvOp.MakePipeTShapeFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh, theP1, theP2, theP3)
4585 anObj = self.AdvOp.MakePipeTShapeFillet(theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh)
4586 RaiseIfFailed("MakePipeTShapeFillet", self.AdvOp)
4587 if Parameters: anObj[0].SetParameters(Parameters)
4590 #@@ insert new functions before this line @@ do not remove this line @@#
4592 # end of l4_advanced
4595 ## Create a copy of the given object
4596 # @ingroup l1_geompy_auxiliary
4598 # @ref swig_all_advanced "Example"
4599 def MakeCopy(self,theOriginal):
4600 # Example: see GEOM_TestAll.py
4601 anObj = self.InsertOp.MakeCopy(theOriginal)
4602 RaiseIfFailed("MakeCopy", self.InsertOp)
4605 ## Add Path to load python scripts from
4606 # @ingroup l1_geompy_auxiliary
4607 def addPath(self,Path):
4608 if (sys.path.count(Path) < 1):
4609 sys.path.append(Path)
4613 ## Load marker texture from the file
4614 # @param Path a path to the texture file
4615 # @return unique texture identifier
4616 # @ingroup l1_geompy_auxiliary
4617 def LoadTexture(self, Path):
4618 # Example: see GEOM_TestAll.py
4619 ID = self.InsertOp.LoadTexture(Path)
4620 RaiseIfFailed("LoadTexture", self.InsertOp)
4623 ## Add marker texture. @a Width and @a Height parameters
4624 # specify width and height of the texture in pixels.
4625 # If @a RowData is @c True, @a Texture parameter should represent texture data
4626 # packed into the byte array. If @a RowData is @c False (default), @a Texture
4627 # parameter should be unpacked string, in which '1' symbols represent opaque
4628 # pixels and '0' represent transparent pixels of the texture bitmap.
4630 # @param Width texture width in pixels
4631 # @param Height texture height in pixels
4632 # @param Texture texture data
4633 # @param RowData if @c True, @a Texture data are packed in the byte stream
4634 # @ingroup l1_geompy_auxiliary
4635 def AddTexture(self, Width, Height, Texture, RowData=False):
4636 # Example: see GEOM_TestAll.py
4637 if not RowData: Texture = PackData(Texture)
4638 ID = self.InsertOp.AddTexture(Width, Height, Texture)
4639 RaiseIfFailed("AddTexture", self.InsertOp)
4643 #Register the new proxy for GEOM_Gen
4644 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geompyDC)