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 shape
2234 # @param aType shape type
2235 def ExtractShapes(self, aShape, aType, isSorted = False):
2236 ListObj = self.ShapesOp.ExtractSubShapes(aShape, aType, isSorted)
2237 RaiseIfFailed("ExtractSubShapes", self.ShapesOp)
2240 # end of l4_decompose
2243 ## @addtogroup l4_decompose_d
2246 ## Deprecated method
2247 # It works like SubShapeAllSortedCentres, but wrongly
2248 # defines centres of faces, shells and solids.
2249 def SubShapeAllSorted(self, aShape, aType):
2250 ListObj = self.ShapesOp.MakeExplode(aShape, aType, True)
2251 RaiseIfFailed("MakeExplode", self.ShapesOp)
2254 ## Deprecated method
2255 # It works like SubShapeAllSortedCentresIDs, but wrongly
2256 # defines centres of faces, shells and solids.
2257 def SubShapeAllSortedIDs(self, aShape, aType):
2258 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, aType, True)
2259 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
2262 ## Deprecated method
2263 # It works like SubShapeSortedCentres, but has a bug
2264 # (wrongly defines centres of faces, shells and solids).
2265 def SubShapeSorted(self, aShape, aType, ListOfInd):
2267 AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, aType)
2268 for ind in ListOfInd:
2269 ListOfIDs.append(AllShapeIDsList[ind - 1])
2270 anObj = self.GetSubShape(aShape, ListOfIDs)
2273 # end of l4_decompose_d
2276 ## @addtogroup l3_healing
2279 ## Apply a sequence of Shape Healing operators to the given object.
2280 # @param theShape Shape to be processed.
2281 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
2282 # @param theParameters List of names of parameters
2283 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
2284 # @param theValues List of values of parameters, in the same order
2285 # as parameters are listed in <VAR>theParameters</VAR> list.
2286 # @return New GEOM_Object, containing processed shape.
2288 # @ref tui_shape_processing "Example"
2289 def ProcessShape(self, theShape, theOperators, theParameters, theValues):
2290 # Example: see GEOM_TestHealing.py
2291 theValues,Parameters = ParseList(theValues)
2292 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
2293 # To avoid script failure in case of good argument shape
2294 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
2296 RaiseIfFailed("ProcessShape", self.HealOp)
2297 for string in (theOperators + theParameters):
2298 Parameters = ":" + Parameters
2300 anObj.SetParameters(Parameters)
2303 ## Remove faces from the given object (shape).
2304 # @param theObject Shape to be processed.
2305 # @param theFaces Indices of faces to be removed, if EMPTY then the method
2306 # removes ALL faces of the given object.
2307 # @return New GEOM_Object, containing processed shape.
2309 # @ref tui_suppress_faces "Example"
2310 def SuppressFaces(self,theObject, theFaces):
2311 # Example: see GEOM_TestHealing.py
2312 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
2313 RaiseIfFailed("SuppressFaces", self.HealOp)
2316 ## Sewing of some shapes into single shape.
2318 # @ref tui_sewing "Example"
2319 def MakeSewing(self, ListShape, theTolerance):
2320 # Example: see GEOM_TestHealing.py
2321 comp = self.MakeCompound(ListShape)
2322 anObj = self.Sew(comp, theTolerance)
2325 ## Sewing of the given object.
2326 # @param theObject Shape to be processed.
2327 # @param theTolerance Required tolerance value.
2328 # @return New GEOM_Object, containing processed shape.
2329 def Sew(self, theObject, theTolerance):
2330 # Example: see MakeSewing() above
2331 theTolerance,Parameters = ParseParameters(theTolerance)
2332 anObj = self.HealOp.Sew(theObject, theTolerance)
2333 RaiseIfFailed("Sew", self.HealOp)
2334 anObj.SetParameters(Parameters)
2337 ## Remove internal wires and edges from the given object (face).
2338 # @param theObject Shape to be processed.
2339 # @param theWires Indices of wires to be removed, if EMPTY then the method
2340 # removes ALL internal wires of the given object.
2341 # @return New GEOM_Object, containing processed shape.
2343 # @ref tui_suppress_internal_wires "Example"
2344 def SuppressInternalWires(self,theObject, theWires):
2345 # Example: see GEOM_TestHealing.py
2346 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
2347 RaiseIfFailed("RemoveIntWires", self.HealOp)
2350 ## Remove internal closed contours (holes) from the given object.
2351 # @param theObject Shape to be processed.
2352 # @param theWires Indices of wires to be removed, if EMPTY then the method
2353 # removes ALL internal holes of the given object
2354 # @return New GEOM_Object, containing processed shape.
2356 # @ref tui_suppress_holes "Example"
2357 def SuppressHoles(self,theObject, theWires):
2358 # Example: see GEOM_TestHealing.py
2359 anObj = self.HealOp.FillHoles(theObject, theWires)
2360 RaiseIfFailed("FillHoles", self.HealOp)
2363 ## Close an open wire.
2364 # @param theObject Shape to be processed.
2365 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
2366 # if [ ], then <VAR>theObject</VAR> itself is a wire.
2367 # @param isCommonVertex If True : closure by creation of a common vertex,
2368 # If False : closure by creation of an edge between ends.
2369 # @return New GEOM_Object, containing processed shape.
2371 # @ref tui_close_contour "Example"
2372 def CloseContour(self,theObject, theWires, isCommonVertex):
2373 # Example: see GEOM_TestHealing.py
2374 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
2375 RaiseIfFailed("CloseContour", self.HealOp)
2378 ## Addition of a point to a given edge object.
2379 # @param theObject Shape to be processed.
2380 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
2381 # if -1, then theObject itself is the edge.
2382 # @param theValue Value of parameter on edge or length parameter,
2383 # depending on \a isByParameter.
2384 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1],
2385 # if FALSE : \a theValue is treated as a length parameter [0..1]
2386 # @return New GEOM_Object, containing processed shape.
2388 # @ref tui_add_point_on_edge "Example"
2389 def DivideEdge(self,theObject, theEdgeIndex, theValue, isByParameter):
2390 # Example: see GEOM_TestHealing.py
2391 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
2392 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
2393 RaiseIfFailed("DivideEdge", self.HealOp)
2394 anObj.SetParameters(Parameters)
2397 ## Change orientation of the given object. Updates given shape.
2398 # @param theObject Shape to be processed.
2400 # @ref swig_todo "Example"
2401 def ChangeOrientationShell(self,theObject):
2402 theObject = self.HealOp.ChangeOrientation(theObject)
2403 RaiseIfFailed("ChangeOrientation", self.HealOp)
2406 ## Change orientation of the given object.
2407 # @param theObject Shape to be processed.
2408 # @return New GEOM_Object, containing processed shape.
2410 # @ref swig_todo "Example"
2411 def ChangeOrientationShellCopy(self, theObject):
2412 anObj = self.HealOp.ChangeOrientationCopy(theObject)
2413 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
2416 ## Try to limit tolerance of the given object by value \a theTolerance.
2417 # @param theObject Shape to be processed.
2418 # @param theTolerance Required tolerance value.
2419 # @return New GEOM_Object, containing processed shape.
2421 # @ref tui_limit_tolerance "Example"
2422 def LimitTolerance(self, theObject, theTolerance = 1e-07):
2423 anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
2424 RaiseIfFailed("LimitTolerance", self.HealOp)
2427 ## Get a list of wires (wrapped in GEOM_Object-s),
2428 # that constitute a free boundary of the given shape.
2429 # @param theObject Shape to get free boundary of.
2430 # @return [status, theClosedWires, theOpenWires]
2431 # status: FALSE, if an error(s) occured during the method execution.
2432 # theClosedWires: Closed wires on the free boundary of the given shape.
2433 # theOpenWires: Open wires on the free boundary of the given shape.
2435 # @ref tui_measurement_tools_page "Example"
2436 def GetFreeBoundary(self, theObject):
2437 # Example: see GEOM_TestHealing.py
2438 anObj = self.HealOp.GetFreeBoundary(theObject)
2439 RaiseIfFailed("GetFreeBoundary", self.HealOp)
2442 ## Replace coincident faces in theShape by one face.
2443 # @param theShape Initial shape.
2444 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
2445 # @param doKeepNonSolids If FALSE, only solids will present in the result,
2446 # otherwise all initial shapes.
2447 # @return New GEOM_Object, containing a copy of theShape without coincident faces.
2449 # @ref tui_glue_faces "Example"
2450 def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True):
2451 # Example: see GEOM_Spanner.py
2452 theTolerance,Parameters = ParseParameters(theTolerance)
2453 anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
2455 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
2456 anObj.SetParameters(Parameters)
2459 ## Find coincident faces in theShape for possible gluing.
2460 # @param theShape Initial shape.
2461 # @param theTolerance Maximum distance between faces,
2462 # which can be considered as coincident.
2465 # @ref swig_todo "Example"
2466 def GetGlueFaces(self, theShape, theTolerance):
2467 # Example: see GEOM_Spanner.py
2468 anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
2469 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
2472 ## Replace coincident faces in theShape by one face
2473 # in compliance with given list of faces
2474 # @param theShape Initial shape.
2475 # @param theTolerance Maximum distance between faces,
2476 # which can be considered as coincident.
2477 # @param theFaces List of faces for gluing.
2478 # @param doKeepNonSolids If FALSE, only solids will present in the result,
2479 # otherwise all initial shapes.
2480 # @return New GEOM_Object, containing a copy of theShape
2481 # without some faces.
2483 # @ref swig_todo "Example"
2484 def MakeGlueFacesByList(self, theShape, theTolerance, theFaces, doKeepNonSolids=True):
2485 # Example: see GEOM_Spanner.py
2486 anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces, doKeepNonSolids)
2488 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
2494 ## @addtogroup l3_boolean Boolean Operations
2497 # -----------------------------------------------------------------------------
2498 # Boolean (Common, Cut, Fuse, Section)
2499 # -----------------------------------------------------------------------------
2501 ## Perform one of boolean operations on two given shapes.
2502 # @param theShape1 First argument for boolean operation.
2503 # @param theShape2 Second argument for boolean operation.
2504 # @param theOperation Indicates the operation to be done:
2505 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
2506 # @return New GEOM_Object, containing the result shape.
2508 # @ref tui_fuse "Example"
2509 def MakeBoolean(self,theShape1, theShape2, theOperation):
2510 # Example: see GEOM_TestAll.py
2511 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation)
2512 RaiseIfFailed("MakeBoolean", self.BoolOp)
2515 ## Shortcut to MakeBoolean(s1, s2, 1)
2517 # @ref tui_common "Example 1"
2518 # \n @ref swig_MakeCommon "Example 2"
2519 def MakeCommon(self, s1, s2):
2520 # Example: see GEOM_TestOthers.py
2521 return self.MakeBoolean(s1, s2, 1)
2523 ## Shortcut to MakeBoolean(s1, s2, 2)
2525 # @ref tui_cut "Example 1"
2526 # \n @ref swig_MakeCommon "Example 2"
2527 def MakeCut(self, s1, s2):
2528 # Example: see GEOM_TestOthers.py
2529 return self.MakeBoolean(s1, s2, 2)
2531 ## Shortcut to MakeBoolean(s1, s2, 3)
2533 # @ref tui_fuse "Example 1"
2534 # \n @ref swig_MakeCommon "Example 2"
2535 def MakeFuse(self, s1, s2):
2536 # Example: see GEOM_TestOthers.py
2537 return self.MakeBoolean(s1, s2, 3)
2539 ## Shortcut to MakeBoolean(s1, s2, 4)
2541 # @ref tui_section "Example 1"
2542 # \n @ref swig_MakeCommon "Example 2"
2543 def MakeSection(self, s1, s2):
2544 # Example: see GEOM_TestOthers.py
2545 return self.MakeBoolean(s1, s2, 4)
2550 ## @addtogroup l3_basic_op
2553 ## Perform partition operation.
2554 # @param ListShapes Shapes to be intersected.
2555 # @param ListTools Shapes to intersect theShapes.
2556 # !!!NOTE: Each compound from ListShapes and ListTools will be exploded
2557 # in order to avoid possible intersection between shapes from
2559 # @param Limit Type of resulting shapes (corresponding to TopAbs_ShapeEnum).
2560 # If this parameter is set to -1 ("Auto"), most appropriate shape limit
2561 # type will be detected automatically.
2562 # @param KeepNonlimitShapes: if this parameter == 0, then only shapes of
2563 # target type (equal to Limit) are kept in the result,
2564 # else standalone shapes of lower dimension
2565 # are kept also (if they exist).
2567 # After implementation new version of PartitionAlgo (October 2006)
2568 # other parameters are ignored by current functionality. They are kept
2569 # in this function only for support old versions.
2570 # Ignored parameters:
2571 # @param ListKeepInside Shapes, outside which the results will be deleted.
2572 # Each shape from theKeepInside must belong to theShapes also.
2573 # @param ListRemoveInside Shapes, inside which the results will be deleted.
2574 # Each shape from theRemoveInside must belong to theShapes also.
2575 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
2576 # @param ListMaterials Material indices for each shape. Make sence,
2577 # only if theRemoveWebs is TRUE.
2579 # @return New GEOM_Object, containing the result shapes.
2581 # @ref tui_partition "Example"
2582 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
2583 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
2584 KeepNonlimitShapes=0):
2585 # Example: see GEOM_TestAll.py
2586 if Limit == ShapeType["AUTO"]:
2587 # automatic detection of the most appropriate shape limit type
2589 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
2590 Limit = EnumToLong(lim)
2592 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
2593 ListKeepInside, ListRemoveInside,
2594 Limit, RemoveWebs, ListMaterials,
2595 KeepNonlimitShapes);
2596 RaiseIfFailed("MakePartition", self.BoolOp)
2599 ## Perform partition operation.
2600 # This method may be useful if it is needed to make a partition for
2601 # compound contains nonintersected shapes. Performance will be better
2602 # since intersection between shapes from compound is not performed.
2604 # Description of all parameters as in previous method MakePartition()
2606 # !!!NOTE: Passed compounds (via ListShapes or via ListTools)
2607 # have to consist of nonintersecting shapes.
2609 # @return New GEOM_Object, containing the result shapes.
2611 # @ref swig_todo "Example"
2612 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
2613 ListKeepInside=[], ListRemoveInside=[],
2614 Limit=ShapeType["AUTO"], RemoveWebs=0,
2615 ListMaterials=[], KeepNonlimitShapes=0):
2616 if Limit == ShapeType["AUTO"]:
2617 # automatic detection of the most appropriate shape limit type
2619 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
2620 Limit = EnumToLong(lim)
2622 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
2623 ListKeepInside, ListRemoveInside,
2624 Limit, RemoveWebs, ListMaterials,
2625 KeepNonlimitShapes);
2626 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
2629 ## Shortcut to MakePartition()
2631 # @ref tui_partition "Example 1"
2632 # \n @ref swig_Partition "Example 2"
2633 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
2634 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
2635 KeepNonlimitShapes=0):
2636 # Example: see GEOM_TestOthers.py
2637 anObj = self.MakePartition(ListShapes, ListTools,
2638 ListKeepInside, ListRemoveInside,
2639 Limit, RemoveWebs, ListMaterials,
2640 KeepNonlimitShapes);
2643 ## Perform partition of the Shape with the Plane
2644 # @param theShape Shape to be intersected.
2645 # @param thePlane Tool shape, to intersect theShape.
2646 # @return New GEOM_Object, containing the result shape.
2648 # @ref tui_partition "Example"
2649 def MakeHalfPartition(self,theShape, thePlane):
2650 # Example: see GEOM_TestAll.py
2651 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
2652 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
2655 # end of l3_basic_op
2658 ## @addtogroup l3_transform
2661 ## Translate the given object along the vector, specified
2662 # by its end points, creating its copy before the translation.
2663 # @param theObject The object to be translated.
2664 # @param thePoint1 Start point of translation vector.
2665 # @param thePoint2 End point of translation vector.
2666 # @return New GEOM_Object, containing the translated object.
2668 # @ref tui_translation "Example 1"
2669 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
2670 def MakeTranslationTwoPoints(self,theObject, thePoint1, thePoint2):
2671 # Example: see GEOM_TestAll.py
2672 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
2673 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
2676 ## Translate the given object along the vector, specified by its components.
2677 # @param theObject The object to be translated.
2678 # @param theDX,theDY,theDZ Components of translation vector.
2679 # @return Translated GEOM_Object.
2681 # @ref tui_translation "Example"
2682 def TranslateDXDYDZ(self,theObject, theDX, theDY, theDZ):
2683 # Example: see GEOM_TestAll.py
2684 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
2685 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
2686 anObj.SetParameters(Parameters)
2687 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
2690 ## Translate the given object along the vector, specified
2691 # by its components, creating its copy before the translation.
2692 # @param theObject The object to be translated.
2693 # @param theDX,theDY,theDZ Components of translation vector.
2694 # @return New GEOM_Object, containing the translated object.
2696 # @ref tui_translation "Example"
2697 def MakeTranslation(self,theObject, theDX, theDY, theDZ):
2698 # Example: see GEOM_TestAll.py
2699 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
2700 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
2701 anObj.SetParameters(Parameters)
2702 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
2705 ## Translate the given object along the given vector,
2706 # creating its copy before the translation.
2707 # @param theObject The object to be translated.
2708 # @param theVector The translation vector.
2709 # @return New GEOM_Object, containing the translated object.
2711 # @ref tui_translation "Example"
2712 def MakeTranslationVector(self,theObject, theVector):
2713 # Example: see GEOM_TestAll.py
2714 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
2715 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
2718 ## Translate the given object along the given vector on given distance.
2719 # @param theObject The object to be translated.
2720 # @param theVector The translation vector.
2721 # @param theDistance The translation distance.
2722 # @param theCopy Flag used to translate object itself or create a copy.
2723 # @return Translated GEOM_Object.
2725 # @ref tui_translation "Example"
2726 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy):
2727 # Example: see GEOM_TestAll.py
2728 theDistance,Parameters = ParseParameters(theDistance)
2729 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
2730 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
2731 anObj.SetParameters(Parameters)
2734 ## Translate the given object along the given vector on given distance,
2735 # creating its copy before the translation.
2736 # @param theObject The object to be translated.
2737 # @param theVector The translation vector.
2738 # @param theDistance The translation distance.
2739 # @return New GEOM_Object, containing the translated object.
2741 # @ref tui_translation "Example"
2742 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance):
2743 # Example: see GEOM_TestAll.py
2744 theDistance,Parameters = ParseParameters(theDistance)
2745 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
2746 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
2747 anObj.SetParameters(Parameters)
2750 ## Rotate the given object around the given axis on the given angle.
2751 # @param theObject The object to be rotated.
2752 # @param theAxis Rotation axis.
2753 # @param theAngle Rotation angle in radians.
2754 # @return Rotated GEOM_Object.
2756 # @ref tui_rotation "Example"
2757 def Rotate(self,theObject, theAxis, theAngle):
2758 # Example: see GEOM_TestAll.py
2760 if isinstance(theAngle,str):
2762 theAngle, Parameters = ParseParameters(theAngle)
2764 theAngle = theAngle*math.pi/180.0
2765 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
2766 RaiseIfFailed("RotateCopy", self.TrsfOp)
2767 anObj.SetParameters(Parameters)
2770 ## Rotate the given object around the given axis
2771 # on the given angle, creating its copy before the rotatation.
2772 # @param theObject The object to be rotated.
2773 # @param theAxis Rotation axis.
2774 # @param theAngle Rotation angle in radians.
2775 # @return New GEOM_Object, containing the rotated object.
2777 # @ref tui_rotation "Example"
2778 def MakeRotation(self,theObject, theAxis, theAngle):
2779 # Example: see GEOM_TestAll.py
2781 if isinstance(theAngle,str):
2783 theAngle, Parameters = ParseParameters(theAngle)
2785 theAngle = theAngle*math.pi/180.0
2786 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
2787 RaiseIfFailed("RotateCopy", self.TrsfOp)
2788 anObj.SetParameters(Parameters)
2791 ## Rotate given object around vector perpendicular to plane
2792 # containing three points, creating its copy before the rotatation.
2793 # @param theObject The object to be rotated.
2794 # @param theCentPoint central point - the axis is the vector perpendicular to the plane
2795 # containing the three points.
2796 # @param thePoint1,thePoint2 - in a perpendicular plane of the axis.
2797 # @return New GEOM_Object, containing the rotated object.
2799 # @ref tui_rotation "Example"
2800 def MakeRotationThreePoints(self,theObject, theCentPoint, thePoint1, thePoint2):
2801 # Example: see GEOM_TestAll.py
2802 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
2803 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
2806 ## Scale the given object by the factor, creating its copy before the scaling.
2807 # @param theObject The object to be scaled.
2808 # @param thePoint Center point for scaling.
2809 # Passing None for it means scaling relatively the origin of global CS.
2810 # @param theFactor Scaling factor value.
2811 # @return New GEOM_Object, containing the scaled shape.
2813 # @ref tui_scale "Example"
2814 def MakeScaleTransform(self, theObject, thePoint, theFactor):
2815 # Example: see GEOM_TestAll.py
2816 theFactor, Parameters = ParseParameters(theFactor)
2817 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
2818 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
2819 anObj.SetParameters(Parameters)
2822 ## Scale the given object by different factors along coordinate axes,
2823 # creating its copy before the scaling.
2824 # @param theObject The object to be scaled.
2825 # @param thePoint Center point for scaling.
2826 # Passing None for it means scaling relatively the origin of global CS.
2827 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
2828 # @return New GEOM_Object, containing the scaled shape.
2830 # @ref swig_scale "Example"
2831 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ):
2832 # Example: see GEOM_TestAll.py
2833 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
2834 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
2835 theFactorX, theFactorY, theFactorZ)
2836 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
2837 anObj.SetParameters(Parameters)
2840 ## Create an object, symmetrical
2841 # to the given one relatively the given plane.
2842 # @param theObject The object to be mirrored.
2843 # @param thePlane Plane of symmetry.
2844 # @return New GEOM_Object, containing the mirrored shape.
2846 # @ref tui_mirror "Example"
2847 def MakeMirrorByPlane(self,theObject, thePlane):
2848 # Example: see GEOM_TestAll.py
2849 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
2850 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
2853 ## Create an object, symmetrical
2854 # to the given one relatively the given axis.
2855 # @param theObject The object to be mirrored.
2856 # @param theAxis Axis of symmetry.
2857 # @return New GEOM_Object, containing the mirrored shape.
2859 # @ref tui_mirror "Example"
2860 def MakeMirrorByAxis(self,theObject, theAxis):
2861 # Example: see GEOM_TestAll.py
2862 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
2863 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
2866 ## Create an object, symmetrical
2867 # to the given one relatively the given point.
2868 # @param theObject The object to be mirrored.
2869 # @param thePoint Point of symmetry.
2870 # @return New GEOM_Object, containing the mirrored shape.
2872 # @ref tui_mirror "Example"
2873 def MakeMirrorByPoint(self,theObject, thePoint):
2874 # Example: see GEOM_TestAll.py
2875 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
2876 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
2879 ## Modify the Location of the given object by LCS,
2880 # creating its copy before the setting.
2881 # @param theObject The object to be displaced.
2882 # @param theStartLCS Coordinate system to perform displacement from it.
2883 # If \a theStartLCS is NULL, displacement
2884 # will be performed from global CS.
2885 # If \a theObject itself is used as \a theStartLCS,
2886 # its location will be changed to \a theEndLCS.
2887 # @param theEndLCS Coordinate system to perform displacement to it.
2888 # @return New GEOM_Object, containing the displaced shape.
2890 # @ref tui_modify_location "Example"
2891 def MakePosition(self,theObject, theStartLCS, theEndLCS):
2892 # Example: see GEOM_TestAll.py
2893 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
2894 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
2897 ## Modify the Location of the given object by Path,
2898 # @param theObject The object to be displaced.
2899 # @param thePath Wire or Edge along that the object will be translated.
2900 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
2901 # @param theCopy is to create a copy objects if true.
2902 # @param theReverse - 0 for usual direction, 1 to reverse path direction.
2903 # @return New GEOM_Object, containing the displaced shape.
2905 # @ref tui_modify_location "Example"
2906 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
2907 # Example: see GEOM_TestAll.py
2908 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
2909 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
2912 ## Create new object as offset of the given one.
2913 # @param theObject The base object for the offset.
2914 # @param theOffset Offset value.
2915 # @return New GEOM_Object, containing the offset object.
2917 # @ref tui_offset "Example"
2918 def MakeOffset(self,theObject, theOffset):
2919 # Example: see GEOM_TestAll.py
2920 theOffset, Parameters = ParseParameters(theOffset)
2921 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
2922 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
2923 anObj.SetParameters(Parameters)
2926 # -----------------------------------------------------------------------------
2928 # -----------------------------------------------------------------------------
2930 ## Translate the given object along the given vector a given number times
2931 # @param theObject The object to be translated.
2932 # @param theVector Direction of the translation.
2933 # @param theStep Distance to translate on.
2934 # @param theNbTimes Quantity of translations to be done.
2935 # @return New GEOM_Object, containing compound of all
2936 # the shapes, obtained after each translation.
2938 # @ref tui_multi_translation "Example"
2939 def MakeMultiTranslation1D(self,theObject, theVector, theStep, theNbTimes):
2940 # Example: see GEOM_TestAll.py
2941 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
2942 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
2943 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
2944 anObj.SetParameters(Parameters)
2947 ## Conseqently apply two specified translations to theObject specified number of times.
2948 # @param theObject The object to be translated.
2949 # @param theVector1 Direction of the first translation.
2950 # @param theStep1 Step of the first translation.
2951 # @param theNbTimes1 Quantity of translations to be done along theVector1.
2952 # @param theVector2 Direction of the second translation.
2953 # @param theStep2 Step of the second translation.
2954 # @param theNbTimes2 Quantity of translations to be done along theVector2.
2955 # @return New GEOM_Object, containing compound of all
2956 # the shapes, obtained after each translation.
2958 # @ref tui_multi_translation "Example"
2959 def MakeMultiTranslation2D(self,theObject, theVector1, theStep1, theNbTimes1,
2960 theVector2, theStep2, theNbTimes2):
2961 # Example: see GEOM_TestAll.py
2962 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
2963 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
2964 theVector2, theStep2, theNbTimes2)
2965 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
2966 anObj.SetParameters(Parameters)
2969 ## Rotate the given object around the given axis a given number times.
2970 # Rotation angle will be 2*PI/theNbTimes.
2971 # @param theObject The object to be rotated.
2972 # @param theAxis The rotation axis.
2973 # @param theNbTimes Quantity of rotations to be done.
2974 # @return New GEOM_Object, containing compound of all the
2975 # shapes, obtained after each rotation.
2977 # @ref tui_multi_rotation "Example"
2978 def MultiRotate1D(self,theObject, theAxis, theNbTimes):
2979 # Example: see GEOM_TestAll.py
2980 theAxis, theNbTimes, Parameters = ParseParameters(theAxis, theNbTimes)
2981 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
2982 RaiseIfFailed("MultiRotate1D", self.TrsfOp)
2983 anObj.SetParameters(Parameters)
2986 ## Rotate the given object around the
2987 # given axis on the given angle a given number
2988 # times and multi-translate each rotation result.
2989 # Translation direction passes through center of gravity
2990 # of rotated shape and its projection on the rotation axis.
2991 # @param theObject The object to be rotated.
2992 # @param theAxis Rotation axis.
2993 # @param theAngle Rotation angle in graduces.
2994 # @param theNbTimes1 Quantity of rotations to be done.
2995 # @param theStep Translation distance.
2996 # @param theNbTimes2 Quantity of translations to be done.
2997 # @return New GEOM_Object, containing compound of all the
2998 # shapes, obtained after each transformation.
3000 # @ref tui_multi_rotation "Example"
3001 def MultiRotate2D(self,theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2):
3002 # Example: see GEOM_TestAll.py
3003 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
3004 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
3005 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
3006 anObj.SetParameters(Parameters)
3009 ## The same, as MultiRotate1D(), but axis is given by direction and point
3010 # @ref swig_MakeMultiRotation "Example"
3011 def MakeMultiRotation1D(self,aShape,aDir,aPoint,aNbTimes):
3012 # Example: see GEOM_TestOthers.py
3013 aVec = self.MakeLine(aPoint,aDir)
3014 anObj = self.MultiRotate1D(aShape,aVec,aNbTimes)
3017 ## The same, as MultiRotate2D(), but axis is given by direction and point
3018 # @ref swig_MakeMultiRotation "Example"
3019 def MakeMultiRotation2D(self,aShape,aDir,aPoint,anAngle,nbtimes1,aStep,nbtimes2):
3020 # Example: see GEOM_TestOthers.py
3021 aVec = self.MakeLine(aPoint,aDir)
3022 anObj = self.MultiRotate2D(aShape,aVec,anAngle,nbtimes1,aStep,nbtimes2)
3025 # end of l3_transform
3028 ## @addtogroup l3_local
3031 ## Perform a fillet on all edges of the given shape.
3032 # @param theShape Shape, to perform fillet on.
3033 # @param theR Fillet radius.
3034 # @return New GEOM_Object, containing the result shape.
3036 # @ref tui_fillet "Example 1"
3037 # \n @ref swig_MakeFilletAll "Example 2"
3038 def MakeFilletAll(self,theShape, theR):
3039 # Example: see GEOM_TestOthers.py
3040 theR,Parameters = ParseParameters(theR)
3041 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
3042 RaiseIfFailed("MakeFilletAll", self.LocalOp)
3043 anObj.SetParameters(Parameters)
3046 ## Perform a fillet on the specified edges/faces of the given shape
3047 # @param theShape Shape, to perform fillet on.
3048 # @param theR Fillet radius.
3049 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR>.
3050 # @param theListShapes Global indices of edges/faces to perform fillet on.
3051 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
3052 # @return New GEOM_Object, containing the result shape.
3054 # @ref tui_fillet "Example"
3055 def MakeFillet(self,theShape, theR, theShapeType, theListShapes):
3056 # Example: see GEOM_TestAll.py
3057 theR,Parameters = ParseParameters(theR)
3059 if theShapeType == ShapeType["EDGE"]:
3060 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
3061 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
3063 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
3064 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
3065 anObj.SetParameters(Parameters)
3068 ## The same that MakeFillet but with two Fillet Radius R1 and R2
3069 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes):
3070 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
3072 if theShapeType == ShapeType["EDGE"]:
3073 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
3074 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
3076 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
3077 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
3078 anObj.SetParameters(Parameters)
3081 ## Perform a fillet on the specified edges of the given shape
3082 # @param theShape - Wire Shape to perform fillet on.
3083 # @param theR - Fillet radius.
3084 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
3085 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
3086 # \note The list of vertices could be empty,
3087 # in this case fillet will done done at all vertices in wire
3088 # @return New GEOM_Object, containing the result shape.
3090 # @ref tui_fillet2d "Example"
3091 def MakeFillet1D(self,theShape, theR, theListOfVertexes):
3092 # Example: see GEOM_TestAll.py
3093 theR,Parameters = ParseParameters(theR)
3094 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes)
3095 RaiseIfFailed("MakeFillet1D", self.LocalOp)
3096 anObj.SetParameters(Parameters)
3099 ## Perform a fillet on the specified edges/faces of the given shape
3100 # @param theShape - Face Shape to perform fillet on.
3101 # @param theR - Fillet radius.
3102 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
3103 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
3104 # @return New GEOM_Object, containing the result shape.
3106 # @ref tui_fillet2d "Example"
3107 def MakeFillet2D(self,theShape, theR, theListOfVertexes):
3108 # Example: see GEOM_TestAll.py
3109 theR,Parameters = ParseParameters(theR)
3110 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
3111 RaiseIfFailed("MakeFillet2D", self.LocalOp)
3112 anObj.SetParameters(Parameters)
3115 ## Perform a symmetric chamfer on all edges of the given shape.
3116 # @param theShape Shape, to perform chamfer on.
3117 # @param theD Chamfer size along each face.
3118 # @return New GEOM_Object, containing the result shape.
3120 # @ref tui_chamfer "Example 1"
3121 # \n @ref swig_MakeChamferAll "Example 2"
3122 def MakeChamferAll(self,theShape, theD):
3123 # Example: see GEOM_TestOthers.py
3124 theD,Parameters = ParseParameters(theD)
3125 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
3126 RaiseIfFailed("MakeChamferAll", self.LocalOp)
3127 anObj.SetParameters(Parameters)
3130 ## Perform a chamfer on edges, common to the specified faces,
3131 # with distance D1 on the Face1
3132 # @param theShape Shape, to perform chamfer on.
3133 # @param theD1 Chamfer size along \a theFace1.
3134 # @param theD2 Chamfer size along \a theFace2.
3135 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
3136 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
3137 # @return New GEOM_Object, containing the result shape.
3139 # @ref tui_chamfer "Example"
3140 def MakeChamferEdge(self,theShape, theD1, theD2, theFace1, theFace2):
3141 # Example: see GEOM_TestAll.py
3142 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
3143 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
3144 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
3145 anObj.SetParameters(Parameters)
3148 ## The Same that MakeChamferEdge but with params theD is chamfer length and
3149 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
3150 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2):
3152 if isinstance(theAngle,str):
3154 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
3156 theAngle = theAngle*math.pi/180.0
3157 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
3158 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
3159 anObj.SetParameters(Parameters)
3162 ## Perform a chamfer on all edges of the specified faces,
3163 # with distance D1 on the first specified face (if several for one edge)
3164 # @param theShape Shape, to perform chamfer on.
3165 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
3166 # connected to the edge, are in \a theFaces, \a theD1
3167 # will be get along face, which is nearer to \a theFaces beginning.
3168 # @param theD2 Chamfer size along another of two faces, connected to the edge.
3169 # @param theFaces Sequence of global indices of faces of \a theShape.
3170 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
3171 # @return New GEOM_Object, containing the result shape.
3173 # @ref tui_chamfer "Example"
3174 def MakeChamferFaces(self,theShape, theD1, theD2, theFaces):
3175 # Example: see GEOM_TestAll.py
3176 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
3177 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
3178 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
3179 anObj.SetParameters(Parameters)
3182 ## The Same that MakeChamferFaces but with params theD is chamfer lenght and
3183 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
3185 # @ref swig_FilletChamfer "Example"
3186 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces):
3188 if isinstance(theAngle,str):
3190 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
3192 theAngle = theAngle*math.pi/180.0
3193 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
3194 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
3195 anObj.SetParameters(Parameters)
3198 ## Perform a chamfer on edges,
3199 # with distance D1 on the first specified face (if several for one edge)
3200 # @param theShape Shape, to perform chamfer on.
3201 # @param theD1,theD2 Chamfer size
3202 # @param theEdges Sequence of edges of \a theShape.
3203 # @return New GEOM_Object, containing the result shape.
3205 # @ref swig_FilletChamfer "Example"
3206 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges):
3207 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
3208 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
3209 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
3210 anObj.SetParameters(Parameters)
3213 ## The Same that MakeChamferEdges but with params theD is chamfer lenght and
3214 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
3215 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges):
3217 if isinstance(theAngle,str):
3219 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
3221 theAngle = theAngle*math.pi/180.0
3222 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
3223 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
3224 anObj.SetParameters(Parameters)
3227 ## Shortcut to MakeChamferEdge() and MakeChamferFaces()
3229 # @ref swig_MakeChamfer "Example"
3230 def MakeChamfer(self,aShape,d1,d2,aShapeType,ListShape):
3231 # Example: see GEOM_TestOthers.py
3233 if aShapeType == ShapeType["EDGE"]:
3234 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1])
3236 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape)
3242 ## @addtogroup l3_basic_op
3245 ## Perform an Archimde operation on the given shape with given parameters.
3246 # The object presenting the resulting face is returned.
3247 # @param theShape Shape to be put in water.
3248 # @param theWeight Weight og the shape.
3249 # @param theWaterDensity Density of the water.
3250 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
3251 # @return New GEOM_Object, containing a section of \a theShape
3252 # by a plane, corresponding to water level.
3254 # @ref tui_archimede "Example"
3255 def Archimede(self,theShape, theWeight, theWaterDensity, theMeshDeflection):
3256 # Example: see GEOM_TestAll.py
3257 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
3258 theWeight,theWaterDensity,theMeshDeflection)
3259 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
3260 RaiseIfFailed("MakeArchimede", self.LocalOp)
3261 anObj.SetParameters(Parameters)
3264 # end of l3_basic_op
3267 ## @addtogroup l2_measure
3270 ## Get point coordinates
3273 # @ref tui_measurement_tools_page "Example"
3274 def PointCoordinates(self,Point):
3275 # Example: see GEOM_TestMeasures.py
3276 aTuple = self.MeasuOp.PointCoordinates(Point)
3277 RaiseIfFailed("PointCoordinates", self.MeasuOp)
3280 ## Get summarized length of all wires,
3281 # area of surface and volume of the given shape.
3282 # @param theShape Shape to define properties of.
3283 # @return [theLength, theSurfArea, theVolume]
3284 # theLength: Summarized length of all wires of the given shape.
3285 # theSurfArea: Area of surface of the given shape.
3286 # theVolume: Volume of the given shape.
3288 # @ref tui_measurement_tools_page "Example"
3289 def BasicProperties(self,theShape):
3290 # Example: see GEOM_TestMeasures.py
3291 aTuple = self.MeasuOp.GetBasicProperties(theShape)
3292 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
3295 ## Get parameters of bounding box of the given shape
3296 # @param theShape Shape to obtain bounding box of.
3297 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
3298 # Xmin,Xmax: Limits of shape along OX axis.
3299 # Ymin,Ymax: Limits of shape along OY axis.
3300 # Zmin,Zmax: Limits of shape along OZ axis.
3302 # @ref tui_measurement_tools_page "Example"
3303 def BoundingBox(self,theShape):
3304 # Example: see GEOM_TestMeasures.py
3305 aTuple = self.MeasuOp.GetBoundingBox(theShape)
3306 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
3309 ## Get inertia matrix and moments of inertia of theShape.
3310 # @param theShape Shape to calculate inertia of.
3311 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
3312 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
3313 # Ix,Iy,Iz: Moments of inertia of the given shape.
3315 # @ref tui_measurement_tools_page "Example"
3316 def Inertia(self,theShape):
3317 # Example: see GEOM_TestMeasures.py
3318 aTuple = self.MeasuOp.GetInertia(theShape)
3319 RaiseIfFailed("GetInertia", self.MeasuOp)
3322 ## Get minimal distance between the given shapes.
3323 # @param theShape1,theShape2 Shapes to find minimal distance between.
3324 # @return Value of the minimal distance between the given shapes.
3326 # @ref tui_measurement_tools_page "Example"
3327 def MinDistance(self, theShape1, theShape2):
3328 # Example: see GEOM_TestMeasures.py
3329 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
3330 RaiseIfFailed("GetMinDistance", self.MeasuOp)
3333 ## Get minimal distance between the given shapes.
3334 # @param theShape1,theShape2 Shapes to find minimal distance between.
3335 # @return Value of the minimal distance between the given shapes.
3337 # @ref swig_all_measure "Example"
3338 def MinDistanceComponents(self, theShape1, theShape2):
3339 # Example: see GEOM_TestMeasures.py
3340 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
3341 RaiseIfFailed("GetMinDistance", self.MeasuOp)
3342 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
3345 ## Get angle between the given shapes in degrees.
3346 # @param theShape1,theShape2 Lines or linear edges to find angle between.
3347 # @return Value of the angle between the given shapes in degrees.
3349 # @ref tui_measurement_tools_page "Example"
3350 def GetAngle(self, theShape1, theShape2):
3351 # Example: see GEOM_TestMeasures.py
3352 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
3353 RaiseIfFailed("GetAngle", self.MeasuOp)
3355 ## Get angle between the given shapes in radians.
3356 # @param theShape1,theShape2 Lines or linear edges to find angle between.
3357 # @return Value of the angle between the given shapes in radians.
3359 # @ref tui_measurement_tools_page "Example"
3360 def GetAngleRadians(self, theShape1, theShape2):
3361 # Example: see GEOM_TestMeasures.py
3362 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
3363 RaiseIfFailed("GetAngle", self.MeasuOp)
3366 ## @name Curve Curvature Measurement
3367 # Methods for receiving radius of curvature of curves
3368 # in the given point
3371 ## Measure curvature of a curve at a point, set by parameter.
3372 # @ref swig_todo "Example"
3373 def CurveCurvatureByParam(self, theCurve, theParam):
3374 # Example: see GEOM_TestMeasures.py
3375 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
3376 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
3380 # @ref swig_todo "Example"
3381 def CurveCurvatureByPoint(self, theCurve, thePoint):
3382 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
3383 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
3387 ## @name Surface Curvature Measurement
3388 # Methods for receiving max and min radius of curvature of surfaces
3389 # in the given point
3393 ## @ref swig_todo "Example"
3394 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
3395 # Example: see GEOM_TestMeasures.py
3396 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
3397 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
3401 ## @ref swig_todo "Example"
3402 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
3403 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
3404 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
3408 ## @ref swig_todo "Example"
3409 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
3410 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
3411 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
3415 ## @ref swig_todo "Example"
3416 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
3417 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
3418 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
3422 ## Get min and max tolerances of sub-shapes of theShape
3423 # @param theShape Shape, to get tolerances of.
3424 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
3425 # FaceMin,FaceMax: Min and max tolerances of the faces.
3426 # EdgeMin,EdgeMax: Min and max tolerances of the edges.
3427 # VertMin,VertMax: Min and max tolerances of the vertices.
3429 # @ref tui_measurement_tools_page "Example"
3430 def Tolerance(self,theShape):
3431 # Example: see GEOM_TestMeasures.py
3432 aTuple = self.MeasuOp.GetTolerance(theShape)
3433 RaiseIfFailed("GetTolerance", self.MeasuOp)
3436 ## Obtain description of the given shape (number of sub-shapes of each type)
3437 # @param theShape Shape to be described.
3438 # @return Description of the given shape.
3440 # @ref tui_measurement_tools_page "Example"
3441 def WhatIs(self,theShape):
3442 # Example: see GEOM_TestMeasures.py
3443 aDescr = self.MeasuOp.WhatIs(theShape)
3444 RaiseIfFailed("WhatIs", self.MeasuOp)
3447 ## Obtain quantity of shapes of the given type in \a theShape.
3448 # If \a theShape is of type \a theType, it is also counted.
3449 # @param theShape Shape to be described.
3450 # @return Quantity of shapes of type \a theType in \a theShape.
3452 # @ref tui_measurement_tools_page "Example"
3453 def NbShapes (self, theShape, theType):
3454 # Example: see GEOM_TestMeasures.py
3455 listSh = self.SubShapeAllIDs(theShape, theType)
3457 t = EnumToLong(theShape.GetShapeType())
3458 theType = EnumToLong(theType)
3464 ## Obtain quantity of shapes of each type in \a theShape.
3465 # The \a theShape is also counted.
3466 # @param theShape Shape to be described.
3467 # @return Dictionary of shape types with bound quantities of shapes.
3469 # @ref tui_measurement_tools_page "Example"
3470 def ShapeInfo (self, theShape):
3471 # Example: see GEOM_TestMeasures.py
3473 for typeSh in ShapeType:
3474 if typeSh in ( "AUTO", "SHAPE" ): continue
3475 listSh = self.SubShapeAllIDs(theShape, ShapeType[typeSh])
3477 if EnumToLong(theShape.GetShapeType()) == ShapeType[typeSh]:
3484 ## Get a point, situated at the centre of mass of theShape.
3485 # @param theShape Shape to define centre of mass of.
3486 # @return New GEOM_Object, containing the created point.
3488 # @ref tui_measurement_tools_page "Example"
3489 def MakeCDG(self,theShape):
3490 # Example: see GEOM_TestMeasures.py
3491 anObj = self.MeasuOp.GetCentreOfMass(theShape)
3492 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
3495 ## Get a vertex subshape by index depended with orientation.
3496 # @param theShape Shape to find subshape.
3497 # @param theIndex Index to find vertex by this index.
3498 # @return New GEOM_Object, containing the created vertex.
3500 # @ref tui_measurement_tools_page "Example"
3501 def GetVertexByIndex(self,theShape, theIndex):
3502 # Example: see GEOM_TestMeasures.py
3503 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
3504 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
3507 ## Get the first vertex of wire/edge depended orientation.
3508 # @param theShape Shape to find first vertex.
3509 # @return New GEOM_Object, containing the created vertex.
3511 # @ref tui_measurement_tools_page "Example"
3512 def GetFirstVertex(self,theShape):
3513 # Example: see GEOM_TestMeasures.py
3514 anObj = self.GetVertexByIndex(theShape, 0)
3515 RaiseIfFailed("GetFirstVertex", self.MeasuOp)
3518 ## Get the last vertex of wire/edge depended orientation.
3519 # @param theShape Shape to find last vertex.
3520 # @return New GEOM_Object, containing the created vertex.
3522 # @ref tui_measurement_tools_page "Example"
3523 def GetLastVertex(self,theShape):
3524 # Example: see GEOM_TestMeasures.py
3525 nb_vert = self.ShapesOp.NumberOfSubShapes(theShape, ShapeType["VERTEX"])
3526 anObj = self.GetVertexByIndex(theShape, (nb_vert-1))
3527 RaiseIfFailed("GetLastVertex", self.MeasuOp)
3530 ## Get a normale to the given face. If the point is not given,
3531 # the normale is calculated at the center of mass.
3532 # @param theFace Face to define normale of.
3533 # @param theOptionalPoint Point to compute the normale at.
3534 # @return New GEOM_Object, containing the created vector.
3536 # @ref swig_todo "Example"
3537 def GetNormal(self, theFace, theOptionalPoint = None):
3538 # Example: see GEOM_TestMeasures.py
3539 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
3540 RaiseIfFailed("GetNormal", self.MeasuOp)
3543 ## Check a topology of the given shape.
3544 # @param theShape Shape to check validity of.
3545 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked,
3546 # if TRUE, the shape's geometry will be checked also.
3547 # @return TRUE, if the shape "seems to be valid".
3548 # If theShape is invalid, prints a description of problem.
3550 # @ref tui_measurement_tools_page "Example"
3551 def CheckShape(self,theShape, theIsCheckGeom = 0):
3552 # Example: see GEOM_TestMeasures.py
3554 (IsValid, Status) = self.MeasuOp.CheckShapeWithGeometry(theShape)
3555 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
3557 (IsValid, Status) = self.MeasuOp.CheckShape(theShape)
3558 RaiseIfFailed("CheckShape", self.MeasuOp)
3563 ## Get position (LCS) of theShape.
3565 # Origin of the LCS is situated at the shape's center of mass.
3566 # Axes of the LCS are obtained from shape's location or,
3567 # if the shape is a planar face, from position of its plane.
3569 # @param theShape Shape to calculate position of.
3570 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
3571 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
3572 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
3573 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
3575 # @ref swig_todo "Example"
3576 def GetPosition(self,theShape):
3577 # Example: see GEOM_TestMeasures.py
3578 aTuple = self.MeasuOp.GetPosition(theShape)
3579 RaiseIfFailed("GetPosition", self.MeasuOp)
3582 ## Get kind of theShape.
3584 # @param theShape Shape to get a kind of.
3585 # @return Returns a kind of shape in terms of <VAR>GEOM_IKindOfShape.shape_kind</VAR> enumeration
3586 # and a list of parameters, describing the shape.
3587 # @note Concrete meaning of each value, returned via \a theIntegers
3588 # or \a theDoubles list depends on the kind of the shape.
3589 # The full list of possible outputs is:
3591 # - geompy.kind.COMPOUND nb_solids nb_faces nb_edges nb_vertices
3592 # - geompy.kind.COMPSOLID nb_solids nb_faces nb_edges nb_vertices
3594 # - geompy.kind.SHELL geompy.info.CLOSED nb_faces nb_edges nb_vertices
3595 # - geompy.kind.SHELL geompy.info.UNCLOSED nb_faces nb_edges nb_vertices
3597 # - geompy.kind.WIRE geompy.info.CLOSED nb_edges nb_vertices
3598 # - geompy.kind.WIRE geompy.info.UNCLOSED nb_edges nb_vertices
3600 # - geompy.kind.SPHERE xc yc zc R
3601 # - geompy.kind.CYLINDER xb yb zb dx dy dz R H
3602 # - geompy.kind.BOX xc yc zc ax ay az
3603 # - geompy.kind.ROTATED_BOX xc yc zc zx zy zz xx xy xz ax ay az
3604 # - geompy.kind.TORUS xc yc zc dx dy dz R_1 R_2
3605 # - geompy.kind.CONE xb yb zb dx dy dz R_1 R_2 H
3606 # - geompy.kind.POLYHEDRON nb_faces nb_edges nb_vertices
3607 # - geompy.kind.SOLID nb_faces nb_edges nb_vertices
3609 # - geompy.kind.SPHERE2D xc yc zc R
3610 # - geompy.kind.CYLINDER2D xb yb zb dx dy dz R H
3611 # - geompy.kind.TORUS2D xc yc zc dx dy dz R_1 R_2
3612 # - geompy.kind.CONE2D xc yc zc dx dy dz R_1 R_2 H
3613 # - geompy.kind.DISK_CIRCLE xc yc zc dx dy dz R
3614 # - geompy.kind.DISK_ELLIPSE xc yc zc dx dy dz R_1 R_2
3615 # - geompy.kind.POLYGON xo yo zo dx dy dz nb_edges nb_vertices
3616 # - geompy.kind.PLANE xo yo zo dx dy dz
3617 # - geompy.kind.PLANAR xo yo zo dx dy dz nb_edges nb_vertices
3618 # - geompy.kind.FACE nb_edges nb_vertices
3620 # - geompy.kind.CIRCLE xc yc zc dx dy dz R
3621 # - geompy.kind.ARC_CIRCLE xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2
3622 # - geompy.kind.ELLIPSE xc yc zc dx dy dz R_1 R_2
3623 # - geompy.kind.ARC_ELLIPSE xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2
3624 # - geompy.kind.LINE xo yo zo dx dy dz
3625 # - geompy.kind.SEGMENT x1 y1 z1 x2 y2 z2
3626 # - geompy.kind.EDGE nb_vertices
3628 # - geompy.kind.VERTEX x y z
3630 # @ref swig_todo "Example"
3631 def KindOfShape(self,theShape):
3632 # Example: see GEOM_TestMeasures.py
3633 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
3634 RaiseIfFailed("KindOfShape", self.MeasuOp)
3636 aKind = aRoughTuple[0]
3637 anInts = aRoughTuple[1]
3638 aDbls = aRoughTuple[2]
3640 # Now there is no exception from this rule:
3641 aKindTuple = [aKind] + aDbls + anInts
3643 # If they are we will regroup parameters for such kind of shape.
3645 #if aKind == kind.SOME_KIND:
3646 # # SOME_KIND int int double int double double
3647 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
3654 ## @addtogroup l2_import_export
3657 ## Import a shape from the BREP or IGES or STEP file
3658 # (depends on given format) with given name.
3659 # @param theFileName The file, containing the shape.
3660 # @param theFormatName Specify format for the file reading.
3661 # Available formats can be obtained with InsertOp.ImportTranslators() method.
3662 # If format 'IGES_SCALE' is used instead 'IGES' length unit will be
3663 # set to 'meter' and result model will be scaled.
3664 # @return New GEOM_Object, containing the imported shape.
3666 # @ref swig_Import_Export "Example"
3667 def Import(self,theFileName, theFormatName):
3668 # Example: see GEOM_TestOthers.py
3669 anObj = self.InsertOp.Import(theFileName, theFormatName)
3670 RaiseIfFailed("Import", self.InsertOp)
3673 ## Shortcut to Import() for BREP format
3675 # @ref swig_Import_Export "Example"
3676 def ImportBREP(self,theFileName):
3677 # Example: see GEOM_TestOthers.py
3678 return self.Import(theFileName, "BREP")
3680 ## Shortcut to Import() for IGES format
3682 # @ref swig_Import_Export "Example"
3683 def ImportIGES(self,theFileName):
3684 # Example: see GEOM_TestOthers.py
3685 return self.Import(theFileName, "IGES")
3687 ## Return length unit from given IGES file
3689 # @ref swig_Import_Export "Example"
3690 def GetIGESUnit(self,theFileName):
3691 # Example: see GEOM_TestOthers.py
3692 anObj = self.InsertOp.Import(theFileName, "IGES_UNIT")
3693 #RaiseIfFailed("Import", self.InsertOp)
3694 # recieve name using returned vertex
3696 if anObj.GetShapeType() == GEOM.VERTEX:
3699 vertices = self.SubShapeAll(anObj,ShapeType["VERTEX"])
3701 p = self.PointCoordinates(vertices[0])
3702 if abs(p[0]-0.01) < 1.e-6:
3704 elif abs(p[0]-0.001) < 1.e-6:
3708 ## Shortcut to Import() for STEP format
3710 # @ref swig_Import_Export "Example"
3711 def ImportSTEP(self,theFileName):
3712 # Example: see GEOM_TestOthers.py
3713 return self.Import(theFileName, "STEP")
3715 ## Export the given shape into a file with given name.
3716 # @param theObject Shape to be stored in the file.
3717 # @param theFileName Name of the file to store the given shape in.
3718 # @param theFormatName Specify format for the shape storage.
3719 # Available formats can be obtained with InsertOp.ImportTranslators() method.
3721 # @ref swig_Import_Export "Example"
3722 def Export(self,theObject, theFileName, theFormatName):
3723 # Example: see GEOM_TestOthers.py
3724 self.InsertOp.Export(theObject, theFileName, theFormatName)
3725 if self.InsertOp.IsDone() == 0:
3726 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
3730 ## Shortcut to Export() for BREP format
3732 # @ref swig_Import_Export "Example"
3733 def ExportBREP(self,theObject, theFileName):
3734 # Example: see GEOM_TestOthers.py
3735 return self.Export(theObject, theFileName, "BREP")
3737 ## Shortcut to Export() for IGES format
3739 # @ref swig_Import_Export "Example"
3740 def ExportIGES(self,theObject, theFileName):
3741 # Example: see GEOM_TestOthers.py
3742 return self.Export(theObject, theFileName, "IGES")
3744 ## Shortcut to Export() for STEP format
3746 # @ref swig_Import_Export "Example"
3747 def ExportSTEP(self,theObject, theFileName):
3748 # Example: see GEOM_TestOthers.py
3749 return self.Export(theObject, theFileName, "STEP")
3751 # end of l2_import_export
3754 ## @addtogroup l3_blocks
3757 ## Create a quadrangle face from four edges. Order of Edges is not
3758 # important. It is not necessary that edges share the same vertex.
3759 # @param E1,E2,E3,E4 Edges for the face bound.
3760 # @return New GEOM_Object, containing the created face.
3762 # @ref tui_building_by_blocks_page "Example"
3763 def MakeQuad(self,E1, E2, E3, E4):
3764 # Example: see GEOM_Spanner.py
3765 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
3766 RaiseIfFailed("MakeQuad", self.BlocksOp)
3769 ## Create a quadrangle face on two edges.
3770 # The missing edges will be built by creating the shortest ones.
3771 # @param E1,E2 Two opposite edges for the face.
3772 # @return New GEOM_Object, containing the created face.
3774 # @ref tui_building_by_blocks_page "Example"
3775 def MakeQuad2Edges(self,E1, E2):
3776 # Example: see GEOM_Spanner.py
3777 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
3778 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
3781 ## Create a quadrangle face with specified corners.
3782 # The missing edges will be built by creating the shortest ones.
3783 # @param V1,V2,V3,V4 Corner vertices for the face.
3784 # @return New GEOM_Object, containing the created face.
3786 # @ref tui_building_by_blocks_page "Example 1"
3787 # \n @ref swig_MakeQuad4Vertices "Example 2"
3788 def MakeQuad4Vertices(self,V1, V2, V3, V4):
3789 # Example: see GEOM_Spanner.py
3790 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
3791 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
3794 ## Create a hexahedral solid, bounded by the six given faces. Order of
3795 # faces is not important. It is not necessary that Faces share the same edge.
3796 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
3797 # @return New GEOM_Object, containing the created solid.
3799 # @ref tui_building_by_blocks_page "Example 1"
3800 # \n @ref swig_MakeHexa "Example 2"
3801 def MakeHexa(self,F1, F2, F3, F4, F5, F6):
3802 # Example: see GEOM_Spanner.py
3803 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
3804 RaiseIfFailed("MakeHexa", self.BlocksOp)
3807 ## Create a hexahedral solid between two given faces.
3808 # The missing faces will be built by creating the smallest ones.
3809 # @param F1,F2 Two opposite faces for the hexahedral solid.
3810 # @return New GEOM_Object, containing the created solid.
3812 # @ref tui_building_by_blocks_page "Example 1"
3813 # \n @ref swig_MakeHexa2Faces "Example 2"
3814 def MakeHexa2Faces(self,F1, F2):
3815 # Example: see GEOM_Spanner.py
3816 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
3817 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
3823 ## @addtogroup l3_blocks_op
3826 ## Get a vertex, found in the given shape by its coordinates.
3827 # @param theShape Block or a compound of blocks.
3828 # @param theX,theY,theZ Coordinates of the sought vertex.
3829 # @param theEpsilon Maximum allowed distance between the resulting
3830 # vertex and point with the given coordinates.
3831 # @return New GEOM_Object, containing the found vertex.
3833 # @ref swig_GetPoint "Example"
3834 def GetPoint(self, theShape, theX, theY, theZ, theEpsilon):
3835 # Example: see GEOM_TestOthers.py
3836 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
3837 RaiseIfFailed("GetPoint", self.BlocksOp)
3840 ## Find a vertex of the given shape, which has minimal distance to the given point.
3841 # @param theShape Any shape.
3842 # @param thePoint Point, close to the desired vertex.
3843 # @return New GEOM_Object, containing the found vertex.
3845 # @ref swig_GetVertexNearPoint "Example"
3846 def GetVertexNearPoint(self, theShape, thePoint):
3847 # Example: see GEOM_TestOthers.py
3848 anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
3849 RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
3852 ## Get an edge, found in the given shape by two given vertices.
3853 # @param theShape Block or a compound of blocks.
3854 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
3855 # @return New GEOM_Object, containing the found edge.
3857 # @ref swig_GetEdge "Example"
3858 def GetEdge(self, theShape, thePoint1, thePoint2):
3859 # Example: see GEOM_Spanner.py
3860 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
3861 RaiseIfFailed("GetEdge", self.BlocksOp)
3864 ## Find an edge of the given shape, which has minimal distance to the given point.
3865 # @param theShape Block or a compound of blocks.
3866 # @param thePoint Point, close to the desired edge.
3867 # @return New GEOM_Object, containing the found edge.
3869 # @ref swig_GetEdgeNearPoint "Example"
3870 def GetEdgeNearPoint(self, theShape, thePoint):
3871 # Example: see GEOM_TestOthers.py
3872 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
3873 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
3876 ## Returns a face, found in the given shape by four given corner vertices.
3877 # @param theShape Block or a compound of blocks.
3878 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
3879 # @return New GEOM_Object, containing the found face.
3881 # @ref swig_todo "Example"
3882 def GetFaceByPoints(self,theShape, thePoint1, thePoint2, thePoint3, thePoint4):
3883 # Example: see GEOM_Spanner.py
3884 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
3885 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
3888 ## Get a face of block, found in the given shape by two given edges.
3889 # @param theShape Block or a compound of blocks.
3890 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
3891 # @return New GEOM_Object, containing the found face.
3893 # @ref swig_todo "Example"
3894 def GetFaceByEdges(self,theShape, theEdge1, theEdge2):
3895 # Example: see GEOM_Spanner.py
3896 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
3897 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
3900 ## Find a face, opposite to the given one in the given block.
3901 # @param theBlock Must be a hexahedral solid.
3902 # @param theFace Face of \a theBlock, opposite to the desired face.
3903 # @return New GEOM_Object, containing the found face.
3905 # @ref swig_GetOppositeFace "Example"
3906 def GetOppositeFace(self,theBlock, theFace):
3907 # Example: see GEOM_Spanner.py
3908 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
3909 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
3912 ## Find a face of the given shape, which has minimal distance to the given point.
3913 # @param theShape Block or a compound of blocks.
3914 # @param thePoint Point, close to the desired face.
3915 # @return New GEOM_Object, containing the found face.
3917 # @ref swig_GetFaceNearPoint "Example"
3918 def GetFaceNearPoint(self, theShape, thePoint):
3919 # Example: see GEOM_Spanner.py
3920 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
3921 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
3924 ## Find a face of block, whose outside normale has minimal angle with the given vector.
3925 # @param theBlock Block or a compound of blocks.
3926 # @param theVector Vector, close to the normale of the desired face.
3927 # @return New GEOM_Object, containing the found face.
3929 # @ref swig_todo "Example"
3930 def GetFaceByNormale(self, theBlock, theVector):
3931 # Example: see GEOM_Spanner.py
3932 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
3933 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
3936 ## Find all subshapes of type \a theShapeType of the given shape,
3937 # which have minimal distance to the given point.
3938 # @param theShape Any shape.
3939 # @param thePoint Point, close to the desired shape.
3940 # @param theShapeType Defines what kind of subshapes is searched.
3941 # @param theTolerance The tolerance for distances comparison. All shapes
3942 # with distances to the given point in interval
3943 # [minimal_distance, minimal_distance + theTolerance] will be gathered.
3944 # @return New GEOM_Object, containing a group of all found shapes.
3946 # @ref swig_GetShapesNearPoint "Example"
3947 def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07):
3948 # Example: see GEOM_TestOthers.py
3949 anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
3950 RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
3953 # end of l3_blocks_op
3956 ## @addtogroup l4_blocks_measure
3959 ## Check, if the compound of blocks is given.
3960 # To be considered as a compound of blocks, the
3961 # given shape must satisfy the following conditions:
3962 # - Each element of the compound should be a Block (6 faces and 12 edges).
3963 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
3964 # - The compound should be connexe.
3965 # - The glue between two quadrangle faces should be applied.
3966 # @param theCompound The compound to check.
3967 # @return TRUE, if the given shape is a compound of blocks.
3968 # If theCompound is not valid, prints all discovered errors.
3970 # @ref tui_measurement_tools_page "Example 1"
3971 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
3972 def CheckCompoundOfBlocks(self,theCompound):
3973 # Example: see GEOM_Spanner.py
3974 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
3975 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
3977 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
3981 ## Remove all seam and degenerated edges from \a theShape.
3982 # Unite faces and edges, sharing one surface. It means that
3983 # this faces must have references to one C++ surface object (handle).
3984 # @param theShape The compound or single solid to remove irregular edges from.
3985 # @param doUnionFaces If True, then unite faces. If False (the default value),
3986 # do not unite faces.
3987 # @return Improved shape.
3989 # @ref swig_RemoveExtraEdges "Example"
3990 def RemoveExtraEdges(self, theShape, doUnionFaces=False):
3991 # Example: see GEOM_TestOthers.py
3992 nbFacesOptimum = -1 # -1 means do not unite faces
3993 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
3994 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
3995 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
3998 ## Check, if the given shape is a blocks compound.
3999 # Fix all detected errors.
4000 # \note Single block can be also fixed by this method.
4001 # @param theShape The compound to check and improve.
4002 # @return Improved compound.
4004 # @ref swig_CheckAndImprove "Example"
4005 def CheckAndImprove(self,theShape):
4006 # Example: see GEOM_TestOthers.py
4007 anObj = self.BlocksOp.CheckAndImprove(theShape)
4008 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
4011 # end of l4_blocks_measure
4014 ## @addtogroup l3_blocks_op
4017 ## Get all the blocks, contained in the given compound.
4018 # @param theCompound The compound to explode.
4019 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
4020 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
4021 # \note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
4022 # @return List of GEOM_Objects, containing the retrieved blocks.
4024 # @ref tui_explode_on_blocks "Example 1"
4025 # \n @ref swig_MakeBlockExplode "Example 2"
4026 def MakeBlockExplode(self,theCompound, theMinNbFaces, theMaxNbFaces):
4027 # Example: see GEOM_TestOthers.py
4028 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
4029 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
4030 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
4032 anObj.SetParameters(Parameters)
4036 ## Find block, containing the given point inside its volume or on boundary.
4037 # @param theCompound Compound, to find block in.
4038 # @param thePoint Point, close to the desired block. If the point lays on
4039 # boundary between some blocks, we return block with nearest center.
4040 # @return New GEOM_Object, containing the found block.
4042 # @ref swig_todo "Example"
4043 def GetBlockNearPoint(self,theCompound, thePoint):
4044 # Example: see GEOM_Spanner.py
4045 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
4046 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
4049 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
4050 # @param theCompound Compound, to find block in.
4051 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
4052 # @return New GEOM_Object, containing the found block.
4054 # @ref swig_GetBlockByParts "Example"
4055 def GetBlockByParts(self,theCompound, theParts):
4056 # Example: see GEOM_TestOthers.py
4057 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
4058 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
4061 ## Return all blocks, containing all the elements, passed as the parts.
4062 # @param theCompound Compound, to find blocks in.
4063 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
4064 # @return List of GEOM_Objects, containing the found blocks.
4066 # @ref swig_todo "Example"
4067 def GetBlocksByParts(self,theCompound, theParts):
4068 # Example: see GEOM_Spanner.py
4069 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
4070 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
4073 ## Multi-transformate block and glue the result.
4074 # Transformation is defined so, as to superpose direction faces.
4075 # @param Block Hexahedral solid to be multi-transformed.
4076 # @param DirFace1 ID of First direction face.
4077 # @param DirFace2 ID of Second direction face.
4078 # @param NbTimes Quantity of transformations to be done.
4079 # \note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
4080 # @return New GEOM_Object, containing the result shape.
4082 # @ref tui_multi_transformation "Example"
4083 def MakeMultiTransformation1D(self,Block, DirFace1, DirFace2, NbTimes):
4084 # Example: see GEOM_Spanner.py
4085 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
4086 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
4087 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
4088 anObj.SetParameters(Parameters)
4091 ## Multi-transformate block and glue the result.
4092 # @param Block Hexahedral solid to be multi-transformed.
4093 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
4094 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
4095 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
4096 # @return New GEOM_Object, containing the result shape.
4098 # @ref tui_multi_transformation "Example"
4099 def MakeMultiTransformation2D(self,Block, DirFace1U, DirFace2U, NbTimesU,
4100 DirFace1V, DirFace2V, NbTimesV):
4101 # Example: see GEOM_Spanner.py
4102 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
4103 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
4104 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
4105 DirFace1V, DirFace2V, NbTimesV)
4106 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
4107 anObj.SetParameters(Parameters)
4110 ## Build all possible propagation groups.
4111 # Propagation group is a set of all edges, opposite to one (main)
4112 # edge of this group directly or through other opposite edges.
4113 # Notion of Opposite Edge make sence only on quadrangle face.
4114 # @param theShape Shape to build propagation groups on.
4115 # @return List of GEOM_Objects, each of them is a propagation group.
4117 # @ref swig_Propagate "Example"
4118 def Propagate(self,theShape):
4119 # Example: see GEOM_TestOthers.py
4120 listChains = self.BlocksOp.Propagate(theShape)
4121 RaiseIfFailed("Propagate", self.BlocksOp)
4124 # end of l3_blocks_op
4127 ## @addtogroup l3_groups
4130 ## Creates a new group which will store sub shapes of theMainShape
4131 # @param theMainShape is a GEOM object on which the group is selected
4132 # @param theShapeType defines a shape type of the group
4133 # @return a newly created GEOM group
4135 # @ref tui_working_with_groups_page "Example 1"
4136 # \n @ref swig_CreateGroup "Example 2"
4137 def CreateGroup(self,theMainShape, theShapeType):
4138 # Example: see GEOM_TestOthers.py
4139 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
4140 RaiseIfFailed("CreateGroup", self.GroupOp)
4143 ## Adds a sub object with ID theSubShapeId to the group
4144 # @param theGroup is a GEOM group to which the new sub shape is added
4145 # @param theSubShapeID is a sub shape ID in the main object.
4146 # \note Use method GetSubShapeID() to get an unique ID of the sub shape
4148 # @ref tui_working_with_groups_page "Example"
4149 def AddObject(self,theGroup, theSubShapeID):
4150 # Example: see GEOM_TestOthers.py
4151 self.GroupOp.AddObject(theGroup, theSubShapeID)
4152 if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
4153 RaiseIfFailed("AddObject", self.GroupOp)
4157 ## Removes a sub object with ID \a theSubShapeId from the group
4158 # @param theGroup is a GEOM group from which the new sub shape is removed
4159 # @param theSubShapeID is a sub shape ID in the main object.
4160 # \note Use method GetSubShapeID() to get an unique ID of the sub shape
4162 # @ref tui_working_with_groups_page "Example"
4163 def RemoveObject(self,theGroup, theSubShapeID):
4164 # Example: see GEOM_TestOthers.py
4165 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
4166 RaiseIfFailed("RemoveObject", self.GroupOp)
4169 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
4170 # @param theGroup is a GEOM group to which the new sub shapes are added.
4171 # @param theSubShapes is a list of sub shapes to be added.
4173 # @ref tui_working_with_groups_page "Example"
4174 def UnionList (self,theGroup, theSubShapes):
4175 # Example: see GEOM_TestOthers.py
4176 self.GroupOp.UnionList(theGroup, theSubShapes)
4177 RaiseIfFailed("UnionList", self.GroupOp)
4180 ## Works like the above method, but argument
4181 # theSubShapes here is a list of sub-shapes indices
4183 # @ref swig_UnionIDs "Example"
4184 def UnionIDs(self,theGroup, theSubShapes):
4185 # Example: see GEOM_TestOthers.py
4186 self.GroupOp.UnionIDs(theGroup, theSubShapes)
4187 RaiseIfFailed("UnionIDs", self.GroupOp)
4190 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
4191 # @param theGroup is a GEOM group from which the sub-shapes are removed.
4192 # @param theSubShapes is a list of sub-shapes to be removed.
4194 # @ref tui_working_with_groups_page "Example"
4195 def DifferenceList (self,theGroup, theSubShapes):
4196 # Example: see GEOM_TestOthers.py
4197 self.GroupOp.DifferenceList(theGroup, theSubShapes)
4198 RaiseIfFailed("DifferenceList", self.GroupOp)
4201 ## Works like the above method, but argument
4202 # theSubShapes here is a list of sub-shapes indices
4204 # @ref swig_DifferenceIDs "Example"
4205 def DifferenceIDs(self,theGroup, theSubShapes):
4206 # Example: see GEOM_TestOthers.py
4207 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
4208 RaiseIfFailed("DifferenceIDs", self.GroupOp)
4211 ## Returns a list of sub objects ID stored in the group
4212 # @param theGroup is a GEOM group for which a list of IDs is requested
4214 # @ref swig_GetObjectIDs "Example"
4215 def GetObjectIDs(self,theGroup):
4216 # Example: see GEOM_TestOthers.py
4217 ListIDs = self.GroupOp.GetObjects(theGroup)
4218 RaiseIfFailed("GetObjects", self.GroupOp)
4221 ## Returns a type of sub objects stored in the group
4222 # @param theGroup is a GEOM group which type is returned.
4224 # @ref swig_GetType "Example"
4225 def GetType(self,theGroup):
4226 # Example: see GEOM_TestOthers.py
4227 aType = self.GroupOp.GetType(theGroup)
4228 RaiseIfFailed("GetType", self.GroupOp)
4231 ## Convert a type of geom object from id to string value
4232 # @param theId is a GEOM obect type id.
4234 # @ref swig_GetType "Example"
4235 def ShapeIdToType(self, theId):
4309 return "FREE_BOUNDS"
4317 return "THRUSECTIONS"
4319 return "COMPOUNDFILTER"
4321 return "SHAPES_ON_SHAPE"
4323 return "ELLIPSE_ARC"
4330 return "Shape Id not exist."
4332 ## Returns a main shape associated with the group
4333 # @param theGroup is a GEOM group for which a main shape object is requested
4334 # @return a GEOM object which is a main shape for theGroup
4336 # @ref swig_GetMainShape "Example"
4337 def GetMainShape(self,theGroup):
4338 # Example: see GEOM_TestOthers.py
4339 anObj = self.GroupOp.GetMainShape(theGroup)
4340 RaiseIfFailed("GetMainShape", self.GroupOp)
4343 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
4344 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
4346 # @ref swig_todo "Example"
4347 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1):
4348 edges = self.SubShapeAll(theShape, ShapeType["EDGE"])
4351 Props = self.BasicProperties(edge)
4352 if min_length <= Props[0] and Props[0] <= max_length:
4353 if (not include_min) and (min_length == Props[0]):
4356 if (not include_max) and (Props[0] == max_length):
4359 edges_in_range.append(edge)
4361 if len(edges_in_range) <= 0:
4362 print "No edges found by given criteria"
4365 group_edges = self.CreateGroup(theShape, ShapeType["EDGE"])
4366 self.UnionList(group_edges, edges_in_range)
4370 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
4371 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
4373 # @ref swig_todo "Example"
4374 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
4375 nb_selected = sg.SelectedCount()
4377 print "Select a shape before calling this function, please."
4380 print "Only one shape must be selected"
4383 id_shape = sg.getSelected(0)
4384 shape = IDToObject( id_shape )
4386 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
4390 if include_min: left_str = " <= "
4391 if include_max: right_str = " <= "
4393 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
4394 + left_str + "length" + right_str + `max_length`)
4396 sg.updateObjBrowser(1)
4403 ## @addtogroup l4_advanced
4406 ## Create a T-shape object with specified caracteristics for the main
4407 # and the incident pipes (radius, width, half-length).
4408 # The extremities of the main pipe are located on junctions points P1 and P2.
4409 # The extremity of the incident pipe is located on junction point P3.
4410 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
4411 # the main plane of the T-shape is XOY.
4412 # @param theR1 Internal radius of main pipe
4413 # @param theW1 Width of main pipe
4414 # @param theL1 Half-length of main pipe
4415 # @param theR2 Internal radius of incident pipe (R2 < R1)
4416 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
4417 # @param theL2 Half-length of incident pipe
4418 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
4419 # @param theP1 1st junction point of main pipe
4420 # @param theP2 2nd junction point of main pipe
4421 # @param theP3 Junction point of incident pipe
4422 # @return List of GEOM_Objects, containing the created shape and propagation groups.
4424 # @ref tui_creation_pipetshape "Example"
4425 def MakePipeTShape(self, theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh=True, theP1=None, theP2=None, theP3=None):
4426 theR1, theW1, theL1, theR2, theW2, theL2, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2)
4427 if (theP1 and theP2 and theP3):
4428 anObj = self.AdvOp.MakePipeTShapeWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh, theP1, theP2, theP3)
4430 anObj = self.AdvOp.MakePipeTShape(theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh)
4431 RaiseIfFailed("MakePipeTShape", self.AdvOp)
4432 if Parameters: anObj[0].SetParameters(Parameters)
4435 ## Create a T-shape object with chamfer and with specified caracteristics for the main
4436 # and the incident pipes (radius, width, half-length). The chamfer is
4437 # created on the junction of the pipes.
4438 # The extremities of the main pipe are located on junctions points P1 and P2.
4439 # The extremity of the incident pipe is located on junction point P3.
4440 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
4441 # the main plane of the T-shape is XOY.
4442 # @param theR1 Internal radius of main pipe
4443 # @param theW1 Width of main pipe
4444 # @param theL1 Half-length of main pipe
4445 # @param theR2 Internal radius of incident pipe (R2 < R1)
4446 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
4447 # @param theL2 Half-length of incident pipe
4448 # @param theH Height of the chamfer.
4449 # @param theW Width of the chamfer.
4450 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
4451 # @param theP1 1st junction point of main pipe
4452 # @param theP2 2nd junction point of main pipe
4453 # @param theP3 Junction point of incident pipe
4454 # @return List of GEOM_Objects, containing the created shape and propagation groups.
4456 # @ref tui_creation_pipetshape "Example"
4457 def MakePipeTShapeChamfer(self, theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh=True, theP1=None, theP2=None, theP3=None):
4458 theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW)
4459 if (theP1 and theP2 and theP3):
4460 anObj = self.AdvOp.MakePipeTShapeChamferWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh, theP1, theP2, theP3)
4462 anObj = self.AdvOp.MakePipeTShapeChamfer(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh)
4463 RaiseIfFailed("MakePipeTShapeChamfer", self.AdvOp)
4464 if Parameters: anObj[0].SetParameters(Parameters)
4467 ## Create a T-shape object with fillet and with specified caracteristics for the main
4468 # and the incident pipes (radius, width, half-length). The fillet is
4469 # created on the junction of the pipes.
4470 # The extremities of the main pipe are located on junctions points P1 and P2.
4471 # The extremity of the incident pipe is located on junction point P3.
4472 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
4473 # the main plane of the T-shape is XOY.
4474 # @param theR1 Internal radius of main pipe
4475 # @param theW1 Width of main pipe
4476 # @param theL1 Half-length of main pipe
4477 # @param theR2 Internal radius of incident pipe (R2 < R1)
4478 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
4479 # @param theL2 Half-length of incident pipe
4480 # @param theRF Radius of curvature of fillet.
4481 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
4482 # @param theP1 1st junction point of main pipe
4483 # @param theP2 2nd junction point of main pipe
4484 # @param theP3 Junction point of incident pipe
4485 # @return List of GEOM_Objects, containing the created shape and propagation groups.
4487 # @ref tui_creation_pipetshape "Example"
4488 def MakePipeTShapeFillet(self, theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh=True, theP1=None, theP2=None, theP3=None):
4489 theR1, theW1, theL1, theR2, theW2, theL2, theRF, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theRF)
4490 if (theP1 and theP2 and theP3):
4491 anObj = self.AdvOp.MakePipeTShapeFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh, theP1, theP2, theP3)
4493 anObj = self.AdvOp.MakePipeTShapeFillet(theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh)
4494 RaiseIfFailed("MakePipeTShapeFillet", self.AdvOp)
4495 if Parameters: anObj[0].SetParameters(Parameters)
4498 #@@ insert new functions before this line @@ do not remove this line @@#
4500 # end of l4_advanced
4503 ## Create a copy of the given object
4504 # @ingroup l1_geompy_auxiliary
4506 # @ref swig_all_advanced "Example"
4507 def MakeCopy(self,theOriginal):
4508 # Example: see GEOM_TestAll.py
4509 anObj = self.InsertOp.MakeCopy(theOriginal)
4510 RaiseIfFailed("MakeCopy", self.InsertOp)
4513 ## Add Path to load python scripts from
4514 # @ingroup l1_geompy_auxiliary
4515 def addPath(self,Path):
4516 if (sys.path.count(Path) < 1):
4517 sys.path.append(Path)
4521 ## Load marker texture from the file
4522 # @param Path a path to the texture file
4523 # @return unique texture identifier
4524 # @ingroup l1_geompy_auxiliary
4525 def LoadTexture(self, Path):
4526 # Example: see GEOM_TestAll.py
4527 ID = self.InsertOp.LoadTexture(Path)
4528 RaiseIfFailed("LoadTexture", self.InsertOp)
4531 ## Add marker texture. @a Width and @a Height parameters
4532 # specify width and height of the texture in pixels.
4533 # If @a RowData is @c True, @a Texture parameter should represent texture data
4534 # packed into the byte array. If @a RowData is @c False (default), @a Texture
4535 # parameter should be unpacked string, in which '1' symbols represent opaque
4536 # pixels and '0' represent transparent pixels of the texture bitmap.
4538 # @param Width texture width in pixels
4539 # @param Height texture height in pixels
4540 # @param Texture texture data
4541 # @param RowData if @c True, @a Texture data are packed in the byte stream
4542 # @ingroup l1_geompy_auxiliary
4543 def AddTexture(self, Width, Height, Texture, RowData=False):
4544 # Example: see GEOM_TestAll.py
4545 if not RowData: Texture = PackData(Texture)
4546 ID = self.InsertOp.AddTexture(Width, Height, Texture)
4547 RaiseIfFailed("AddTexture", self.InsertOp)
4551 #Register the new proxy for GEOM_Gen
4552 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geompyDC)