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 a
1307 # vector, defined by two points, in 2 Ways (forward/backward).
1308 # @param theBase Base shape to be extruded.
1309 # @param thePoint1 First end of extrusion vector.
1310 # @param thePoint2 Second end of extrusion vector.
1311 # @return New GEOM_Object, containing the created prism.
1313 # @ref tui_creation_prism "Example"
1314 def MakePrism2Ways(self, theBase, thePoint1, thePoint2):
1315 # Example: see GEOM_TestAll.py
1316 anObj = self.PrimOp.MakePrismTwoPnt2Ways(theBase, thePoint1, thePoint2)
1317 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
1320 ## Create a shape by extrusion of the base shape along the vector,
1321 # i.e. all the space, transfixed by the base shape during its translation
1322 # along the vector on the given distance.
1323 # @param theBase Base shape to be extruded.
1324 # @param theVec Direction of extrusion.
1325 # @param theH Prism dimension along theVec.
1326 # @return New GEOM_Object, containing the created prism.
1328 # @ref tui_creation_prism "Example"
1329 def MakePrismVecH(self, theBase, theVec, theH):
1330 # Example: see GEOM_TestAll.py
1331 theH,Parameters = ParseParameters(theH)
1332 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
1333 RaiseIfFailed("MakePrismVecH", self.PrimOp)
1334 anObj.SetParameters(Parameters)
1337 ## Create a shape by extrusion of the base shape along the vector,
1338 # i.e. all the space, transfixed by the base shape during its translation
1339 # along the vector on the given distance in 2 Ways (forward/backward).
1340 # @param theBase Base shape to be extruded.
1341 # @param theVec Direction of extrusion.
1342 # @param theH Prism dimension along theVec in forward direction.
1343 # @return New GEOM_Object, containing the created prism.
1345 # @ref tui_creation_prism "Example"
1346 def MakePrismVecH2Ways(self, theBase, theVec, theH):
1347 # Example: see GEOM_TestAll.py
1348 theH,Parameters = ParseParameters(theH)
1349 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
1350 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
1351 anObj.SetParameters(Parameters)
1354 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
1355 # @param theBase Base shape to be extruded.
1356 # @param theDX, theDY, theDZ Directions of extrusion.
1357 # @return New GEOM_Object, containing the created prism.
1359 # @ref tui_creation_prism "Example"
1360 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ):
1361 # Example: see GEOM_TestAll.py
1362 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1363 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
1364 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
1365 anObj.SetParameters(Parameters)
1368 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
1369 # i.e. all the space, transfixed by the base shape during its translation
1370 # along the vector on the given distance in 2 Ways (forward/backward).
1371 # @param theBase Base shape to be extruded.
1372 # @param theDX, theDY, theDZ Directions of extrusion.
1373 # @return New GEOM_Object, containing the created prism.
1375 # @ref tui_creation_prism "Example"
1376 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ):
1377 # Example: see GEOM_TestAll.py
1378 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1379 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
1380 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
1381 anObj.SetParameters(Parameters)
1384 ## Create a shape by revolution of the base shape around the axis
1385 # on the given angle, i.e. all the space, transfixed by the base
1386 # shape during its rotation around the axis on the given angle.
1387 # @param theBase Base shape to be rotated.
1388 # @param theAxis Rotation axis.
1389 # @param theAngle Rotation angle in radians.
1390 # @return New GEOM_Object, containing the created revolution.
1392 # @ref tui_creation_revolution "Example"
1393 def MakeRevolution(self, theBase, theAxis, theAngle):
1394 # Example: see GEOM_TestAll.py
1395 theAngle,Parameters = ParseParameters(theAngle)
1396 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
1397 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
1398 anObj.SetParameters(Parameters)
1401 ## The Same Revolution but in both ways forward&backward.
1402 def MakeRevolution2Ways(self, theBase, theAxis, theAngle):
1403 theAngle,Parameters = ParseParameters(theAngle)
1404 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
1405 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
1406 anObj.SetParameters(Parameters)
1409 ## Create a filling from the given compound of contours.
1410 # @param theShape the compound of contours
1411 # @param theMinDeg a minimal degree of BSpline surface to create
1412 # @param theMaxDeg a maximal degree of BSpline surface to create
1413 # @param theTol2D a 2d tolerance to be reached
1414 # @param theTol3D a 3d tolerance to be reached
1415 # @param theNbIter a number of iteration of approximation algorithm
1416 # @param theMethod Kind of method to perform filling operation:
1417 # GEOM.FOM_Default - Default - standard behaviour
1418 # /GEOM.FOM_UseOri - Use edges orientation - orientation of edges is
1419 # used: if the edge is reversed, the curve from this edge
1420 # is reversed before using it in the filling algorithm.
1421 # /GEOM.FOM_AutoCorrect - Auto-correct orientation - changes the orientation
1422 # of the curves using minimization of sum of distances
1423 # between the end points of the edges.
1424 # @param isApprox if True, BSpline curves are generated in the process
1425 # of surface construction. By default it is False, that means
1426 # the surface is created using Besier curves. The usage of
1427 # Approximation makes the algorithm work slower, but allows
1428 # building the surface for rather complex cases
1429 # @return New GEOM_Object, containing the created filling surface.
1431 # @ref tui_creation_filling "Example"
1432 def MakeFilling(self, theShape, theMinDeg, theMaxDeg, theTol2D,
1433 theTol3D, theNbIter, theMethod=GEOM.FOM_Default, isApprox=0):
1434 # Example: see GEOM_TestAll.py
1435 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
1436 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
1437 theTol2D, theTol3D, theNbIter,
1438 theMethod, isApprox)
1439 RaiseIfFailed("MakeFilling", self.PrimOp)
1440 anObj.SetParameters(Parameters)
1443 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
1444 # @param theSeqSections - set of specified sections.
1445 # @param theModeSolid - mode defining building solid or shell
1446 # @param thePreci - precision 3D used for smoothing by default 1.e-6
1447 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
1448 # @return New GEOM_Object, containing the created shell or solid.
1450 # @ref swig_todo "Example"
1451 def MakeThruSections(self,theSeqSections,theModeSolid,thePreci,theRuled):
1452 # Example: see GEOM_TestAll.py
1453 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
1454 RaiseIfFailed("MakeThruSections", self.PrimOp)
1457 ## Create a shape by extrusion of the base shape along
1458 # the path shape. The path shape can be a wire or an edge.
1459 # @param theBase Base shape to be extruded.
1460 # @param thePath Path shape to extrude the base shape along it.
1461 # @return New GEOM_Object, containing the created pipe.
1463 # @ref tui_creation_pipe "Example"
1464 def MakePipe(self,theBase, thePath):
1465 # Example: see GEOM_TestAll.py
1466 anObj = self.PrimOp.MakePipe(theBase, thePath)
1467 RaiseIfFailed("MakePipe", self.PrimOp)
1470 ## Create a shape by extrusion of the profile shape along
1471 # the path shape. The path shape can be a wire or an edge.
1472 # the several profiles can be specified in the several locations of path.
1473 # @param theSeqBases - list of Bases shape to be extruded.
1474 # @param theLocations - list of locations on the path corresponding
1475 # specified list of the Bases shapes. Number of locations
1476 # should be equal to number of bases or list of locations can be empty.
1477 # @param thePath - Path shape to extrude the base shape along it.
1478 # @param theWithContact - the mode defining that the section is translated to be in
1479 # contact with the spine.
1480 # @param theWithCorrection - defining that the section is rotated to be
1481 # orthogonal to the spine tangent in the correspondent point
1482 # @return New GEOM_Object, containing the created pipe.
1484 # @ref tui_creation_pipe_with_diff_sec "Example"
1485 def MakePipeWithDifferentSections(self, theSeqBases,
1486 theLocations, thePath,
1487 theWithContact, theWithCorrection):
1488 anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
1489 theLocations, thePath,
1490 theWithContact, theWithCorrection)
1491 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
1494 ## Create a shape by extrusion of the profile shape along
1495 # the path shape. The path shape can be a wire or a edge.
1496 # the several profiles can be specified in the several locations of path.
1497 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
1498 # shell or face. If number of faces in neighbour sections
1499 # aren't coincided result solid between such sections will
1500 # be created using external boundaries of this shells.
1501 # @param theSeqSubBases - list of corresponding subshapes of section shapes.
1502 # This list is used for searching correspondences between
1503 # faces in the sections. Size of this list must be equal
1504 # to size of list of base shapes.
1505 # @param theLocations - list of locations on the path corresponding
1506 # specified list of the Bases shapes. Number of locations
1507 # should be equal to number of bases. First and last
1508 # locations must be coincided with first and last vertexes
1509 # of path correspondingly.
1510 # @param thePath - Path shape to extrude the base shape along it.
1511 # @param theWithContact - the mode defining that the section is translated to be in
1512 # contact with the spine.
1513 # @param theWithCorrection - defining that the section is rotated to be
1514 # orthogonal to the spine tangent in the correspondent point
1515 # @return New GEOM_Object, containing the created solids.
1517 # @ref tui_creation_pipe_with_shell_sec "Example"
1518 def MakePipeWithShellSections(self,theSeqBases, theSeqSubBases,
1519 theLocations, thePath,
1520 theWithContact, theWithCorrection):
1521 anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
1522 theLocations, thePath,
1523 theWithContact, theWithCorrection)
1524 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
1527 ## Create a shape by extrusion of the profile shape along
1528 # the path shape. This function is used only for debug pipe
1529 # functionality - it is a version of previous function
1530 # (MakePipeWithShellSections(...)) which give a possibility to
1531 # recieve information about creating pipe between each pair of
1532 # sections step by step.
1533 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
1534 theLocations, thePath,
1535 theWithContact, theWithCorrection):
1537 nbsect = len(theSeqBases)
1538 nbsubsect = len(theSeqSubBases)
1539 #print "nbsect = ",nbsect
1540 for i in range(1,nbsect):
1542 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
1543 tmpLocations = [ theLocations[i-1], theLocations[i] ]
1545 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
1546 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
1547 tmpLocations, thePath,
1548 theWithContact, theWithCorrection)
1549 if self.PrimOp.IsDone() == 0:
1550 print "Problems with pipe creation between ",i," and ",i+1," sections"
1551 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
1554 print "Pipe between ",i," and ",i+1," sections is OK"
1559 resc = self.MakeCompound(res)
1560 #resc = self.MakeSewing(res, 0.001)
1561 #print "resc: ",resc
1564 ## Create solids between given sections
1565 # @param theSeqBases - list of sections (shell or face).
1566 # @param theLocations - list of corresponding vertexes
1567 # @return New GEOM_Object, containing the created solids.
1569 # @ref tui_creation_pipe_without_path "Example"
1570 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations):
1571 anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
1572 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
1575 ## Create a shape by extrusion of the base shape along
1576 # the path shape with constant bi-normal direction along the given vector.
1577 # The path shape can be a wire or an edge.
1578 # @param theBase Base shape to be extruded.
1579 # @param thePath Path shape to extrude the base shape along it.
1580 # @param theVec Vector defines a constant binormal direction to keep the
1581 # same angle beetween the direction and the sections
1582 # along the sweep surface.
1583 # @return New GEOM_Object, containing the created pipe.
1585 # @ref tui_creation_pipe "Example"
1586 def MakePipeBiNormalAlongVector(self,theBase, thePath, theVec):
1587 # Example: see GEOM_TestAll.py
1588 anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
1589 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
1595 ## @addtogroup l3_advanced
1598 ## Create a linear edge with specified ends.
1599 # @param thePnt1 Point for the first end of edge.
1600 # @param thePnt2 Point for the second end of edge.
1601 # @return New GEOM_Object, containing the created edge.
1603 # @ref tui_creation_edge "Example"
1604 def MakeEdge(self,thePnt1, thePnt2):
1605 # Example: see GEOM_TestAll.py
1606 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
1607 RaiseIfFailed("MakeEdge", self.ShapesOp)
1610 ## Create an edge from specified wire.
1611 # @param theWire source Wire.
1612 # @param theLinearTolerance linear tolerance value.
1613 # @param theAngularTolerance angular tolerance value.
1614 # @return New GEOM_Object, containing the created edge.
1616 # @ref tui_creation_edge "Example"
1617 def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12):
1618 # Example: see GEOM_TestAll.py
1619 anObj = self.ShapesOp.MakeEdgeWire(theWire, theLinearTolerance, theAngularTolerance)
1620 RaiseIfFailed("MakeEdgeWire", self.ShapesOp)
1623 ## Create a wire from the set of edges and wires.
1624 # @param theEdgesAndWires List of edges and/or wires.
1625 # @param theTolerance Maximum distance between vertices, that will be merged.
1626 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
1627 # @return New GEOM_Object, containing the created wire.
1629 # @ref tui_creation_wire "Example"
1630 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07):
1631 # Example: see GEOM_TestAll.py
1632 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
1633 RaiseIfFailed("MakeWire", self.ShapesOp)
1636 ## Create a face on the given wire.
1637 # @param theWire closed Wire or Edge to build the face on.
1638 # @param isPlanarWanted If TRUE, only planar face will be built.
1639 # If impossible, NULL object will be returned.
1640 # @return New GEOM_Object, containing the created face.
1642 # @ref tui_creation_face "Example"
1643 def MakeFace(self,theWire, isPlanarWanted):
1644 # Example: see GEOM_TestAll.py
1645 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
1646 RaiseIfFailed("MakeFace", self.ShapesOp)
1649 ## Create a face on the given wires set.
1650 # @param theWires List of closed wires or edges to build the face on.
1651 # @param isPlanarWanted If TRUE, only planar face will be built.
1652 # If impossible, NULL object will be returned.
1653 # @return New GEOM_Object, containing the created face.
1655 # @ref tui_creation_face "Example"
1656 def MakeFaceWires(self,theWires, isPlanarWanted):
1657 # Example: see GEOM_TestAll.py
1658 anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
1659 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
1662 ## Shortcut to MakeFaceWires()
1664 # @ref tui_creation_face "Example 1"
1665 # \n @ref swig_MakeFaces "Example 2"
1666 def MakeFaces(self,theWires, isPlanarWanted):
1667 # Example: see GEOM_TestOthers.py
1668 anObj = self.MakeFaceWires(theWires, isPlanarWanted)
1671 ## Create a shell from the set of faces and shells.
1672 # @param theFacesAndShells List of faces and/or shells.
1673 # @return New GEOM_Object, containing the created shell.
1675 # @ref tui_creation_shell "Example"
1676 def MakeShell(self,theFacesAndShells):
1677 # Example: see GEOM_TestAll.py
1678 anObj = self.ShapesOp.MakeShell(theFacesAndShells)
1679 RaiseIfFailed("MakeShell", self.ShapesOp)
1682 ## Create a solid, bounded by the given shells.
1683 # @param theShells Sequence of bounding shells.
1684 # @return New GEOM_Object, containing the created solid.
1686 # @ref tui_creation_solid "Example"
1687 def MakeSolid(self,theShells):
1688 # Example: see GEOM_TestAll.py
1689 anObj = self.ShapesOp.MakeSolidShells(theShells)
1690 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
1693 ## Create a compound of the given shapes.
1694 # @param theShapes List of shapes to put in compound.
1695 # @return New GEOM_Object, containing the created compound.
1697 # @ref tui_creation_compound "Example"
1698 def MakeCompound(self,theShapes):
1699 # Example: see GEOM_TestAll.py
1700 anObj = self.ShapesOp.MakeCompound(theShapes)
1701 RaiseIfFailed("MakeCompound", self.ShapesOp)
1704 # end of l3_advanced
1707 ## @addtogroup l2_measure
1710 ## Gives quantity of faces in the given shape.
1711 # @param theShape Shape to count faces of.
1712 # @return Quantity of faces.
1714 # @ref swig_NumberOf "Example"
1715 def NumberOfFaces(self, theShape):
1716 # Example: see GEOM_TestOthers.py
1717 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
1718 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
1721 ## Gives quantity of edges in the given shape.
1722 # @param theShape Shape to count edges of.
1723 # @return Quantity of edges.
1725 # @ref swig_NumberOf "Example"
1726 def NumberOfEdges(self, theShape):
1727 # Example: see GEOM_TestOthers.py
1728 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
1729 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
1732 ## Gives quantity of subshapes of type theShapeType in the given shape.
1733 # @param theShape Shape to count subshapes of.
1734 # @param theShapeType Type of subshapes to count.
1735 # @return Quantity of subshapes of given type.
1737 # @ref swig_NumberOf "Example"
1738 def NumberOfSubShapes(self, theShape, theShapeType):
1739 # Example: see GEOM_TestOthers.py
1740 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
1741 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
1744 ## Gives quantity of solids in the given shape.
1745 # @param theShape Shape to count solids in.
1746 # @return Quantity of solids.
1748 # @ref swig_NumberOf "Example"
1749 def NumberOfSolids(self, theShape):
1750 # Example: see GEOM_TestOthers.py
1751 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, ShapeType["SOLID"])
1752 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
1758 ## @addtogroup l3_healing
1761 ## Reverses an orientation the given shape.
1762 # @param theShape Shape to be reversed.
1763 # @return The reversed copy of theShape.
1765 # @ref swig_ChangeOrientation "Example"
1766 def ChangeOrientation(self,theShape):
1767 # Example: see GEOM_TestAll.py
1768 anObj = self.ShapesOp.ChangeOrientation(theShape)
1769 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
1772 ## Shortcut to ChangeOrientation()
1774 # @ref swig_OrientationChange "Example"
1775 def OrientationChange(self,theShape):
1776 # Example: see GEOM_TestOthers.py
1777 anObj = self.ChangeOrientation(theShape)
1783 ## @addtogroup l4_obtain
1786 ## Retrieve all free faces from the given shape.
1787 # Free face is a face, which is not shared between two shells of the shape.
1788 # @param theShape Shape to find free faces in.
1789 # @return List of IDs of all free faces, contained in theShape.
1791 # @ref tui_measurement_tools_page "Example"
1792 def GetFreeFacesIDs(self,theShape):
1793 # Example: see GEOM_TestOthers.py
1794 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
1795 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
1798 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
1799 # @param theShape1 Shape to find sub-shapes in.
1800 # @param theShape2 Shape to find shared sub-shapes with.
1801 # @param theShapeType Type of sub-shapes to be retrieved.
1802 # @return List of sub-shapes of theShape1, shared with theShape2.
1804 # @ref swig_GetSharedShapes "Example"
1805 def GetSharedShapes(self,theShape1, theShape2, theShapeType):
1806 # Example: see GEOM_TestOthers.py
1807 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
1808 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
1811 ## Get all sub-shapes, shared by all shapes in the list <VAR>theShapes</VAR>.
1812 # @param theShapes Shapes to find common sub-shapes of.
1813 # @param theShapeType Type of sub-shapes to be retrieved.
1814 # @return List of objects, that are sub-shapes of all given shapes.
1816 # @ref swig_GetSharedShapes "Example"
1817 def GetSharedShapesMulti(self, theShapes, theShapeType):
1818 # Example: see GEOM_TestOthers.py
1819 aList = self.ShapesOp.GetSharedShapesMulti(theShapes, theShapeType)
1820 RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
1823 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
1824 # situated relatively the specified plane by the certain way,
1825 # defined through <VAR>theState</VAR> parameter.
1826 # @param theShape Shape to find sub-shapes of.
1827 # @param theShapeType Type of sub-shapes to be retrieved.
1828 # @param theAx1 Vector (or line, or linear edge), specifying normal
1829 # direction and location of the plane to find shapes on.
1830 # @param theState The state of the subshapes to find. It can be one of
1831 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1832 # @return List of all found sub-shapes.
1834 # @ref swig_GetShapesOnPlane "Example"
1835 def GetShapesOnPlane(self,theShape, theShapeType, theAx1, theState):
1836 # Example: see GEOM_TestOthers.py
1837 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
1838 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
1841 ## Works like the above method, but returns list of sub-shapes indices
1843 # @ref swig_GetShapesOnPlaneIDs "Example"
1844 def GetShapesOnPlaneIDs(self,theShape, theShapeType, theAx1, theState):
1845 # Example: see GEOM_TestOthers.py
1846 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
1847 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
1850 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
1851 # situated relatively the specified plane by the certain way,
1852 # defined through <VAR>theState</VAR> parameter.
1853 # @param theShape Shape to find sub-shapes of.
1854 # @param theShapeType Type of sub-shapes to be retrieved.
1855 # @param theAx1 Vector (or line, or linear edge), specifying normal
1856 # direction of the plane to find shapes on.
1857 # @param thePnt Point specifying location of the plane to find shapes on.
1858 # @param theState The state of the subshapes to find. It can be one of
1859 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1860 # @return List of all found sub-shapes.
1862 # @ref swig_GetShapesOnPlaneWithLocation "Example"
1863 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState):
1864 # Example: see GEOM_TestOthers.py
1865 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
1866 theAx1, thePnt, theState)
1867 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
1870 ## Works like the above method, but returns list of sub-shapes indices
1872 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
1873 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
1874 # Example: see GEOM_TestOthers.py
1875 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
1876 theAx1, thePnt, theState)
1877 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
1880 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1881 # the specified cylinder by the certain way, defined through \a theState parameter.
1882 # @param theShape Shape to find sub-shapes of.
1883 # @param theShapeType Type of sub-shapes to be retrieved.
1884 # @param theAxis Vector (or line, or linear edge), specifying
1885 # axis of the cylinder to find shapes on.
1886 # @param theRadius Radius of the cylinder to find shapes on.
1887 # @param theState The state of the subshapes to find. It can be one of
1888 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1889 # @return List of all found sub-shapes.
1891 # @ref swig_GetShapesOnCylinder "Example"
1892 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState):
1893 # Example: see GEOM_TestOthers.py
1894 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
1895 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
1898 ## Works like the above method, but returns list of sub-shapes indices
1900 # @ref swig_GetShapesOnCylinderIDs "Example"
1901 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
1902 # Example: see GEOM_TestOthers.py
1903 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
1904 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
1907 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1908 # the specified cylinder by the certain way, defined through \a theState parameter.
1909 # @param theShape Shape to find sub-shapes of.
1910 # @param theShapeType Type of sub-shapes to be retrieved.
1911 # @param theAxis Vector (or line, or linear edge), specifying
1912 # axis of the cylinder to find shapes on.
1913 # @param thePnt Point specifying location of the bottom of the cylinder.
1914 # @param theRadius Radius of the cylinder to find shapes on.
1915 # @param theState The state of the subshapes to find. It can be one of
1916 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1917 # @return List of all found sub-shapes.
1919 # @ref swig_GetShapesOnCylinderWithLocation "Example"
1920 def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
1921 # Example: see GEOM_TestOthers.py
1922 aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
1923 RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
1926 ## Works like the above method, but returns list of sub-shapes indices
1928 # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
1929 def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
1930 # Example: see GEOM_TestOthers.py
1931 aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
1932 RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
1935 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1936 # the specified sphere by the certain way, defined through \a theState parameter.
1937 # @param theShape Shape to find sub-shapes of.
1938 # @param theShapeType Type of sub-shapes to be retrieved.
1939 # @param theCenter Point, specifying center of the sphere to find shapes on.
1940 # @param theRadius Radius of the sphere to find shapes on.
1941 # @param theState The state of the subshapes to find. It can be one of
1942 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1943 # @return List of all found sub-shapes.
1945 # @ref swig_GetShapesOnSphere "Example"
1946 def GetShapesOnSphere(self,theShape, theShapeType, theCenter, theRadius, theState):
1947 # Example: see GEOM_TestOthers.py
1948 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
1949 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
1952 ## Works like the above method, but returns list of sub-shapes indices
1954 # @ref swig_GetShapesOnSphereIDs "Example"
1955 def GetShapesOnSphereIDs(self,theShape, theShapeType, theCenter, theRadius, theState):
1956 # Example: see GEOM_TestOthers.py
1957 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
1958 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
1961 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1962 # the specified quadrangle by the certain way, defined through \a theState parameter.
1963 # @param theShape Shape to find sub-shapes of.
1964 # @param theShapeType Type of sub-shapes to be retrieved.
1965 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
1966 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
1967 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
1968 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
1969 # @param theState The state of the subshapes to find. It can be one of
1970 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1971 # @return List of all found sub-shapes.
1973 # @ref swig_GetShapesOnQuadrangle "Example"
1974 def GetShapesOnQuadrangle(self, theShape, theShapeType,
1975 theTopLeftPoint, theTopRigthPoint,
1976 theBottomLeftPoint, theBottomRigthPoint, theState):
1977 # Example: see GEOM_TestOthers.py
1978 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
1979 theTopLeftPoint, theTopRigthPoint,
1980 theBottomLeftPoint, theBottomRigthPoint, theState)
1981 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
1984 ## Works like the above method, but returns list of sub-shapes indices
1986 # @ref swig_GetShapesOnQuadrangleIDs "Example"
1987 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
1988 theTopLeftPoint, theTopRigthPoint,
1989 theBottomLeftPoint, theBottomRigthPoint, theState):
1990 # Example: see GEOM_TestOthers.py
1991 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
1992 theTopLeftPoint, theTopRigthPoint,
1993 theBottomLeftPoint, theBottomRigthPoint, theState)
1994 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
1997 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1998 # the specified \a theBox by the certain way, defined through \a theState parameter.
1999 # @param theBox Shape for relative comparing.
2000 # @param theShape Shape to find sub-shapes of.
2001 # @param theShapeType Type of sub-shapes to be retrieved.
2002 # @param theState The state of the subshapes to find. It can be one of
2003 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
2004 # @return List of all found sub-shapes.
2006 # @ref swig_GetShapesOnBox "Example"
2007 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState):
2008 # Example: see GEOM_TestOthers.py
2009 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
2010 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
2013 ## Works like the above method, but returns list of sub-shapes indices
2015 # @ref swig_GetShapesOnBoxIDs "Example"
2016 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
2017 # Example: see GEOM_TestOthers.py
2018 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
2019 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
2022 ## Find in \a theShape all sub-shapes of type \a theShapeType,
2023 # situated relatively the specified \a theCheckShape by the
2024 # certain way, defined through \a theState parameter.
2025 # @param theCheckShape Shape for relative comparing. It must be a solid.
2026 # @param theShape Shape to find sub-shapes of.
2027 # @param theShapeType Type of sub-shapes to be retrieved.
2028 # @param theState The state of the subshapes to find. It can be one of
2029 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
2030 # @return List of all found sub-shapes.
2032 # @ref swig_GetShapesOnShape "Example"
2033 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState):
2034 # Example: see GEOM_TestOthers.py
2035 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
2036 theShapeType, theState)
2037 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
2040 ## Works like the above method, but returns result as compound
2042 # @ref swig_GetShapesOnShapeAsCompound "Example"
2043 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState):
2044 # Example: see GEOM_TestOthers.py
2045 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
2046 theShapeType, theState)
2047 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
2050 ## Works like the above method, but returns list of sub-shapes indices
2052 # @ref swig_GetShapesOnShapeIDs "Example"
2053 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
2054 # Example: see GEOM_TestOthers.py
2055 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
2056 theShapeType, theState)
2057 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
2060 ## Get sub-shape(s) of theShapeWhere, which are
2061 # coincident with \a theShapeWhat or could be a part of it.
2062 # @param theShapeWhere Shape to find sub-shapes of.
2063 # @param theShapeWhat Shape, specifying what to find.
2064 # @return Group of all found sub-shapes or a single found sub-shape.
2066 # @note This function has a restriction on argument shapes.
2067 # If \a theShapeWhere has curved parts with significantly
2068 # outstanding centres (i.e. the mass centre of a part is closer to
2069 # \a theShapeWhat than to the part), such parts will not be found.
2070 # @image html get_in_place_lost_part.png
2072 # @ref swig_GetInPlace "Example"
2073 def GetInPlace(self, theShapeWhere, theShapeWhat):
2074 # Example: see GEOM_TestOthers.py
2075 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
2076 RaiseIfFailed("GetInPlace", self.ShapesOp)
2079 ## Get sub-shape(s) of \a theShapeWhere, which are
2080 # coincident with \a theShapeWhat or could be a part of it.
2082 # Implementation of this method is based on a saved history of an operation,
2083 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
2084 # arguments (an argument shape or a sub-shape of an argument shape).
2085 # The operation could be the Partition or one of boolean operations,
2086 # performed on simple shapes (not on compounds).
2088 # @param theShapeWhere Shape to find sub-shapes of.
2089 # @param theShapeWhat Shape, specifying what to find (must be in the
2090 # building history of the ShapeWhere).
2091 # @return Group of all found sub-shapes or a single found sub-shape.
2093 # @ref swig_GetInPlace "Example"
2094 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat):
2095 # Example: see GEOM_TestOthers.py
2096 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
2097 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
2100 ## Get sub-shape of theShapeWhere, which is
2101 # equal to \a theShapeWhat.
2102 # @param theShapeWhere Shape to find sub-shape of.
2103 # @param theShapeWhat Shape, specifying what to find.
2104 # @return New GEOM_Object for found sub-shape.
2106 # @ref swig_GetSame "Example"
2107 def GetSame(self,theShapeWhere, theShapeWhat):
2108 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
2109 RaiseIfFailed("GetSame", self.ShapesOp)
2115 ## @addtogroup l4_access
2118 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
2119 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
2121 # @ref swig_all_decompose "Example"
2122 def GetSubShape(self, aShape, ListOfID):
2123 # Example: see GEOM_TestAll.py
2124 anObj = self.AddSubShape(aShape,ListOfID)
2127 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
2129 # @ref swig_all_decompose "Example"
2130 def GetSubShapeID(self, aShape, aSubShape):
2131 # Example: see GEOM_TestAll.py
2132 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
2133 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
2139 ## @addtogroup l4_decompose
2142 ## Get all sub-shapes and groups of \a theShape,
2143 # that were created already by any other methods.
2144 # @param theShape Any shape.
2145 # @param theGroupsOnly If this parameter is TRUE, only groups will be
2146 # returned, else all found sub-shapes and groups.
2147 # @return List of existing sub-objects of \a theShape.
2149 # @ref swig_all_decompose "Example"
2150 def GetExistingSubObjects(self, theShape, theGroupsOnly = False):
2151 # Example: see GEOM_TestAll.py
2152 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, theGroupsOnly)
2153 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
2156 ## Get all groups of \a theShape,
2157 # that were created already by any other methods.
2158 # @param theShape Any shape.
2159 # @return List of existing groups of \a theShape.
2161 # @ref swig_all_decompose "Example"
2162 def GetGroups(self, theShape):
2163 # Example: see GEOM_TestAll.py
2164 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, True)
2165 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
2168 ## Explode a shape on subshapes of a given type.
2169 # If the shape itself matches the type, it is also returned.
2170 # @param aShape Shape to be exploded.
2171 # @param aType Type of sub-shapes to be retrieved.
2172 # @return List of sub-shapes of type theShapeType, contained in theShape.
2174 # @ref swig_all_decompose "Example"
2175 def SubShapeAll(self, aShape, aType):
2176 # Example: see GEOM_TestAll.py
2177 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, aType, False)
2178 RaiseIfFailed("SubShapeAll", self.ShapesOp)
2181 ## Explode a shape on subshapes of a given type.
2182 # @param aShape Shape to be exploded.
2183 # @param aType Type of sub-shapes to be retrieved.
2184 # @return List of IDs of sub-shapes.
2186 # @ref swig_all_decompose "Example"
2187 def SubShapeAllIDs(self, aShape, aType):
2188 ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, aType, False)
2189 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
2192 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
2193 # selected by they indices in list of all sub-shapes of type <VAR>aType</VAR>.
2194 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
2196 # @ref swig_all_decompose "Example"
2197 def SubShape(self, aShape, aType, ListOfInd):
2198 # Example: see GEOM_TestAll.py
2200 AllShapeIDsList = self.SubShapeAllIDs(aShape, aType)
2201 for ind in ListOfInd:
2202 ListOfIDs.append(AllShapeIDsList[ind - 1])
2203 anObj = self.GetSubShape(aShape, ListOfIDs)
2206 ## Explode a shape on subshapes of a given type.
2207 # Sub-shapes will be sorted by coordinates of their gravity centers.
2208 # If the shape itself matches the type, it is also returned.
2209 # @param aShape Shape to be exploded.
2210 # @param aType Type of sub-shapes to be retrieved.
2211 # @return List of sub-shapes of type theShapeType, contained in theShape.
2213 # @ref swig_SubShapeAllSorted "Example"
2214 def SubShapeAllSortedCentres(self, aShape, aType):
2215 # Example: see GEOM_TestAll.py
2216 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, aType, True)
2217 RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
2220 ## Explode a shape on subshapes of a given type.
2221 # Sub-shapes will be sorted by coordinates of their gravity centers.
2222 # @param aShape Shape to be exploded.
2223 # @param aType Type of sub-shapes to be retrieved.
2224 # @return List of IDs of sub-shapes.
2226 # @ref swig_all_decompose "Example"
2227 def SubShapeAllSortedCentresIDs(self, aShape, aType):
2228 ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, aType, True)
2229 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
2232 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
2233 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
2234 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
2236 # @ref swig_all_decompose "Example"
2237 def SubShapeSortedCentres(self, aShape, aType, ListOfInd):
2238 # Example: see GEOM_TestAll.py
2240 AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, aType)
2241 for ind in ListOfInd:
2242 ListOfIDs.append(AllShapeIDsList[ind - 1])
2243 anObj = self.GetSubShape(aShape, ListOfIDs)
2246 ## Extract shapes (excluding the main shape) of given type.
2247 # @param aShape The shape.
2248 # @param aType The shape type.
2249 # @param isSorted Boolean flag to switch sorting on/off.
2250 # @return List of sub-shapes of type aType, contained in aShape.
2252 # @ref swig_FilletChamfer "Example"
2253 def ExtractShapes(self, aShape, aType, isSorted = False):
2254 # Example: see GEOM_TestAll.py
2255 ListObj = self.ShapesOp.ExtractSubShapes(aShape, aType, isSorted)
2256 RaiseIfFailed("ExtractSubShapes", self.ShapesOp)
2259 # end of l4_decompose
2262 ## @addtogroup l4_decompose_d
2265 ## Deprecated method
2266 # It works like SubShapeAllSortedCentres, but wrongly
2267 # defines centres of faces, shells and solids.
2268 def SubShapeAllSorted(self, aShape, aType):
2269 ListObj = self.ShapesOp.MakeExplode(aShape, aType, True)
2270 RaiseIfFailed("MakeExplode", self.ShapesOp)
2273 ## Deprecated method
2274 # It works like SubShapeAllSortedCentresIDs, but wrongly
2275 # defines centres of faces, shells and solids.
2276 def SubShapeAllSortedIDs(self, aShape, aType):
2277 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, aType, True)
2278 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
2281 ## Deprecated method
2282 # It works like SubShapeSortedCentres, but has a bug
2283 # (wrongly defines centres of faces, shells and solids).
2284 def SubShapeSorted(self, aShape, aType, ListOfInd):
2286 AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, aType)
2287 for ind in ListOfInd:
2288 ListOfIDs.append(AllShapeIDsList[ind - 1])
2289 anObj = self.GetSubShape(aShape, ListOfIDs)
2292 # end of l4_decompose_d
2295 ## @addtogroup l3_healing
2298 ## Apply a sequence of Shape Healing operators to the given object.
2299 # @param theShape Shape to be processed.
2300 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
2301 # @param theParameters List of names of parameters
2302 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
2303 # @param theValues List of values of parameters, in the same order
2304 # as parameters are listed in <VAR>theParameters</VAR> list.
2305 # @return New GEOM_Object, containing processed shape.
2307 # @ref tui_shape_processing "Example"
2308 def ProcessShape(self, theShape, theOperators, theParameters, theValues):
2309 # Example: see GEOM_TestHealing.py
2310 theValues,Parameters = ParseList(theValues)
2311 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
2312 # To avoid script failure in case of good argument shape
2313 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
2315 RaiseIfFailed("ProcessShape", self.HealOp)
2316 for string in (theOperators + theParameters):
2317 Parameters = ":" + Parameters
2319 anObj.SetParameters(Parameters)
2322 ## Remove faces from the given object (shape).
2323 # @param theObject Shape to be processed.
2324 # @param theFaces Indices of faces to be removed, if EMPTY then the method
2325 # removes ALL faces of the given object.
2326 # @return New GEOM_Object, containing processed shape.
2328 # @ref tui_suppress_faces "Example"
2329 def SuppressFaces(self,theObject, theFaces):
2330 # Example: see GEOM_TestHealing.py
2331 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
2332 RaiseIfFailed("SuppressFaces", self.HealOp)
2335 ## Sewing of some shapes into single shape.
2337 # @ref tui_sewing "Example"
2338 def MakeSewing(self, ListShape, theTolerance):
2339 # Example: see GEOM_TestHealing.py
2340 comp = self.MakeCompound(ListShape)
2341 anObj = self.Sew(comp, theTolerance)
2344 ## Sewing of the given object.
2345 # @param theObject Shape to be processed.
2346 # @param theTolerance Required tolerance value.
2347 # @return New GEOM_Object, containing processed shape.
2348 def Sew(self, theObject, theTolerance):
2349 # Example: see MakeSewing() above
2350 theTolerance,Parameters = ParseParameters(theTolerance)
2351 anObj = self.HealOp.Sew(theObject, theTolerance)
2352 RaiseIfFailed("Sew", self.HealOp)
2353 anObj.SetParameters(Parameters)
2356 ## Remove internal wires and edges from the given object (face).
2357 # @param theObject Shape to be processed.
2358 # @param theWires Indices of wires to be removed, if EMPTY then the method
2359 # removes ALL internal wires of the given object.
2360 # @return New GEOM_Object, containing processed shape.
2362 # @ref tui_suppress_internal_wires "Example"
2363 def SuppressInternalWires(self,theObject, theWires):
2364 # Example: see GEOM_TestHealing.py
2365 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
2366 RaiseIfFailed("RemoveIntWires", self.HealOp)
2369 ## Remove internal closed contours (holes) from the given object.
2370 # @param theObject Shape to be processed.
2371 # @param theWires Indices of wires to be removed, if EMPTY then the method
2372 # removes ALL internal holes of the given object
2373 # @return New GEOM_Object, containing processed shape.
2375 # @ref tui_suppress_holes "Example"
2376 def SuppressHoles(self,theObject, theWires):
2377 # Example: see GEOM_TestHealing.py
2378 anObj = self.HealOp.FillHoles(theObject, theWires)
2379 RaiseIfFailed("FillHoles", self.HealOp)
2382 ## Close an open wire.
2383 # @param theObject Shape to be processed.
2384 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
2385 # if [ ], then <VAR>theObject</VAR> itself is a wire.
2386 # @param isCommonVertex If True : closure by creation of a common vertex,
2387 # If False : closure by creation of an edge between ends.
2388 # @return New GEOM_Object, containing processed shape.
2390 # @ref tui_close_contour "Example"
2391 def CloseContour(self,theObject, theWires, isCommonVertex):
2392 # Example: see GEOM_TestHealing.py
2393 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
2394 RaiseIfFailed("CloseContour", self.HealOp)
2397 ## Addition of a point to a given edge object.
2398 # @param theObject Shape to be processed.
2399 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
2400 # if -1, then theObject itself is the edge.
2401 # @param theValue Value of parameter on edge or length parameter,
2402 # depending on \a isByParameter.
2403 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1],
2404 # if FALSE : \a theValue is treated as a length parameter [0..1]
2405 # @return New GEOM_Object, containing processed shape.
2407 # @ref tui_add_point_on_edge "Example"
2408 def DivideEdge(self,theObject, theEdgeIndex, theValue, isByParameter):
2409 # Example: see GEOM_TestHealing.py
2410 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
2411 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
2412 RaiseIfFailed("DivideEdge", self.HealOp)
2413 anObj.SetParameters(Parameters)
2416 ## Change orientation of the given object. Updates given shape.
2417 # @param theObject Shape to be processed.
2419 # @ref swig_todo "Example"
2420 def ChangeOrientationShell(self,theObject):
2421 theObject = self.HealOp.ChangeOrientation(theObject)
2422 RaiseIfFailed("ChangeOrientation", self.HealOp)
2425 ## Change orientation of the given object.
2426 # @param theObject Shape to be processed.
2427 # @return New GEOM_Object, containing processed shape.
2429 # @ref swig_todo "Example"
2430 def ChangeOrientationShellCopy(self, theObject):
2431 anObj = self.HealOp.ChangeOrientationCopy(theObject)
2432 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
2435 ## Try to limit tolerance of the given object by value \a theTolerance.
2436 # @param theObject Shape to be processed.
2437 # @param theTolerance Required tolerance value.
2438 # @return New GEOM_Object, containing processed shape.
2440 # @ref tui_limit_tolerance "Example"
2441 def LimitTolerance(self, theObject, theTolerance = 1e-07):
2442 anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
2443 RaiseIfFailed("LimitTolerance", self.HealOp)
2446 ## Get a list of wires (wrapped in GEOM_Object-s),
2447 # that constitute a free boundary of the given shape.
2448 # @param theObject Shape to get free boundary of.
2449 # @return [status, theClosedWires, theOpenWires]
2450 # status: FALSE, if an error(s) occured during the method execution.
2451 # theClosedWires: Closed wires on the free boundary of the given shape.
2452 # theOpenWires: Open wires on the free boundary of the given shape.
2454 # @ref tui_measurement_tools_page "Example"
2455 def GetFreeBoundary(self, theObject):
2456 # Example: see GEOM_TestHealing.py
2457 anObj = self.HealOp.GetFreeBoundary(theObject)
2458 RaiseIfFailed("GetFreeBoundary", self.HealOp)
2461 ## Replace coincident faces in theShape by one face.
2462 # @param theShape Initial shape.
2463 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
2464 # @param doKeepNonSolids If FALSE, only solids will present in the result,
2465 # otherwise all initial shapes.
2466 # @return New GEOM_Object, containing a copy of theShape without coincident faces.
2468 # @ref tui_glue_faces "Example"
2469 def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True):
2470 # Example: see GEOM_Spanner.py
2471 theTolerance,Parameters = ParseParameters(theTolerance)
2472 anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
2474 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
2475 anObj.SetParameters(Parameters)
2478 ## Find coincident faces in theShape for possible gluing.
2479 # @param theShape Initial shape.
2480 # @param theTolerance Maximum distance between faces,
2481 # which can be considered as coincident.
2484 # @ref swig_todo "Example"
2485 def GetGlueFaces(self, theShape, theTolerance):
2486 # Example: see GEOM_Spanner.py
2487 anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
2488 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
2491 ## Replace coincident faces in theShape by one face
2492 # in compliance with given list of faces
2493 # @param theShape Initial shape.
2494 # @param theTolerance Maximum distance between faces,
2495 # which can be considered as coincident.
2496 # @param theFaces List of faces for gluing.
2497 # @param doKeepNonSolids If FALSE, only solids will present in the result,
2498 # otherwise all initial shapes.
2499 # @return New GEOM_Object, containing a copy of theShape
2500 # without some faces.
2502 # @ref swig_todo "Example"
2503 def MakeGlueFacesByList(self, theShape, theTolerance, theFaces, doKeepNonSolids=True):
2504 # Example: see GEOM_Spanner.py
2505 anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces, doKeepNonSolids)
2507 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
2513 ## @addtogroup l3_boolean Boolean Operations
2516 # -----------------------------------------------------------------------------
2517 # Boolean (Common, Cut, Fuse, Section)
2518 # -----------------------------------------------------------------------------
2520 ## Perform one of boolean operations on two given shapes.
2521 # @param theShape1 First argument for boolean operation.
2522 # @param theShape2 Second argument for boolean operation.
2523 # @param theOperation Indicates the operation to be done:
2524 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
2525 # @return New GEOM_Object, containing the result shape.
2527 # @ref tui_fuse "Example"
2528 def MakeBoolean(self,theShape1, theShape2, theOperation):
2529 # Example: see GEOM_TestAll.py
2530 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation)
2531 RaiseIfFailed("MakeBoolean", self.BoolOp)
2534 ## Shortcut to MakeBoolean(s1, s2, 1)
2536 # @ref tui_common "Example 1"
2537 # \n @ref swig_MakeCommon "Example 2"
2538 def MakeCommon(self, s1, s2):
2539 # Example: see GEOM_TestOthers.py
2540 return self.MakeBoolean(s1, s2, 1)
2542 ## Shortcut to MakeBoolean(s1, s2, 2)
2544 # @ref tui_cut "Example 1"
2545 # \n @ref swig_MakeCommon "Example 2"
2546 def MakeCut(self, s1, s2):
2547 # Example: see GEOM_TestOthers.py
2548 return self.MakeBoolean(s1, s2, 2)
2550 ## Shortcut to MakeBoolean(s1, s2, 3)
2552 # @ref tui_fuse "Example 1"
2553 # \n @ref swig_MakeCommon "Example 2"
2554 def MakeFuse(self, s1, s2):
2555 # Example: see GEOM_TestOthers.py
2556 return self.MakeBoolean(s1, s2, 3)
2558 ## Shortcut to MakeBoolean(s1, s2, 4)
2560 # @ref tui_section "Example 1"
2561 # \n @ref swig_MakeCommon "Example 2"
2562 def MakeSection(self, s1, s2):
2563 # Example: see GEOM_TestOthers.py
2564 return self.MakeBoolean(s1, s2, 4)
2569 ## @addtogroup l3_basic_op
2572 ## Perform partition operation.
2573 # @param ListShapes Shapes to be intersected.
2574 # @param ListTools Shapes to intersect theShapes.
2575 # !!!NOTE: Each compound from ListShapes and ListTools will be exploded
2576 # in order to avoid possible intersection between shapes from
2578 # @param Limit Type of resulting shapes (corresponding to TopAbs_ShapeEnum).
2579 # If this parameter is set to -1 ("Auto"), most appropriate shape limit
2580 # type will be detected automatically.
2581 # @param KeepNonlimitShapes: if this parameter == 0, then only shapes of
2582 # target type (equal to Limit) are kept in the result,
2583 # else standalone shapes of lower dimension
2584 # are kept also (if they exist).
2586 # After implementation new version of PartitionAlgo (October 2006)
2587 # other parameters are ignored by current functionality. They are kept
2588 # in this function only for support old versions.
2589 # Ignored parameters:
2590 # @param ListKeepInside Shapes, outside which the results will be deleted.
2591 # Each shape from theKeepInside must belong to theShapes also.
2592 # @param ListRemoveInside Shapes, inside which the results will be deleted.
2593 # Each shape from theRemoveInside must belong to theShapes also.
2594 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
2595 # @param ListMaterials Material indices for each shape. Make sence,
2596 # only if theRemoveWebs is TRUE.
2598 # @return New GEOM_Object, containing the result shapes.
2600 # @ref tui_partition "Example"
2601 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
2602 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
2603 KeepNonlimitShapes=0):
2604 # Example: see GEOM_TestAll.py
2605 if Limit == ShapeType["AUTO"]:
2606 # automatic detection of the most appropriate shape limit type
2608 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
2609 Limit = EnumToLong(lim)
2611 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
2612 ListKeepInside, ListRemoveInside,
2613 Limit, RemoveWebs, ListMaterials,
2614 KeepNonlimitShapes);
2615 RaiseIfFailed("MakePartition", self.BoolOp)
2618 ## Perform partition operation.
2619 # This method may be useful if it is needed to make a partition for
2620 # compound contains nonintersected shapes. Performance will be better
2621 # since intersection between shapes from compound is not performed.
2623 # Description of all parameters as in previous method MakePartition()
2625 # !!!NOTE: Passed compounds (via ListShapes or via ListTools)
2626 # have to consist of nonintersecting shapes.
2628 # @return New GEOM_Object, containing the result shapes.
2630 # @ref swig_todo "Example"
2631 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
2632 ListKeepInside=[], ListRemoveInside=[],
2633 Limit=ShapeType["AUTO"], RemoveWebs=0,
2634 ListMaterials=[], KeepNonlimitShapes=0):
2635 if Limit == ShapeType["AUTO"]:
2636 # automatic detection of the most appropriate shape limit type
2638 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
2639 Limit = EnumToLong(lim)
2641 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
2642 ListKeepInside, ListRemoveInside,
2643 Limit, RemoveWebs, ListMaterials,
2644 KeepNonlimitShapes);
2645 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
2648 ## Shortcut to MakePartition()
2650 # @ref tui_partition "Example 1"
2651 # \n @ref swig_Partition "Example 2"
2652 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
2653 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
2654 KeepNonlimitShapes=0):
2655 # Example: see GEOM_TestOthers.py
2656 anObj = self.MakePartition(ListShapes, ListTools,
2657 ListKeepInside, ListRemoveInside,
2658 Limit, RemoveWebs, ListMaterials,
2659 KeepNonlimitShapes);
2662 ## Perform partition of the Shape with the Plane
2663 # @param theShape Shape to be intersected.
2664 # @param thePlane Tool shape, to intersect theShape.
2665 # @return New GEOM_Object, containing the result shape.
2667 # @ref tui_partition "Example"
2668 def MakeHalfPartition(self,theShape, thePlane):
2669 # Example: see GEOM_TestAll.py
2670 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
2671 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
2674 # end of l3_basic_op
2677 ## @addtogroup l3_transform
2680 ## Translate the given object along the vector, specified
2681 # by its end points, creating its copy before the translation.
2682 # @param theObject The object to be translated.
2683 # @param thePoint1 Start point of translation vector.
2684 # @param thePoint2 End point of translation vector.
2685 # @return New GEOM_Object, containing the translated object.
2687 # @ref tui_translation "Example 1"
2688 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
2689 def MakeTranslationTwoPoints(self,theObject, thePoint1, thePoint2):
2690 # Example: see GEOM_TestAll.py
2691 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
2692 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
2695 ## Translate the given object along the vector, specified by its components.
2696 # @param theObject The object to be translated.
2697 # @param theDX,theDY,theDZ Components of translation vector.
2698 # @return Translated GEOM_Object.
2700 # @ref tui_translation "Example"
2701 def TranslateDXDYDZ(self,theObject, theDX, theDY, theDZ):
2702 # Example: see GEOM_TestAll.py
2703 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
2704 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
2705 anObj.SetParameters(Parameters)
2706 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
2709 ## Translate the given object along the vector, specified
2710 # by its components, creating its copy before the translation.
2711 # @param theObject The object to be translated.
2712 # @param theDX,theDY,theDZ Components of translation vector.
2713 # @return New GEOM_Object, containing the translated object.
2715 # @ref tui_translation "Example"
2716 def MakeTranslation(self,theObject, theDX, theDY, theDZ):
2717 # Example: see GEOM_TestAll.py
2718 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
2719 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
2720 anObj.SetParameters(Parameters)
2721 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
2724 ## Translate the given object along the given vector,
2725 # creating its copy before the translation.
2726 # @param theObject The object to be translated.
2727 # @param theVector The translation vector.
2728 # @return New GEOM_Object, containing the translated object.
2730 # @ref tui_translation "Example"
2731 def MakeTranslationVector(self,theObject, theVector):
2732 # Example: see GEOM_TestAll.py
2733 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
2734 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
2737 ## Translate the given object along the given vector on given distance.
2738 # @param theObject The object to be translated.
2739 # @param theVector The translation vector.
2740 # @param theDistance The translation distance.
2741 # @param theCopy Flag used to translate object itself or create a copy.
2742 # @return Translated GEOM_Object.
2744 # @ref tui_translation "Example"
2745 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy):
2746 # Example: see GEOM_TestAll.py
2747 theDistance,Parameters = ParseParameters(theDistance)
2748 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
2749 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
2750 anObj.SetParameters(Parameters)
2753 ## Translate the given object along the given vector on given distance,
2754 # creating its copy before the translation.
2755 # @param theObject The object to be translated.
2756 # @param theVector The translation vector.
2757 # @param theDistance The translation distance.
2758 # @return New GEOM_Object, containing the translated object.
2760 # @ref tui_translation "Example"
2761 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance):
2762 # Example: see GEOM_TestAll.py
2763 theDistance,Parameters = ParseParameters(theDistance)
2764 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
2765 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
2766 anObj.SetParameters(Parameters)
2769 ## Rotate the given object around the given axis on the given angle.
2770 # @param theObject The object to be rotated.
2771 # @param theAxis Rotation axis.
2772 # @param theAngle Rotation angle in radians.
2773 # @return Rotated GEOM_Object.
2775 # @ref tui_rotation "Example"
2776 def Rotate(self,theObject, theAxis, theAngle):
2777 # Example: see GEOM_TestAll.py
2779 if isinstance(theAngle,str):
2781 theAngle, Parameters = ParseParameters(theAngle)
2783 theAngle = theAngle*math.pi/180.0
2784 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
2785 RaiseIfFailed("RotateCopy", self.TrsfOp)
2786 anObj.SetParameters(Parameters)
2789 ## Rotate the given object around the given axis
2790 # on the given angle, creating its copy before the rotatation.
2791 # @param theObject The object to be rotated.
2792 # @param theAxis Rotation axis.
2793 # @param theAngle Rotation angle in radians.
2794 # @return New GEOM_Object, containing the rotated object.
2796 # @ref tui_rotation "Example"
2797 def MakeRotation(self,theObject, theAxis, theAngle):
2798 # Example: see GEOM_TestAll.py
2800 if isinstance(theAngle,str):
2802 theAngle, Parameters = ParseParameters(theAngle)
2804 theAngle = theAngle*math.pi/180.0
2805 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
2806 RaiseIfFailed("RotateCopy", self.TrsfOp)
2807 anObj.SetParameters(Parameters)
2810 ## Rotate given object around vector perpendicular to plane
2811 # containing three points, creating its copy before the rotatation.
2812 # @param theObject The object to be rotated.
2813 # @param theCentPoint central point - the axis is the vector perpendicular to the plane
2814 # containing the three points.
2815 # @param thePoint1,thePoint2 - in a perpendicular plane of the axis.
2816 # @return New GEOM_Object, containing the rotated object.
2818 # @ref tui_rotation "Example"
2819 def MakeRotationThreePoints(self,theObject, theCentPoint, thePoint1, thePoint2):
2820 # Example: see GEOM_TestAll.py
2821 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
2822 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
2825 ## Scale the given object by the factor, creating its copy before the scaling.
2826 # @param theObject The object to be scaled.
2827 # @param thePoint Center point for scaling.
2828 # Passing None for it means scaling relatively the origin of global CS.
2829 # @param theFactor Scaling factor value.
2830 # @return New GEOM_Object, containing the scaled shape.
2832 # @ref tui_scale "Example"
2833 def MakeScaleTransform(self, theObject, thePoint, theFactor):
2834 # Example: see GEOM_TestAll.py
2835 theFactor, Parameters = ParseParameters(theFactor)
2836 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
2837 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
2838 anObj.SetParameters(Parameters)
2841 ## Scale the given object by different factors along coordinate axes,
2842 # creating its copy before the scaling.
2843 # @param theObject The object to be scaled.
2844 # @param thePoint Center point for scaling.
2845 # Passing None for it means scaling relatively the origin of global CS.
2846 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
2847 # @return New GEOM_Object, containing the scaled shape.
2849 # @ref swig_scale "Example"
2850 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ):
2851 # Example: see GEOM_TestAll.py
2852 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
2853 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
2854 theFactorX, theFactorY, theFactorZ)
2855 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
2856 anObj.SetParameters(Parameters)
2859 ## Create an object, symmetrical
2860 # to the given one relatively the given plane.
2861 # @param theObject The object to be mirrored.
2862 # @param thePlane Plane of symmetry.
2863 # @return New GEOM_Object, containing the mirrored shape.
2865 # @ref tui_mirror "Example"
2866 def MakeMirrorByPlane(self,theObject, thePlane):
2867 # Example: see GEOM_TestAll.py
2868 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
2869 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
2872 ## Create an object, symmetrical
2873 # to the given one relatively the given axis.
2874 # @param theObject The object to be mirrored.
2875 # @param theAxis Axis of symmetry.
2876 # @return New GEOM_Object, containing the mirrored shape.
2878 # @ref tui_mirror "Example"
2879 def MakeMirrorByAxis(self,theObject, theAxis):
2880 # Example: see GEOM_TestAll.py
2881 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
2882 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
2885 ## Create an object, symmetrical
2886 # to the given one relatively the given point.
2887 # @param theObject The object to be mirrored.
2888 # @param thePoint Point of symmetry.
2889 # @return New GEOM_Object, containing the mirrored shape.
2891 # @ref tui_mirror "Example"
2892 def MakeMirrorByPoint(self,theObject, thePoint):
2893 # Example: see GEOM_TestAll.py
2894 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
2895 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
2898 ## Modify the Location of the given object by LCS,
2899 # creating its copy before the setting.
2900 # @param theObject The object to be displaced.
2901 # @param theStartLCS Coordinate system to perform displacement from it.
2902 # If \a theStartLCS is NULL, displacement
2903 # will be performed from global CS.
2904 # If \a theObject itself is used as \a theStartLCS,
2905 # its location will be changed to \a theEndLCS.
2906 # @param theEndLCS Coordinate system to perform displacement to it.
2907 # @return New GEOM_Object, containing the displaced shape.
2909 # @ref tui_modify_location "Example"
2910 def MakePosition(self,theObject, theStartLCS, theEndLCS):
2911 # Example: see GEOM_TestAll.py
2912 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
2913 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
2916 ## Modify the Location of the given object by Path,
2917 # @param theObject The object to be displaced.
2918 # @param thePath Wire or Edge along that the object will be translated.
2919 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
2920 # @param theCopy is to create a copy objects if true.
2921 # @param theReverse - 0 for usual direction, 1 to reverse path direction.
2922 # @return New GEOM_Object, containing the displaced shape.
2924 # @ref tui_modify_location "Example"
2925 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
2926 # Example: see GEOM_TestAll.py
2927 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
2928 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
2931 ## Create new object as offset of the given one.
2932 # @param theObject The base object for the offset.
2933 # @param theOffset Offset value.
2934 # @return New GEOM_Object, containing the offset object.
2936 # @ref tui_offset "Example"
2937 def MakeOffset(self,theObject, theOffset):
2938 # Example: see GEOM_TestAll.py
2939 theOffset, Parameters = ParseParameters(theOffset)
2940 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
2941 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
2942 anObj.SetParameters(Parameters)
2945 # -----------------------------------------------------------------------------
2947 # -----------------------------------------------------------------------------
2949 ## Translate the given object along the given vector a given number times
2950 # @param theObject The object to be translated.
2951 # @param theVector Direction of the translation.
2952 # @param theStep Distance to translate on.
2953 # @param theNbTimes Quantity of translations to be done.
2954 # @return New GEOM_Object, containing compound of all
2955 # the shapes, obtained after each translation.
2957 # @ref tui_multi_translation "Example"
2958 def MakeMultiTranslation1D(self,theObject, theVector, theStep, theNbTimes):
2959 # Example: see GEOM_TestAll.py
2960 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
2961 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
2962 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
2963 anObj.SetParameters(Parameters)
2966 ## Conseqently apply two specified translations to theObject specified number of times.
2967 # @param theObject The object to be translated.
2968 # @param theVector1 Direction of the first translation.
2969 # @param theStep1 Step of the first translation.
2970 # @param theNbTimes1 Quantity of translations to be done along theVector1.
2971 # @param theVector2 Direction of the second translation.
2972 # @param theStep2 Step of the second translation.
2973 # @param theNbTimes2 Quantity of translations to be done along theVector2.
2974 # @return New GEOM_Object, containing compound of all
2975 # the shapes, obtained after each translation.
2977 # @ref tui_multi_translation "Example"
2978 def MakeMultiTranslation2D(self,theObject, theVector1, theStep1, theNbTimes1,
2979 theVector2, theStep2, theNbTimes2):
2980 # Example: see GEOM_TestAll.py
2981 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
2982 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
2983 theVector2, theStep2, theNbTimes2)
2984 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
2985 anObj.SetParameters(Parameters)
2988 ## Rotate the given object around the given axis a given number times.
2989 # Rotation angle will be 2*PI/theNbTimes.
2990 # @param theObject The object to be rotated.
2991 # @param theAxis The rotation axis.
2992 # @param theNbTimes Quantity of rotations to be done.
2993 # @return New GEOM_Object, containing compound of all the
2994 # shapes, obtained after each rotation.
2996 # @ref tui_multi_rotation "Example"
2997 def MultiRotate1D(self,theObject, theAxis, theNbTimes):
2998 # Example: see GEOM_TestAll.py
2999 theAxis, theNbTimes, Parameters = ParseParameters(theAxis, theNbTimes)
3000 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
3001 RaiseIfFailed("MultiRotate1D", self.TrsfOp)
3002 anObj.SetParameters(Parameters)
3005 ## Rotate the given object around the
3006 # given axis on the given angle a given number
3007 # times and multi-translate each rotation result.
3008 # Translation direction passes through center of gravity
3009 # of rotated shape and its projection on the rotation axis.
3010 # @param theObject The object to be rotated.
3011 # @param theAxis Rotation axis.
3012 # @param theAngle Rotation angle in graduces.
3013 # @param theNbTimes1 Quantity of rotations to be done.
3014 # @param theStep Translation distance.
3015 # @param theNbTimes2 Quantity of translations to be done.
3016 # @return New GEOM_Object, containing compound of all the
3017 # shapes, obtained after each transformation.
3019 # @ref tui_multi_rotation "Example"
3020 def MultiRotate2D(self,theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2):
3021 # Example: see GEOM_TestAll.py
3022 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
3023 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
3024 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
3025 anObj.SetParameters(Parameters)
3028 ## The same, as MultiRotate1D(), but axis is given by direction and point
3029 # @ref swig_MakeMultiRotation "Example"
3030 def MakeMultiRotation1D(self,aShape,aDir,aPoint,aNbTimes):
3031 # Example: see GEOM_TestOthers.py
3032 aVec = self.MakeLine(aPoint,aDir)
3033 anObj = self.MultiRotate1D(aShape,aVec,aNbTimes)
3036 ## The same, as MultiRotate2D(), but axis is given by direction and point
3037 # @ref swig_MakeMultiRotation "Example"
3038 def MakeMultiRotation2D(self,aShape,aDir,aPoint,anAngle,nbtimes1,aStep,nbtimes2):
3039 # Example: see GEOM_TestOthers.py
3040 aVec = self.MakeLine(aPoint,aDir)
3041 anObj = self.MultiRotate2D(aShape,aVec,anAngle,nbtimes1,aStep,nbtimes2)
3044 # end of l3_transform
3047 ## @addtogroup l3_local
3050 ## Perform a fillet on all edges of the given shape.
3051 # @param theShape Shape, to perform fillet on.
3052 # @param theR Fillet radius.
3053 # @return New GEOM_Object, containing the result shape.
3055 # @ref tui_fillet "Example 1"
3056 # \n @ref swig_MakeFilletAll "Example 2"
3057 def MakeFilletAll(self,theShape, theR):
3058 # Example: see GEOM_TestOthers.py
3059 theR,Parameters = ParseParameters(theR)
3060 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
3061 RaiseIfFailed("MakeFilletAll", self.LocalOp)
3062 anObj.SetParameters(Parameters)
3065 ## Perform a fillet on the specified edges/faces of the given shape
3066 # @param theShape Shape, to perform fillet on.
3067 # @param theR Fillet radius.
3068 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR>.
3069 # @param theListShapes Global indices of edges/faces to perform fillet on.
3070 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
3071 # @return New GEOM_Object, containing the result shape.
3073 # @ref tui_fillet "Example"
3074 def MakeFillet(self,theShape, theR, theShapeType, theListShapes):
3075 # Example: see GEOM_TestAll.py
3076 theR,Parameters = ParseParameters(theR)
3078 if theShapeType == ShapeType["EDGE"]:
3079 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
3080 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
3082 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
3083 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
3084 anObj.SetParameters(Parameters)
3087 ## The same that MakeFillet but with two Fillet Radius R1 and R2
3088 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes):
3089 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
3091 if theShapeType == ShapeType["EDGE"]:
3092 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
3093 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
3095 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
3096 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
3097 anObj.SetParameters(Parameters)
3100 ## Perform a fillet on the specified edges of the given shape
3101 # @param theShape - Wire Shape to perform fillet on.
3102 # @param theR - Fillet radius.
3103 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
3104 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
3105 # \note The list of vertices could be empty,
3106 # in this case fillet will done done at all vertices in wire
3107 # @return New GEOM_Object, containing the result shape.
3109 # @ref tui_fillet2d "Example"
3110 def MakeFillet1D(self,theShape, theR, theListOfVertexes):
3111 # Example: see GEOM_TestAll.py
3112 theR,Parameters = ParseParameters(theR)
3113 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes)
3114 RaiseIfFailed("MakeFillet1D", self.LocalOp)
3115 anObj.SetParameters(Parameters)
3118 ## Perform a fillet on the specified edges/faces of the given shape
3119 # @param theShape - Face Shape to perform fillet on.
3120 # @param theR - Fillet radius.
3121 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
3122 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
3123 # @return New GEOM_Object, containing the result shape.
3125 # @ref tui_fillet2d "Example"
3126 def MakeFillet2D(self,theShape, theR, theListOfVertexes):
3127 # Example: see GEOM_TestAll.py
3128 theR,Parameters = ParseParameters(theR)
3129 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
3130 RaiseIfFailed("MakeFillet2D", self.LocalOp)
3131 anObj.SetParameters(Parameters)
3134 ## Perform a symmetric chamfer on all edges of the given shape.
3135 # @param theShape Shape, to perform chamfer on.
3136 # @param theD Chamfer size along each face.
3137 # @return New GEOM_Object, containing the result shape.
3139 # @ref tui_chamfer "Example 1"
3140 # \n @ref swig_MakeChamferAll "Example 2"
3141 def MakeChamferAll(self,theShape, theD):
3142 # Example: see GEOM_TestOthers.py
3143 theD,Parameters = ParseParameters(theD)
3144 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
3145 RaiseIfFailed("MakeChamferAll", self.LocalOp)
3146 anObj.SetParameters(Parameters)
3149 ## Perform a chamfer on edges, common to the specified faces,
3150 # with distance D1 on the Face1
3151 # @param theShape Shape, to perform chamfer on.
3152 # @param theD1 Chamfer size along \a theFace1.
3153 # @param theD2 Chamfer size along \a theFace2.
3154 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
3155 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
3156 # @return New GEOM_Object, containing the result shape.
3158 # @ref tui_chamfer "Example"
3159 def MakeChamferEdge(self,theShape, theD1, theD2, theFace1, theFace2):
3160 # Example: see GEOM_TestAll.py
3161 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
3162 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
3163 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
3164 anObj.SetParameters(Parameters)
3167 ## The Same that MakeChamferEdge but with params theD is chamfer length and
3168 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
3169 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2):
3171 if isinstance(theAngle,str):
3173 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
3175 theAngle = theAngle*math.pi/180.0
3176 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
3177 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
3178 anObj.SetParameters(Parameters)
3181 ## Perform a chamfer on all edges of the specified faces,
3182 # with distance D1 on the first specified face (if several for one edge)
3183 # @param theShape Shape, to perform chamfer on.
3184 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
3185 # connected to the edge, are in \a theFaces, \a theD1
3186 # will be get along face, which is nearer to \a theFaces beginning.
3187 # @param theD2 Chamfer size along another of two faces, connected to the edge.
3188 # @param theFaces Sequence of global indices of faces of \a theShape.
3189 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
3190 # @return New GEOM_Object, containing the result shape.
3192 # @ref tui_chamfer "Example"
3193 def MakeChamferFaces(self,theShape, theD1, theD2, theFaces):
3194 # Example: see GEOM_TestAll.py
3195 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
3196 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
3197 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
3198 anObj.SetParameters(Parameters)
3201 ## The Same that MakeChamferFaces but with params theD is chamfer lenght and
3202 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
3204 # @ref swig_FilletChamfer "Example"
3205 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces):
3207 if isinstance(theAngle,str):
3209 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
3211 theAngle = theAngle*math.pi/180.0
3212 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
3213 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
3214 anObj.SetParameters(Parameters)
3217 ## Perform a chamfer on edges,
3218 # with distance D1 on the first specified face (if several for one edge)
3219 # @param theShape Shape, to perform chamfer on.
3220 # @param theD1,theD2 Chamfer size
3221 # @param theEdges Sequence of edges of \a theShape.
3222 # @return New GEOM_Object, containing the result shape.
3224 # @ref swig_FilletChamfer "Example"
3225 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges):
3226 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
3227 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
3228 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
3229 anObj.SetParameters(Parameters)
3232 ## The Same that MakeChamferEdges but with params theD is chamfer lenght and
3233 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
3234 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges):
3236 if isinstance(theAngle,str):
3238 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
3240 theAngle = theAngle*math.pi/180.0
3241 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
3242 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
3243 anObj.SetParameters(Parameters)
3246 ## Shortcut to MakeChamferEdge() and MakeChamferFaces()
3248 # @ref swig_MakeChamfer "Example"
3249 def MakeChamfer(self,aShape,d1,d2,aShapeType,ListShape):
3250 # Example: see GEOM_TestOthers.py
3252 if aShapeType == ShapeType["EDGE"]:
3253 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1])
3255 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape)
3261 ## @addtogroup l3_basic_op
3264 ## Perform an Archimde operation on the given shape with given parameters.
3265 # The object presenting the resulting face is returned.
3266 # @param theShape Shape to be put in water.
3267 # @param theWeight Weight og the shape.
3268 # @param theWaterDensity Density of the water.
3269 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
3270 # @return New GEOM_Object, containing a section of \a theShape
3271 # by a plane, corresponding to water level.
3273 # @ref tui_archimede "Example"
3274 def Archimede(self,theShape, theWeight, theWaterDensity, theMeshDeflection):
3275 # Example: see GEOM_TestAll.py
3276 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
3277 theWeight,theWaterDensity,theMeshDeflection)
3278 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
3279 RaiseIfFailed("MakeArchimede", self.LocalOp)
3280 anObj.SetParameters(Parameters)
3283 # end of l3_basic_op
3286 ## @addtogroup l2_measure
3289 ## Get point coordinates
3292 # @ref tui_measurement_tools_page "Example"
3293 def PointCoordinates(self,Point):
3294 # Example: see GEOM_TestMeasures.py
3295 aTuple = self.MeasuOp.PointCoordinates(Point)
3296 RaiseIfFailed("PointCoordinates", self.MeasuOp)
3299 ## Get summarized length of all wires,
3300 # area of surface and volume of the given shape.
3301 # @param theShape Shape to define properties of.
3302 # @return [theLength, theSurfArea, theVolume]
3303 # theLength: Summarized length of all wires of the given shape.
3304 # theSurfArea: Area of surface of the given shape.
3305 # theVolume: Volume of the given shape.
3307 # @ref tui_measurement_tools_page "Example"
3308 def BasicProperties(self,theShape):
3309 # Example: see GEOM_TestMeasures.py
3310 aTuple = self.MeasuOp.GetBasicProperties(theShape)
3311 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
3314 ## Get parameters of bounding box of the given shape
3315 # @param theShape Shape to obtain bounding box of.
3316 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
3317 # Xmin,Xmax: Limits of shape along OX axis.
3318 # Ymin,Ymax: Limits of shape along OY axis.
3319 # Zmin,Zmax: Limits of shape along OZ axis.
3321 # @ref tui_measurement_tools_page "Example"
3322 def BoundingBox(self,theShape):
3323 # Example: see GEOM_TestMeasures.py
3324 aTuple = self.MeasuOp.GetBoundingBox(theShape)
3325 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
3328 ## Get inertia matrix and moments of inertia of theShape.
3329 # @param theShape Shape to calculate inertia of.
3330 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
3331 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
3332 # Ix,Iy,Iz: Moments of inertia of the given shape.
3334 # @ref tui_measurement_tools_page "Example"
3335 def Inertia(self,theShape):
3336 # Example: see GEOM_TestMeasures.py
3337 aTuple = self.MeasuOp.GetInertia(theShape)
3338 RaiseIfFailed("GetInertia", self.MeasuOp)
3341 ## Get if coords are included in the shape (ST_IN or ST_ON)
3342 # @param theShape Shape
3343 # @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
3344 # @param tolerance to be used (default is 1.0e-7)
3345 # @return list_of_boolean = [res1, res2, ...]
3346 def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
3347 return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
3349 ## Get minimal distance between the given shapes.
3350 # @param theShape1,theShape2 Shapes to find minimal distance between.
3351 # @return Value of the minimal distance between the given shapes.
3353 # @ref tui_measurement_tools_page "Example"
3354 def MinDistance(self, theShape1, theShape2):
3355 # Example: see GEOM_TestMeasures.py
3356 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
3357 RaiseIfFailed("GetMinDistance", self.MeasuOp)
3360 ## Get minimal distance between the given shapes.
3361 # @param theShape1,theShape2 Shapes to find minimal distance between.
3362 # @return Value of the minimal distance between the given shapes.
3364 # @ref swig_all_measure "Example"
3365 def MinDistanceComponents(self, theShape1, theShape2):
3366 # Example: see GEOM_TestMeasures.py
3367 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
3368 RaiseIfFailed("GetMinDistance", self.MeasuOp)
3369 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
3372 ## Get angle between the given shapes in degrees.
3373 # @param theShape1,theShape2 Lines or linear edges to find angle between.
3374 # @return Value of the angle between the given shapes in degrees.
3376 # @ref tui_measurement_tools_page "Example"
3377 def GetAngle(self, theShape1, theShape2):
3378 # Example: see GEOM_TestMeasures.py
3379 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
3380 RaiseIfFailed("GetAngle", self.MeasuOp)
3382 ## Get angle between the given shapes in radians.
3383 # @param theShape1,theShape2 Lines or linear edges to find angle between.
3384 # @return Value of the angle between the given shapes in radians.
3386 # @ref tui_measurement_tools_page "Example"
3387 def GetAngleRadians(self, theShape1, theShape2):
3388 # Example: see GEOM_TestMeasures.py
3389 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
3390 RaiseIfFailed("GetAngle", self.MeasuOp)
3393 ## @name Curve Curvature Measurement
3394 # Methods for receiving radius of curvature of curves
3395 # in the given point
3398 ## Measure curvature of a curve at a point, set by parameter.
3399 # @ref swig_todo "Example"
3400 def CurveCurvatureByParam(self, theCurve, theParam):
3401 # Example: see GEOM_TestMeasures.py
3402 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
3403 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
3407 # @ref swig_todo "Example"
3408 def CurveCurvatureByPoint(self, theCurve, thePoint):
3409 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
3410 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
3414 ## @name Surface Curvature Measurement
3415 # Methods for receiving max and min radius of curvature of surfaces
3416 # in the given point
3420 ## @ref swig_todo "Example"
3421 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
3422 # Example: see GEOM_TestMeasures.py
3423 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
3424 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
3428 ## @ref swig_todo "Example"
3429 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
3430 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
3431 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
3435 ## @ref swig_todo "Example"
3436 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
3437 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
3438 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
3442 ## @ref swig_todo "Example"
3443 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
3444 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
3445 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
3449 ## Get min and max tolerances of sub-shapes of theShape
3450 # @param theShape Shape, to get tolerances of.
3451 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
3452 # FaceMin,FaceMax: Min and max tolerances of the faces.
3453 # EdgeMin,EdgeMax: Min and max tolerances of the edges.
3454 # VertMin,VertMax: Min and max tolerances of the vertices.
3456 # @ref tui_measurement_tools_page "Example"
3457 def Tolerance(self,theShape):
3458 # Example: see GEOM_TestMeasures.py
3459 aTuple = self.MeasuOp.GetTolerance(theShape)
3460 RaiseIfFailed("GetTolerance", self.MeasuOp)
3463 ## Obtain description of the given shape (number of sub-shapes of each type)
3464 # @param theShape Shape to be described.
3465 # @return Description of the given shape.
3467 # @ref tui_measurement_tools_page "Example"
3468 def WhatIs(self,theShape):
3469 # Example: see GEOM_TestMeasures.py
3470 aDescr = self.MeasuOp.WhatIs(theShape)
3471 RaiseIfFailed("WhatIs", self.MeasuOp)
3474 ## Obtain quantity of shapes of the given type in \a theShape.
3475 # If \a theShape is of type \a theType, it is also counted.
3476 # @param theShape Shape to be described.
3477 # @return Quantity of shapes of type \a theType in \a theShape.
3479 # @ref tui_measurement_tools_page "Example"
3480 def NbShapes (self, theShape, theType):
3481 # Example: see GEOM_TestMeasures.py
3482 listSh = self.SubShapeAllIDs(theShape, theType)
3484 t = EnumToLong(theShape.GetShapeType())
3485 theType = EnumToLong(theType)
3491 ## Obtain quantity of shapes of each type in \a theShape.
3492 # The \a theShape is also counted.
3493 # @param theShape Shape to be described.
3494 # @return Dictionary of shape types with bound quantities of shapes.
3496 # @ref tui_measurement_tools_page "Example"
3497 def ShapeInfo (self, theShape):
3498 # Example: see GEOM_TestMeasures.py
3500 for typeSh in ShapeType:
3501 if typeSh in ( "AUTO", "SHAPE" ): continue
3502 listSh = self.SubShapeAllIDs(theShape, ShapeType[typeSh])
3504 if EnumToLong(theShape.GetShapeType()) == ShapeType[typeSh]:
3511 ## Get a point, situated at the centre of mass of theShape.
3512 # @param theShape Shape to define centre of mass of.
3513 # @return New GEOM_Object, containing the created point.
3515 # @ref tui_measurement_tools_page "Example"
3516 def MakeCDG(self,theShape):
3517 # Example: see GEOM_TestMeasures.py
3518 anObj = self.MeasuOp.GetCentreOfMass(theShape)
3519 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
3522 ## Get a vertex subshape by index depended with orientation.
3523 # @param theShape Shape to find subshape.
3524 # @param theIndex Index to find vertex by this index.
3525 # @return New GEOM_Object, containing the created vertex.
3527 # @ref tui_measurement_tools_page "Example"
3528 def GetVertexByIndex(self,theShape, theIndex):
3529 # Example: see GEOM_TestMeasures.py
3530 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
3531 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
3534 ## Get the first vertex of wire/edge depended orientation.
3535 # @param theShape Shape to find first vertex.
3536 # @return New GEOM_Object, containing the created vertex.
3538 # @ref tui_measurement_tools_page "Example"
3539 def GetFirstVertex(self,theShape):
3540 # Example: see GEOM_TestMeasures.py
3541 anObj = self.GetVertexByIndex(theShape, 0)
3542 RaiseIfFailed("GetFirstVertex", self.MeasuOp)
3545 ## Get the last vertex of wire/edge depended orientation.
3546 # @param theShape Shape to find last vertex.
3547 # @return New GEOM_Object, containing the created vertex.
3549 # @ref tui_measurement_tools_page "Example"
3550 def GetLastVertex(self,theShape):
3551 # Example: see GEOM_TestMeasures.py
3552 nb_vert = self.ShapesOp.NumberOfSubShapes(theShape, ShapeType["VERTEX"])
3553 anObj = self.GetVertexByIndex(theShape, (nb_vert-1))
3554 RaiseIfFailed("GetLastVertex", self.MeasuOp)
3557 ## Get a normale to the given face. If the point is not given,
3558 # the normale is calculated at the center of mass.
3559 # @param theFace Face to define normale of.
3560 # @param theOptionalPoint Point to compute the normale at.
3561 # @return New GEOM_Object, containing the created vector.
3563 # @ref swig_todo "Example"
3564 def GetNormal(self, theFace, theOptionalPoint = None):
3565 # Example: see GEOM_TestMeasures.py
3566 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
3567 RaiseIfFailed("GetNormal", self.MeasuOp)
3570 ## Check a topology of the given shape.
3571 # @param theShape Shape to check validity of.
3572 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked,
3573 # if TRUE, the shape's geometry will be checked also.
3574 # @return TRUE, if the shape "seems to be valid".
3575 # If theShape is invalid, prints a description of problem.
3577 # @ref tui_measurement_tools_page "Example"
3578 def CheckShape(self,theShape, theIsCheckGeom = 0):
3579 # Example: see GEOM_TestMeasures.py
3581 (IsValid, Status) = self.MeasuOp.CheckShapeWithGeometry(theShape)
3582 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
3584 (IsValid, Status) = self.MeasuOp.CheckShape(theShape)
3585 RaiseIfFailed("CheckShape", self.MeasuOp)
3590 ## Get position (LCS) of theShape.
3592 # Origin of the LCS is situated at the shape's center of mass.
3593 # Axes of the LCS are obtained from shape's location or,
3594 # if the shape is a planar face, from position of its plane.
3596 # @param theShape Shape to calculate position of.
3597 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
3598 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
3599 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
3600 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
3602 # @ref swig_todo "Example"
3603 def GetPosition(self,theShape):
3604 # Example: see GEOM_TestMeasures.py
3605 aTuple = self.MeasuOp.GetPosition(theShape)
3606 RaiseIfFailed("GetPosition", self.MeasuOp)
3609 ## Get kind of theShape.
3611 # @param theShape Shape to get a kind of.
3612 # @return Returns a kind of shape in terms of <VAR>GEOM_IKindOfShape.shape_kind</VAR> enumeration
3613 # and a list of parameters, describing the shape.
3614 # @note Concrete meaning of each value, returned via \a theIntegers
3615 # or \a theDoubles list depends on the kind of the shape.
3616 # The full list of possible outputs is:
3618 # - geompy.kind.COMPOUND nb_solids nb_faces nb_edges nb_vertices
3619 # - geompy.kind.COMPSOLID nb_solids nb_faces nb_edges nb_vertices
3621 # - geompy.kind.SHELL geompy.info.CLOSED nb_faces nb_edges nb_vertices
3622 # - geompy.kind.SHELL geompy.info.UNCLOSED nb_faces nb_edges nb_vertices
3624 # - geompy.kind.WIRE geompy.info.CLOSED nb_edges nb_vertices
3625 # - geompy.kind.WIRE geompy.info.UNCLOSED nb_edges nb_vertices
3627 # - geompy.kind.SPHERE xc yc zc R
3628 # - geompy.kind.CYLINDER xb yb zb dx dy dz R H
3629 # - geompy.kind.BOX xc yc zc ax ay az
3630 # - geompy.kind.ROTATED_BOX xc yc zc zx zy zz xx xy xz ax ay az
3631 # - geompy.kind.TORUS xc yc zc dx dy dz R_1 R_2
3632 # - geompy.kind.CONE xb yb zb dx dy dz R_1 R_2 H
3633 # - geompy.kind.POLYHEDRON nb_faces nb_edges nb_vertices
3634 # - geompy.kind.SOLID nb_faces nb_edges nb_vertices
3636 # - geompy.kind.SPHERE2D xc yc zc R
3637 # - geompy.kind.CYLINDER2D xb yb zb dx dy dz R H
3638 # - geompy.kind.TORUS2D xc yc zc dx dy dz R_1 R_2
3639 # - geompy.kind.CONE2D xc yc zc dx dy dz R_1 R_2 H
3640 # - geompy.kind.DISK_CIRCLE xc yc zc dx dy dz R
3641 # - geompy.kind.DISK_ELLIPSE xc yc zc dx dy dz R_1 R_2
3642 # - geompy.kind.POLYGON xo yo zo dx dy dz nb_edges nb_vertices
3643 # - geompy.kind.PLANE xo yo zo dx dy dz
3644 # - geompy.kind.PLANAR xo yo zo dx dy dz nb_edges nb_vertices
3645 # - geompy.kind.FACE nb_edges nb_vertices
3647 # - geompy.kind.CIRCLE xc yc zc dx dy dz R
3648 # - geompy.kind.ARC_CIRCLE xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2
3649 # - geompy.kind.ELLIPSE xc yc zc dx dy dz R_1 R_2
3650 # - geompy.kind.ARC_ELLIPSE xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2
3651 # - geompy.kind.LINE xo yo zo dx dy dz
3652 # - geompy.kind.SEGMENT x1 y1 z1 x2 y2 z2
3653 # - geompy.kind.EDGE nb_vertices
3655 # - geompy.kind.VERTEX x y z
3657 # @ref swig_todo "Example"
3658 def KindOfShape(self,theShape):
3659 # Example: see GEOM_TestMeasures.py
3660 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
3661 RaiseIfFailed("KindOfShape", self.MeasuOp)
3663 aKind = aRoughTuple[0]
3664 anInts = aRoughTuple[1]
3665 aDbls = aRoughTuple[2]
3667 # Now there is no exception from this rule:
3668 aKindTuple = [aKind] + aDbls + anInts
3670 # If they are we will regroup parameters for such kind of shape.
3672 #if aKind == kind.SOME_KIND:
3673 # # SOME_KIND int int double int double double
3674 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
3681 ## @addtogroup l2_import_export
3684 ## Import a shape from the BREP or IGES or STEP file
3685 # (depends on given format) with given name.
3686 # @param theFileName The file, containing the shape.
3687 # @param theFormatName Specify format for the file reading.
3688 # Available formats can be obtained with InsertOp.ImportTranslators() method.
3689 # If format 'IGES_SCALE' is used instead 'IGES' length unit will be
3690 # set to 'meter' and result model will be scaled.
3691 # @return New GEOM_Object, containing the imported shape.
3693 # @ref swig_Import_Export "Example"
3694 def Import(self,theFileName, theFormatName):
3695 # Example: see GEOM_TestOthers.py
3696 anObj = self.InsertOp.Import(theFileName, theFormatName)
3697 RaiseIfFailed("Import", self.InsertOp)
3700 ## Shortcut to Import() for BREP format
3702 # @ref swig_Import_Export "Example"
3703 def ImportBREP(self,theFileName):
3704 # Example: see GEOM_TestOthers.py
3705 return self.Import(theFileName, "BREP")
3707 ## Shortcut to Import() for IGES format
3709 # @ref swig_Import_Export "Example"
3710 def ImportIGES(self,theFileName):
3711 # Example: see GEOM_TestOthers.py
3712 return self.Import(theFileName, "IGES")
3714 ## Return length unit from given IGES file
3716 # @ref swig_Import_Export "Example"
3717 def GetIGESUnit(self,theFileName):
3718 # Example: see GEOM_TestOthers.py
3719 anObj = self.InsertOp.Import(theFileName, "IGES_UNIT")
3720 #RaiseIfFailed("Import", self.InsertOp)
3721 # recieve name using returned vertex
3723 if anObj.GetShapeType() == GEOM.VERTEX:
3726 vertices = self.SubShapeAll(anObj,ShapeType["VERTEX"])
3728 p = self.PointCoordinates(vertices[0])
3729 if abs(p[0]-0.01) < 1.e-6:
3731 elif abs(p[0]-0.001) < 1.e-6:
3735 ## Shortcut to Import() for STEP format
3737 # @ref swig_Import_Export "Example"
3738 def ImportSTEP(self,theFileName):
3739 # Example: see GEOM_TestOthers.py
3740 return self.Import(theFileName, "STEP")
3742 ## Export the given shape into a file with given name.
3743 # @param theObject Shape to be stored in the file.
3744 # @param theFileName Name of the file to store the given shape in.
3745 # @param theFormatName Specify format for the shape storage.
3746 # Available formats can be obtained with InsertOp.ImportTranslators() method.
3748 # @ref swig_Import_Export "Example"
3749 def Export(self,theObject, theFileName, theFormatName):
3750 # Example: see GEOM_TestOthers.py
3751 self.InsertOp.Export(theObject, theFileName, theFormatName)
3752 if self.InsertOp.IsDone() == 0:
3753 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
3757 ## Shortcut to Export() for BREP format
3759 # @ref swig_Import_Export "Example"
3760 def ExportBREP(self,theObject, theFileName):
3761 # Example: see GEOM_TestOthers.py
3762 return self.Export(theObject, theFileName, "BREP")
3764 ## Shortcut to Export() for IGES format
3766 # @ref swig_Import_Export "Example"
3767 def ExportIGES(self,theObject, theFileName):
3768 # Example: see GEOM_TestOthers.py
3769 return self.Export(theObject, theFileName, "IGES")
3771 ## Shortcut to Export() for STEP format
3773 # @ref swig_Import_Export "Example"
3774 def ExportSTEP(self,theObject, theFileName):
3775 # Example: see GEOM_TestOthers.py
3776 return self.Export(theObject, theFileName, "STEP")
3778 # end of l2_import_export
3781 ## @addtogroup l3_blocks
3784 ## Create a quadrangle face from four edges. Order of Edges is not
3785 # important. It is not necessary that edges share the same vertex.
3786 # @param E1,E2,E3,E4 Edges for the face bound.
3787 # @return New GEOM_Object, containing the created face.
3789 # @ref tui_building_by_blocks_page "Example"
3790 def MakeQuad(self,E1, E2, E3, E4):
3791 # Example: see GEOM_Spanner.py
3792 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
3793 RaiseIfFailed("MakeQuad", self.BlocksOp)
3796 ## Create a quadrangle face on two edges.
3797 # The missing edges will be built by creating the shortest ones.
3798 # @param E1,E2 Two opposite edges for the face.
3799 # @return New GEOM_Object, containing the created face.
3801 # @ref tui_building_by_blocks_page "Example"
3802 def MakeQuad2Edges(self,E1, E2):
3803 # Example: see GEOM_Spanner.py
3804 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
3805 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
3808 ## Create a quadrangle face with specified corners.
3809 # The missing edges will be built by creating the shortest ones.
3810 # @param V1,V2,V3,V4 Corner vertices for the face.
3811 # @return New GEOM_Object, containing the created face.
3813 # @ref tui_building_by_blocks_page "Example 1"
3814 # \n @ref swig_MakeQuad4Vertices "Example 2"
3815 def MakeQuad4Vertices(self,V1, V2, V3, V4):
3816 # Example: see GEOM_Spanner.py
3817 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
3818 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
3821 ## Create a hexahedral solid, bounded by the six given faces. Order of
3822 # faces is not important. It is not necessary that Faces share the same edge.
3823 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
3824 # @return New GEOM_Object, containing the created solid.
3826 # @ref tui_building_by_blocks_page "Example 1"
3827 # \n @ref swig_MakeHexa "Example 2"
3828 def MakeHexa(self,F1, F2, F3, F4, F5, F6):
3829 # Example: see GEOM_Spanner.py
3830 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
3831 RaiseIfFailed("MakeHexa", self.BlocksOp)
3834 ## Create a hexahedral solid between two given faces.
3835 # The missing faces will be built by creating the smallest ones.
3836 # @param F1,F2 Two opposite faces for the hexahedral solid.
3837 # @return New GEOM_Object, containing the created solid.
3839 # @ref tui_building_by_blocks_page "Example 1"
3840 # \n @ref swig_MakeHexa2Faces "Example 2"
3841 def MakeHexa2Faces(self,F1, F2):
3842 # Example: see GEOM_Spanner.py
3843 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
3844 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
3850 ## @addtogroup l3_blocks_op
3853 ## Get a vertex, found in the given shape by its coordinates.
3854 # @param theShape Block or a compound of blocks.
3855 # @param theX,theY,theZ Coordinates of the sought vertex.
3856 # @param theEpsilon Maximum allowed distance between the resulting
3857 # vertex and point with the given coordinates.
3858 # @return New GEOM_Object, containing the found vertex.
3860 # @ref swig_GetPoint "Example"
3861 def GetPoint(self, theShape, theX, theY, theZ, theEpsilon):
3862 # Example: see GEOM_TestOthers.py
3863 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
3864 RaiseIfFailed("GetPoint", self.BlocksOp)
3867 ## Find a vertex of the given shape, which has minimal distance to the given point.
3868 # @param theShape Any shape.
3869 # @param thePoint Point, close to the desired vertex.
3870 # @return New GEOM_Object, containing the found vertex.
3872 # @ref swig_GetVertexNearPoint "Example"
3873 def GetVertexNearPoint(self, theShape, thePoint):
3874 # Example: see GEOM_TestOthers.py
3875 anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
3876 RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
3879 ## Get an edge, found in the given shape by two given vertices.
3880 # @param theShape Block or a compound of blocks.
3881 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
3882 # @return New GEOM_Object, containing the found edge.
3884 # @ref swig_GetEdge "Example"
3885 def GetEdge(self, theShape, thePoint1, thePoint2):
3886 # Example: see GEOM_Spanner.py
3887 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
3888 RaiseIfFailed("GetEdge", self.BlocksOp)
3891 ## Find an edge of the given shape, which has minimal distance to the given point.
3892 # @param theShape Block or a compound of blocks.
3893 # @param thePoint Point, close to the desired edge.
3894 # @return New GEOM_Object, containing the found edge.
3896 # @ref swig_GetEdgeNearPoint "Example"
3897 def GetEdgeNearPoint(self, theShape, thePoint):
3898 # Example: see GEOM_TestOthers.py
3899 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
3900 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
3903 ## Returns a face, found in the given shape by four given corner vertices.
3904 # @param theShape Block or a compound of blocks.
3905 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
3906 # @return New GEOM_Object, containing the found face.
3908 # @ref swig_todo "Example"
3909 def GetFaceByPoints(self,theShape, thePoint1, thePoint2, thePoint3, thePoint4):
3910 # Example: see GEOM_Spanner.py
3911 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
3912 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
3915 ## Get a face of block, found in the given shape by two given edges.
3916 # @param theShape Block or a compound of blocks.
3917 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
3918 # @return New GEOM_Object, containing the found face.
3920 # @ref swig_todo "Example"
3921 def GetFaceByEdges(self,theShape, theEdge1, theEdge2):
3922 # Example: see GEOM_Spanner.py
3923 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
3924 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
3927 ## Find a face, opposite to the given one in the given block.
3928 # @param theBlock Must be a hexahedral solid.
3929 # @param theFace Face of \a theBlock, opposite to the desired face.
3930 # @return New GEOM_Object, containing the found face.
3932 # @ref swig_GetOppositeFace "Example"
3933 def GetOppositeFace(self,theBlock, theFace):
3934 # Example: see GEOM_Spanner.py
3935 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
3936 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
3939 ## Find a face of the given shape, which has minimal distance to the given point.
3940 # @param theShape Block or a compound of blocks.
3941 # @param thePoint Point, close to the desired face.
3942 # @return New GEOM_Object, containing the found face.
3944 # @ref swig_GetFaceNearPoint "Example"
3945 def GetFaceNearPoint(self, theShape, thePoint):
3946 # Example: see GEOM_Spanner.py
3947 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
3948 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
3951 ## Find a face of block, whose outside normale has minimal angle with the given vector.
3952 # @param theBlock Block or a compound of blocks.
3953 # @param theVector Vector, close to the normale of the desired face.
3954 # @return New GEOM_Object, containing the found face.
3956 # @ref swig_todo "Example"
3957 def GetFaceByNormale(self, theBlock, theVector):
3958 # Example: see GEOM_Spanner.py
3959 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
3960 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
3963 ## Find all subshapes of type \a theShapeType of the given shape,
3964 # which have minimal distance to the given point.
3965 # @param theShape Any shape.
3966 # @param thePoint Point, close to the desired shape.
3967 # @param theShapeType Defines what kind of subshapes is searched.
3968 # @param theTolerance The tolerance for distances comparison. All shapes
3969 # with distances to the given point in interval
3970 # [minimal_distance, minimal_distance + theTolerance] will be gathered.
3971 # @return New GEOM_Object, containing a group of all found shapes.
3973 # @ref swig_GetShapesNearPoint "Example"
3974 def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07):
3975 # Example: see GEOM_TestOthers.py
3976 anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
3977 RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
3980 # end of l3_blocks_op
3983 ## @addtogroup l4_blocks_measure
3986 ## Check, if the compound of blocks is given.
3987 # To be considered as a compound of blocks, the
3988 # given shape must satisfy the following conditions:
3989 # - Each element of the compound should be a Block (6 faces and 12 edges).
3990 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
3991 # - The compound should be connexe.
3992 # - The glue between two quadrangle faces should be applied.
3993 # @param theCompound The compound to check.
3994 # @return TRUE, if the given shape is a compound of blocks.
3995 # If theCompound is not valid, prints all discovered errors.
3997 # @ref tui_measurement_tools_page "Example 1"
3998 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
3999 def CheckCompoundOfBlocks(self,theCompound):
4000 # Example: see GEOM_Spanner.py
4001 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
4002 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
4004 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
4008 ## Remove all seam and degenerated edges from \a theShape.
4009 # Unite faces and edges, sharing one surface. It means that
4010 # this faces must have references to one C++ surface object (handle).
4011 # @param theShape The compound or single solid to remove irregular edges from.
4012 # @param doUnionFaces If True, then unite faces. If False (the default value),
4013 # do not unite faces.
4014 # @return Improved shape.
4016 # @ref swig_RemoveExtraEdges "Example"
4017 def RemoveExtraEdges(self, theShape, doUnionFaces=False):
4018 # Example: see GEOM_TestOthers.py
4019 nbFacesOptimum = -1 # -1 means do not unite faces
4020 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
4021 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
4022 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
4025 ## Check, if the given shape is a blocks compound.
4026 # Fix all detected errors.
4027 # \note Single block can be also fixed by this method.
4028 # @param theShape The compound to check and improve.
4029 # @return Improved compound.
4031 # @ref swig_CheckAndImprove "Example"
4032 def CheckAndImprove(self,theShape):
4033 # Example: see GEOM_TestOthers.py
4034 anObj = self.BlocksOp.CheckAndImprove(theShape)
4035 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
4038 # end of l4_blocks_measure
4041 ## @addtogroup l3_blocks_op
4044 ## Get all the blocks, contained in the given compound.
4045 # @param theCompound The compound to explode.
4046 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
4047 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
4048 # \note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
4049 # @return List of GEOM_Objects, containing the retrieved blocks.
4051 # @ref tui_explode_on_blocks "Example 1"
4052 # \n @ref swig_MakeBlockExplode "Example 2"
4053 def MakeBlockExplode(self,theCompound, theMinNbFaces, theMaxNbFaces):
4054 # Example: see GEOM_TestOthers.py
4055 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
4056 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
4057 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
4059 anObj.SetParameters(Parameters)
4063 ## Find block, containing the given point inside its volume or on boundary.
4064 # @param theCompound Compound, to find block in.
4065 # @param thePoint Point, close to the desired block. If the point lays on
4066 # boundary between some blocks, we return block with nearest center.
4067 # @return New GEOM_Object, containing the found block.
4069 # @ref swig_todo "Example"
4070 def GetBlockNearPoint(self,theCompound, thePoint):
4071 # Example: see GEOM_Spanner.py
4072 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
4073 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
4076 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
4077 # @param theCompound Compound, to find block in.
4078 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
4079 # @return New GEOM_Object, containing the found block.
4081 # @ref swig_GetBlockByParts "Example"
4082 def GetBlockByParts(self,theCompound, theParts):
4083 # Example: see GEOM_TestOthers.py
4084 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
4085 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
4088 ## Return all blocks, containing all the elements, passed as the parts.
4089 # @param theCompound Compound, to find blocks in.
4090 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
4091 # @return List of GEOM_Objects, containing the found blocks.
4093 # @ref swig_todo "Example"
4094 def GetBlocksByParts(self,theCompound, theParts):
4095 # Example: see GEOM_Spanner.py
4096 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
4097 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
4100 ## Multi-transformate block and glue the result.
4101 # Transformation is defined so, as to superpose direction faces.
4102 # @param Block Hexahedral solid to be multi-transformed.
4103 # @param DirFace1 ID of First direction face.
4104 # @param DirFace2 ID of Second direction face.
4105 # @param NbTimes Quantity of transformations to be done.
4106 # \note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
4107 # @return New GEOM_Object, containing the result shape.
4109 # @ref tui_multi_transformation "Example"
4110 def MakeMultiTransformation1D(self,Block, DirFace1, DirFace2, NbTimes):
4111 # Example: see GEOM_Spanner.py
4112 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
4113 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
4114 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
4115 anObj.SetParameters(Parameters)
4118 ## Multi-transformate block and glue the result.
4119 # @param Block Hexahedral solid to be multi-transformed.
4120 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
4121 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
4122 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
4123 # @return New GEOM_Object, containing the result shape.
4125 # @ref tui_multi_transformation "Example"
4126 def MakeMultiTransformation2D(self,Block, DirFace1U, DirFace2U, NbTimesU,
4127 DirFace1V, DirFace2V, NbTimesV):
4128 # Example: see GEOM_Spanner.py
4129 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
4130 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
4131 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
4132 DirFace1V, DirFace2V, NbTimesV)
4133 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
4134 anObj.SetParameters(Parameters)
4137 ## Build all possible propagation groups.
4138 # Propagation group is a set of all edges, opposite to one (main)
4139 # edge of this group directly or through other opposite edges.
4140 # Notion of Opposite Edge make sence only on quadrangle face.
4141 # @param theShape Shape to build propagation groups on.
4142 # @return List of GEOM_Objects, each of them is a propagation group.
4144 # @ref swig_Propagate "Example"
4145 def Propagate(self,theShape):
4146 # Example: see GEOM_TestOthers.py
4147 listChains = self.BlocksOp.Propagate(theShape)
4148 RaiseIfFailed("Propagate", self.BlocksOp)
4151 # end of l3_blocks_op
4154 ## @addtogroup l3_groups
4157 ## Creates a new group which will store sub shapes of theMainShape
4158 # @param theMainShape is a GEOM object on which the group is selected
4159 # @param theShapeType defines a shape type of the group
4160 # @return a newly created GEOM group
4162 # @ref tui_working_with_groups_page "Example 1"
4163 # \n @ref swig_CreateGroup "Example 2"
4164 def CreateGroup(self,theMainShape, theShapeType):
4165 # Example: see GEOM_TestOthers.py
4166 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
4167 RaiseIfFailed("CreateGroup", self.GroupOp)
4170 ## Adds a sub object with ID theSubShapeId to the group
4171 # @param theGroup is a GEOM group to which the new sub shape is added
4172 # @param theSubShapeID is a sub shape ID in the main object.
4173 # \note Use method GetSubShapeID() to get an unique ID of the sub shape
4175 # @ref tui_working_with_groups_page "Example"
4176 def AddObject(self,theGroup, theSubShapeID):
4177 # Example: see GEOM_TestOthers.py
4178 self.GroupOp.AddObject(theGroup, theSubShapeID)
4179 if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
4180 RaiseIfFailed("AddObject", self.GroupOp)
4184 ## Removes a sub object with ID \a theSubShapeId from the group
4185 # @param theGroup is a GEOM group from which the new sub shape is removed
4186 # @param theSubShapeID is a sub shape ID in the main object.
4187 # \note Use method GetSubShapeID() to get an unique ID of the sub shape
4189 # @ref tui_working_with_groups_page "Example"
4190 def RemoveObject(self,theGroup, theSubShapeID):
4191 # Example: see GEOM_TestOthers.py
4192 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
4193 RaiseIfFailed("RemoveObject", self.GroupOp)
4196 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
4197 # @param theGroup is a GEOM group to which the new sub shapes are added.
4198 # @param theSubShapes is a list of sub shapes to be added.
4200 # @ref tui_working_with_groups_page "Example"
4201 def UnionList (self,theGroup, theSubShapes):
4202 # Example: see GEOM_TestOthers.py
4203 self.GroupOp.UnionList(theGroup, theSubShapes)
4204 RaiseIfFailed("UnionList", self.GroupOp)
4207 ## Works like the above method, but argument
4208 # theSubShapes here is a list of sub-shapes indices
4210 # @ref swig_UnionIDs "Example"
4211 def UnionIDs(self,theGroup, theSubShapes):
4212 # Example: see GEOM_TestOthers.py
4213 self.GroupOp.UnionIDs(theGroup, theSubShapes)
4214 RaiseIfFailed("UnionIDs", self.GroupOp)
4217 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
4218 # @param theGroup is a GEOM group from which the sub-shapes are removed.
4219 # @param theSubShapes is a list of sub-shapes to be removed.
4221 # @ref tui_working_with_groups_page "Example"
4222 def DifferenceList (self,theGroup, theSubShapes):
4223 # Example: see GEOM_TestOthers.py
4224 self.GroupOp.DifferenceList(theGroup, theSubShapes)
4225 RaiseIfFailed("DifferenceList", self.GroupOp)
4228 ## Works like the above method, but argument
4229 # theSubShapes here is a list of sub-shapes indices
4231 # @ref swig_DifferenceIDs "Example"
4232 def DifferenceIDs(self,theGroup, theSubShapes):
4233 # Example: see GEOM_TestOthers.py
4234 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
4235 RaiseIfFailed("DifferenceIDs", self.GroupOp)
4238 ## Returns a list of sub objects ID stored in the group
4239 # @param theGroup is a GEOM group for which a list of IDs is requested
4241 # @ref swig_GetObjectIDs "Example"
4242 def GetObjectIDs(self,theGroup):
4243 # Example: see GEOM_TestOthers.py
4244 ListIDs = self.GroupOp.GetObjects(theGroup)
4245 RaiseIfFailed("GetObjects", self.GroupOp)
4248 ## Returns a type of sub objects stored in the group
4249 # @param theGroup is a GEOM group which type is returned.
4251 # @ref swig_GetType "Example"
4252 def GetType(self,theGroup):
4253 # Example: see GEOM_TestOthers.py
4254 aType = self.GroupOp.GetType(theGroup)
4255 RaiseIfFailed("GetType", self.GroupOp)
4258 ## Convert a type of geom object from id to string value
4259 # @param theId is a GEOM obect type id.
4261 # @ref swig_GetType "Example"
4262 def ShapeIdToType(self, theId):
4336 return "FREE_BOUNDS"
4344 return "THRUSECTIONS"
4346 return "COMPOUNDFILTER"
4348 return "SHAPES_ON_SHAPE"
4350 return "ELLIPSE_ARC"
4357 return "Shape Id not exist."
4359 ## Returns a main shape associated with the group
4360 # @param theGroup is a GEOM group for which a main shape object is requested
4361 # @return a GEOM object which is a main shape for theGroup
4363 # @ref swig_GetMainShape "Example"
4364 def GetMainShape(self,theGroup):
4365 # Example: see GEOM_TestOthers.py
4366 anObj = self.GroupOp.GetMainShape(theGroup)
4367 RaiseIfFailed("GetMainShape", self.GroupOp)
4370 ## Create group of edges of theShape, 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 GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1):
4375 edges = self.SubShapeAll(theShape, ShapeType["EDGE"])
4378 Props = self.BasicProperties(edge)
4379 if min_length <= Props[0] and Props[0] <= max_length:
4380 if (not include_min) and (min_length == Props[0]):
4383 if (not include_max) and (Props[0] == max_length):
4386 edges_in_range.append(edge)
4388 if len(edges_in_range) <= 0:
4389 print "No edges found by given criteria"
4392 group_edges = self.CreateGroup(theShape, ShapeType["EDGE"])
4393 self.UnionList(group_edges, edges_in_range)
4397 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
4398 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
4400 # @ref swig_todo "Example"
4401 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
4402 nb_selected = sg.SelectedCount()
4404 print "Select a shape before calling this function, please."
4407 print "Only one shape must be selected"
4410 id_shape = sg.getSelected(0)
4411 shape = IDToObject( id_shape )
4413 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
4417 if include_min: left_str = " <= "
4418 if include_max: right_str = " <= "
4420 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
4421 + left_str + "length" + right_str + `max_length`)
4423 sg.updateObjBrowser(1)
4430 ## @addtogroup l4_advanced
4433 ## Create a T-shape object with specified caracteristics for the main
4434 # and the incident pipes (radius, width, half-length).
4435 # The extremities of the main pipe are located on junctions points P1 and P2.
4436 # The extremity of the incident pipe is located on junction point P3.
4437 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
4438 # the main plane of the T-shape is XOY.
4439 # @param theR1 Internal radius of main pipe
4440 # @param theW1 Width of main pipe
4441 # @param theL1 Half-length of main pipe
4442 # @param theR2 Internal radius of incident pipe (R2 < R1)
4443 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
4444 # @param theL2 Half-length of incident pipe
4445 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
4446 # @param theP1 1st junction point of main pipe
4447 # @param theP2 2nd junction point of main pipe
4448 # @param theP3 Junction point of incident pipe
4449 # @return List of GEOM_Objects, containing the created shape and propagation groups.
4451 # @ref tui_creation_pipetshape "Example"
4452 def MakePipeTShape(self, theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh=True, theP1=None, theP2=None, theP3=None):
4453 theR1, theW1, theL1, theR2, theW2, theL2, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2)
4454 if (theP1 and theP2 and theP3):
4455 anObj = self.AdvOp.MakePipeTShapeWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh, theP1, theP2, theP3)
4457 anObj = self.AdvOp.MakePipeTShape(theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh)
4458 RaiseIfFailed("MakePipeTShape", self.AdvOp)
4459 if Parameters: anObj[0].SetParameters(Parameters)
4462 ## Create a T-shape object with chamfer and with specified caracteristics for the main
4463 # and the incident pipes (radius, width, half-length). The chamfer is
4464 # created on the junction of the pipes.
4465 # The extremities of the main pipe are located on junctions points P1 and P2.
4466 # The extremity of the incident pipe is located on junction point P3.
4467 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
4468 # the main plane of the T-shape is XOY.
4469 # @param theR1 Internal radius of main pipe
4470 # @param theW1 Width of main pipe
4471 # @param theL1 Half-length of main pipe
4472 # @param theR2 Internal radius of incident pipe (R2 < R1)
4473 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
4474 # @param theL2 Half-length of incident pipe
4475 # @param theH Height of the chamfer.
4476 # @param theW Width of the chamfer.
4477 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
4478 # @param theP1 1st junction point of main pipe
4479 # @param theP2 2nd junction point of main pipe
4480 # @param theP3 Junction point of incident pipe
4481 # @return List of GEOM_Objects, containing the created shape and propagation groups.
4483 # @ref tui_creation_pipetshape "Example"
4484 def MakePipeTShapeChamfer(self, theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh=True, theP1=None, theP2=None, theP3=None):
4485 theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW)
4486 if (theP1 and theP2 and theP3):
4487 anObj = self.AdvOp.MakePipeTShapeChamferWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh, theP1, theP2, theP3)
4489 anObj = self.AdvOp.MakePipeTShapeChamfer(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh)
4490 RaiseIfFailed("MakePipeTShapeChamfer", self.AdvOp)
4491 if Parameters: anObj[0].SetParameters(Parameters)
4494 ## Create a T-shape object with fillet and with specified caracteristics for the main
4495 # and the incident pipes (radius, width, half-length). The fillet is
4496 # created on the junction of the pipes.
4497 # The extremities of the main pipe are located on junctions points P1 and P2.
4498 # The extremity of the incident pipe is located on junction point P3.
4499 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
4500 # the main plane of the T-shape is XOY.
4501 # @param theR1 Internal radius of main pipe
4502 # @param theW1 Width of main pipe
4503 # @param theL1 Half-length of main pipe
4504 # @param theR2 Internal radius of incident pipe (R2 < R1)
4505 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
4506 # @param theL2 Half-length of incident pipe
4507 # @param theRF Radius of curvature of fillet.
4508 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
4509 # @param theP1 1st junction point of main pipe
4510 # @param theP2 2nd junction point of main pipe
4511 # @param theP3 Junction point of incident pipe
4512 # @return List of GEOM_Objects, containing the created shape and propagation groups.
4514 # @ref tui_creation_pipetshape "Example"
4515 def MakePipeTShapeFillet(self, theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh=True, theP1=None, theP2=None, theP3=None):
4516 theR1, theW1, theL1, theR2, theW2, theL2, theRF, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theRF)
4517 if (theP1 and theP2 and theP3):
4518 anObj = self.AdvOp.MakePipeTShapeFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh, theP1, theP2, theP3)
4520 anObj = self.AdvOp.MakePipeTShapeFillet(theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh)
4521 RaiseIfFailed("MakePipeTShapeFillet", self.AdvOp)
4522 if Parameters: anObj[0].SetParameters(Parameters)
4525 #@@ insert new functions before this line @@ do not remove this line @@#
4527 # end of l4_advanced
4530 ## Create a copy of the given object
4531 # @ingroup l1_geompy_auxiliary
4533 # @ref swig_all_advanced "Example"
4534 def MakeCopy(self,theOriginal):
4535 # Example: see GEOM_TestAll.py
4536 anObj = self.InsertOp.MakeCopy(theOriginal)
4537 RaiseIfFailed("MakeCopy", self.InsertOp)
4540 ## Add Path to load python scripts from
4541 # @ingroup l1_geompy_auxiliary
4542 def addPath(self,Path):
4543 if (sys.path.count(Path) < 1):
4544 sys.path.append(Path)
4548 ## Load marker texture from the file
4549 # @param Path a path to the texture file
4550 # @return unique texture identifier
4551 # @ingroup l1_geompy_auxiliary
4552 def LoadTexture(self, Path):
4553 # Example: see GEOM_TestAll.py
4554 ID = self.InsertOp.LoadTexture(Path)
4555 RaiseIfFailed("LoadTexture", self.InsertOp)
4558 ## Add marker texture. @a Width and @a Height parameters
4559 # specify width and height of the texture in pixels.
4560 # If @a RowData is @c True, @a Texture parameter should represent texture data
4561 # packed into the byte array. If @a RowData is @c False (default), @a Texture
4562 # parameter should be unpacked string, in which '1' symbols represent opaque
4563 # pixels and '0' represent transparent pixels of the texture bitmap.
4565 # @param Width texture width in pixels
4566 # @param Height texture height in pixels
4567 # @param Texture texture data
4568 # @param RowData if @c True, @a Texture data are packed in the byte stream
4569 # @ingroup l1_geompy_auxiliary
4570 def AddTexture(self, Width, Height, Texture, RowData=False):
4571 # Example: see GEOM_TestAll.py
4572 if not RowData: Texture = PackData(Texture)
4573 ID = self.InsertOp.AddTexture(Width, Height, Texture)
4574 RaiseIfFailed("AddTexture", self.InsertOp)
4578 #Register the new proxy for GEOM_Gen
4579 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geompyDC)