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 # end of l1_geompy_auxiliary
390 ## @addtogroup l3_restore_ss
393 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
394 # To be used from python scripts out of geompy.addToStudy (non-default usage)
395 # \param theObject published GEOM object, arguments of which will be published
396 # \param theArgs list of GEOM_Object, operation arguments to be published.
397 # If this list is empty, all operation arguments will be published
398 # \param theFindMethod method to search subshapes, corresponding to arguments and
399 # their subshapes. Value from enumeration GEOM::find_shape_method.
400 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
401 # Do not publish subshapes in place of arguments, but only
402 # in place of subshapes of the first argument,
403 # because the whole shape corresponds to the first argument.
404 # Mainly to be used after transformations, but it also can be
405 # usefull after partition with one object shape, and some other
406 # operations, where only the first argument has to be considered.
407 # If theObject has only one argument shape, this flag is automatically
408 # considered as True, not regarding really passed value.
409 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
410 # and prefix "from_subshapes_of_" to names of partially restored subshapes.
411 # \return list of published sub-shapes
413 # @ref tui_restore_prs_params "Example"
414 def RestoreSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
415 theInheritFirstArg=False, theAddPrefix=True):
416 # Example: see GEOM_TestAll.py
417 return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
418 theFindMethod, theInheritFirstArg, theAddPrefix)
420 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
421 # To be used from python scripts out of geompy.addToStudy (non-default usage)
422 # \param theObject published GEOM object, arguments of which will be published
423 # \param theArgs list of GEOM_Object, operation arguments to be published.
424 # If this list is empty, all operation arguments will be published
425 # \param theFindMethod method to search subshapes, corresponding to arguments and
426 # their subshapes. Value from enumeration GEOM::find_shape_method.
427 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
428 # Do not publish subshapes in place of arguments, but only
429 # in place of subshapes of the first argument,
430 # because the whole shape corresponds to the first argument.
431 # Mainly to be used after transformations, but it also can be
432 # usefull after partition with one object shape, and some other
433 # operations, where only the first argument has to be considered.
434 # If theObject has only one argument shape, this flag is automatically
435 # considered as True, not regarding really passed value.
436 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
437 # and prefix "from_subshapes_of_" to names of partially restored subshapes.
438 # \return list of published sub-shapes
440 # @ref tui_restore_prs_params "Example"
441 def RestoreGivenSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
442 theInheritFirstArg=False, theAddPrefix=True):
443 # Example: see GEOM_TestAll.py
444 return self.RestoreGivenSubShapesO(self.myStudy, theObject, theArgs,
445 theFindMethod, theInheritFirstArg, theAddPrefix)
447 # end of l3_restore_ss
450 ## @addtogroup l3_basic_go
453 ## Create point by three coordinates.
454 # @param theX The X coordinate of the point.
455 # @param theY The Y coordinate of the point.
456 # @param theZ The Z coordinate of the point.
457 # @return New GEOM_Object, containing the created point.
459 # @ref tui_creation_point "Example"
460 def MakeVertex(self, theX, theY, theZ):
461 # Example: see GEOM_TestAll.py
462 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
463 anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
464 RaiseIfFailed("MakePointXYZ", self.BasicOp)
465 anObj.SetParameters(Parameters)
468 ## Create a point, distant from the referenced point
469 # on the given distances along the coordinate axes.
470 # @param theReference The referenced point.
471 # @param theX Displacement from the referenced point along OX axis.
472 # @param theY Displacement from the referenced point along OY axis.
473 # @param theZ Displacement from the referenced point along OZ axis.
474 # @return New GEOM_Object, containing the created point.
476 # @ref tui_creation_point "Example"
477 def MakeVertexWithRef(self,theReference, theX, theY, theZ):
478 # Example: see GEOM_TestAll.py
479 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
480 anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
481 RaiseIfFailed("MakePointWithReference", self.BasicOp)
482 anObj.SetParameters(Parameters)
485 ## Create a point, corresponding to the given parameter on the given curve.
486 # @param theRefCurve The referenced curve.
487 # @param theParameter Value of parameter on the referenced curve.
488 # @return New GEOM_Object, containing the created point.
490 # @ref tui_creation_point "Example"
491 def MakeVertexOnCurve(self,theRefCurve, theParameter):
492 # Example: see GEOM_TestAll.py
493 theParameter, Parameters = ParseParameters(theParameter)
494 anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter)
495 RaiseIfFailed("MakePointOnCurve", self.BasicOp)
496 anObj.SetParameters(Parameters)
499 ## Create a point by projection give coordinates on the given curve
500 # @param theRefCurve The referenced curve.
501 # @param theX X-coordinate in 3D space
502 # @param theY Y-coordinate in 3D space
503 # @param theZ Z-coordinate in 3D space
504 # @return New GEOM_Object, containing the created point.
506 # @ref tui_creation_point "Example"
507 def MakeVertexOnCurveByCoord(self,theRefCurve, theX, theY, theZ):
508 # Example: see GEOM_TestAll.py
509 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
510 anObj = self.BasicOp.MakePointOnCurveByCoord(theRefCurve, theX, theY, theZ)
511 RaiseIfFailed("MakeVertexOnCurveByCoord", self.BasicOp)
512 anObj.SetParameters(Parameters)
515 ## Create a point, corresponding to the given length on the given curve.
516 # @param theRefCurve The referenced curve.
517 # @param theLength Length on the referenced curve.
518 # @param theReverse Flag allowing to choose the direction for the calculation of the length (False = forward or True = reversed).
519 # @return New GEOM_Object, containing the created point.
521 # @ref tui_creation_point "Example"
522 def MakeVertexOnCurveByLength(self,theRefCurve, theLength, theReverse = False):
523 # Example: see GEOM_TestAll.py
524 theLength, Parameters = ParseParameters(theLength)
525 anObj = self.BasicOp.MakePointOnCurveByLength(theRefCurve, theLength, theReverse)
526 RaiseIfFailed("MakePointOnCurveByLength", self.BasicOp)
527 anObj.SetParameters(Parameters)
530 ## Create a point, corresponding to the given parameters on the
532 # @param theRefSurf The referenced surface.
533 # @param theUParameter Value of U-parameter on the referenced surface.
534 # @param theVParameter Value of V-parameter on the referenced surface.
535 # @return New GEOM_Object, containing the created point.
537 # @ref swig_MakeVertexOnSurface "Example"
538 def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter):
539 theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
540 # Example: see GEOM_TestAll.py
541 anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
542 RaiseIfFailed("MakePointOnSurface", self.BasicOp)
543 anObj.SetParameters(Parameters);
546 ## Create a point by projection give coordinates on the given surface
547 # @param theRefSurf The referenced surface.
548 # @param theX X-coordinate in 3D space
549 # @param theY Y-coordinate in 3D space
550 # @param theZ Z-coordinate in 3D space
551 # @return New GEOM_Object, containing the created point.
553 # @ref swig_MakeVertexOnSurfaceByCoord "Example"
554 def MakeVertexOnSurfaceByCoord(self, theRefSurf, theX, theY, theZ):
555 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
556 # Example: see GEOM_TestAll.py
557 anObj = self.BasicOp.MakePointOnSurfaceByCoord(theRefSurf, theX, theY, theZ)
558 RaiseIfFailed("MakeVertexOnSurfaceByCoord", self.BasicOp)
559 anObj.SetParameters(Parameters);
562 ## Create a point on intersection of two lines.
563 # @param theRefLine1, theRefLine2 The referenced lines.
564 # @return New GEOM_Object, containing the created point.
566 # @ref swig_MakeVertexOnLinesIntersection "Example"
567 def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2):
568 # Example: see GEOM_TestAll.py
569 anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
570 RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
573 ## Create a tangent, corresponding to the given parameter on the given curve.
574 # @param theRefCurve The referenced curve.
575 # @param theParameter Value of parameter on the referenced curve.
576 # @return New GEOM_Object, containing the created tangent.
578 # @ref swig_MakeTangentOnCurve "Example"
579 def MakeTangentOnCurve(self, theRefCurve, theParameter):
580 anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
581 RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
584 ## Create a tangent plane, corresponding to the given parameter on the given face.
585 # @param theFace The face for which tangent plane should be built.
586 # @param theParameterV vertical value of the center point (0.0 - 1.0).
587 # @param theParameterU horisontal value of the center point (0.0 - 1.0).
588 # @param theTrimSize the size of plane.
589 # @return New GEOM_Object, containing the created tangent.
591 # @ref swig_MakeTangentPlaneOnFace "Example"
592 def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize):
593 anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
594 RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
597 ## Create a vector with the given components.
598 # @param theDX X component of the vector.
599 # @param theDY Y component of the vector.
600 # @param theDZ Z component of the vector.
601 # @return New GEOM_Object, containing the created vector.
603 # @ref tui_creation_vector "Example"
604 def MakeVectorDXDYDZ(self,theDX, theDY, theDZ):
605 # Example: see GEOM_TestAll.py
606 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
607 anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
608 RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
609 anObj.SetParameters(Parameters)
612 ## Create a vector between two points.
613 # @param thePnt1 Start point for the vector.
614 # @param thePnt2 End point for the vector.
615 # @return New GEOM_Object, containing the created vector.
617 # @ref tui_creation_vector "Example"
618 def MakeVector(self,thePnt1, thePnt2):
619 # Example: see GEOM_TestAll.py
620 anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
621 RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
624 ## Create a line, passing through the given point
625 # and parrallel to the given direction
626 # @param thePnt Point. The resulting line will pass through it.
627 # @param theDir Direction. The resulting line will be parallel to it.
628 # @return New GEOM_Object, containing the created line.
630 # @ref tui_creation_line "Example"
631 def MakeLine(self,thePnt, theDir):
632 # Example: see GEOM_TestAll.py
633 anObj = self.BasicOp.MakeLine(thePnt, theDir)
634 RaiseIfFailed("MakeLine", self.BasicOp)
637 ## Create a line, passing through the given points
638 # @param thePnt1 First of two points, defining the line.
639 # @param thePnt2 Second of two points, defining the line.
640 # @return New GEOM_Object, containing the created line.
642 # @ref tui_creation_line "Example"
643 def MakeLineTwoPnt(self,thePnt1, thePnt2):
644 # Example: see GEOM_TestAll.py
645 anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
646 RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
649 ## Create a line on two faces intersection.
650 # @param theFace1 First of two faces, defining the line.
651 # @param theFace2 Second of two faces, defining the line.
652 # @return New GEOM_Object, containing the created line.
654 # @ref swig_MakeLineTwoFaces "Example"
655 def MakeLineTwoFaces(self, theFace1, theFace2):
656 # Example: see GEOM_TestAll.py
657 anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
658 RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
661 ## Create a plane, passing through the given point
662 # and normal to the given vector.
663 # @param thePnt Point, the plane has to pass through.
664 # @param theVec Vector, defining the plane normal direction.
665 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
666 # @return New GEOM_Object, containing the created plane.
668 # @ref tui_creation_plane "Example"
669 def MakePlane(self,thePnt, theVec, theTrimSize):
670 # Example: see GEOM_TestAll.py
671 theTrimSize, Parameters = ParseParameters(theTrimSize);
672 anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
673 RaiseIfFailed("MakePlanePntVec", self.BasicOp)
674 anObj.SetParameters(Parameters)
677 ## Create a plane, passing through the three given points
678 # @param thePnt1 First of three points, defining the plane.
679 # @param thePnt2 Second of three points, defining the plane.
680 # @param thePnt3 Fird of three points, defining the plane.
681 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
682 # @return New GEOM_Object, containing the created plane.
684 # @ref tui_creation_plane "Example"
685 def MakePlaneThreePnt(self,thePnt1, thePnt2, thePnt3, theTrimSize):
686 # Example: see GEOM_TestAll.py
687 theTrimSize, Parameters = ParseParameters(theTrimSize);
688 anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
689 RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
690 anObj.SetParameters(Parameters)
693 ## Create a plane, similar to the existing one, but with another size of representing face.
694 # @param theFace Referenced plane or LCS(Marker).
695 # @param theTrimSize New half size of a side of quadrangle face, representing the plane.
696 # @return New GEOM_Object, containing the created plane.
698 # @ref tui_creation_plane "Example"
699 def MakePlaneFace(self,theFace, theTrimSize):
700 # Example: see GEOM_TestAll.py
701 theTrimSize, Parameters = ParseParameters(theTrimSize);
702 anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
703 RaiseIfFailed("MakePlaneFace", self.BasicOp)
704 anObj.SetParameters(Parameters)
707 ## Create a plane, passing through the 2 vectors
708 # with center in a start point of the first vector.
709 # @param theVec1 Vector, defining center point and plane direction.
710 # @param theVec2 Vector, defining the plane normal direction.
711 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
712 # @return New GEOM_Object, containing the created plane.
714 # @ref tui_creation_plane "Example"
715 def MakePlane2Vec(self,theVec1, theVec2, theTrimSize):
716 # Example: see GEOM_TestAll.py
717 theTrimSize, Parameters = ParseParameters(theTrimSize);
718 anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
719 RaiseIfFailed("MakePlane2Vec", self.BasicOp)
720 anObj.SetParameters(Parameters)
723 ## Create a plane, based on a Local coordinate system.
724 # @param theLCS coordinate system, defining plane.
725 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
726 # @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
727 # @return New GEOM_Object, containing the created plane.
729 # @ref tui_creation_plane "Example"
730 def MakePlaneLCS(self,theLCS, theTrimSize, theOrientation):
731 # Example: see GEOM_TestAll.py
732 theTrimSize, Parameters = ParseParameters(theTrimSize);
733 anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
734 RaiseIfFailed("MakePlaneLCS", self.BasicOp)
735 anObj.SetParameters(Parameters)
738 ## Create a local coordinate system.
739 # @param OX,OY,OZ Three coordinates of coordinate system origin.
740 # @param XDX,XDY,XDZ Three components of OX direction
741 # @param YDX,YDY,YDZ Three components of OY direction
742 # @return New GEOM_Object, containing the created coordinate system.
744 # @ref swig_MakeMarker "Example"
745 def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ):
746 # Example: see GEOM_TestAll.py
747 OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
748 anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
749 RaiseIfFailed("MakeMarker", self.BasicOp)
750 anObj.SetParameters(Parameters)
753 ## Create a local coordinate system from shape.
754 # @param theShape The initial shape to detect the coordinate system.
755 # @return New GEOM_Object, containing the created coordinate system.
757 # @ref tui_creation_lcs "Example"
758 def MakeMarkerFromShape(self, theShape):
759 anObj = self.BasicOp.MakeMarkerFromShape(theShape)
760 RaiseIfFailed("MakeMarkerFromShape", self.BasicOp)
763 ## Create a local coordinate system from point and two vectors.
764 # @param theOrigin Point of coordinate system origin.
765 # @param theXVec Vector of X direction
766 # @param theYVec Vector of Y direction
767 # @return New GEOM_Object, containing the created coordinate system.
769 # @ref tui_creation_lcs "Example"
770 def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec):
771 anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec)
772 RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp)
778 ## @addtogroup l4_curves
781 ## Create an arc of circle, passing through three given points.
782 # @param thePnt1 Start point of the arc.
783 # @param thePnt2 Middle point of the arc.
784 # @param thePnt3 End point of the arc.
785 # @return New GEOM_Object, containing the created arc.
787 # @ref swig_MakeArc "Example"
788 def MakeArc(self,thePnt1, thePnt2, thePnt3):
789 # Example: see GEOM_TestAll.py
790 anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
791 RaiseIfFailed("MakeArc", self.CurvesOp)
794 ## Create an arc of circle from a center and 2 points.
795 # @param thePnt1 Center of the arc
796 # @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
797 # @param thePnt3 End point of the arc (Gives also a direction)
798 # @param theSense Orientation of the arc
799 # @return New GEOM_Object, containing the created arc.
801 # @ref swig_MakeArc "Example"
802 def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False):
803 # Example: see GEOM_TestAll.py
804 anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
805 RaiseIfFailed("MakeArcCenter", self.CurvesOp)
808 ## Create an arc of ellipse, of center and two points.
809 # @param theCenter Center of the arc.
810 # @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
811 # @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
812 # @return New GEOM_Object, containing the created arc.
814 # @ref swig_MakeArc "Example"
815 def MakeArcOfEllipse(self,theCenter, thePnt1, thePnt2):
816 # Example: see GEOM_TestAll.py
817 anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
818 RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
821 ## Create a circle with given center, normal vector and radius.
822 # @param thePnt Circle center.
823 # @param theVec Vector, normal to the plane of the circle.
824 # @param theR Circle radius.
825 # @return New GEOM_Object, containing the created circle.
827 # @ref tui_creation_circle "Example"
828 def MakeCircle(self, thePnt, theVec, theR):
829 # Example: see GEOM_TestAll.py
830 theR, Parameters = ParseParameters(theR)
831 anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
832 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
833 anObj.SetParameters(Parameters)
836 ## Create a circle with given radius.
837 # Center of the circle will be in the origin of global
838 # coordinate system and normal vector will be codirected with Z axis
839 # @param theR Circle radius.
840 # @return New GEOM_Object, containing the created circle.
841 def MakeCircleR(self, theR):
842 anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
843 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
846 ## Create a circle, passing through three given points
847 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
848 # @return New GEOM_Object, containing the created circle.
850 # @ref tui_creation_circle "Example"
851 def MakeCircleThreePnt(self,thePnt1, thePnt2, thePnt3):
852 # Example: see GEOM_TestAll.py
853 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
854 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
857 ## Create a circle, with given point1 as center,
858 # passing through the point2 as radius and laying in the plane,
859 # defined by all three given points.
860 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
861 # @return New GEOM_Object, containing the created circle.
863 # @ref swig_MakeCircle "Example"
864 def MakeCircleCenter2Pnt(self,thePnt1, thePnt2, thePnt3):
865 # Example: see GEOM_example6.py
866 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
867 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
870 ## Create an ellipse with given center, normal vector and radiuses.
871 # @param thePnt Ellipse center.
872 # @param theVec Vector, normal to the plane of the ellipse.
873 # @param theRMajor Major ellipse radius.
874 # @param theRMinor Minor ellipse radius.
875 # @param theVecMaj Vector, direction of the ellipse's main axis.
876 # @return New GEOM_Object, containing the created ellipse.
878 # @ref tui_creation_ellipse "Example"
879 def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None):
880 # Example: see GEOM_TestAll.py
881 theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
882 if theVecMaj is not None:
883 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
885 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
887 RaiseIfFailed("MakeEllipse", self.CurvesOp)
888 anObj.SetParameters(Parameters)
891 ## Create an ellipse with given radiuses.
892 # Center of the ellipse will be in the origin of global
893 # coordinate system and normal vector will be codirected with Z axis
894 # @param theRMajor Major ellipse radius.
895 # @param theRMinor Minor ellipse radius.
896 # @return New GEOM_Object, containing the created ellipse.
897 def MakeEllipseRR(self, theRMajor, theRMinor):
898 anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
899 RaiseIfFailed("MakeEllipse", self.CurvesOp)
902 ## Create a polyline on the set of points.
903 # @param thePoints Sequence of points for the polyline.
904 # @return New GEOM_Object, containing the created polyline.
906 # @ref tui_creation_curve "Example"
907 def MakePolyline(self,thePoints):
908 # Example: see GEOM_TestAll.py
909 anObj = self.CurvesOp.MakePolyline(thePoints)
910 RaiseIfFailed("MakePolyline", self.CurvesOp)
913 ## Create bezier curve on the set of points.
914 # @param thePoints Sequence of points for the bezier curve.
915 # @return New GEOM_Object, containing the created bezier curve.
917 # @ref tui_creation_curve "Example"
918 def MakeBezier(self,thePoints):
919 # Example: see GEOM_TestAll.py
920 anObj = self.CurvesOp.MakeSplineBezier(thePoints)
921 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
924 ## Create B-Spline curve on the set of points.
925 # @param thePoints Sequence of points for the B-Spline curve.
926 # @param theIsClosed If True, build a closed curve.
927 # @return New GEOM_Object, containing the created B-Spline curve.
929 # @ref tui_creation_curve "Example"
930 def MakeInterpol(self, thePoints, theIsClosed=False):
931 # Example: see GEOM_TestAll.py
932 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed)
933 RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
939 ## @addtogroup l3_sketcher
942 ## Create a sketcher (wire or face), following the textual description,
943 # passed through <VAR>theCommand</VAR> argument. \n
944 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
945 # Format of the description string have to be the following:
947 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
950 # - x1, y1 are coordinates of the first sketcher point (zero by default),
952 # - "R angle" : Set the direction by angle
953 # - "D dx dy" : Set the direction by DX & DY
956 # - "TT x y" : Create segment by point at X & Y
957 # - "T dx dy" : Create segment by point with DX & DY
958 # - "L length" : Create segment by direction & Length
959 # - "IX x" : Create segment by direction & Intersect. X
960 # - "IY y" : Create segment by direction & Intersect. Y
963 # - "C radius length" : Create arc by direction, radius and length(in degree)
964 # - "AA x y": Create arc by point at X & Y
965 # - "A dx dy" : Create arc by point with DX & DY
966 # - "A dx dy" : Create arc by point with DX & DY
967 # - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
968 # - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
969 # - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
970 # - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
973 # - "WW" : Close Wire (to finish)
974 # - "WF" : Close Wire and build face (to finish)
977 # - Flag1 (= reverse) is 0 or 2 ...
978 # - if 0 the drawn arc is the one of lower angle (< Pi)
979 # - if 2 the drawn arc ius the one of greater angle (> Pi)
982 # - Flag2 (= control tolerance) is 0 or 1 ...
983 # - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
984 # - if 1 the wire is built only if the end point is on the arc
985 # with a tolerance of 10^-7 on the distance else the creation fails
987 # @param theCommand String, defining the sketcher in local
988 # coordinates of the working plane.
989 # @param theWorkingPlane Nine double values, defining origin,
990 # OZ and OX directions of the working plane.
991 # @return New GEOM_Object, containing the created wire.
993 # @ref tui_sketcher_page "Example"
994 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0]):
995 # Example: see GEOM_TestAll.py
996 theCommand,Parameters = ParseSketcherCommand(theCommand)
997 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
998 RaiseIfFailed("MakeSketcher", self.CurvesOp)
999 anObj.SetParameters(Parameters)
1002 ## Create a sketcher (wire or face), following the textual description,
1003 # passed through <VAR>theCommand</VAR> argument. \n
1004 # For format of the description string see the previous method.\n
1005 # @param theCommand String, defining the sketcher in local
1006 # coordinates of the working plane.
1007 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
1008 # @return New GEOM_Object, containing the created wire.
1010 # @ref tui_sketcher_page "Example"
1011 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane):
1012 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
1013 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
1016 ## Create a sketcher wire, following the numerical description,
1017 # passed through <VAR>theCoordinates</VAR> argument. \n
1018 # @param theCoordinates double values, defining points to create a wire,
1020 # @return New GEOM_Object, containing the created wire.
1022 # @ref tui_sketcher_page "Example"
1023 def Make3DSketcher(self, theCoordinates):
1024 theCoordinates,Parameters = ParseParameters(theCoordinates)
1025 anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
1026 RaiseIfFailed("Make3DSketcher", self.CurvesOp)
1027 anObj.SetParameters(Parameters)
1030 # end of l3_sketcher
1033 ## @addtogroup l3_3d_primitives
1036 ## Create a box by coordinates of two opposite vertices.
1038 # @ref tui_creation_box "Example"
1039 def MakeBox(self,x1,y1,z1,x2,y2,z2):
1040 # Example: see GEOM_TestAll.py
1041 pnt1 = self.MakeVertex(x1,y1,z1)
1042 pnt2 = self.MakeVertex(x2,y2,z2)
1043 return self.MakeBoxTwoPnt(pnt1,pnt2)
1045 ## Create a box with specified dimensions along the coordinate axes
1046 # and with edges, parallel to the coordinate axes.
1047 # Center of the box will be at point (DX/2, DY/2, DZ/2).
1048 # @param theDX Length of Box edges, parallel to OX axis.
1049 # @param theDY Length of Box edges, parallel to OY axis.
1050 # @param theDZ Length of Box edges, parallel to OZ axis.
1051 # @return New GEOM_Object, containing the created box.
1053 # @ref tui_creation_box "Example"
1054 def MakeBoxDXDYDZ(self,theDX, theDY, theDZ):
1055 # Example: see GEOM_TestAll.py
1056 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1057 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
1058 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
1059 anObj.SetParameters(Parameters)
1062 ## Create a box with two specified opposite vertices,
1063 # and with edges, parallel to the coordinate axes
1064 # @param thePnt1 First of two opposite vertices.
1065 # @param thePnt2 Second of two opposite vertices.
1066 # @return New GEOM_Object, containing the created box.
1068 # @ref tui_creation_box "Example"
1069 def MakeBoxTwoPnt(self,thePnt1, thePnt2):
1070 # Example: see GEOM_TestAll.py
1071 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
1072 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
1075 ## Create a face with specified dimensions along OX-OY coordinate axes,
1076 # with edges, parallel to this coordinate axes.
1077 # @param theH height of Face.
1078 # @param theW width of Face.
1079 # @param theOrientation orientation belong axis OXY OYZ OZX
1080 # @return New GEOM_Object, containing the created face.
1082 # @ref tui_creation_face "Example"
1083 def MakeFaceHW(self,theH, theW, theOrientation):
1084 # Example: see GEOM_TestAll.py
1085 theH,theW,Parameters = ParseParameters(theH, theW)
1086 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
1087 RaiseIfFailed("MakeFaceHW", self.PrimOp)
1088 anObj.SetParameters(Parameters)
1091 ## Create a face from another plane and two sizes,
1092 # vertical size and horisontal size.
1093 # @param theObj Normale vector to the creating face or
1095 # @param theH Height (vertical size).
1096 # @param theW Width (horisontal size).
1097 # @return New GEOM_Object, containing the created face.
1099 # @ref tui_creation_face "Example"
1100 def MakeFaceObjHW(self, theObj, theH, theW):
1101 # Example: see GEOM_TestAll.py
1102 theH,theW,Parameters = ParseParameters(theH, theW)
1103 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
1104 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
1105 anObj.SetParameters(Parameters)
1108 ## Create a disk with given center, normal vector and radius.
1109 # @param thePnt Disk center.
1110 # @param theVec Vector, normal to the plane of the disk.
1111 # @param theR Disk radius.
1112 # @return New GEOM_Object, containing the created disk.
1114 # @ref tui_creation_disk "Example"
1115 def MakeDiskPntVecR(self,thePnt, theVec, theR):
1116 # Example: see GEOM_TestAll.py
1117 theR,Parameters = ParseParameters(theR)
1118 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
1119 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
1120 anObj.SetParameters(Parameters)
1123 ## Create a disk, passing through three given points
1124 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
1125 # @return New GEOM_Object, containing the created disk.
1127 # @ref tui_creation_disk "Example"
1128 def MakeDiskThreePnt(self,thePnt1, thePnt2, thePnt3):
1129 # Example: see GEOM_TestAll.py
1130 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
1131 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
1134 ## Create a disk with specified dimensions along OX-OY coordinate axes.
1135 # @param theR Radius of Face.
1136 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
1137 # @return New GEOM_Object, containing the created disk.
1139 # @ref tui_creation_face "Example"
1140 def MakeDiskR(self,theR, theOrientation):
1141 # Example: see GEOM_TestAll.py
1142 theR,Parameters = ParseParameters(theR)
1143 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
1144 RaiseIfFailed("MakeDiskR", self.PrimOp)
1145 anObj.SetParameters(Parameters)
1148 ## Create a cylinder with given base point, axis, radius and height.
1149 # @param thePnt Central point of cylinder base.
1150 # @param theAxis Cylinder axis.
1151 # @param theR Cylinder radius.
1152 # @param theH Cylinder height.
1153 # @return New GEOM_Object, containing the created cylinder.
1155 # @ref tui_creation_cylinder "Example"
1156 def MakeCylinder(self,thePnt, theAxis, theR, theH):
1157 # Example: see GEOM_TestAll.py
1158 theR,theH,Parameters = ParseParameters(theR, theH)
1159 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
1160 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
1161 anObj.SetParameters(Parameters)
1164 ## Create a cylinder with given radius and height at
1165 # the origin of coordinate system. Axis of the cylinder
1166 # will be collinear to the OZ axis of the coordinate system.
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 MakeCylinderRH(self,theR, theH):
1173 # Example: see GEOM_TestAll.py
1174 theR,theH,Parameters = ParseParameters(theR, theH)
1175 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
1176 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
1177 anObj.SetParameters(Parameters)
1180 ## Create a sphere with given center and radius.
1181 # @param thePnt Sphere center.
1182 # @param theR Sphere radius.
1183 # @return New GEOM_Object, containing the created sphere.
1185 # @ref tui_creation_sphere "Example"
1186 def MakeSpherePntR(self, thePnt, theR):
1187 # Example: see GEOM_TestAll.py
1188 theR,Parameters = ParseParameters(theR)
1189 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
1190 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
1191 anObj.SetParameters(Parameters)
1194 ## Create a sphere with given center and radius.
1195 # @param x,y,z Coordinates of sphere center.
1196 # @param theR Sphere radius.
1197 # @return New GEOM_Object, containing the created sphere.
1199 # @ref tui_creation_sphere "Example"
1200 def MakeSphere(self, x, y, z, theR):
1201 # Example: see GEOM_TestAll.py
1202 point = self.MakeVertex(x, y, z)
1203 anObj = self.MakeSpherePntR(point, theR)
1206 ## Create a sphere with given radius at the origin of coordinate system.
1207 # @param theR Sphere radius.
1208 # @return New GEOM_Object, containing the created sphere.
1210 # @ref tui_creation_sphere "Example"
1211 def MakeSphereR(self, theR):
1212 # Example: see GEOM_TestAll.py
1213 theR,Parameters = ParseParameters(theR)
1214 anObj = self.PrimOp.MakeSphereR(theR)
1215 RaiseIfFailed("MakeSphereR", self.PrimOp)
1216 anObj.SetParameters(Parameters)
1219 ## Create a cone with given base point, axis, height and radiuses.
1220 # @param thePnt Central point of the first cone base.
1221 # @param theAxis Cone axis.
1222 # @param theR1 Radius of the first cone base.
1223 # @param theR2 Radius of the second cone base.
1224 # \note If both radiuses are non-zero, the cone will be truncated.
1225 # \note If the radiuses are equal, a cylinder will be created instead.
1226 # @param theH Cone height.
1227 # @return New GEOM_Object, containing the created cone.
1229 # @ref tui_creation_cone "Example"
1230 def MakeCone(self,thePnt, theAxis, theR1, theR2, theH):
1231 # Example: see GEOM_TestAll.py
1232 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
1233 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
1234 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
1235 anObj.SetParameters(Parameters)
1238 ## Create a cone with given height and radiuses at
1239 # the origin of coordinate system. Axis of the cone will
1240 # be collinear to the OZ axis of the coordinate system.
1241 # @param theR1 Radius of the first cone base.
1242 # @param theR2 Radius of the second cone base.
1243 # \note If both radiuses are non-zero, the cone will be truncated.
1244 # \note If the radiuses are equal, a cylinder will be created instead.
1245 # @param theH Cone height.
1246 # @return New GEOM_Object, containing the created cone.
1248 # @ref tui_creation_cone "Example"
1249 def MakeConeR1R2H(self,theR1, theR2, theH):
1250 # Example: see GEOM_TestAll.py
1251 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
1252 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
1253 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
1254 anObj.SetParameters(Parameters)
1257 ## Create a torus with given center, normal vector and radiuses.
1258 # @param thePnt Torus central point.
1259 # @param theVec Torus axis of symmetry.
1260 # @param theRMajor Torus major radius.
1261 # @param theRMinor Torus minor radius.
1262 # @return New GEOM_Object, containing the created torus.
1264 # @ref tui_creation_torus "Example"
1265 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor):
1266 # Example: see GEOM_TestAll.py
1267 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
1268 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
1269 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
1270 anObj.SetParameters(Parameters)
1273 ## Create a torus with given radiuses at the origin of coordinate system.
1274 # @param theRMajor Torus major radius.
1275 # @param theRMinor Torus minor radius.
1276 # @return New GEOM_Object, containing the created torus.
1278 # @ref tui_creation_torus "Example"
1279 def MakeTorusRR(self, theRMajor, theRMinor):
1280 # Example: see GEOM_TestAll.py
1281 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
1282 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
1283 RaiseIfFailed("MakeTorusRR", self.PrimOp)
1284 anObj.SetParameters(Parameters)
1287 # end of l3_3d_primitives
1290 ## @addtogroup l3_complex
1293 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
1294 # @param theBase Base shape to be extruded.
1295 # @param thePoint1 First end of extrusion vector.
1296 # @param thePoint2 Second end of extrusion vector.
1297 # @return New GEOM_Object, containing the created prism.
1299 # @ref tui_creation_prism "Example"
1300 def MakePrism(self, theBase, thePoint1, thePoint2):
1301 # Example: see GEOM_TestAll.py
1302 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
1303 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
1306 ## Create a shape by extrusion of the base shape along the vector,
1307 # i.e. all the space, transfixed by the base shape during its translation
1308 # along the vector on the given distance.
1309 # @param theBase Base shape to be extruded.
1310 # @param theVec Direction of extrusion.
1311 # @param theH Prism dimension along theVec.
1312 # @return New GEOM_Object, containing the created prism.
1314 # @ref tui_creation_prism "Example"
1315 def MakePrismVecH(self, theBase, theVec, theH):
1316 # Example: see GEOM_TestAll.py
1317 theH,Parameters = ParseParameters(theH)
1318 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
1319 RaiseIfFailed("MakePrismVecH", self.PrimOp)
1320 anObj.SetParameters(Parameters)
1323 ## Create a shape by extrusion of the base shape along the vector,
1324 # i.e. all the space, transfixed by the base shape during its translation
1325 # along the vector on the given distance in 2 Ways (forward/backward) .
1326 # @param theBase Base shape to be extruded.
1327 # @param theVec Direction of extrusion.
1328 # @param theH Prism dimension along theVec in forward direction.
1329 # @return New GEOM_Object, containing the created prism.
1331 # @ref tui_creation_prism "Example"
1332 def MakePrismVecH2Ways(self, theBase, theVec, theH):
1333 # Example: see GEOM_TestAll.py
1334 theH,Parameters = ParseParameters(theH)
1335 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
1336 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
1337 anObj.SetParameters(Parameters)
1340 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
1341 # @param theBase Base shape to be extruded.
1342 # @param theDX, theDY, theDZ Directions of extrusion.
1343 # @return New GEOM_Object, containing the created prism.
1345 # @ref tui_creation_prism "Example"
1346 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ):
1347 # Example: see GEOM_TestAll.py
1348 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1349 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
1350 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
1351 anObj.SetParameters(Parameters)
1354 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
1355 # i.e. all the space, transfixed by the base shape during its translation
1356 # along the vector on the given distance in 2 Ways (forward/backward) .
1357 # @param theBase Base shape to be extruded.
1358 # @param theDX, theDY, theDZ Directions of extrusion.
1359 # @return New GEOM_Object, containing the created prism.
1361 # @ref tui_creation_prism "Example"
1362 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ):
1363 # Example: see GEOM_TestAll.py
1364 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1365 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
1366 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
1367 anObj.SetParameters(Parameters)
1370 ## Create a shape by revolution of the base shape around the axis
1371 # on the given angle, i.e. all the space, transfixed by the base
1372 # shape during its rotation around the axis on the given angle.
1373 # @param theBase Base shape to be rotated.
1374 # @param theAxis Rotation axis.
1375 # @param theAngle Rotation angle in radians.
1376 # @return New GEOM_Object, containing the created revolution.
1378 # @ref tui_creation_revolution "Example"
1379 def MakeRevolution(self, theBase, theAxis, theAngle):
1380 # Example: see GEOM_TestAll.py
1381 theAngle,Parameters = ParseParameters(theAngle)
1382 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
1383 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
1384 anObj.SetParameters(Parameters)
1387 ## The Same Revolution but in both ways forward&backward.
1388 def MakeRevolution2Ways(self, theBase, theAxis, theAngle):
1389 theAngle,Parameters = ParseParameters(theAngle)
1390 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
1391 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
1392 anObj.SetParameters(Parameters)
1395 ## Create a filling from the given compound of contours.
1396 # @param theShape the compound of contours
1397 # @param theMinDeg a minimal degree of BSpline surface to create
1398 # @param theMaxDeg a maximal degree of BSpline surface to create
1399 # @param theTol2D a 2d tolerance to be reached
1400 # @param theTol3D a 3d tolerance to be reached
1401 # @param theNbIter a number of iteration of approximation algorithm
1402 # @param theMethod Kind of method to perform filling operation:
1403 # GEOM.FOM_Default - Default - standard behaviour
1404 # /GEOM.FOM_UseOri - Use edges orientation - orientation of edges is
1405 # used: if the edge is reversed, the curve from this edge
1406 # is reversed before using it in the filling algorithm.
1407 # /GEOM.FOM_AutoCorrect - Auto-correct orientation - changes the orientation
1408 # of the curves using minimization of sum of distances
1409 # between the end points of the edges.
1410 # @param isApprox if True, BSpline curves are generated in the process
1411 # of surface construction. By default it is False, that means
1412 # the surface is created using Besier curves. The usage of
1413 # Approximation makes the algorithm work slower, but allows
1414 # building the surface for rather complex cases
1415 # @return New GEOM_Object, containing the created filling surface.
1417 # @ref tui_creation_filling "Example"
1418 def MakeFilling(self, theShape, theMinDeg, theMaxDeg, theTol2D,
1419 theTol3D, theNbIter, theMethod=GEOM.FOM_Default, isApprox=0):
1420 # Example: see GEOM_TestAll.py
1421 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
1422 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
1423 theTol2D, theTol3D, theNbIter,
1424 theMethod, isApprox)
1425 RaiseIfFailed("MakeFilling", self.PrimOp)
1426 anObj.SetParameters(Parameters)
1429 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
1430 # @param theSeqSections - set of specified sections.
1431 # @param theModeSolid - mode defining building solid or shell
1432 # @param thePreci - precision 3D used for smoothing by default 1.e-6
1433 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
1434 # @return New GEOM_Object, containing the created shell or solid.
1436 # @ref swig_todo "Example"
1437 def MakeThruSections(self,theSeqSections,theModeSolid,thePreci,theRuled):
1438 # Example: see GEOM_TestAll.py
1439 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
1440 RaiseIfFailed("MakeThruSections", self.PrimOp)
1443 ## Create a shape by extrusion of the base shape along
1444 # the path shape. The path shape can be a wire or an edge.
1445 # @param theBase Base shape to be extruded.
1446 # @param thePath Path shape to extrude the base shape along it.
1447 # @return New GEOM_Object, containing the created pipe.
1449 # @ref tui_creation_pipe "Example"
1450 def MakePipe(self,theBase, thePath):
1451 # Example: see GEOM_TestAll.py
1452 anObj = self.PrimOp.MakePipe(theBase, thePath)
1453 RaiseIfFailed("MakePipe", self.PrimOp)
1456 ## Create a shape by extrusion of the profile shape along
1457 # the path shape. The path shape can be a wire or an edge.
1458 # the several profiles can be specified in the several locations of path.
1459 # @param theSeqBases - list of Bases shape to be extruded.
1460 # @param theLocations - list of locations on the path corresponding
1461 # specified list of the Bases shapes. Number of locations
1462 # should be equal to number of bases or list of locations can be empty.
1463 # @param thePath - Path shape to extrude the base shape along it.
1464 # @param theWithContact - the mode defining that the section is translated to be in
1465 # contact with the spine.
1466 # @param theWithCorrection - defining that the section is rotated to be
1467 # orthogonal to the spine tangent in the correspondent point
1468 # @return New GEOM_Object, containing the created pipe.
1470 # @ref tui_creation_pipe_with_diff_sec "Example"
1471 def MakePipeWithDifferentSections(self, theSeqBases,
1472 theLocations, thePath,
1473 theWithContact, theWithCorrection):
1474 anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
1475 theLocations, thePath,
1476 theWithContact, theWithCorrection)
1477 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
1480 ## Create a shape by extrusion of the profile shape along
1481 # the path shape. The path shape can be a wire or a edge.
1482 # the several profiles can be specified in the several locations of path.
1483 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
1484 # shell or face. If number of faces in neighbour sections
1485 # aren't coincided result solid between such sections will
1486 # be created using external boundaries of this shells.
1487 # @param theSeqSubBases - list of corresponding subshapes of section shapes.
1488 # This list is used for searching correspondences between
1489 # faces in the sections. Size of this list must be equal
1490 # to size of list of base shapes.
1491 # @param theLocations - list of locations on the path corresponding
1492 # specified list of the Bases shapes. Number of locations
1493 # should be equal to number of bases. First and last
1494 # locations must be coincided with first and last vertexes
1495 # of path correspondingly.
1496 # @param thePath - Path shape to extrude the base shape along it.
1497 # @param theWithContact - the mode defining that the section is translated to be in
1498 # contact with the spine.
1499 # @param theWithCorrection - defining that the section is rotated to be
1500 # orthogonal to the spine tangent in the correspondent point
1501 # @return New GEOM_Object, containing the created solids.
1503 # @ref tui_creation_pipe_with_shell_sec "Example"
1504 def MakePipeWithShellSections(self,theSeqBases, theSeqSubBases,
1505 theLocations, thePath,
1506 theWithContact, theWithCorrection):
1507 anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
1508 theLocations, thePath,
1509 theWithContact, theWithCorrection)
1510 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
1513 ## Create a shape by extrusion of the profile shape along
1514 # the path shape. This function is used only for debug pipe
1515 # functionality - it is a version of previous function
1516 # (MakePipeWithShellSections(...)) which give a possibility to
1517 # recieve information about creating pipe between each pair of
1518 # sections step by step.
1519 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
1520 theLocations, thePath,
1521 theWithContact, theWithCorrection):
1523 nbsect = len(theSeqBases)
1524 nbsubsect = len(theSeqSubBases)
1525 #print "nbsect = ",nbsect
1526 for i in range(1,nbsect):
1528 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
1529 tmpLocations = [ theLocations[i-1], theLocations[i] ]
1531 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
1532 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
1533 tmpLocations, thePath,
1534 theWithContact, theWithCorrection)
1535 if self.PrimOp.IsDone() == 0:
1536 print "Problems with pipe creation between ",i," and ",i+1," sections"
1537 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
1540 print "Pipe between ",i," and ",i+1," sections is OK"
1545 resc = self.MakeCompound(res)
1546 #resc = self.MakeSewing(res, 0.001)
1547 #print "resc: ",resc
1550 ## Create solids between given sections
1551 # @param theSeqBases - list of sections (shell or face).
1552 # @param theLocations - list of corresponding vertexes
1553 # @return New GEOM_Object, containing the created solids.
1555 # @ref tui_creation_pipe_without_path "Example"
1556 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations):
1557 anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
1558 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
1561 ## Create a shape by extrusion of the base shape along
1562 # the path shape with constant bi-normal direction along the given vector.
1563 # The path shape can be a wire or an edge.
1564 # @param theBase Base shape to be extruded.
1565 # @param thePath Path shape to extrude the base shape along it.
1566 # @param theVec Vector defines a constant binormal direction to keep the
1567 # same angle beetween the direction and the sections
1568 # along the sweep surface.
1569 # @return New GEOM_Object, containing the created pipe.
1571 # @ref tui_creation_pipe "Example"
1572 def MakePipeBiNormalAlongVector(self,theBase, thePath, theVec):
1573 # Example: see GEOM_TestAll.py
1574 anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
1575 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
1581 ## @addtogroup l3_advanced
1584 ## Create a linear edge with specified ends.
1585 # @param thePnt1 Point for the first end of edge.
1586 # @param thePnt2 Point for the second end of edge.
1587 # @return New GEOM_Object, containing the created edge.
1589 # @ref tui_creation_edge "Example"
1590 def MakeEdge(self,thePnt1, thePnt2):
1591 # Example: see GEOM_TestAll.py
1592 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
1593 RaiseIfFailed("MakeEdge", self.ShapesOp)
1596 ## Create an edge from specified wire.
1597 # @param theWire source Wire.
1598 # @param theLinearTolerance linear tolerance value.
1599 # @param theAngularTolerance angular tolerance value.
1600 # @return New GEOM_Object, containing the created edge.
1602 # @ref tui_creation_edge "Example"
1603 def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12):
1604 # Example: see GEOM_TestAll.py
1605 anObj = self.ShapesOp.MakeEdgeWire(theWire, theLinearTolerance, theAngularTolerance)
1606 RaiseIfFailed("MakeEdgeWire", self.ShapesOp)
1609 ## Create a wire from the set of edges and wires.
1610 # @param theEdgesAndWires List of edges and/or wires.
1611 # @param theTolerance Maximum distance between vertices, that will be merged.
1612 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
1613 # @return New GEOM_Object, containing the created wire.
1615 # @ref tui_creation_wire "Example"
1616 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07):
1617 # Example: see GEOM_TestAll.py
1618 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
1619 RaiseIfFailed("MakeWire", self.ShapesOp)
1622 ## Create a face on the given wire.
1623 # @param theWire closed Wire or Edge to build the face on.
1624 # @param isPlanarWanted If TRUE, only planar face will be built.
1625 # If impossible, NULL object will be returned.
1626 # @return New GEOM_Object, containing the created face.
1628 # @ref tui_creation_face "Example"
1629 def MakeFace(self,theWire, isPlanarWanted):
1630 # Example: see GEOM_TestAll.py
1631 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
1632 RaiseIfFailed("MakeFace", self.ShapesOp)
1635 ## Create a face on the given wires set.
1636 # @param theWires List of closed wires or edges to build the face on.
1637 # @param isPlanarWanted If TRUE, only planar face will be built.
1638 # If impossible, NULL object will be returned.
1639 # @return New GEOM_Object, containing the created face.
1641 # @ref tui_creation_face "Example"
1642 def MakeFaceWires(self,theWires, isPlanarWanted):
1643 # Example: see GEOM_TestAll.py
1644 anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
1645 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
1648 ## Shortcut to MakeFaceWires()
1650 # @ref tui_creation_face "Example 1"
1651 # \n @ref swig_MakeFaces "Example 2"
1652 def MakeFaces(self,theWires, isPlanarWanted):
1653 # Example: see GEOM_TestOthers.py
1654 anObj = self.MakeFaceWires(theWires, isPlanarWanted)
1657 ## Create a shell from the set of faces and shells.
1658 # @param theFacesAndShells List of faces and/or shells.
1659 # @return New GEOM_Object, containing the created shell.
1661 # @ref tui_creation_shell "Example"
1662 def MakeShell(self,theFacesAndShells):
1663 # Example: see GEOM_TestAll.py
1664 anObj = self.ShapesOp.MakeShell(theFacesAndShells)
1665 RaiseIfFailed("MakeShell", self.ShapesOp)
1668 ## Create a solid, bounded by the given shells.
1669 # @param theShells Sequence of bounding shells.
1670 # @return New GEOM_Object, containing the created solid.
1672 # @ref tui_creation_solid "Example"
1673 def MakeSolid(self,theShells):
1674 # Example: see GEOM_TestAll.py
1675 anObj = self.ShapesOp.MakeSolidShells(theShells)
1676 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
1679 ## Create a compound of the given shapes.
1680 # @param theShapes List of shapes to put in compound.
1681 # @return New GEOM_Object, containing the created compound.
1683 # @ref tui_creation_compound "Example"
1684 def MakeCompound(self,theShapes):
1685 # Example: see GEOM_TestAll.py
1686 anObj = self.ShapesOp.MakeCompound(theShapes)
1687 RaiseIfFailed("MakeCompound", self.ShapesOp)
1690 # end of l3_advanced
1693 ## @addtogroup l2_measure
1696 ## Gives quantity of faces in the given shape.
1697 # @param theShape Shape to count faces of.
1698 # @return Quantity of faces.
1700 # @ref swig_NumberOf "Example"
1701 def NumberOfFaces(self, theShape):
1702 # Example: see GEOM_TestOthers.py
1703 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
1704 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
1707 ## Gives quantity of edges in the given shape.
1708 # @param theShape Shape to count edges of.
1709 # @return Quantity of edges.
1711 # @ref swig_NumberOf "Example"
1712 def NumberOfEdges(self, theShape):
1713 # Example: see GEOM_TestOthers.py
1714 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
1715 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
1718 ## Gives quantity of subshapes of type theShapeType in the given shape.
1719 # @param theShape Shape to count subshapes of.
1720 # @param theShapeType Type of subshapes to count.
1721 # @return Quantity of subshapes of given type.
1723 # @ref swig_NumberOf "Example"
1724 def NumberOfSubShapes(self, theShape, theShapeType):
1725 # Example: see GEOM_TestOthers.py
1726 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
1727 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
1730 ## Gives quantity of solids in the given shape.
1731 # @param theShape Shape to count solids in.
1732 # @return Quantity of solids.
1734 # @ref swig_NumberOf "Example"
1735 def NumberOfSolids(self, theShape):
1736 # Example: see GEOM_TestOthers.py
1737 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, ShapeType["SOLID"])
1738 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
1744 ## @addtogroup l3_healing
1747 ## Reverses an orientation the given shape.
1748 # @param theShape Shape to be reversed.
1749 # @return The reversed copy of theShape.
1751 # @ref swig_ChangeOrientation "Example"
1752 def ChangeOrientation(self,theShape):
1753 # Example: see GEOM_TestAll.py
1754 anObj = self.ShapesOp.ChangeOrientation(theShape)
1755 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
1758 ## Shortcut to ChangeOrientation()
1760 # @ref swig_OrientationChange "Example"
1761 def OrientationChange(self,theShape):
1762 # Example: see GEOM_TestOthers.py
1763 anObj = self.ChangeOrientation(theShape)
1769 ## @addtogroup l4_obtain
1772 ## Retrieve all free faces from the given shape.
1773 # Free face is a face, which is not shared between two shells of the shape.
1774 # @param theShape Shape to find free faces in.
1775 # @return List of IDs of all free faces, contained in theShape.
1777 # @ref tui_measurement_tools_page "Example"
1778 def GetFreeFacesIDs(self,theShape):
1779 # Example: see GEOM_TestOthers.py
1780 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
1781 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
1784 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
1785 # @param theShape1 Shape to find sub-shapes in.
1786 # @param theShape2 Shape to find shared sub-shapes with.
1787 # @param theShapeType Type of sub-shapes to be retrieved.
1788 # @return List of sub-shapes of theShape1, shared with theShape2.
1790 # @ref swig_GetSharedShapes "Example"
1791 def GetSharedShapes(self,theShape1, theShape2, theShapeType):
1792 # Example: see GEOM_TestOthers.py
1793 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
1794 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
1797 ## Get all sub-shapes, shared by all shapes in the list <VAR>theShapes</VAR>.
1798 # @param theShapes Shapes to find common sub-shapes of.
1799 # @param theShapeType Type of sub-shapes to be retrieved.
1800 # @return List of objects, that are sub-shapes of all given shapes.
1802 # @ref swig_GetSharedShapes "Example"
1803 def GetSharedShapesMulti(self, theShapes, theShapeType):
1804 # Example: see GEOM_TestOthers.py
1805 aList = self.ShapesOp.GetSharedShapesMulti(theShapes, theShapeType)
1806 RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
1809 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
1810 # situated relatively the specified plane by the certain way,
1811 # defined through <VAR>theState</VAR> parameter.
1812 # @param theShape Shape to find sub-shapes of.
1813 # @param theShapeType Type of sub-shapes to be retrieved.
1814 # @param theAx1 Vector (or line, or linear edge), specifying normal
1815 # direction and location of the plane to find shapes on.
1816 # @param theState The state of the subshapes to find. It can be one of
1817 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1818 # @return List of all found sub-shapes.
1820 # @ref swig_GetShapesOnPlane "Example"
1821 def GetShapesOnPlane(self,theShape, theShapeType, theAx1, theState):
1822 # Example: see GEOM_TestOthers.py
1823 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
1824 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
1827 ## Works like the above method, but returns list of sub-shapes indices
1829 # @ref swig_GetShapesOnPlaneIDs "Example"
1830 def GetShapesOnPlaneIDs(self,theShape, theShapeType, theAx1, theState):
1831 # Example: see GEOM_TestOthers.py
1832 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
1833 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
1836 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
1837 # situated relatively the specified plane by the certain way,
1838 # defined through <VAR>theState</VAR> parameter.
1839 # @param theShape Shape to find sub-shapes of.
1840 # @param theShapeType Type of sub-shapes to be retrieved.
1841 # @param theAx1 Vector (or line, or linear edge), specifying normal
1842 # direction of the plane to find shapes on.
1843 # @param thePnt Point specifying location of the plane to find shapes on.
1844 # @param theState The state of the subshapes to find. It can be one of
1845 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1846 # @return List of all found sub-shapes.
1848 # @ref swig_GetShapesOnPlaneWithLocation "Example"
1849 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState):
1850 # Example: see GEOM_TestOthers.py
1851 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
1852 theAx1, thePnt, theState)
1853 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
1856 ## Works like the above method, but returns list of sub-shapes indices
1858 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
1859 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
1860 # Example: see GEOM_TestOthers.py
1861 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
1862 theAx1, thePnt, theState)
1863 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
1866 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1867 # the specified cylinder by the certain way, defined through \a theState parameter.
1868 # @param theShape Shape to find sub-shapes of.
1869 # @param theShapeType Type of sub-shapes to be retrieved.
1870 # @param theAxis Vector (or line, or linear edge), specifying
1871 # axis of the cylinder to find shapes on.
1872 # @param theRadius Radius of the cylinder to find shapes on.
1873 # @param theState The state of the subshapes to find. It can be one of
1874 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1875 # @return List of all found sub-shapes.
1877 # @ref swig_GetShapesOnCylinder "Example"
1878 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState):
1879 # Example: see GEOM_TestOthers.py
1880 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
1881 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
1884 ## Works like the above method, but returns list of sub-shapes indices
1886 # @ref swig_GetShapesOnCylinderIDs "Example"
1887 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
1888 # Example: see GEOM_TestOthers.py
1889 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
1890 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
1893 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1894 # the specified cylinder by the certain way, defined through \a theState parameter.
1895 # @param theShape Shape to find sub-shapes of.
1896 # @param theShapeType Type of sub-shapes to be retrieved.
1897 # @param theAxis Vector (or line, or linear edge), specifying
1898 # axis of the cylinder to find shapes on.
1899 # @param thePnt Point specifying location of the bottom of the cylinder.
1900 # @param theRadius Radius of the cylinder to find shapes on.
1901 # @param theState The state of the subshapes to find. It can be one of
1902 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1903 # @return List of all found sub-shapes.
1905 # @ref swig_GetShapesOnCylinderWithLocation "Example"
1906 def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
1907 # Example: see GEOM_TestOthers.py
1908 aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
1909 RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
1912 ## Works like the above method, but returns list of sub-shapes indices
1914 # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
1915 def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
1916 # Example: see GEOM_TestOthers.py
1917 aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
1918 RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
1921 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1922 # the specified sphere by the certain way, defined through \a theState parameter.
1923 # @param theShape Shape to find sub-shapes of.
1924 # @param theShapeType Type of sub-shapes to be retrieved.
1925 # @param theCenter Point, specifying center of the sphere to find shapes on.
1926 # @param theRadius Radius of the sphere to find shapes on.
1927 # @param theState The state of the subshapes to find. It can be one of
1928 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1929 # @return List of all found sub-shapes.
1931 # @ref swig_GetShapesOnSphere "Example"
1932 def GetShapesOnSphere(self,theShape, theShapeType, theCenter, theRadius, theState):
1933 # Example: see GEOM_TestOthers.py
1934 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
1935 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
1938 ## Works like the above method, but returns list of sub-shapes indices
1940 # @ref swig_GetShapesOnSphereIDs "Example"
1941 def GetShapesOnSphereIDs(self,theShape, theShapeType, theCenter, theRadius, theState):
1942 # Example: see GEOM_TestOthers.py
1943 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
1944 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
1947 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1948 # the specified quadrangle by the certain way, defined through \a theState parameter.
1949 # @param theShape Shape to find sub-shapes of.
1950 # @param theShapeType Type of sub-shapes to be retrieved.
1951 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
1952 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
1953 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
1954 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
1955 # @param theState The state of the subshapes to find. It can be one of
1956 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1957 # @return List of all found sub-shapes.
1959 # @ref swig_GetShapesOnQuadrangle "Example"
1960 def GetShapesOnQuadrangle(self, theShape, theShapeType,
1961 theTopLeftPoint, theTopRigthPoint,
1962 theBottomLeftPoint, theBottomRigthPoint, theState):
1963 # Example: see GEOM_TestOthers.py
1964 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
1965 theTopLeftPoint, theTopRigthPoint,
1966 theBottomLeftPoint, theBottomRigthPoint, theState)
1967 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
1970 ## Works like the above method, but returns list of sub-shapes indices
1972 # @ref swig_GetShapesOnQuadrangleIDs "Example"
1973 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
1974 theTopLeftPoint, theTopRigthPoint,
1975 theBottomLeftPoint, theBottomRigthPoint, theState):
1976 # Example: see GEOM_TestOthers.py
1977 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
1978 theTopLeftPoint, theTopRigthPoint,
1979 theBottomLeftPoint, theBottomRigthPoint, theState)
1980 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
1983 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1984 # the specified \a theBox by the certain way, defined through \a theState parameter.
1985 # @param theBox Shape for relative comparing.
1986 # @param theShape Shape to find sub-shapes of.
1987 # @param theShapeType Type of sub-shapes to be retrieved.
1988 # @param theState The state of the subshapes to find. It can be one of
1989 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1990 # @return List of all found sub-shapes.
1992 # @ref swig_GetShapesOnBox "Example"
1993 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState):
1994 # Example: see GEOM_TestOthers.py
1995 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
1996 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
1999 ## Works like the above method, but returns list of sub-shapes indices
2001 # @ref swig_GetShapesOnBoxIDs "Example"
2002 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
2003 # Example: see GEOM_TestOthers.py
2004 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
2005 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
2008 ## Find in \a theShape all sub-shapes of type \a theShapeType,
2009 # situated relatively the specified \a theCheckShape by the
2010 # certain way, defined through \a theState parameter.
2011 # @param theCheckShape Shape for relative comparing. It must be a solid.
2012 # @param theShape Shape to find sub-shapes of.
2013 # @param theShapeType Type of sub-shapes to be retrieved.
2014 # @param theState The state of the subshapes to find. It can be one of
2015 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
2016 # @return List of all found sub-shapes.
2018 # @ref swig_GetShapesOnShape "Example"
2019 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState):
2020 # Example: see GEOM_TestOthers.py
2021 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
2022 theShapeType, theState)
2023 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
2026 ## Works like the above method, but returns result as compound
2028 # @ref swig_GetShapesOnShapeAsCompound "Example"
2029 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState):
2030 # Example: see GEOM_TestOthers.py
2031 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
2032 theShapeType, theState)
2033 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
2036 ## Works like the above method, but returns list of sub-shapes indices
2038 # @ref swig_GetShapesOnShapeIDs "Example"
2039 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
2040 # Example: see GEOM_TestOthers.py
2041 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
2042 theShapeType, theState)
2043 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
2046 ## Get sub-shape(s) of theShapeWhere, which are
2047 # coincident with \a theShapeWhat or could be a part of it.
2048 # @param theShapeWhere Shape to find sub-shapes of.
2049 # @param theShapeWhat Shape, specifying what to find.
2050 # @return Group of all found sub-shapes or a single found sub-shape.
2052 # @note This function has a restriction on argument shapes.
2053 # If \a theShapeWhere has curved parts with significantly
2054 # outstanding centres (i.e. the mass centre of a part is closer to
2055 # \a theShapeWhat than to the part), such parts will not be found.
2056 # @image html get_in_place_lost_part.png
2058 # @ref swig_GetInPlace "Example"
2059 def GetInPlace(self, theShapeWhere, theShapeWhat):
2060 # Example: see GEOM_TestOthers.py
2061 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
2062 RaiseIfFailed("GetInPlace", self.ShapesOp)
2065 ## Get sub-shape(s) of \a theShapeWhere, which are
2066 # coincident with \a theShapeWhat or could be a part of it.
2068 # Implementation of this method is based on a saved history of an operation,
2069 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
2070 # arguments (an argument shape or a sub-shape of an argument shape).
2071 # The operation could be the Partition or one of boolean operations,
2072 # performed on simple shapes (not on compounds).
2074 # @param theShapeWhere Shape to find sub-shapes of.
2075 # @param theShapeWhat Shape, specifying what to find (must be in the
2076 # building history of the ShapeWhere).
2077 # @return Group of all found sub-shapes or a single found sub-shape.
2079 # @ref swig_GetInPlace "Example"
2080 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat):
2081 # Example: see GEOM_TestOthers.py
2082 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
2083 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
2086 ## Get sub-shape of theShapeWhere, which is
2087 # equal to \a theShapeWhat.
2088 # @param theShapeWhere Shape to find sub-shape of.
2089 # @param theShapeWhat Shape, specifying what to find.
2090 # @return New GEOM_Object for found sub-shape.
2092 # @ref swig_GetSame "Example"
2093 def GetSame(self,theShapeWhere, theShapeWhat):
2094 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
2095 RaiseIfFailed("GetSame", self.ShapesOp)
2101 ## @addtogroup l4_access
2104 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
2105 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
2107 # @ref swig_all_decompose "Example"
2108 def GetSubShape(self, aShape, ListOfID):
2109 # Example: see GEOM_TestAll.py
2110 anObj = self.AddSubShape(aShape,ListOfID)
2113 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
2115 # @ref swig_all_decompose "Example"
2116 def GetSubShapeID(self, aShape, aSubShape):
2117 # Example: see GEOM_TestAll.py
2118 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
2119 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
2125 ## @addtogroup l4_decompose
2128 ## Get all sub-shapes and groups of \a theShape,
2129 # that were created already by any other methods.
2130 # @param theShape Any shape.
2131 # @param theGroupsOnly If this parameter is TRUE, only groups will be
2132 # returned, else all found sub-shapes and groups.
2133 # @return List of existing sub-objects of \a theShape.
2135 # @ref swig_all_decompose "Example"
2136 def GetExistingSubObjects(self, theShape, theGroupsOnly = False):
2137 # Example: see GEOM_TestAll.py
2138 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, theGroupsOnly)
2139 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
2142 ## Get all groups of \a theShape,
2143 # that were created already by any other methods.
2144 # @param theShape Any shape.
2145 # @return List of existing groups of \a theShape.
2147 # @ref swig_all_decompose "Example"
2148 def GetGroups(self, theShape):
2149 # Example: see GEOM_TestAll.py
2150 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, True)
2151 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
2154 ## Explode a shape on subshapes of a given type.
2155 # If the shape itself matches the type, it is also returned.
2156 # @param aShape Shape to be exploded.
2157 # @param aType Type of sub-shapes to be retrieved.
2158 # @return List of sub-shapes of type theShapeType, contained in theShape.
2160 # @ref swig_all_decompose "Example"
2161 def SubShapeAll(self, aShape, aType):
2162 # Example: see GEOM_TestAll.py
2163 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, aType, False)
2164 RaiseIfFailed("SubShapeAll", self.ShapesOp)
2167 ## Explode a shape on subshapes of a given type.
2168 # @param aShape Shape to be exploded.
2169 # @param aType Type of sub-shapes to be retrieved.
2170 # @return List of IDs of sub-shapes.
2172 # @ref swig_all_decompose "Example"
2173 def SubShapeAllIDs(self, aShape, aType):
2174 ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, aType, False)
2175 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
2178 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
2179 # selected by they indices in list of all sub-shapes of type <VAR>aType</VAR>.
2180 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
2182 # @ref swig_all_decompose "Example"
2183 def SubShape(self, aShape, aType, ListOfInd):
2184 # Example: see GEOM_TestAll.py
2186 AllShapeIDsList = self.SubShapeAllIDs(aShape, aType)
2187 for ind in ListOfInd:
2188 ListOfIDs.append(AllShapeIDsList[ind - 1])
2189 anObj = self.GetSubShape(aShape, ListOfIDs)
2192 ## Explode a shape on subshapes of a given type.
2193 # Sub-shapes will be sorted by coordinates of their gravity centers.
2194 # If the shape itself matches the type, it is also returned.
2195 # @param aShape Shape to be exploded.
2196 # @param aType Type of sub-shapes to be retrieved.
2197 # @return List of sub-shapes of type theShapeType, contained in theShape.
2199 # @ref swig_SubShapeAllSorted "Example"
2200 def SubShapeAllSortedCentres(self, aShape, aType):
2201 # Example: see GEOM_TestAll.py
2202 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, aType, True)
2203 RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
2206 ## Explode a shape on subshapes of a given type.
2207 # Sub-shapes will be sorted by coordinates of their gravity centers.
2208 # @param aShape Shape to be exploded.
2209 # @param aType Type of sub-shapes to be retrieved.
2210 # @return List of IDs of sub-shapes.
2212 # @ref swig_all_decompose "Example"
2213 def SubShapeAllSortedCentresIDs(self, aShape, aType):
2214 ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, aType, True)
2215 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
2218 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
2219 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
2220 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
2222 # @ref swig_all_decompose "Example"
2223 def SubShapeSortedCentres(self, aShape, aType, ListOfInd):
2224 # Example: see GEOM_TestAll.py
2226 AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, aType)
2227 for ind in ListOfInd:
2228 ListOfIDs.append(AllShapeIDsList[ind - 1])
2229 anObj = self.GetSubShape(aShape, ListOfIDs)
2232 ## Extract shapes (excluding the main shape) of given type.
2233 # @param aShape The shape.
2234 # @param aType The shape type.
2235 # @param isSorted Boolean flag to switch sorting on/off.
2236 # @return List of sub-shapes of type aType, contained in aShape.
2238 # @ref swig_FilletChamfer "Example"
2239 def ExtractShapes(self, aShape, aType, isSorted = False):
2240 # Example: see GEOM_TestAll.py
2241 ListObj = self.ShapesOp.ExtractSubShapes(aShape, aType, isSorted)
2242 RaiseIfFailed("ExtractSubShapes", self.ShapesOp)
2245 # end of l4_decompose
2248 ## @addtogroup l4_decompose_d
2251 ## Deprecated method
2252 # It works like SubShapeAllSortedCentres, but wrongly
2253 # defines centres of faces, shells and solids.
2254 def SubShapeAllSorted(self, aShape, aType):
2255 ListObj = self.ShapesOp.MakeExplode(aShape, aType, True)
2256 RaiseIfFailed("MakeExplode", self.ShapesOp)
2259 ## Deprecated method
2260 # It works like SubShapeAllSortedCentresIDs, but wrongly
2261 # defines centres of faces, shells and solids.
2262 def SubShapeAllSortedIDs(self, aShape, aType):
2263 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, aType, True)
2264 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
2267 ## Deprecated method
2268 # It works like SubShapeSortedCentres, but has a bug
2269 # (wrongly defines centres of faces, shells and solids).
2270 def SubShapeSorted(self, aShape, aType, ListOfInd):
2272 AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, aType)
2273 for ind in ListOfInd:
2274 ListOfIDs.append(AllShapeIDsList[ind - 1])
2275 anObj = self.GetSubShape(aShape, ListOfIDs)
2278 # end of l4_decompose_d
2281 ## @addtogroup l3_healing
2284 ## Apply a sequence of Shape Healing operators to the given object.
2285 # @param theShape Shape to be processed.
2286 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
2287 # @param theParameters List of names of parameters
2288 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
2289 # @param theValues List of values of parameters, in the same order
2290 # as parameters are listed in <VAR>theParameters</VAR> list.
2291 # @return New GEOM_Object, containing processed shape.
2293 # @ref tui_shape_processing "Example"
2294 def ProcessShape(self, theShape, theOperators, theParameters, theValues):
2295 # Example: see GEOM_TestHealing.py
2296 theValues,Parameters = ParseList(theValues)
2297 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
2298 # To avoid script failure in case of good argument shape
2299 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
2301 RaiseIfFailed("ProcessShape", self.HealOp)
2302 for string in (theOperators + theParameters):
2303 Parameters = ":" + Parameters
2305 anObj.SetParameters(Parameters)
2308 ## Remove faces from the given object (shape).
2309 # @param theObject Shape to be processed.
2310 # @param theFaces Indices of faces to be removed, if EMPTY then the method
2311 # removes ALL faces of the given object.
2312 # @return New GEOM_Object, containing processed shape.
2314 # @ref tui_suppress_faces "Example"
2315 def SuppressFaces(self,theObject, theFaces):
2316 # Example: see GEOM_TestHealing.py
2317 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
2318 RaiseIfFailed("SuppressFaces", self.HealOp)
2321 ## Sewing of some shapes into single shape.
2323 # @ref tui_sewing "Example"
2324 def MakeSewing(self, ListShape, theTolerance):
2325 # Example: see GEOM_TestHealing.py
2326 comp = self.MakeCompound(ListShape)
2327 anObj = self.Sew(comp, theTolerance)
2330 ## Sewing of the given object.
2331 # @param theObject Shape to be processed.
2332 # @param theTolerance Required tolerance value.
2333 # @return New GEOM_Object, containing processed shape.
2334 def Sew(self, theObject, theTolerance):
2335 # Example: see MakeSewing() above
2336 theTolerance,Parameters = ParseParameters(theTolerance)
2337 anObj = self.HealOp.Sew(theObject, theTolerance)
2338 RaiseIfFailed("Sew", self.HealOp)
2339 anObj.SetParameters(Parameters)
2342 ## Remove internal wires and edges from the given object (face).
2343 # @param theObject Shape to be processed.
2344 # @param theWires Indices of wires to be removed, if EMPTY then the method
2345 # removes ALL internal wires of the given object.
2346 # @return New GEOM_Object, containing processed shape.
2348 # @ref tui_suppress_internal_wires "Example"
2349 def SuppressInternalWires(self,theObject, theWires):
2350 # Example: see GEOM_TestHealing.py
2351 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
2352 RaiseIfFailed("RemoveIntWires", self.HealOp)
2355 ## Remove internal closed contours (holes) from the given object.
2356 # @param theObject Shape to be processed.
2357 # @param theWires Indices of wires to be removed, if EMPTY then the method
2358 # removes ALL internal holes of the given object
2359 # @return New GEOM_Object, containing processed shape.
2361 # @ref tui_suppress_holes "Example"
2362 def SuppressHoles(self,theObject, theWires):
2363 # Example: see GEOM_TestHealing.py
2364 anObj = self.HealOp.FillHoles(theObject, theWires)
2365 RaiseIfFailed("FillHoles", self.HealOp)
2368 ## Close an open wire.
2369 # @param theObject Shape to be processed.
2370 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
2371 # if [ ], then <VAR>theObject</VAR> itself is a wire.
2372 # @param isCommonVertex If True : closure by creation of a common vertex,
2373 # If False : closure by creation of an edge between ends.
2374 # @return New GEOM_Object, containing processed shape.
2376 # @ref tui_close_contour "Example"
2377 def CloseContour(self,theObject, theWires, isCommonVertex):
2378 # Example: see GEOM_TestHealing.py
2379 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
2380 RaiseIfFailed("CloseContour", self.HealOp)
2383 ## Addition of a point to a given edge object.
2384 # @param theObject Shape to be processed.
2385 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
2386 # if -1, then theObject itself is the edge.
2387 # @param theValue Value of parameter on edge or length parameter,
2388 # depending on \a isByParameter.
2389 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1],
2390 # if FALSE : \a theValue is treated as a length parameter [0..1]
2391 # @return New GEOM_Object, containing processed shape.
2393 # @ref tui_add_point_on_edge "Example"
2394 def DivideEdge(self,theObject, theEdgeIndex, theValue, isByParameter):
2395 # Example: see GEOM_TestHealing.py
2396 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
2397 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
2398 RaiseIfFailed("DivideEdge", self.HealOp)
2399 anObj.SetParameters(Parameters)
2402 ## Change orientation of the given object. Updates given shape.
2403 # @param theObject Shape to be processed.
2405 # @ref swig_todo "Example"
2406 def ChangeOrientationShell(self,theObject):
2407 theObject = self.HealOp.ChangeOrientation(theObject)
2408 RaiseIfFailed("ChangeOrientation", self.HealOp)
2411 ## Change orientation of the given object.
2412 # @param theObject Shape to be processed.
2413 # @return New GEOM_Object, containing processed shape.
2415 # @ref swig_todo "Example"
2416 def ChangeOrientationShellCopy(self, theObject):
2417 anObj = self.HealOp.ChangeOrientationCopy(theObject)
2418 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
2421 ## Try to limit tolerance of the given object by value \a theTolerance.
2422 # @param theObject Shape to be processed.
2423 # @param theTolerance Required tolerance value.
2424 # @return New GEOM_Object, containing processed shape.
2426 # @ref tui_limit_tolerance "Example"
2427 def LimitTolerance(self, theObject, theTolerance = 1e-07):
2428 anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
2429 RaiseIfFailed("LimitTolerance", self.HealOp)
2432 ## Get a list of wires (wrapped in GEOM_Object-s),
2433 # that constitute a free boundary of the given shape.
2434 # @param theObject Shape to get free boundary of.
2435 # @return [status, theClosedWires, theOpenWires]
2436 # status: FALSE, if an error(s) occured during the method execution.
2437 # theClosedWires: Closed wires on the free boundary of the given shape.
2438 # theOpenWires: Open wires on the free boundary of the given shape.
2440 # @ref tui_measurement_tools_page "Example"
2441 def GetFreeBoundary(self, theObject):
2442 # Example: see GEOM_TestHealing.py
2443 anObj = self.HealOp.GetFreeBoundary(theObject)
2444 RaiseIfFailed("GetFreeBoundary", self.HealOp)
2447 ## Replace coincident faces in theShape by one face.
2448 # @param theShape Initial shape.
2449 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
2450 # @param doKeepNonSolids If FALSE, only solids will present in the result,
2451 # otherwise all initial shapes.
2452 # @return New GEOM_Object, containing a copy of theShape without coincident faces.
2454 # @ref tui_glue_faces "Example"
2455 def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True):
2456 # Example: see GEOM_Spanner.py
2457 theTolerance,Parameters = ParseParameters(theTolerance)
2458 anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
2460 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
2461 anObj.SetParameters(Parameters)
2464 ## Find coincident faces in theShape for possible gluing.
2465 # @param theShape Initial shape.
2466 # @param theTolerance Maximum distance between faces,
2467 # which can be considered as coincident.
2470 # @ref swig_todo "Example"
2471 def GetGlueFaces(self, theShape, theTolerance):
2472 # Example: see GEOM_Spanner.py
2473 anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
2474 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
2477 ## Replace coincident faces in theShape by one face
2478 # in compliance with given list of faces
2479 # @param theShape Initial shape.
2480 # @param theTolerance Maximum distance between faces,
2481 # which can be considered as coincident.
2482 # @param theFaces List of faces for gluing.
2483 # @param doKeepNonSolids If FALSE, only solids will present in the result,
2484 # otherwise all initial shapes.
2485 # @return New GEOM_Object, containing a copy of theShape
2486 # without some faces.
2488 # @ref swig_todo "Example"
2489 def MakeGlueFacesByList(self, theShape, theTolerance, theFaces, doKeepNonSolids=True):
2490 # Example: see GEOM_Spanner.py
2491 anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces, doKeepNonSolids)
2493 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
2499 ## @addtogroup l3_boolean Boolean Operations
2502 # -----------------------------------------------------------------------------
2503 # Boolean (Common, Cut, Fuse, Section)
2504 # -----------------------------------------------------------------------------
2506 ## Perform one of boolean operations on two given shapes.
2507 # @param theShape1 First argument for boolean operation.
2508 # @param theShape2 Second argument for boolean operation.
2509 # @param theOperation Indicates the operation to be done:
2510 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
2511 # @return New GEOM_Object, containing the result shape.
2513 # @ref tui_fuse "Example"
2514 def MakeBoolean(self,theShape1, theShape2, theOperation):
2515 # Example: see GEOM_TestAll.py
2516 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation)
2517 RaiseIfFailed("MakeBoolean", self.BoolOp)
2520 ## Shortcut to MakeBoolean(s1, s2, 1)
2522 # @ref tui_common "Example 1"
2523 # \n @ref swig_MakeCommon "Example 2"
2524 def MakeCommon(self, s1, s2):
2525 # Example: see GEOM_TestOthers.py
2526 return self.MakeBoolean(s1, s2, 1)
2528 ## Shortcut to MakeBoolean(s1, s2, 2)
2530 # @ref tui_cut "Example 1"
2531 # \n @ref swig_MakeCommon "Example 2"
2532 def MakeCut(self, s1, s2):
2533 # Example: see GEOM_TestOthers.py
2534 return self.MakeBoolean(s1, s2, 2)
2536 ## Shortcut to MakeBoolean(s1, s2, 3)
2538 # @ref tui_fuse "Example 1"
2539 # \n @ref swig_MakeCommon "Example 2"
2540 def MakeFuse(self, s1, s2):
2541 # Example: see GEOM_TestOthers.py
2542 return self.MakeBoolean(s1, s2, 3)
2544 ## Shortcut to MakeBoolean(s1, s2, 4)
2546 # @ref tui_section "Example 1"
2547 # \n @ref swig_MakeCommon "Example 2"
2548 def MakeSection(self, s1, s2):
2549 # Example: see GEOM_TestOthers.py
2550 return self.MakeBoolean(s1, s2, 4)
2555 ## @addtogroup l3_basic_op
2558 ## Perform partition operation.
2559 # @param ListShapes Shapes to be intersected.
2560 # @param ListTools Shapes to intersect theShapes.
2561 # !!!NOTE: Each compound from ListShapes and ListTools will be exploded
2562 # in order to avoid possible intersection between shapes from
2564 # @param Limit Type of resulting shapes (corresponding to TopAbs_ShapeEnum).
2565 # If this parameter is set to -1 ("Auto"), most appropriate shape limit
2566 # type will be detected automatically.
2567 # @param KeepNonlimitShapes: if this parameter == 0, then only shapes of
2568 # target type (equal to Limit) are kept in the result,
2569 # else standalone shapes of lower dimension
2570 # are kept also (if they exist).
2572 # After implementation new version of PartitionAlgo (October 2006)
2573 # other parameters are ignored by current functionality. They are kept
2574 # in this function only for support old versions.
2575 # Ignored parameters:
2576 # @param ListKeepInside Shapes, outside which the results will be deleted.
2577 # Each shape from theKeepInside must belong to theShapes also.
2578 # @param ListRemoveInside Shapes, inside which the results will be deleted.
2579 # Each shape from theRemoveInside must belong to theShapes also.
2580 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
2581 # @param ListMaterials Material indices for each shape. Make sence,
2582 # only if theRemoveWebs is TRUE.
2584 # @return New GEOM_Object, containing the result shapes.
2586 # @ref tui_partition "Example"
2587 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
2588 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
2589 KeepNonlimitShapes=0):
2590 # Example: see GEOM_TestAll.py
2591 if Limit == ShapeType["AUTO"]:
2592 # automatic detection of the most appropriate shape limit type
2594 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
2595 Limit = EnumToLong(lim)
2597 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
2598 ListKeepInside, ListRemoveInside,
2599 Limit, RemoveWebs, ListMaterials,
2600 KeepNonlimitShapes);
2601 RaiseIfFailed("MakePartition", self.BoolOp)
2604 ## Perform partition operation.
2605 # This method may be useful if it is needed to make a partition for
2606 # compound contains nonintersected shapes. Performance will be better
2607 # since intersection between shapes from compound is not performed.
2609 # Description of all parameters as in previous method MakePartition()
2611 # !!!NOTE: Passed compounds (via ListShapes or via ListTools)
2612 # have to consist of nonintersecting shapes.
2614 # @return New GEOM_Object, containing the result shapes.
2616 # @ref swig_todo "Example"
2617 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
2618 ListKeepInside=[], ListRemoveInside=[],
2619 Limit=ShapeType["AUTO"], RemoveWebs=0,
2620 ListMaterials=[], KeepNonlimitShapes=0):
2621 if Limit == ShapeType["AUTO"]:
2622 # automatic detection of the most appropriate shape limit type
2624 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
2625 Limit = EnumToLong(lim)
2627 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
2628 ListKeepInside, ListRemoveInside,
2629 Limit, RemoveWebs, ListMaterials,
2630 KeepNonlimitShapes);
2631 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
2634 ## Shortcut to MakePartition()
2636 # @ref tui_partition "Example 1"
2637 # \n @ref swig_Partition "Example 2"
2638 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
2639 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
2640 KeepNonlimitShapes=0):
2641 # Example: see GEOM_TestOthers.py
2642 anObj = self.MakePartition(ListShapes, ListTools,
2643 ListKeepInside, ListRemoveInside,
2644 Limit, RemoveWebs, ListMaterials,
2645 KeepNonlimitShapes);
2648 ## Perform partition of the Shape with the Plane
2649 # @param theShape Shape to be intersected.
2650 # @param thePlane Tool shape, to intersect theShape.
2651 # @return New GEOM_Object, containing the result shape.
2653 # @ref tui_partition "Example"
2654 def MakeHalfPartition(self,theShape, thePlane):
2655 # Example: see GEOM_TestAll.py
2656 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
2657 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
2660 # end of l3_basic_op
2663 ## @addtogroup l3_transform
2666 ## Translate the given object along the vector, specified
2667 # by its end points, creating its copy before the translation.
2668 # @param theObject The object to be translated.
2669 # @param thePoint1 Start point of translation vector.
2670 # @param thePoint2 End point of translation vector.
2671 # @return New GEOM_Object, containing the translated object.
2673 # @ref tui_translation "Example 1"
2674 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
2675 def MakeTranslationTwoPoints(self,theObject, thePoint1, thePoint2):
2676 # Example: see GEOM_TestAll.py
2677 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
2678 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
2681 ## Translate the given object along the vector, specified by its components.
2682 # @param theObject The object to be translated.
2683 # @param theDX,theDY,theDZ Components of translation vector.
2684 # @return Translated GEOM_Object.
2686 # @ref tui_translation "Example"
2687 def TranslateDXDYDZ(self,theObject, theDX, theDY, theDZ):
2688 # Example: see GEOM_TestAll.py
2689 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
2690 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
2691 anObj.SetParameters(Parameters)
2692 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
2695 ## Translate the given object along the vector, specified
2696 # by its components, creating its copy before the translation.
2697 # @param theObject The object to be translated.
2698 # @param theDX,theDY,theDZ Components of translation vector.
2699 # @return New GEOM_Object, containing the translated object.
2701 # @ref tui_translation "Example"
2702 def MakeTranslation(self,theObject, theDX, theDY, theDZ):
2703 # Example: see GEOM_TestAll.py
2704 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
2705 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
2706 anObj.SetParameters(Parameters)
2707 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
2710 ## Translate the given object along the given vector,
2711 # creating its copy before the translation.
2712 # @param theObject The object to be translated.
2713 # @param theVector The translation vector.
2714 # @return New GEOM_Object, containing the translated object.
2716 # @ref tui_translation "Example"
2717 def MakeTranslationVector(self,theObject, theVector):
2718 # Example: see GEOM_TestAll.py
2719 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
2720 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
2723 ## Translate the given object along the given vector on given distance.
2724 # @param theObject The object to be translated.
2725 # @param theVector The translation vector.
2726 # @param theDistance The translation distance.
2727 # @param theCopy Flag used to translate object itself or create a copy.
2728 # @return Translated GEOM_Object.
2730 # @ref tui_translation "Example"
2731 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy):
2732 # Example: see GEOM_TestAll.py
2733 theDistance,Parameters = ParseParameters(theDistance)
2734 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
2735 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
2736 anObj.SetParameters(Parameters)
2739 ## Translate the given object along the given vector on given distance,
2740 # creating its copy before the translation.
2741 # @param theObject The object to be translated.
2742 # @param theVector The translation vector.
2743 # @param theDistance The translation distance.
2744 # @return New GEOM_Object, containing the translated object.
2746 # @ref tui_translation "Example"
2747 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance):
2748 # Example: see GEOM_TestAll.py
2749 theDistance,Parameters = ParseParameters(theDistance)
2750 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
2751 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
2752 anObj.SetParameters(Parameters)
2755 ## Rotate the given object around the given axis on the given angle.
2756 # @param theObject The object to be rotated.
2757 # @param theAxis Rotation axis.
2758 # @param theAngle Rotation angle in radians.
2759 # @return Rotated GEOM_Object.
2761 # @ref tui_rotation "Example"
2762 def Rotate(self,theObject, theAxis, theAngle):
2763 # Example: see GEOM_TestAll.py
2765 if isinstance(theAngle,str):
2767 theAngle, Parameters = ParseParameters(theAngle)
2769 theAngle = theAngle*math.pi/180.0
2770 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
2771 RaiseIfFailed("RotateCopy", self.TrsfOp)
2772 anObj.SetParameters(Parameters)
2775 ## Rotate the given object around the given axis
2776 # on the given angle, creating its copy before the rotatation.
2777 # @param theObject The object to be rotated.
2778 # @param theAxis Rotation axis.
2779 # @param theAngle Rotation angle in radians.
2780 # @return New GEOM_Object, containing the rotated object.
2782 # @ref tui_rotation "Example"
2783 def MakeRotation(self,theObject, theAxis, theAngle):
2784 # Example: see GEOM_TestAll.py
2786 if isinstance(theAngle,str):
2788 theAngle, Parameters = ParseParameters(theAngle)
2790 theAngle = theAngle*math.pi/180.0
2791 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
2792 RaiseIfFailed("RotateCopy", self.TrsfOp)
2793 anObj.SetParameters(Parameters)
2796 ## Rotate given object around vector perpendicular to plane
2797 # containing three points, creating its copy before the rotatation.
2798 # @param theObject The object to be rotated.
2799 # @param theCentPoint central point - the axis is the vector perpendicular to the plane
2800 # containing the three points.
2801 # @param thePoint1,thePoint2 - in a perpendicular plane of the axis.
2802 # @return New GEOM_Object, containing the rotated object.
2804 # @ref tui_rotation "Example"
2805 def MakeRotationThreePoints(self,theObject, theCentPoint, thePoint1, thePoint2):
2806 # Example: see GEOM_TestAll.py
2807 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
2808 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
2811 ## Scale the given object by the factor, creating its copy before the scaling.
2812 # @param theObject The object to be scaled.
2813 # @param thePoint Center point for scaling.
2814 # Passing None for it means scaling relatively the origin of global CS.
2815 # @param theFactor Scaling factor value.
2816 # @return New GEOM_Object, containing the scaled shape.
2818 # @ref tui_scale "Example"
2819 def MakeScaleTransform(self, theObject, thePoint, theFactor):
2820 # Example: see GEOM_TestAll.py
2821 theFactor, Parameters = ParseParameters(theFactor)
2822 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
2823 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
2824 anObj.SetParameters(Parameters)
2827 ## Scale the given object by different factors along coordinate axes,
2828 # creating its copy before the scaling.
2829 # @param theObject The object to be scaled.
2830 # @param thePoint Center point for scaling.
2831 # Passing None for it means scaling relatively the origin of global CS.
2832 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
2833 # @return New GEOM_Object, containing the scaled shape.
2835 # @ref swig_scale "Example"
2836 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ):
2837 # Example: see GEOM_TestAll.py
2838 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
2839 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
2840 theFactorX, theFactorY, theFactorZ)
2841 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
2842 anObj.SetParameters(Parameters)
2845 ## Create an object, symmetrical
2846 # to the given one relatively the given plane.
2847 # @param theObject The object to be mirrored.
2848 # @param thePlane Plane of symmetry.
2849 # @return New GEOM_Object, containing the mirrored shape.
2851 # @ref tui_mirror "Example"
2852 def MakeMirrorByPlane(self,theObject, thePlane):
2853 # Example: see GEOM_TestAll.py
2854 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
2855 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
2858 ## Create an object, symmetrical
2859 # to the given one relatively the given axis.
2860 # @param theObject The object to be mirrored.
2861 # @param theAxis Axis of symmetry.
2862 # @return New GEOM_Object, containing the mirrored shape.
2864 # @ref tui_mirror "Example"
2865 def MakeMirrorByAxis(self,theObject, theAxis):
2866 # Example: see GEOM_TestAll.py
2867 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
2868 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
2871 ## Create an object, symmetrical
2872 # to the given one relatively the given point.
2873 # @param theObject The object to be mirrored.
2874 # @param thePoint Point of symmetry.
2875 # @return New GEOM_Object, containing the mirrored shape.
2877 # @ref tui_mirror "Example"
2878 def MakeMirrorByPoint(self,theObject, thePoint):
2879 # Example: see GEOM_TestAll.py
2880 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
2881 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
2884 ## Modify the Location of the given object by LCS,
2885 # creating its copy before the setting.
2886 # @param theObject The object to be displaced.
2887 # @param theStartLCS Coordinate system to perform displacement from it.
2888 # If \a theStartLCS is NULL, displacement
2889 # will be performed from global CS.
2890 # If \a theObject itself is used as \a theStartLCS,
2891 # its location will be changed to \a theEndLCS.
2892 # @param theEndLCS Coordinate system to perform displacement to it.
2893 # @return New GEOM_Object, containing the displaced shape.
2895 # @ref tui_modify_location "Example"
2896 def MakePosition(self,theObject, theStartLCS, theEndLCS):
2897 # Example: see GEOM_TestAll.py
2898 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
2899 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
2902 ## Modify the Location of the given object by Path,
2903 # @param theObject The object to be displaced.
2904 # @param thePath Wire or Edge along that the object will be translated.
2905 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
2906 # @param theCopy is to create a copy objects if true.
2907 # @param theReverse - 0 for usual direction, 1 to reverse path direction.
2908 # @return New GEOM_Object, containing the displaced shape.
2910 # @ref tui_modify_location "Example"
2911 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
2912 # Example: see GEOM_TestAll.py
2913 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
2914 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
2917 ## Create new object as offset of the given one.
2918 # @param theObject The base object for the offset.
2919 # @param theOffset Offset value.
2920 # @return New GEOM_Object, containing the offset object.
2922 # @ref tui_offset "Example"
2923 def MakeOffset(self,theObject, theOffset):
2924 # Example: see GEOM_TestAll.py
2925 theOffset, Parameters = ParseParameters(theOffset)
2926 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
2927 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
2928 anObj.SetParameters(Parameters)
2931 # -----------------------------------------------------------------------------
2933 # -----------------------------------------------------------------------------
2935 ## Translate the given object along the given vector a given number times
2936 # @param theObject The object to be translated.
2937 # @param theVector Direction of the translation.
2938 # @param theStep Distance to translate on.
2939 # @param theNbTimes Quantity of translations to be done.
2940 # @return New GEOM_Object, containing compound of all
2941 # the shapes, obtained after each translation.
2943 # @ref tui_multi_translation "Example"
2944 def MakeMultiTranslation1D(self,theObject, theVector, theStep, theNbTimes):
2945 # Example: see GEOM_TestAll.py
2946 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
2947 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
2948 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
2949 anObj.SetParameters(Parameters)
2952 ## Conseqently apply two specified translations to theObject specified number of times.
2953 # @param theObject The object to be translated.
2954 # @param theVector1 Direction of the first translation.
2955 # @param theStep1 Step of the first translation.
2956 # @param theNbTimes1 Quantity of translations to be done along theVector1.
2957 # @param theVector2 Direction of the second translation.
2958 # @param theStep2 Step of the second translation.
2959 # @param theNbTimes2 Quantity of translations to be done along theVector2.
2960 # @return New GEOM_Object, containing compound of all
2961 # the shapes, obtained after each translation.
2963 # @ref tui_multi_translation "Example"
2964 def MakeMultiTranslation2D(self,theObject, theVector1, theStep1, theNbTimes1,
2965 theVector2, theStep2, theNbTimes2):
2966 # Example: see GEOM_TestAll.py
2967 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
2968 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
2969 theVector2, theStep2, theNbTimes2)
2970 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
2971 anObj.SetParameters(Parameters)
2974 ## Rotate the given object around the given axis a given number times.
2975 # Rotation angle will be 2*PI/theNbTimes.
2976 # @param theObject The object to be rotated.
2977 # @param theAxis The rotation axis.
2978 # @param theNbTimes Quantity of rotations to be done.
2979 # @return New GEOM_Object, containing compound of all the
2980 # shapes, obtained after each rotation.
2982 # @ref tui_multi_rotation "Example"
2983 def MultiRotate1D(self,theObject, theAxis, theNbTimes):
2984 # Example: see GEOM_TestAll.py
2985 theAxis, theNbTimes, Parameters = ParseParameters(theAxis, theNbTimes)
2986 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
2987 RaiseIfFailed("MultiRotate1D", self.TrsfOp)
2988 anObj.SetParameters(Parameters)
2991 ## Rotate the given object around the
2992 # given axis on the given angle a given number
2993 # times and multi-translate each rotation result.
2994 # Translation direction passes through center of gravity
2995 # of rotated shape and its projection on the rotation axis.
2996 # @param theObject The object to be rotated.
2997 # @param theAxis Rotation axis.
2998 # @param theAngle Rotation angle in graduces.
2999 # @param theNbTimes1 Quantity of rotations to be done.
3000 # @param theStep Translation distance.
3001 # @param theNbTimes2 Quantity of translations to be done.
3002 # @return New GEOM_Object, containing compound of all the
3003 # shapes, obtained after each transformation.
3005 # @ref tui_multi_rotation "Example"
3006 def MultiRotate2D(self,theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2):
3007 # Example: see GEOM_TestAll.py
3008 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
3009 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
3010 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
3011 anObj.SetParameters(Parameters)
3014 ## The same, as MultiRotate1D(), but axis is given by direction and point
3015 # @ref swig_MakeMultiRotation "Example"
3016 def MakeMultiRotation1D(self,aShape,aDir,aPoint,aNbTimes):
3017 # Example: see GEOM_TestOthers.py
3018 aVec = self.MakeLine(aPoint,aDir)
3019 anObj = self.MultiRotate1D(aShape,aVec,aNbTimes)
3022 ## The same, as MultiRotate2D(), but axis is given by direction and point
3023 # @ref swig_MakeMultiRotation "Example"
3024 def MakeMultiRotation2D(self,aShape,aDir,aPoint,anAngle,nbtimes1,aStep,nbtimes2):
3025 # Example: see GEOM_TestOthers.py
3026 aVec = self.MakeLine(aPoint,aDir)
3027 anObj = self.MultiRotate2D(aShape,aVec,anAngle,nbtimes1,aStep,nbtimes2)
3030 # end of l3_transform
3033 ## @addtogroup l3_local
3036 ## Perform a fillet on all edges of the given shape.
3037 # @param theShape Shape, to perform fillet on.
3038 # @param theR Fillet radius.
3039 # @return New GEOM_Object, containing the result shape.
3041 # @ref tui_fillet "Example 1"
3042 # \n @ref swig_MakeFilletAll "Example 2"
3043 def MakeFilletAll(self,theShape, theR):
3044 # Example: see GEOM_TestOthers.py
3045 theR,Parameters = ParseParameters(theR)
3046 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
3047 RaiseIfFailed("MakeFilletAll", self.LocalOp)
3048 anObj.SetParameters(Parameters)
3051 ## Perform a fillet on the specified edges/faces of the given shape
3052 # @param theShape Shape, to perform fillet on.
3053 # @param theR Fillet radius.
3054 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR>.
3055 # @param theListShapes Global indices of edges/faces to perform fillet on.
3056 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
3057 # @return New GEOM_Object, containing the result shape.
3059 # @ref tui_fillet "Example"
3060 def MakeFillet(self,theShape, theR, theShapeType, theListShapes):
3061 # Example: see GEOM_TestAll.py
3062 theR,Parameters = ParseParameters(theR)
3064 if theShapeType == ShapeType["EDGE"]:
3065 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
3066 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
3068 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
3069 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
3070 anObj.SetParameters(Parameters)
3073 ## The same that MakeFillet but with two Fillet Radius R1 and R2
3074 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes):
3075 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
3077 if theShapeType == ShapeType["EDGE"]:
3078 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
3079 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
3081 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
3082 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
3083 anObj.SetParameters(Parameters)
3086 ## Perform a fillet on the specified edges of the given shape
3087 # @param theShape - Wire Shape to perform fillet on.
3088 # @param theR - Fillet radius.
3089 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
3090 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
3091 # \note The list of vertices could be empty,
3092 # in this case fillet will done done at all vertices in wire
3093 # @return New GEOM_Object, containing the result shape.
3095 # @ref tui_fillet2d "Example"
3096 def MakeFillet1D(self,theShape, theR, theListOfVertexes):
3097 # Example: see GEOM_TestAll.py
3098 theR,Parameters = ParseParameters(theR)
3099 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes)
3100 RaiseIfFailed("MakeFillet1D", self.LocalOp)
3101 anObj.SetParameters(Parameters)
3104 ## Perform a fillet on the specified edges/faces of the given shape
3105 # @param theShape - Face Shape to perform fillet on.
3106 # @param theR - Fillet radius.
3107 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
3108 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
3109 # @return New GEOM_Object, containing the result shape.
3111 # @ref tui_fillet2d "Example"
3112 def MakeFillet2D(self,theShape, theR, theListOfVertexes):
3113 # Example: see GEOM_TestAll.py
3114 theR,Parameters = ParseParameters(theR)
3115 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
3116 RaiseIfFailed("MakeFillet2D", self.LocalOp)
3117 anObj.SetParameters(Parameters)
3120 ## Perform a symmetric chamfer on all edges of the given shape.
3121 # @param theShape Shape, to perform chamfer on.
3122 # @param theD Chamfer size along each face.
3123 # @return New GEOM_Object, containing the result shape.
3125 # @ref tui_chamfer "Example 1"
3126 # \n @ref swig_MakeChamferAll "Example 2"
3127 def MakeChamferAll(self,theShape, theD):
3128 # Example: see GEOM_TestOthers.py
3129 theD,Parameters = ParseParameters(theD)
3130 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
3131 RaiseIfFailed("MakeChamferAll", self.LocalOp)
3132 anObj.SetParameters(Parameters)
3135 ## Perform a chamfer on edges, common to the specified faces,
3136 # with distance D1 on the Face1
3137 # @param theShape Shape, to perform chamfer on.
3138 # @param theD1 Chamfer size along \a theFace1.
3139 # @param theD2 Chamfer size along \a theFace2.
3140 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
3141 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
3142 # @return New GEOM_Object, containing the result shape.
3144 # @ref tui_chamfer "Example"
3145 def MakeChamferEdge(self,theShape, theD1, theD2, theFace1, theFace2):
3146 # Example: see GEOM_TestAll.py
3147 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
3148 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
3149 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
3150 anObj.SetParameters(Parameters)
3153 ## The Same that MakeChamferEdge but with params theD is chamfer length and
3154 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
3155 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2):
3157 if isinstance(theAngle,str):
3159 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
3161 theAngle = theAngle*math.pi/180.0
3162 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
3163 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
3164 anObj.SetParameters(Parameters)
3167 ## Perform a chamfer on all edges of the specified faces,
3168 # with distance D1 on the first specified face (if several for one edge)
3169 # @param theShape Shape, to perform chamfer on.
3170 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
3171 # connected to the edge, are in \a theFaces, \a theD1
3172 # will be get along face, which is nearer to \a theFaces beginning.
3173 # @param theD2 Chamfer size along another of two faces, connected to the edge.
3174 # @param theFaces Sequence of global indices of faces of \a theShape.
3175 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
3176 # @return New GEOM_Object, containing the result shape.
3178 # @ref tui_chamfer "Example"
3179 def MakeChamferFaces(self,theShape, theD1, theD2, theFaces):
3180 # Example: see GEOM_TestAll.py
3181 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
3182 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
3183 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
3184 anObj.SetParameters(Parameters)
3187 ## The Same that MakeChamferFaces but with params theD is chamfer lenght and
3188 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
3190 # @ref swig_FilletChamfer "Example"
3191 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces):
3193 if isinstance(theAngle,str):
3195 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
3197 theAngle = theAngle*math.pi/180.0
3198 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
3199 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
3200 anObj.SetParameters(Parameters)
3203 ## Perform a chamfer on edges,
3204 # with distance D1 on the first specified face (if several for one edge)
3205 # @param theShape Shape, to perform chamfer on.
3206 # @param theD1,theD2 Chamfer size
3207 # @param theEdges Sequence of edges of \a theShape.
3208 # @return New GEOM_Object, containing the result shape.
3210 # @ref swig_FilletChamfer "Example"
3211 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges):
3212 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
3213 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
3214 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
3215 anObj.SetParameters(Parameters)
3218 ## The Same that MakeChamferEdges but with params theD is chamfer lenght and
3219 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
3220 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges):
3222 if isinstance(theAngle,str):
3224 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
3226 theAngle = theAngle*math.pi/180.0
3227 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
3228 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
3229 anObj.SetParameters(Parameters)
3232 ## Shortcut to MakeChamferEdge() and MakeChamferFaces()
3234 # @ref swig_MakeChamfer "Example"
3235 def MakeChamfer(self,aShape,d1,d2,aShapeType,ListShape):
3236 # Example: see GEOM_TestOthers.py
3238 if aShapeType == ShapeType["EDGE"]:
3239 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1])
3241 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape)
3247 ## @addtogroup l3_basic_op
3250 ## Perform an Archimde operation on the given shape with given parameters.
3251 # The object presenting the resulting face is returned.
3252 # @param theShape Shape to be put in water.
3253 # @param theWeight Weight og the shape.
3254 # @param theWaterDensity Density of the water.
3255 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
3256 # @return New GEOM_Object, containing a section of \a theShape
3257 # by a plane, corresponding to water level.
3259 # @ref tui_archimede "Example"
3260 def Archimede(self,theShape, theWeight, theWaterDensity, theMeshDeflection):
3261 # Example: see GEOM_TestAll.py
3262 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
3263 theWeight,theWaterDensity,theMeshDeflection)
3264 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
3265 RaiseIfFailed("MakeArchimede", self.LocalOp)
3266 anObj.SetParameters(Parameters)
3269 # end of l3_basic_op
3272 ## @addtogroup l2_measure
3275 ## Get point coordinates
3278 # @ref tui_measurement_tools_page "Example"
3279 def PointCoordinates(self,Point):
3280 # Example: see GEOM_TestMeasures.py
3281 aTuple = self.MeasuOp.PointCoordinates(Point)
3282 RaiseIfFailed("PointCoordinates", self.MeasuOp)
3285 ## Get summarized length of all wires,
3286 # area of surface and volume of the given shape.
3287 # @param theShape Shape to define properties of.
3288 # @return [theLength, theSurfArea, theVolume]
3289 # theLength: Summarized length of all wires of the given shape.
3290 # theSurfArea: Area of surface of the given shape.
3291 # theVolume: Volume of the given shape.
3293 # @ref tui_measurement_tools_page "Example"
3294 def BasicProperties(self,theShape):
3295 # Example: see GEOM_TestMeasures.py
3296 aTuple = self.MeasuOp.GetBasicProperties(theShape)
3297 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
3300 ## Get parameters of bounding box of the given shape
3301 # @param theShape Shape to obtain bounding box of.
3302 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
3303 # Xmin,Xmax: Limits of shape along OX axis.
3304 # Ymin,Ymax: Limits of shape along OY axis.
3305 # Zmin,Zmax: Limits of shape along OZ axis.
3307 # @ref tui_measurement_tools_page "Example"
3308 def BoundingBox(self,theShape):
3309 # Example: see GEOM_TestMeasures.py
3310 aTuple = self.MeasuOp.GetBoundingBox(theShape)
3311 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
3314 ## Get inertia matrix and moments of inertia of theShape.
3315 # @param theShape Shape to calculate inertia of.
3316 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
3317 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
3318 # Ix,Iy,Iz: Moments of inertia of the given shape.
3320 # @ref tui_measurement_tools_page "Example"
3321 def Inertia(self,theShape):
3322 # Example: see GEOM_TestMeasures.py
3323 aTuple = self.MeasuOp.GetInertia(theShape)
3324 RaiseIfFailed("GetInertia", self.MeasuOp)
3327 ## Get minimal distance between the given shapes.
3328 # @param theShape1,theShape2 Shapes to find minimal distance between.
3329 # @return Value of the minimal distance between the given shapes.
3331 # @ref tui_measurement_tools_page "Example"
3332 def MinDistance(self, theShape1, theShape2):
3333 # Example: see GEOM_TestMeasures.py
3334 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
3335 RaiseIfFailed("GetMinDistance", self.MeasuOp)
3338 ## Get minimal distance between the given shapes.
3339 # @param theShape1,theShape2 Shapes to find minimal distance between.
3340 # @return Value of the minimal distance between the given shapes.
3342 # @ref swig_all_measure "Example"
3343 def MinDistanceComponents(self, theShape1, theShape2):
3344 # Example: see GEOM_TestMeasures.py
3345 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
3346 RaiseIfFailed("GetMinDistance", self.MeasuOp)
3347 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
3350 ## Get angle between the given shapes in degrees.
3351 # @param theShape1,theShape2 Lines or linear edges to find angle between.
3352 # @return Value of the angle between the given shapes in degrees.
3354 # @ref tui_measurement_tools_page "Example"
3355 def GetAngle(self, theShape1, theShape2):
3356 # Example: see GEOM_TestMeasures.py
3357 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
3358 RaiseIfFailed("GetAngle", self.MeasuOp)
3360 ## Get angle between the given shapes in radians.
3361 # @param theShape1,theShape2 Lines or linear edges to find angle between.
3362 # @return Value of the angle between the given shapes in radians.
3364 # @ref tui_measurement_tools_page "Example"
3365 def GetAngleRadians(self, theShape1, theShape2):
3366 # Example: see GEOM_TestMeasures.py
3367 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
3368 RaiseIfFailed("GetAngle", self.MeasuOp)
3371 ## @name Curve Curvature Measurement
3372 # Methods for receiving radius of curvature of curves
3373 # in the given point
3376 ## Measure curvature of a curve at a point, set by parameter.
3377 # @ref swig_todo "Example"
3378 def CurveCurvatureByParam(self, theCurve, theParam):
3379 # Example: see GEOM_TestMeasures.py
3380 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
3381 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
3385 # @ref swig_todo "Example"
3386 def CurveCurvatureByPoint(self, theCurve, thePoint):
3387 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
3388 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
3392 ## @name Surface Curvature Measurement
3393 # Methods for receiving max and min radius of curvature of surfaces
3394 # in the given point
3398 ## @ref swig_todo "Example"
3399 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
3400 # Example: see GEOM_TestMeasures.py
3401 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
3402 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
3406 ## @ref swig_todo "Example"
3407 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
3408 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
3409 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
3413 ## @ref swig_todo "Example"
3414 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
3415 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
3416 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
3420 ## @ref swig_todo "Example"
3421 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
3422 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
3423 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
3427 ## Get min and max tolerances of sub-shapes of theShape
3428 # @param theShape Shape, to get tolerances of.
3429 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
3430 # FaceMin,FaceMax: Min and max tolerances of the faces.
3431 # EdgeMin,EdgeMax: Min and max tolerances of the edges.
3432 # VertMin,VertMax: Min and max tolerances of the vertices.
3434 # @ref tui_measurement_tools_page "Example"
3435 def Tolerance(self,theShape):
3436 # Example: see GEOM_TestMeasures.py
3437 aTuple = self.MeasuOp.GetTolerance(theShape)
3438 RaiseIfFailed("GetTolerance", self.MeasuOp)
3441 ## Obtain description of the given shape (number of sub-shapes of each type)
3442 # @param theShape Shape to be described.
3443 # @return Description of the given shape.
3445 # @ref tui_measurement_tools_page "Example"
3446 def WhatIs(self,theShape):
3447 # Example: see GEOM_TestMeasures.py
3448 aDescr = self.MeasuOp.WhatIs(theShape)
3449 RaiseIfFailed("WhatIs", self.MeasuOp)
3452 ## Obtain quantity of shapes of the given type in \a theShape.
3453 # If \a theShape is of type \a theType, it is also counted.
3454 # @param theShape Shape to be described.
3455 # @return Quantity of shapes of type \a theType in \a theShape.
3457 # @ref tui_measurement_tools_page "Example"
3458 def NbShapes (self, theShape, theType):
3459 # Example: see GEOM_TestMeasures.py
3460 listSh = self.SubShapeAllIDs(theShape, theType)
3462 t = EnumToLong(theShape.GetShapeType())
3463 theType = EnumToLong(theType)
3469 ## Obtain quantity of shapes of each type in \a theShape.
3470 # The \a theShape is also counted.
3471 # @param theShape Shape to be described.
3472 # @return Dictionary of shape types with bound quantities of shapes.
3474 # @ref tui_measurement_tools_page "Example"
3475 def ShapeInfo (self, theShape):
3476 # Example: see GEOM_TestMeasures.py
3478 for typeSh in ShapeType:
3479 if typeSh in ( "AUTO", "SHAPE" ): continue
3480 listSh = self.SubShapeAllIDs(theShape, ShapeType[typeSh])
3482 if EnumToLong(theShape.GetShapeType()) == ShapeType[typeSh]:
3489 ## Get a point, situated at the centre of mass of theShape.
3490 # @param theShape Shape to define centre of mass of.
3491 # @return New GEOM_Object, containing the created point.
3493 # @ref tui_measurement_tools_page "Example"
3494 def MakeCDG(self,theShape):
3495 # Example: see GEOM_TestMeasures.py
3496 anObj = self.MeasuOp.GetCentreOfMass(theShape)
3497 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
3500 ## Get a vertex subshape by index depended with orientation.
3501 # @param theShape Shape to find subshape.
3502 # @param theIndex Index to find vertex by this index.
3503 # @return New GEOM_Object, containing the created vertex.
3505 # @ref tui_measurement_tools_page "Example"
3506 def GetVertexByIndex(self,theShape, theIndex):
3507 # Example: see GEOM_TestMeasures.py
3508 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
3509 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
3512 ## Get the first vertex of wire/edge depended orientation.
3513 # @param theShape Shape to find first vertex.
3514 # @return New GEOM_Object, containing the created vertex.
3516 # @ref tui_measurement_tools_page "Example"
3517 def GetFirstVertex(self,theShape):
3518 # Example: see GEOM_TestMeasures.py
3519 anObj = self.GetVertexByIndex(theShape, 0)
3520 RaiseIfFailed("GetFirstVertex", self.MeasuOp)
3523 ## Get the last vertex of wire/edge depended orientation.
3524 # @param theShape Shape to find last vertex.
3525 # @return New GEOM_Object, containing the created vertex.
3527 # @ref tui_measurement_tools_page "Example"
3528 def GetLastVertex(self,theShape):
3529 # Example: see GEOM_TestMeasures.py
3530 nb_vert = self.ShapesOp.NumberOfSubShapes(theShape, ShapeType["VERTEX"])
3531 anObj = self.GetVertexByIndex(theShape, (nb_vert-1))
3532 RaiseIfFailed("GetLastVertex", self.MeasuOp)
3535 ## Get a normale to the given face. If the point is not given,
3536 # the normale is calculated at the center of mass.
3537 # @param theFace Face to define normale of.
3538 # @param theOptionalPoint Point to compute the normale at.
3539 # @return New GEOM_Object, containing the created vector.
3541 # @ref swig_todo "Example"
3542 def GetNormal(self, theFace, theOptionalPoint = None):
3543 # Example: see GEOM_TestMeasures.py
3544 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
3545 RaiseIfFailed("GetNormal", self.MeasuOp)
3548 ## Check a topology of the given shape.
3549 # @param theShape Shape to check validity of.
3550 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked,
3551 # if TRUE, the shape's geometry will be checked also.
3552 # @return TRUE, if the shape "seems to be valid".
3553 # If theShape is invalid, prints a description of problem.
3555 # @ref tui_measurement_tools_page "Example"
3556 def CheckShape(self,theShape, theIsCheckGeom = 0):
3557 # Example: see GEOM_TestMeasures.py
3559 (IsValid, Status) = self.MeasuOp.CheckShapeWithGeometry(theShape)
3560 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
3562 (IsValid, Status) = self.MeasuOp.CheckShape(theShape)
3563 RaiseIfFailed("CheckShape", self.MeasuOp)
3568 ## Get position (LCS) of theShape.
3570 # Origin of the LCS is situated at the shape's center of mass.
3571 # Axes of the LCS are obtained from shape's location or,
3572 # if the shape is a planar face, from position of its plane.
3574 # @param theShape Shape to calculate position of.
3575 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
3576 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
3577 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
3578 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
3580 # @ref swig_todo "Example"
3581 def GetPosition(self,theShape):
3582 # Example: see GEOM_TestMeasures.py
3583 aTuple = self.MeasuOp.GetPosition(theShape)
3584 RaiseIfFailed("GetPosition", self.MeasuOp)
3587 ## Get kind of theShape.
3589 # @param theShape Shape to get a kind of.
3590 # @return Returns a kind of shape in terms of <VAR>GEOM_IKindOfShape.shape_kind</VAR> enumeration
3591 # and a list of parameters, describing the shape.
3592 # @note Concrete meaning of each value, returned via \a theIntegers
3593 # or \a theDoubles list depends on the kind of the shape.
3594 # The full list of possible outputs is:
3596 # - geompy.kind.COMPOUND nb_solids nb_faces nb_edges nb_vertices
3597 # - geompy.kind.COMPSOLID nb_solids nb_faces nb_edges nb_vertices
3599 # - geompy.kind.SHELL geompy.info.CLOSED nb_faces nb_edges nb_vertices
3600 # - geompy.kind.SHELL geompy.info.UNCLOSED nb_faces nb_edges nb_vertices
3602 # - geompy.kind.WIRE geompy.info.CLOSED nb_edges nb_vertices
3603 # - geompy.kind.WIRE geompy.info.UNCLOSED nb_edges nb_vertices
3605 # - geompy.kind.SPHERE xc yc zc R
3606 # - geompy.kind.CYLINDER xb yb zb dx dy dz R H
3607 # - geompy.kind.BOX xc yc zc ax ay az
3608 # - geompy.kind.ROTATED_BOX xc yc zc zx zy zz xx xy xz ax ay az
3609 # - geompy.kind.TORUS xc yc zc dx dy dz R_1 R_2
3610 # - geompy.kind.CONE xb yb zb dx dy dz R_1 R_2 H
3611 # - geompy.kind.POLYHEDRON nb_faces nb_edges nb_vertices
3612 # - geompy.kind.SOLID nb_faces nb_edges nb_vertices
3614 # - geompy.kind.SPHERE2D xc yc zc R
3615 # - geompy.kind.CYLINDER2D xb yb zb dx dy dz R H
3616 # - geompy.kind.TORUS2D xc yc zc dx dy dz R_1 R_2
3617 # - geompy.kind.CONE2D xc yc zc dx dy dz R_1 R_2 H
3618 # - geompy.kind.DISK_CIRCLE xc yc zc dx dy dz R
3619 # - geompy.kind.DISK_ELLIPSE xc yc zc dx dy dz R_1 R_2
3620 # - geompy.kind.POLYGON xo yo zo dx dy dz nb_edges nb_vertices
3621 # - geompy.kind.PLANE xo yo zo dx dy dz
3622 # - geompy.kind.PLANAR xo yo zo dx dy dz nb_edges nb_vertices
3623 # - geompy.kind.FACE nb_edges nb_vertices
3625 # - geompy.kind.CIRCLE xc yc zc dx dy dz R
3626 # - geompy.kind.ARC_CIRCLE xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2
3627 # - geompy.kind.ELLIPSE xc yc zc dx dy dz R_1 R_2
3628 # - geompy.kind.ARC_ELLIPSE xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2
3629 # - geompy.kind.LINE xo yo zo dx dy dz
3630 # - geompy.kind.SEGMENT x1 y1 z1 x2 y2 z2
3631 # - geompy.kind.EDGE nb_vertices
3633 # - geompy.kind.VERTEX x y z
3635 # @ref swig_todo "Example"
3636 def KindOfShape(self,theShape):
3637 # Example: see GEOM_TestMeasures.py
3638 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
3639 RaiseIfFailed("KindOfShape", self.MeasuOp)
3641 aKind = aRoughTuple[0]
3642 anInts = aRoughTuple[1]
3643 aDbls = aRoughTuple[2]
3645 # Now there is no exception from this rule:
3646 aKindTuple = [aKind] + aDbls + anInts
3648 # If they are we will regroup parameters for such kind of shape.
3650 #if aKind == kind.SOME_KIND:
3651 # # SOME_KIND int int double int double double
3652 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
3659 ## @addtogroup l2_import_export
3662 ## Import a shape from the BREP or IGES or STEP file
3663 # (depends on given format) with given name.
3664 # @param theFileName The file, containing the shape.
3665 # @param theFormatName Specify format for the file reading.
3666 # Available formats can be obtained with InsertOp.ImportTranslators() method.
3667 # If format 'IGES_SCALE' is used instead 'IGES' length unit will be
3668 # set to 'meter' and result model will be scaled.
3669 # @return New GEOM_Object, containing the imported shape.
3671 # @ref swig_Import_Export "Example"
3672 def Import(self,theFileName, theFormatName):
3673 # Example: see GEOM_TestOthers.py
3674 anObj = self.InsertOp.Import(theFileName, theFormatName)
3675 RaiseIfFailed("Import", self.InsertOp)
3678 ## Shortcut to Import() for BREP format
3680 # @ref swig_Import_Export "Example"
3681 def ImportBREP(self,theFileName):
3682 # Example: see GEOM_TestOthers.py
3683 return self.Import(theFileName, "BREP")
3685 ## Shortcut to Import() for IGES format
3687 # @ref swig_Import_Export "Example"
3688 def ImportIGES(self,theFileName):
3689 # Example: see GEOM_TestOthers.py
3690 return self.Import(theFileName, "IGES")
3692 ## Return length unit from given IGES file
3694 # @ref swig_Import_Export "Example"
3695 def GetIGESUnit(self,theFileName):
3696 # Example: see GEOM_TestOthers.py
3697 anObj = self.InsertOp.Import(theFileName, "IGES_UNIT")
3698 #RaiseIfFailed("Import", self.InsertOp)
3699 # recieve name using returned vertex
3701 if anObj.GetShapeType() == GEOM.VERTEX:
3704 vertices = self.SubShapeAll(anObj,ShapeType["VERTEX"])
3706 p = self.PointCoordinates(vertices[0])
3707 if abs(p[0]-0.01) < 1.e-6:
3709 elif abs(p[0]-0.001) < 1.e-6:
3713 ## Shortcut to Import() for STEP format
3715 # @ref swig_Import_Export "Example"
3716 def ImportSTEP(self,theFileName):
3717 # Example: see GEOM_TestOthers.py
3718 return self.Import(theFileName, "STEP")
3720 ## Export the given shape into a file with given name.
3721 # @param theObject Shape to be stored in the file.
3722 # @param theFileName Name of the file to store the given shape in.
3723 # @param theFormatName Specify format for the shape storage.
3724 # Available formats can be obtained with InsertOp.ImportTranslators() method.
3726 # @ref swig_Import_Export "Example"
3727 def Export(self,theObject, theFileName, theFormatName):
3728 # Example: see GEOM_TestOthers.py
3729 self.InsertOp.Export(theObject, theFileName, theFormatName)
3730 if self.InsertOp.IsDone() == 0:
3731 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
3735 ## Shortcut to Export() for BREP format
3737 # @ref swig_Import_Export "Example"
3738 def ExportBREP(self,theObject, theFileName):
3739 # Example: see GEOM_TestOthers.py
3740 return self.Export(theObject, theFileName, "BREP")
3742 ## Shortcut to Export() for IGES format
3744 # @ref swig_Import_Export "Example"
3745 def ExportIGES(self,theObject, theFileName):
3746 # Example: see GEOM_TestOthers.py
3747 return self.Export(theObject, theFileName, "IGES")
3749 ## Shortcut to Export() for STEP format
3751 # @ref swig_Import_Export "Example"
3752 def ExportSTEP(self,theObject, theFileName):
3753 # Example: see GEOM_TestOthers.py
3754 return self.Export(theObject, theFileName, "STEP")
3756 # end of l2_import_export
3759 ## @addtogroup l3_blocks
3762 ## Create a quadrangle face from four edges. Order of Edges is not
3763 # important. It is not necessary that edges share the same vertex.
3764 # @param E1,E2,E3,E4 Edges for the face bound.
3765 # @return New GEOM_Object, containing the created face.
3767 # @ref tui_building_by_blocks_page "Example"
3768 def MakeQuad(self,E1, E2, E3, E4):
3769 # Example: see GEOM_Spanner.py
3770 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
3771 RaiseIfFailed("MakeQuad", self.BlocksOp)
3774 ## Create a quadrangle face on two edges.
3775 # The missing edges will be built by creating the shortest ones.
3776 # @param E1,E2 Two opposite edges for the face.
3777 # @return New GEOM_Object, containing the created face.
3779 # @ref tui_building_by_blocks_page "Example"
3780 def MakeQuad2Edges(self,E1, E2):
3781 # Example: see GEOM_Spanner.py
3782 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
3783 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
3786 ## Create a quadrangle face with specified corners.
3787 # The missing edges will be built by creating the shortest ones.
3788 # @param V1,V2,V3,V4 Corner vertices for the face.
3789 # @return New GEOM_Object, containing the created face.
3791 # @ref tui_building_by_blocks_page "Example 1"
3792 # \n @ref swig_MakeQuad4Vertices "Example 2"
3793 def MakeQuad4Vertices(self,V1, V2, V3, V4):
3794 # Example: see GEOM_Spanner.py
3795 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
3796 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
3799 ## Create a hexahedral solid, bounded by the six given faces. Order of
3800 # faces is not important. It is not necessary that Faces share the same edge.
3801 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
3802 # @return New GEOM_Object, containing the created solid.
3804 # @ref tui_building_by_blocks_page "Example 1"
3805 # \n @ref swig_MakeHexa "Example 2"
3806 def MakeHexa(self,F1, F2, F3, F4, F5, F6):
3807 # Example: see GEOM_Spanner.py
3808 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
3809 RaiseIfFailed("MakeHexa", self.BlocksOp)
3812 ## Create a hexahedral solid between two given faces.
3813 # The missing faces will be built by creating the smallest ones.
3814 # @param F1,F2 Two opposite faces for the hexahedral solid.
3815 # @return New GEOM_Object, containing the created solid.
3817 # @ref tui_building_by_blocks_page "Example 1"
3818 # \n @ref swig_MakeHexa2Faces "Example 2"
3819 def MakeHexa2Faces(self,F1, F2):
3820 # Example: see GEOM_Spanner.py
3821 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
3822 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
3828 ## @addtogroup l3_blocks_op
3831 ## Get a vertex, found in the given shape by its coordinates.
3832 # @param theShape Block or a compound of blocks.
3833 # @param theX,theY,theZ Coordinates of the sought vertex.
3834 # @param theEpsilon Maximum allowed distance between the resulting
3835 # vertex and point with the given coordinates.
3836 # @return New GEOM_Object, containing the found vertex.
3838 # @ref swig_GetPoint "Example"
3839 def GetPoint(self, theShape, theX, theY, theZ, theEpsilon):
3840 # Example: see GEOM_TestOthers.py
3841 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
3842 RaiseIfFailed("GetPoint", self.BlocksOp)
3845 ## Find a vertex of the given shape, which has minimal distance to the given point.
3846 # @param theShape Any shape.
3847 # @param thePoint Point, close to the desired vertex.
3848 # @return New GEOM_Object, containing the found vertex.
3850 # @ref swig_GetVertexNearPoint "Example"
3851 def GetVertexNearPoint(self, theShape, thePoint):
3852 # Example: see GEOM_TestOthers.py
3853 anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
3854 RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
3857 ## Get an edge, found in the given shape by two given vertices.
3858 # @param theShape Block or a compound of blocks.
3859 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
3860 # @return New GEOM_Object, containing the found edge.
3862 # @ref swig_GetEdge "Example"
3863 def GetEdge(self, theShape, thePoint1, thePoint2):
3864 # Example: see GEOM_Spanner.py
3865 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
3866 RaiseIfFailed("GetEdge", self.BlocksOp)
3869 ## Find an edge of the given shape, which has minimal distance to the given point.
3870 # @param theShape Block or a compound of blocks.
3871 # @param thePoint Point, close to the desired edge.
3872 # @return New GEOM_Object, containing the found edge.
3874 # @ref swig_GetEdgeNearPoint "Example"
3875 def GetEdgeNearPoint(self, theShape, thePoint):
3876 # Example: see GEOM_TestOthers.py
3877 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
3878 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
3881 ## Returns a face, found in the given shape by four given corner vertices.
3882 # @param theShape Block or a compound of blocks.
3883 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
3884 # @return New GEOM_Object, containing the found face.
3886 # @ref swig_todo "Example"
3887 def GetFaceByPoints(self,theShape, thePoint1, thePoint2, thePoint3, thePoint4):
3888 # Example: see GEOM_Spanner.py
3889 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
3890 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
3893 ## Get a face of block, found in the given shape by two given edges.
3894 # @param theShape Block or a compound of blocks.
3895 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
3896 # @return New GEOM_Object, containing the found face.
3898 # @ref swig_todo "Example"
3899 def GetFaceByEdges(self,theShape, theEdge1, theEdge2):
3900 # Example: see GEOM_Spanner.py
3901 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
3902 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
3905 ## Find a face, opposite to the given one in the given block.
3906 # @param theBlock Must be a hexahedral solid.
3907 # @param theFace Face of \a theBlock, opposite to the desired face.
3908 # @return New GEOM_Object, containing the found face.
3910 # @ref swig_GetOppositeFace "Example"
3911 def GetOppositeFace(self,theBlock, theFace):
3912 # Example: see GEOM_Spanner.py
3913 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
3914 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
3917 ## Find a face of the given shape, which has minimal distance to the given point.
3918 # @param theShape Block or a compound of blocks.
3919 # @param thePoint Point, close to the desired face.
3920 # @return New GEOM_Object, containing the found face.
3922 # @ref swig_GetFaceNearPoint "Example"
3923 def GetFaceNearPoint(self, theShape, thePoint):
3924 # Example: see GEOM_Spanner.py
3925 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
3926 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
3929 ## Find a face of block, whose outside normale has minimal angle with the given vector.
3930 # @param theBlock Block or a compound of blocks.
3931 # @param theVector Vector, close to the normale of the desired face.
3932 # @return New GEOM_Object, containing the found face.
3934 # @ref swig_todo "Example"
3935 def GetFaceByNormale(self, theBlock, theVector):
3936 # Example: see GEOM_Spanner.py
3937 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
3938 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
3941 ## Find all subshapes of type \a theShapeType of the given shape,
3942 # which have minimal distance to the given point.
3943 # @param theShape Any shape.
3944 # @param thePoint Point, close to the desired shape.
3945 # @param theShapeType Defines what kind of subshapes is searched.
3946 # @param theTolerance The tolerance for distances comparison. All shapes
3947 # with distances to the given point in interval
3948 # [minimal_distance, minimal_distance + theTolerance] will be gathered.
3949 # @return New GEOM_Object, containing a group of all found shapes.
3951 # @ref swig_GetShapesNearPoint "Example"
3952 def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07):
3953 # Example: see GEOM_TestOthers.py
3954 anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
3955 RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
3958 # end of l3_blocks_op
3961 ## @addtogroup l4_blocks_measure
3964 ## Check, if the compound of blocks is given.
3965 # To be considered as a compound of blocks, the
3966 # given shape must satisfy the following conditions:
3967 # - Each element of the compound should be a Block (6 faces and 12 edges).
3968 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
3969 # - The compound should be connexe.
3970 # - The glue between two quadrangle faces should be applied.
3971 # @param theCompound The compound to check.
3972 # @return TRUE, if the given shape is a compound of blocks.
3973 # If theCompound is not valid, prints all discovered errors.
3975 # @ref tui_measurement_tools_page "Example 1"
3976 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
3977 def CheckCompoundOfBlocks(self,theCompound):
3978 # Example: see GEOM_Spanner.py
3979 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
3980 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
3982 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
3986 ## Remove all seam and degenerated edges from \a theShape.
3987 # Unite faces and edges, sharing one surface. It means that
3988 # this faces must have references to one C++ surface object (handle).
3989 # @param theShape The compound or single solid to remove irregular edges from.
3990 # @param doUnionFaces If True, then unite faces. If False (the default value),
3991 # do not unite faces.
3992 # @return Improved shape.
3994 # @ref swig_RemoveExtraEdges "Example"
3995 def RemoveExtraEdges(self, theShape, doUnionFaces=False):
3996 # Example: see GEOM_TestOthers.py
3997 nbFacesOptimum = -1 # -1 means do not unite faces
3998 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
3999 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
4000 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
4003 ## Check, if the given shape is a blocks compound.
4004 # Fix all detected errors.
4005 # \note Single block can be also fixed by this method.
4006 # @param theShape The compound to check and improve.
4007 # @return Improved compound.
4009 # @ref swig_CheckAndImprove "Example"
4010 def CheckAndImprove(self,theShape):
4011 # Example: see GEOM_TestOthers.py
4012 anObj = self.BlocksOp.CheckAndImprove(theShape)
4013 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
4016 # end of l4_blocks_measure
4019 ## @addtogroup l3_blocks_op
4022 ## Get all the blocks, contained in the given compound.
4023 # @param theCompound The compound to explode.
4024 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
4025 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
4026 # \note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
4027 # @return List of GEOM_Objects, containing the retrieved blocks.
4029 # @ref tui_explode_on_blocks "Example 1"
4030 # \n @ref swig_MakeBlockExplode "Example 2"
4031 def MakeBlockExplode(self,theCompound, theMinNbFaces, theMaxNbFaces):
4032 # Example: see GEOM_TestOthers.py
4033 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
4034 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
4035 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
4037 anObj.SetParameters(Parameters)
4041 ## Find block, containing the given point inside its volume or on boundary.
4042 # @param theCompound Compound, to find block in.
4043 # @param thePoint Point, close to the desired block. If the point lays on
4044 # boundary between some blocks, we return block with nearest center.
4045 # @return New GEOM_Object, containing the found block.
4047 # @ref swig_todo "Example"
4048 def GetBlockNearPoint(self,theCompound, thePoint):
4049 # Example: see GEOM_Spanner.py
4050 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
4051 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
4054 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
4055 # @param theCompound Compound, to find block in.
4056 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
4057 # @return New GEOM_Object, containing the found block.
4059 # @ref swig_GetBlockByParts "Example"
4060 def GetBlockByParts(self,theCompound, theParts):
4061 # Example: see GEOM_TestOthers.py
4062 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
4063 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
4066 ## Return all blocks, containing all the elements, passed as the parts.
4067 # @param theCompound Compound, to find blocks in.
4068 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
4069 # @return List of GEOM_Objects, containing the found blocks.
4071 # @ref swig_todo "Example"
4072 def GetBlocksByParts(self,theCompound, theParts):
4073 # Example: see GEOM_Spanner.py
4074 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
4075 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
4078 ## Multi-transformate block and glue the result.
4079 # Transformation is defined so, as to superpose direction faces.
4080 # @param Block Hexahedral solid to be multi-transformed.
4081 # @param DirFace1 ID of First direction face.
4082 # @param DirFace2 ID of Second direction face.
4083 # @param NbTimes Quantity of transformations to be done.
4084 # \note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
4085 # @return New GEOM_Object, containing the result shape.
4087 # @ref tui_multi_transformation "Example"
4088 def MakeMultiTransformation1D(self,Block, DirFace1, DirFace2, NbTimes):
4089 # Example: see GEOM_Spanner.py
4090 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
4091 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
4092 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
4093 anObj.SetParameters(Parameters)
4096 ## Multi-transformate block and glue the result.
4097 # @param Block Hexahedral solid to be multi-transformed.
4098 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
4099 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
4100 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
4101 # @return New GEOM_Object, containing the result shape.
4103 # @ref tui_multi_transformation "Example"
4104 def MakeMultiTransformation2D(self,Block, DirFace1U, DirFace2U, NbTimesU,
4105 DirFace1V, DirFace2V, NbTimesV):
4106 # Example: see GEOM_Spanner.py
4107 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
4108 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
4109 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
4110 DirFace1V, DirFace2V, NbTimesV)
4111 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
4112 anObj.SetParameters(Parameters)
4115 ## Build all possible propagation groups.
4116 # Propagation group is a set of all edges, opposite to one (main)
4117 # edge of this group directly or through other opposite edges.
4118 # Notion of Opposite Edge make sence only on quadrangle face.
4119 # @param theShape Shape to build propagation groups on.
4120 # @return List of GEOM_Objects, each of them is a propagation group.
4122 # @ref swig_Propagate "Example"
4123 def Propagate(self,theShape):
4124 # Example: see GEOM_TestOthers.py
4125 listChains = self.BlocksOp.Propagate(theShape)
4126 RaiseIfFailed("Propagate", self.BlocksOp)
4129 # end of l3_blocks_op
4132 ## @addtogroup l3_groups
4135 ## Creates a new group which will store sub shapes of theMainShape
4136 # @param theMainShape is a GEOM object on which the group is selected
4137 # @param theShapeType defines a shape type of the group
4138 # @return a newly created GEOM group
4140 # @ref tui_working_with_groups_page "Example 1"
4141 # \n @ref swig_CreateGroup "Example 2"
4142 def CreateGroup(self,theMainShape, theShapeType):
4143 # Example: see GEOM_TestOthers.py
4144 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
4145 RaiseIfFailed("CreateGroup", self.GroupOp)
4148 ## Adds a sub object with ID theSubShapeId to the group
4149 # @param theGroup is a GEOM group to which the new sub shape is added
4150 # @param theSubShapeID is a sub shape ID in the main object.
4151 # \note Use method GetSubShapeID() to get an unique ID of the sub shape
4153 # @ref tui_working_with_groups_page "Example"
4154 def AddObject(self,theGroup, theSubShapeID):
4155 # Example: see GEOM_TestOthers.py
4156 self.GroupOp.AddObject(theGroup, theSubShapeID)
4157 if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
4158 RaiseIfFailed("AddObject", self.GroupOp)
4162 ## Removes a sub object with ID \a theSubShapeId from the group
4163 # @param theGroup is a GEOM group from which the new sub shape is removed
4164 # @param theSubShapeID is a sub shape ID in the main object.
4165 # \note Use method GetSubShapeID() to get an unique ID of the sub shape
4167 # @ref tui_working_with_groups_page "Example"
4168 def RemoveObject(self,theGroup, theSubShapeID):
4169 # Example: see GEOM_TestOthers.py
4170 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
4171 RaiseIfFailed("RemoveObject", self.GroupOp)
4174 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
4175 # @param theGroup is a GEOM group to which the new sub shapes are added.
4176 # @param theSubShapes is a list of sub shapes to be added.
4178 # @ref tui_working_with_groups_page "Example"
4179 def UnionList (self,theGroup, theSubShapes):
4180 # Example: see GEOM_TestOthers.py
4181 self.GroupOp.UnionList(theGroup, theSubShapes)
4182 RaiseIfFailed("UnionList", self.GroupOp)
4185 ## Works like the above method, but argument
4186 # theSubShapes here is a list of sub-shapes indices
4188 # @ref swig_UnionIDs "Example"
4189 def UnionIDs(self,theGroup, theSubShapes):
4190 # Example: see GEOM_TestOthers.py
4191 self.GroupOp.UnionIDs(theGroup, theSubShapes)
4192 RaiseIfFailed("UnionIDs", self.GroupOp)
4195 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
4196 # @param theGroup is a GEOM group from which the sub-shapes are removed.
4197 # @param theSubShapes is a list of sub-shapes to be removed.
4199 # @ref tui_working_with_groups_page "Example"
4200 def DifferenceList (self,theGroup, theSubShapes):
4201 # Example: see GEOM_TestOthers.py
4202 self.GroupOp.DifferenceList(theGroup, theSubShapes)
4203 RaiseIfFailed("DifferenceList", self.GroupOp)
4206 ## Works like the above method, but argument
4207 # theSubShapes here is a list of sub-shapes indices
4209 # @ref swig_DifferenceIDs "Example"
4210 def DifferenceIDs(self,theGroup, theSubShapes):
4211 # Example: see GEOM_TestOthers.py
4212 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
4213 RaiseIfFailed("DifferenceIDs", self.GroupOp)
4216 ## Returns a list of sub objects ID stored in the group
4217 # @param theGroup is a GEOM group for which a list of IDs is requested
4219 # @ref swig_GetObjectIDs "Example"
4220 def GetObjectIDs(self,theGroup):
4221 # Example: see GEOM_TestOthers.py
4222 ListIDs = self.GroupOp.GetObjects(theGroup)
4223 RaiseIfFailed("GetObjects", self.GroupOp)
4226 ## Returns a type of sub objects stored in the group
4227 # @param theGroup is a GEOM group which type is returned.
4229 # @ref swig_GetType "Example"
4230 def GetType(self,theGroup):
4231 # Example: see GEOM_TestOthers.py
4232 aType = self.GroupOp.GetType(theGroup)
4233 RaiseIfFailed("GetType", self.GroupOp)
4236 ## Convert a type of geom object from id to string value
4237 # @param theId is a GEOM obect type id.
4239 # @ref swig_GetType "Example"
4240 def ShapeIdToType(self, theId):
4314 return "FREE_BOUNDS"
4322 return "THRUSECTIONS"
4324 return "COMPOUNDFILTER"
4326 return "SHAPES_ON_SHAPE"
4328 return "ELLIPSE_ARC"
4335 return "Shape Id not exist."
4337 ## Returns a main shape associated with the group
4338 # @param theGroup is a GEOM group for which a main shape object is requested
4339 # @return a GEOM object which is a main shape for theGroup
4341 # @ref swig_GetMainShape "Example"
4342 def GetMainShape(self,theGroup):
4343 # Example: see GEOM_TestOthers.py
4344 anObj = self.GroupOp.GetMainShape(theGroup)
4345 RaiseIfFailed("GetMainShape", self.GroupOp)
4348 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
4349 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
4351 # @ref swig_todo "Example"
4352 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1):
4353 edges = self.SubShapeAll(theShape, ShapeType["EDGE"])
4356 Props = self.BasicProperties(edge)
4357 if min_length <= Props[0] and Props[0] <= max_length:
4358 if (not include_min) and (min_length == Props[0]):
4361 if (not include_max) and (Props[0] == max_length):
4364 edges_in_range.append(edge)
4366 if len(edges_in_range) <= 0:
4367 print "No edges found by given criteria"
4370 group_edges = self.CreateGroup(theShape, ShapeType["EDGE"])
4371 self.UnionList(group_edges, edges_in_range)
4375 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
4376 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
4378 # @ref swig_todo "Example"
4379 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
4380 nb_selected = sg.SelectedCount()
4382 print "Select a shape before calling this function, please."
4385 print "Only one shape must be selected"
4388 id_shape = sg.getSelected(0)
4389 shape = IDToObject( id_shape )
4391 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
4395 if include_min: left_str = " <= "
4396 if include_max: right_str = " <= "
4398 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
4399 + left_str + "length" + right_str + `max_length`)
4401 sg.updateObjBrowser(1)
4408 ## @addtogroup l4_advanced
4411 ## Create a T-shape object with specified caracteristics for the main
4412 # and the incident pipes (radius, width, half-length).
4413 # The extremities of the main pipe are located on junctions points P1 and P2.
4414 # The extremity of the incident pipe is located on junction point P3.
4415 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
4416 # the main plane of the T-shape is XOY.
4417 # @param theR1 Internal radius of main pipe
4418 # @param theW1 Width of main pipe
4419 # @param theL1 Half-length of main pipe
4420 # @param theR2 Internal radius of incident pipe (R2 < R1)
4421 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
4422 # @param theL2 Half-length of incident pipe
4423 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
4424 # @param theP1 1st junction point of main pipe
4425 # @param theP2 2nd junction point of main pipe
4426 # @param theP3 Junction point of incident pipe
4427 # @return List of GEOM_Objects, containing the created shape and propagation groups.
4429 # @ref tui_creation_pipetshape "Example"
4430 def MakePipeTShape(self, theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh=True, theP1=None, theP2=None, theP3=None):
4431 theR1, theW1, theL1, theR2, theW2, theL2, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2)
4432 if (theP1 and theP2 and theP3):
4433 anObj = self.AdvOp.MakePipeTShapeWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh, theP1, theP2, theP3)
4435 anObj = self.AdvOp.MakePipeTShape(theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh)
4436 RaiseIfFailed("MakePipeTShape", self.AdvOp)
4437 if Parameters: anObj[0].SetParameters(Parameters)
4440 ## Create a T-shape object with chamfer and with specified caracteristics for the main
4441 # and the incident pipes (radius, width, half-length). The chamfer is
4442 # created on the junction of the pipes.
4443 # The extremities of the main pipe are located on junctions points P1 and P2.
4444 # The extremity of the incident pipe is located on junction point P3.
4445 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
4446 # the main plane of the T-shape is XOY.
4447 # @param theR1 Internal radius of main pipe
4448 # @param theW1 Width of main pipe
4449 # @param theL1 Half-length of main pipe
4450 # @param theR2 Internal radius of incident pipe (R2 < R1)
4451 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
4452 # @param theL2 Half-length of incident pipe
4453 # @param theH Height of the chamfer.
4454 # @param theW Width of the chamfer.
4455 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
4456 # @param theP1 1st junction point of main pipe
4457 # @param theP2 2nd junction point of main pipe
4458 # @param theP3 Junction point of incident pipe
4459 # @return List of GEOM_Objects, containing the created shape and propagation groups.
4461 # @ref tui_creation_pipetshape "Example"
4462 def MakePipeTShapeChamfer(self, theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh=True, theP1=None, theP2=None, theP3=None):
4463 theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW)
4464 if (theP1 and theP2 and theP3):
4465 anObj = self.AdvOp.MakePipeTShapeChamferWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh, theP1, theP2, theP3)
4467 anObj = self.AdvOp.MakePipeTShapeChamfer(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh)
4468 RaiseIfFailed("MakePipeTShapeChamfer", self.AdvOp)
4469 if Parameters: anObj[0].SetParameters(Parameters)
4472 ## Create a T-shape object with fillet and with specified caracteristics for the main
4473 # and the incident pipes (radius, width, half-length). The fillet is
4474 # created on the junction of the pipes.
4475 # The extremities of the main pipe are located on junctions points P1 and P2.
4476 # The extremity of the incident pipe is located on junction point P3.
4477 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
4478 # the main plane of the T-shape is XOY.
4479 # @param theR1 Internal radius of main pipe
4480 # @param theW1 Width of main pipe
4481 # @param theL1 Half-length of main pipe
4482 # @param theR2 Internal radius of incident pipe (R2 < R1)
4483 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
4484 # @param theL2 Half-length of incident pipe
4485 # @param theRF Radius of curvature of fillet.
4486 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
4487 # @param theP1 1st junction point of main pipe
4488 # @param theP2 2nd junction point of main pipe
4489 # @param theP3 Junction point of incident pipe
4490 # @return List of GEOM_Objects, containing the created shape and propagation groups.
4492 # @ref tui_creation_pipetshape "Example"
4493 def MakePipeTShapeFillet(self, theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh=True, theP1=None, theP2=None, theP3=None):
4494 theR1, theW1, theL1, theR2, theW2, theL2, theRF, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theRF)
4495 if (theP1 and theP2 and theP3):
4496 anObj = self.AdvOp.MakePipeTShapeFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh, theP1, theP2, theP3)
4498 anObj = self.AdvOp.MakePipeTShapeFillet(theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh)
4499 RaiseIfFailed("MakePipeTShapeFillet", self.AdvOp)
4500 if Parameters: anObj[0].SetParameters(Parameters)
4503 #@@ insert new functions before this line @@ do not remove this line @@#
4505 # end of l4_advanced
4508 ## Create a copy of the given object
4509 # @ingroup l1_geompy_auxiliary
4511 # @ref swig_all_advanced "Example"
4512 def MakeCopy(self,theOriginal):
4513 # Example: see GEOM_TestAll.py
4514 anObj = self.InsertOp.MakeCopy(theOriginal)
4515 RaiseIfFailed("MakeCopy", self.InsertOp)
4518 ## Add Path to load python scripts from
4519 # @ingroup l1_geompy_auxiliary
4520 def addPath(self,Path):
4521 if (sys.path.count(Path) < 1):
4522 sys.path.append(Path)
4526 ## Load marker texture from the file
4527 # @param Path a path to the texture file
4528 # @return unique texture identifier
4529 # @ingroup l1_geompy_auxiliary
4530 def LoadTexture(self, Path):
4531 # Example: see GEOM_TestAll.py
4532 ID = self.InsertOp.LoadTexture(Path)
4533 RaiseIfFailed("LoadTexture", self.InsertOp)
4536 ## Add marker texture. @a Width and @a Height parameters
4537 # specify width and height of the texture in pixels.
4538 # If @a RowData is @c True, @a Texture parameter should represent texture data
4539 # packed into the byte array. If @a RowData is @c False (default), @a Texture
4540 # parameter should be unpacked string, in which '1' symbols represent opaque
4541 # pixels and '0' represent transparent pixels of the texture bitmap.
4543 # @param Width texture width in pixels
4544 # @param Height texture height in pixels
4545 # @param Texture texture data
4546 # @param RowData if @c True, @a Texture data are packed in the byte stream
4547 # @ingroup l1_geompy_auxiliary
4548 def AddTexture(self, Width, Height, Texture, RowData=False):
4549 # Example: see GEOM_TestAll.py
4550 if not RowData: Texture = PackData(Texture)
4551 ID = self.InsertOp.AddTexture(Width, Height, Texture)
4552 RaiseIfFailed("AddTexture", self.InsertOp)
4556 #Register the new proxy for GEOM_Gen
4557 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geompyDC)