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 ## Dump component to the Python script
337 # This method overrides IDL function to allow default values for the parameters.
338 def DumpPython(self, theStudy, theIsPublished=True, theIsMultiFile=True):
339 return GEOM._objref_GEOM_Gen.DumpPython(self, theStudy, theIsPublished, theIsMultiFile)
341 ## Get name for sub-shape aSubObj of shape aMainObj
343 # @ref swig_SubShapeAllSorted "Example"
344 def SubShapeName(self,aSubObj, aMainObj):
345 # Example: see GEOM_TestAll.py
347 #aSubId = orb.object_to_string(aSubObj)
348 #aMainId = orb.object_to_string(aMainObj)
349 #index = gg.getIndexTopology(aSubId, aMainId)
350 #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
351 index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
352 name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
355 ## Publish in study aShape with name aName
357 # \param aShape the shape to be published
358 # \param aName the name for the shape
359 # \param doRestoreSubShapes if True, finds and publishes also
360 # sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
361 # and published sub-shapes of arguments
362 # \param theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes for
363 # these arguments description
364 # \return study entry of the published shape in form of string
366 # @ref swig_MakeQuad4Vertices "Example"
367 def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
368 theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
369 # Example: see GEOM_TestAll.py
371 aSObject = self.AddInStudy(self.myStudy, aShape, aName, None)
372 if doRestoreSubShapes:
373 self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs,
374 theFindMethod, theInheritFirstArg, True )
376 print "addToStudy() failed"
378 return aShape.GetStudyEntry()
380 ## Publish in study aShape with name aName as sub-object of previously published aFather
382 # @ref swig_SubShapeAllSorted "Example"
383 def addToStudyInFather(self, aFather, aShape, aName):
384 # Example: see GEOM_TestAll.py
386 aSObject = self.AddInStudy(self.myStudy, aShape, aName, aFather)
388 print "addToStudyInFather() failed"
390 return aShape.GetStudyEntry()
392 ## Unpublish object in study
394 def hideInStudy(self, obj):
395 ior = salome.orb.object_to_string(obj)
396 aSObject = self.myStudy.FindObjectIOR(ior)
397 if aSObject is not None:
398 genericAttribute = self.myBuilder.FindOrCreateAttribute(aSObject, "AttributeDrawable")
399 drwAttribute = genericAttribute._narrow(SALOMEDS.AttributeDrawable)
400 drwAttribute.SetDrawable(False)
403 # end of l1_geompy_auxiliary
406 ## @addtogroup l3_restore_ss
409 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
410 # To be used from python scripts out of geompy.addToStudy (non-default usage)
411 # \param theObject published GEOM object, arguments of which will be published
412 # \param theArgs list of GEOM_Object, operation arguments to be published.
413 # If this list is empty, all operation arguments will be published
414 # \param theFindMethod method to search subshapes, corresponding to arguments and
415 # their subshapes. Value from enumeration GEOM::find_shape_method.
416 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
417 # Do not publish subshapes in place of arguments, but only
418 # in place of subshapes of the first argument,
419 # because the whole shape corresponds to the first argument.
420 # Mainly to be used after transformations, but it also can be
421 # usefull after partition with one object shape, and some other
422 # operations, where only the first argument has to be considered.
423 # If theObject has only one argument shape, this flag is automatically
424 # considered as True, not regarding really passed value.
425 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
426 # and prefix "from_subshapes_of_" to names of partially restored subshapes.
427 # \return list of published sub-shapes
429 # @ref tui_restore_prs_params "Example"
430 def RestoreSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
431 theInheritFirstArg=False, theAddPrefix=True):
432 # Example: see GEOM_TestAll.py
433 return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
434 theFindMethod, theInheritFirstArg, theAddPrefix)
436 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
437 # To be used from python scripts out of geompy.addToStudy (non-default usage)
438 # \param theObject published GEOM object, arguments of which will be published
439 # \param theArgs list of GEOM_Object, operation arguments to be published.
440 # If this list is empty, all operation arguments will be published
441 # \param theFindMethod method to search subshapes, corresponding to arguments and
442 # their subshapes. Value from enumeration GEOM::find_shape_method.
443 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
444 # Do not publish subshapes in place of arguments, but only
445 # in place of subshapes of the first argument,
446 # because the whole shape corresponds to the first argument.
447 # Mainly to be used after transformations, but it also can be
448 # usefull after partition with one object shape, and some other
449 # operations, where only the first argument has to be considered.
450 # If theObject has only one argument shape, this flag is automatically
451 # considered as True, not regarding really passed value.
452 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
453 # and prefix "from_subshapes_of_" to names of partially restored subshapes.
454 # \return list of published sub-shapes
456 # @ref tui_restore_prs_params "Example"
457 def RestoreGivenSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
458 theInheritFirstArg=False, theAddPrefix=True):
459 # Example: see GEOM_TestAll.py
460 return self.RestoreGivenSubShapesO(self.myStudy, theObject, theArgs,
461 theFindMethod, theInheritFirstArg, theAddPrefix)
463 # end of l3_restore_ss
466 ## @addtogroup l3_basic_go
469 ## Create point by three coordinates.
470 # @param theX The X coordinate of the point.
471 # @param theY The Y coordinate of the point.
472 # @param theZ The Z coordinate of the point.
473 # @return New GEOM_Object, containing the created point.
475 # @ref tui_creation_point "Example"
476 def MakeVertex(self, theX, theY, theZ):
477 # Example: see GEOM_TestAll.py
478 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
479 anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
480 RaiseIfFailed("MakePointXYZ", self.BasicOp)
481 anObj.SetParameters(Parameters)
484 ## Create a point, distant from the referenced point
485 # on the given distances along the coordinate axes.
486 # @param theReference The referenced point.
487 # @param theX Displacement from the referenced point along OX axis.
488 # @param theY Displacement from the referenced point along OY axis.
489 # @param theZ Displacement from the referenced point along OZ axis.
490 # @return New GEOM_Object, containing the created point.
492 # @ref tui_creation_point "Example"
493 def MakeVertexWithRef(self,theReference, theX, theY, theZ):
494 # Example: see GEOM_TestAll.py
495 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
496 anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
497 RaiseIfFailed("MakePointWithReference", self.BasicOp)
498 anObj.SetParameters(Parameters)
501 ## Create a point, corresponding to the given parameter on the given curve.
502 # @param theRefCurve The referenced curve.
503 # @param theParameter Value of parameter on the referenced curve.
504 # @return New GEOM_Object, containing the created point.
506 # @ref tui_creation_point "Example"
507 def MakeVertexOnCurve(self,theRefCurve, theParameter):
508 # Example: see GEOM_TestAll.py
509 theParameter, Parameters = ParseParameters(theParameter)
510 anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter)
511 RaiseIfFailed("MakePointOnCurve", self.BasicOp)
512 anObj.SetParameters(Parameters)
515 ## Create a point by projection give coordinates on the given curve
516 # @param theRefCurve The referenced curve.
517 # @param theX X-coordinate in 3D space
518 # @param theY Y-coordinate in 3D space
519 # @param theZ Z-coordinate in 3D space
520 # @return New GEOM_Object, containing the created point.
522 # @ref tui_creation_point "Example"
523 def MakeVertexOnCurveByCoord(self,theRefCurve, theX, theY, theZ):
524 # Example: see GEOM_TestAll.py
525 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
526 anObj = self.BasicOp.MakePointOnCurveByCoord(theRefCurve, theX, theY, theZ)
527 RaiseIfFailed("MakeVertexOnCurveByCoord", self.BasicOp)
528 anObj.SetParameters(Parameters)
531 ## Create a point, corresponding to the given length on the given curve.
532 # @param theRefCurve The referenced curve.
533 # @param theLength Length on the referenced curve. It can be negative.
534 # @param theStartPoint Point allowing to choose the direction for the calculation
535 # of the length. If None, start from the first point of theRefCurve.
536 # @return New GEOM_Object, containing the created point.
538 # @ref tui_creation_point "Example"
539 def MakeVertexOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None):
540 # Example: see GEOM_TestAll.py
541 theLength, Parameters = ParseParameters(theLength)
542 anObj = self.BasicOp.MakePointOnCurveByLength(theRefCurve, theLength, theStartPoint)
543 RaiseIfFailed("MakePointOnCurveByLength", self.BasicOp)
544 anObj.SetParameters(Parameters)
547 ## Create a point, corresponding to the given parameters on the
549 # @param theRefSurf The referenced surface.
550 # @param theUParameter Value of U-parameter on the referenced surface.
551 # @param theVParameter Value of V-parameter on the referenced surface.
552 # @return New GEOM_Object, containing the created point.
554 # @ref swig_MakeVertexOnSurface "Example"
555 def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter):
556 theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
557 # Example: see GEOM_TestAll.py
558 anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
559 RaiseIfFailed("MakePointOnSurface", self.BasicOp)
560 anObj.SetParameters(Parameters);
563 ## Create a point by projection give coordinates on the given surface
564 # @param theRefSurf The referenced surface.
565 # @param theX X-coordinate in 3D space
566 # @param theY Y-coordinate in 3D space
567 # @param theZ Z-coordinate in 3D space
568 # @return New GEOM_Object, containing the created point.
570 # @ref swig_MakeVertexOnSurfaceByCoord "Example"
571 def MakeVertexOnSurfaceByCoord(self, theRefSurf, theX, theY, theZ):
572 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
573 # Example: see GEOM_TestAll.py
574 anObj = self.BasicOp.MakePointOnSurfaceByCoord(theRefSurf, theX, theY, theZ)
575 RaiseIfFailed("MakeVertexOnSurfaceByCoord", self.BasicOp)
576 anObj.SetParameters(Parameters);
579 ## Create a point on intersection of two lines.
580 # @param theRefLine1, theRefLine2 The referenced lines.
581 # @return New GEOM_Object, containing the created point.
583 # @ref swig_MakeVertexOnLinesIntersection "Example"
584 def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2):
585 # Example: see GEOM_TestAll.py
586 anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
587 RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
590 ## Create a tangent, corresponding to the given parameter on the given curve.
591 # @param theRefCurve The referenced curve.
592 # @param theParameter Value of parameter on the referenced curve.
593 # @return New GEOM_Object, containing the created tangent.
595 # @ref swig_MakeTangentOnCurve "Example"
596 def MakeTangentOnCurve(self, theRefCurve, theParameter):
597 anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
598 RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
601 ## Create a tangent plane, corresponding to the given parameter on the given face.
602 # @param theFace The face for which tangent plane should be built.
603 # @param theParameterV vertical value of the center point (0.0 - 1.0).
604 # @param theParameterU horisontal value of the center point (0.0 - 1.0).
605 # @param theTrimSize the size of plane.
606 # @return New GEOM_Object, containing the created tangent.
608 # @ref swig_MakeTangentPlaneOnFace "Example"
609 def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize):
610 anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
611 RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
614 ## Create a vector with the given components.
615 # @param theDX X component of the vector.
616 # @param theDY Y component of the vector.
617 # @param theDZ Z component of the vector.
618 # @return New GEOM_Object, containing the created vector.
620 # @ref tui_creation_vector "Example"
621 def MakeVectorDXDYDZ(self,theDX, theDY, theDZ):
622 # Example: see GEOM_TestAll.py
623 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
624 anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
625 RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
626 anObj.SetParameters(Parameters)
629 ## Create a vector between two points.
630 # @param thePnt1 Start point for the vector.
631 # @param thePnt2 End point for the vector.
632 # @return New GEOM_Object, containing the created vector.
634 # @ref tui_creation_vector "Example"
635 def MakeVector(self,thePnt1, thePnt2):
636 # Example: see GEOM_TestAll.py
637 anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
638 RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
641 ## Create a line, passing through the given point
642 # and parrallel to the given direction
643 # @param thePnt Point. The resulting line will pass through it.
644 # @param theDir Direction. The resulting line will be parallel to it.
645 # @return New GEOM_Object, containing the created line.
647 # @ref tui_creation_line "Example"
648 def MakeLine(self,thePnt, theDir):
649 # Example: see GEOM_TestAll.py
650 anObj = self.BasicOp.MakeLine(thePnt, theDir)
651 RaiseIfFailed("MakeLine", self.BasicOp)
654 ## Create a line, passing through the given points
655 # @param thePnt1 First of two points, defining the line.
656 # @param thePnt2 Second of two points, defining the line.
657 # @return New GEOM_Object, containing the created line.
659 # @ref tui_creation_line "Example"
660 def MakeLineTwoPnt(self,thePnt1, thePnt2):
661 # Example: see GEOM_TestAll.py
662 anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
663 RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
666 ## Create a line on two faces intersection.
667 # @param theFace1 First of two faces, defining the line.
668 # @param theFace2 Second of two faces, defining the line.
669 # @return New GEOM_Object, containing the created line.
671 # @ref swig_MakeLineTwoFaces "Example"
672 def MakeLineTwoFaces(self, theFace1, theFace2):
673 # Example: see GEOM_TestAll.py
674 anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
675 RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
678 ## Create a plane, passing through the given point
679 # and normal to the given vector.
680 # @param thePnt Point, the plane has to pass through.
681 # @param theVec Vector, defining the plane normal direction.
682 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
683 # @return New GEOM_Object, containing the created plane.
685 # @ref tui_creation_plane "Example"
686 def MakePlane(self,thePnt, theVec, theTrimSize):
687 # Example: see GEOM_TestAll.py
688 theTrimSize, Parameters = ParseParameters(theTrimSize);
689 anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
690 RaiseIfFailed("MakePlanePntVec", self.BasicOp)
691 anObj.SetParameters(Parameters)
694 ## Create a plane, passing through the three given points
695 # @param thePnt1 First of three points, defining the plane.
696 # @param thePnt2 Second of three points, defining the plane.
697 # @param thePnt3 Fird of three points, defining the plane.
698 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
699 # @return New GEOM_Object, containing the created plane.
701 # @ref tui_creation_plane "Example"
702 def MakePlaneThreePnt(self,thePnt1, thePnt2, thePnt3, theTrimSize):
703 # Example: see GEOM_TestAll.py
704 theTrimSize, Parameters = ParseParameters(theTrimSize);
705 anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
706 RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
707 anObj.SetParameters(Parameters)
710 ## Create a plane, similar to the existing one, but with another size of representing face.
711 # @param theFace Referenced plane or LCS(Marker).
712 # @param theTrimSize New half size of a side of quadrangle face, representing the plane.
713 # @return New GEOM_Object, containing the created plane.
715 # @ref tui_creation_plane "Example"
716 def MakePlaneFace(self,theFace, theTrimSize):
717 # Example: see GEOM_TestAll.py
718 theTrimSize, Parameters = ParseParameters(theTrimSize);
719 anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
720 RaiseIfFailed("MakePlaneFace", self.BasicOp)
721 anObj.SetParameters(Parameters)
724 ## Create a plane, passing through the 2 vectors
725 # with center in a start point of the first vector.
726 # @param theVec1 Vector, defining center point and plane direction.
727 # @param theVec2 Vector, defining the plane normal direction.
728 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
729 # @return New GEOM_Object, containing the created plane.
731 # @ref tui_creation_plane "Example"
732 def MakePlane2Vec(self,theVec1, theVec2, theTrimSize):
733 # Example: see GEOM_TestAll.py
734 theTrimSize, Parameters = ParseParameters(theTrimSize);
735 anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
736 RaiseIfFailed("MakePlane2Vec", self.BasicOp)
737 anObj.SetParameters(Parameters)
740 ## Create a plane, based on a Local coordinate system.
741 # @param theLCS coordinate system, defining plane.
742 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
743 # @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
744 # @return New GEOM_Object, containing the created plane.
746 # @ref tui_creation_plane "Example"
747 def MakePlaneLCS(self,theLCS, theTrimSize, theOrientation):
748 # Example: see GEOM_TestAll.py
749 theTrimSize, Parameters = ParseParameters(theTrimSize);
750 anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
751 RaiseIfFailed("MakePlaneLCS", self.BasicOp)
752 anObj.SetParameters(Parameters)
755 ## Create a local coordinate system.
756 # @param OX,OY,OZ Three coordinates of coordinate system origin.
757 # @param XDX,XDY,XDZ Three components of OX direction
758 # @param YDX,YDY,YDZ Three components of OY direction
759 # @return New GEOM_Object, containing the created coordinate system.
761 # @ref swig_MakeMarker "Example"
762 def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ):
763 # Example: see GEOM_TestAll.py
764 OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
765 anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
766 RaiseIfFailed("MakeMarker", self.BasicOp)
767 anObj.SetParameters(Parameters)
770 ## Create a local coordinate system from shape.
771 # @param theShape The initial shape to detect the coordinate system.
772 # @return New GEOM_Object, containing the created coordinate system.
774 # @ref tui_creation_lcs "Example"
775 def MakeMarkerFromShape(self, theShape):
776 anObj = self.BasicOp.MakeMarkerFromShape(theShape)
777 RaiseIfFailed("MakeMarkerFromShape", self.BasicOp)
780 ## Create a local coordinate system from point and two vectors.
781 # @param theOrigin Point of coordinate system origin.
782 # @param theXVec Vector of X direction
783 # @param theYVec Vector of Y direction
784 # @return New GEOM_Object, containing the created coordinate system.
786 # @ref tui_creation_lcs "Example"
787 def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec):
788 anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec)
789 RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp)
795 ## @addtogroup l4_curves
798 ## Create an arc of circle, passing through three given points.
799 # @param thePnt1 Start point of the arc.
800 # @param thePnt2 Middle point of the arc.
801 # @param thePnt3 End point of the arc.
802 # @return New GEOM_Object, containing the created arc.
804 # @ref swig_MakeArc "Example"
805 def MakeArc(self,thePnt1, thePnt2, thePnt3):
806 # Example: see GEOM_TestAll.py
807 anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
808 RaiseIfFailed("MakeArc", self.CurvesOp)
811 ## Create an arc of circle from a center and 2 points.
812 # @param thePnt1 Center of the arc
813 # @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
814 # @param thePnt3 End point of the arc (Gives also a direction)
815 # @param theSense Orientation of the arc
816 # @return New GEOM_Object, containing the created arc.
818 # @ref swig_MakeArc "Example"
819 def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False):
820 # Example: see GEOM_TestAll.py
821 anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
822 RaiseIfFailed("MakeArcCenter", self.CurvesOp)
825 ## Create an arc of ellipse, of center and two points.
826 # @param theCenter Center of the arc.
827 # @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
828 # @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
829 # @return New GEOM_Object, containing the created arc.
831 # @ref swig_MakeArc "Example"
832 def MakeArcOfEllipse(self,theCenter, thePnt1, thePnt2):
833 # Example: see GEOM_TestAll.py
834 anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
835 RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
838 ## Create a circle with given center, normal vector and radius.
839 # @param thePnt Circle center.
840 # @param theVec Vector, normal to the plane of the circle.
841 # @param theR Circle radius.
842 # @return New GEOM_Object, containing the created circle.
844 # @ref tui_creation_circle "Example"
845 def MakeCircle(self, thePnt, theVec, theR):
846 # Example: see GEOM_TestAll.py
847 theR, Parameters = ParseParameters(theR)
848 anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
849 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
850 anObj.SetParameters(Parameters)
853 ## Create a circle with given radius.
854 # Center of the circle will be in the origin of global
855 # coordinate system and normal vector will be codirected with Z axis
856 # @param theR Circle radius.
857 # @return New GEOM_Object, containing the created circle.
858 def MakeCircleR(self, theR):
859 anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
860 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
863 ## Create a circle, passing through three given points
864 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
865 # @return New GEOM_Object, containing the created circle.
867 # @ref tui_creation_circle "Example"
868 def MakeCircleThreePnt(self,thePnt1, thePnt2, thePnt3):
869 # Example: see GEOM_TestAll.py
870 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
871 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
874 ## Create a circle, with given point1 as center,
875 # passing through the point2 as radius and laying in the plane,
876 # defined by all three given points.
877 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
878 # @return New GEOM_Object, containing the created circle.
880 # @ref swig_MakeCircle "Example"
881 def MakeCircleCenter2Pnt(self,thePnt1, thePnt2, thePnt3):
882 # Example: see GEOM_example6.py
883 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
884 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
887 ## Create an ellipse with given center, normal vector and radiuses.
888 # @param thePnt Ellipse center.
889 # @param theVec Vector, normal to the plane of the ellipse.
890 # @param theRMajor Major ellipse radius.
891 # @param theRMinor Minor ellipse radius.
892 # @param theVecMaj Vector, direction of the ellipse's main axis.
893 # @return New GEOM_Object, containing the created ellipse.
895 # @ref tui_creation_ellipse "Example"
896 def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None):
897 # Example: see GEOM_TestAll.py
898 theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
899 if theVecMaj is not None:
900 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
902 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
904 RaiseIfFailed("MakeEllipse", self.CurvesOp)
905 anObj.SetParameters(Parameters)
908 ## Create an ellipse with given radiuses.
909 # Center of the ellipse will be in the origin of global
910 # coordinate system and normal vector will be codirected with Z axis
911 # @param theRMajor Major ellipse radius.
912 # @param theRMinor Minor ellipse radius.
913 # @return New GEOM_Object, containing the created ellipse.
914 def MakeEllipseRR(self, theRMajor, theRMinor):
915 anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
916 RaiseIfFailed("MakeEllipse", self.CurvesOp)
919 ## Create a polyline on the set of points.
920 # @param thePoints Sequence of points for the polyline.
921 # @param theIsClosed If True, build a closed wire.
922 # @return New GEOM_Object, containing the created polyline.
924 # @ref tui_creation_curve "Example"
925 def MakePolyline(self, thePoints, theIsClosed=False):
926 # Example: see GEOM_TestAll.py
927 anObj = self.CurvesOp.MakePolyline(thePoints, theIsClosed)
928 RaiseIfFailed("MakePolyline", self.CurvesOp)
931 ## Create bezier curve on the set of points.
932 # @param thePoints Sequence of points for the bezier curve.
933 # @param theIsClosed If True, build a closed curve.
934 # @return New GEOM_Object, containing the created bezier curve.
936 # @ref tui_creation_curve "Example"
937 def MakeBezier(self, thePoints, theIsClosed=False):
938 # Example: see GEOM_TestAll.py
939 anObj = self.CurvesOp.MakeSplineBezier(thePoints, theIsClosed)
940 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
943 ## Create B-Spline curve on the set of points.
944 # @param thePoints Sequence of points for the B-Spline curve.
945 # @param theIsClosed If True, build a closed curve.
946 # @param theDoReordering If TRUE, the algo does not follow the order of
947 # \a thePoints but searches for the closest vertex.
948 # @return New GEOM_Object, containing the created B-Spline curve.
950 # @ref tui_creation_curve "Example"
951 def MakeInterpol(self, thePoints, theIsClosed=False, theDoReordering=False):
952 # Example: see GEOM_TestAll.py
953 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed, theDoReordering)
954 RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
960 ## @addtogroup l3_sketcher
963 ## Create a sketcher (wire or face), following the textual description,
964 # passed through <VAR>theCommand</VAR> argument. \n
965 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
966 # Format of the description string have to be the following:
968 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
971 # - x1, y1 are coordinates of the first sketcher point (zero by default),
973 # - "R angle" : Set the direction by angle
974 # - "D dx dy" : Set the direction by DX & DY
977 # - "TT x y" : Create segment by point at X & Y
978 # - "T dx dy" : Create segment by point with DX & DY
979 # - "L length" : Create segment by direction & Length
980 # - "IX x" : Create segment by direction & Intersect. X
981 # - "IY y" : Create segment by direction & Intersect. Y
984 # - "C radius length" : Create arc by direction, radius and length(in degree)
985 # - "AA x y": Create arc by point at X & Y
986 # - "A dx dy" : Create arc by point with DX & DY
987 # - "A dx dy" : Create arc by point with DX & DY
988 # - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
989 # - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
990 # - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
991 # - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
994 # - "WW" : Close Wire (to finish)
995 # - "WF" : Close Wire and build face (to finish)
998 # - Flag1 (= reverse) is 0 or 2 ...
999 # - if 0 the drawn arc is the one of lower angle (< Pi)
1000 # - if 2 the drawn arc ius the one of greater angle (> Pi)
1003 # - Flag2 (= control tolerance) is 0 or 1 ...
1004 # - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
1005 # - if 1 the wire is built only if the end point is on the arc
1006 # with a tolerance of 10^-7 on the distance else the creation fails
1008 # @param theCommand String, defining the sketcher in local
1009 # coordinates of the working plane.
1010 # @param theWorkingPlane Nine double values, defining origin,
1011 # OZ and OX directions of the working plane.
1012 # @return New GEOM_Object, containing the created wire.
1014 # @ref tui_sketcher_page "Example"
1015 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0]):
1016 # Example: see GEOM_TestAll.py
1017 theCommand,Parameters = ParseSketcherCommand(theCommand)
1018 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
1019 RaiseIfFailed("MakeSketcher", self.CurvesOp)
1020 anObj.SetParameters(Parameters)
1023 ## Create a sketcher (wire or face), following the textual description,
1024 # passed through <VAR>theCommand</VAR> argument. \n
1025 # For format of the description string see the previous method.\n
1026 # @param theCommand String, defining the sketcher in local
1027 # coordinates of the working plane.
1028 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
1029 # @return New GEOM_Object, containing the created wire.
1031 # @ref tui_sketcher_page "Example"
1032 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane):
1033 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
1034 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
1037 ## Create a sketcher wire, following the numerical description,
1038 # passed through <VAR>theCoordinates</VAR> argument. \n
1039 # @param theCoordinates double values, defining points to create a wire,
1041 # @return New GEOM_Object, containing the created wire.
1043 # @ref tui_sketcher_page "Example"
1044 def Make3DSketcher(self, theCoordinates):
1045 theCoordinates,Parameters = ParseParameters(theCoordinates)
1046 anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
1047 RaiseIfFailed("Make3DSketcher", self.CurvesOp)
1048 anObj.SetParameters(Parameters)
1051 # end of l3_sketcher
1054 ## @addtogroup l3_3d_primitives
1057 ## Create a box by coordinates of two opposite vertices.
1059 # @ref tui_creation_box "Example"
1060 def MakeBox(self,x1,y1,z1,x2,y2,z2):
1061 # Example: see GEOM_TestAll.py
1062 pnt1 = self.MakeVertex(x1,y1,z1)
1063 pnt2 = self.MakeVertex(x2,y2,z2)
1064 return self.MakeBoxTwoPnt(pnt1,pnt2)
1066 ## Create a box with specified dimensions along the coordinate axes
1067 # and with edges, parallel to the coordinate axes.
1068 # Center of the box will be at point (DX/2, DY/2, DZ/2).
1069 # @param theDX Length of Box edges, parallel to OX axis.
1070 # @param theDY Length of Box edges, parallel to OY axis.
1071 # @param theDZ Length of Box edges, parallel to OZ axis.
1072 # @return New GEOM_Object, containing the created box.
1074 # @ref tui_creation_box "Example"
1075 def MakeBoxDXDYDZ(self,theDX, theDY, theDZ):
1076 # Example: see GEOM_TestAll.py
1077 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1078 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
1079 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
1080 anObj.SetParameters(Parameters)
1083 ## Create a box with two specified opposite vertices,
1084 # and with edges, parallel to the coordinate axes
1085 # @param thePnt1 First of two opposite vertices.
1086 # @param thePnt2 Second of two opposite vertices.
1087 # @return New GEOM_Object, containing the created box.
1089 # @ref tui_creation_box "Example"
1090 def MakeBoxTwoPnt(self,thePnt1, thePnt2):
1091 # Example: see GEOM_TestAll.py
1092 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
1093 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
1096 ## Create a face with specified dimensions along OX-OY coordinate axes,
1097 # with edges, parallel to this coordinate axes.
1098 # @param theH height of Face.
1099 # @param theW width of Face.
1100 # @param theOrientation orientation belong axis OXY OYZ OZX
1101 # @return New GEOM_Object, containing the created face.
1103 # @ref tui_creation_face "Example"
1104 def MakeFaceHW(self,theH, theW, theOrientation):
1105 # Example: see GEOM_TestAll.py
1106 theH,theW,Parameters = ParseParameters(theH, theW)
1107 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
1108 RaiseIfFailed("MakeFaceHW", self.PrimOp)
1109 anObj.SetParameters(Parameters)
1112 ## Create a face from another plane and two sizes,
1113 # vertical size and horisontal size.
1114 # @param theObj Normale vector to the creating face or
1116 # @param theH Height (vertical size).
1117 # @param theW Width (horisontal size).
1118 # @return New GEOM_Object, containing the created face.
1120 # @ref tui_creation_face "Example"
1121 def MakeFaceObjHW(self, theObj, theH, theW):
1122 # Example: see GEOM_TestAll.py
1123 theH,theW,Parameters = ParseParameters(theH, theW)
1124 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
1125 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
1126 anObj.SetParameters(Parameters)
1129 ## Create a disk with given center, normal vector and radius.
1130 # @param thePnt Disk center.
1131 # @param theVec Vector, normal to the plane of the disk.
1132 # @param theR Disk radius.
1133 # @return New GEOM_Object, containing the created disk.
1135 # @ref tui_creation_disk "Example"
1136 def MakeDiskPntVecR(self,thePnt, theVec, theR):
1137 # Example: see GEOM_TestAll.py
1138 theR,Parameters = ParseParameters(theR)
1139 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
1140 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
1141 anObj.SetParameters(Parameters)
1144 ## Create a disk, passing through three given points
1145 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
1146 # @return New GEOM_Object, containing the created disk.
1148 # @ref tui_creation_disk "Example"
1149 def MakeDiskThreePnt(self,thePnt1, thePnt2, thePnt3):
1150 # Example: see GEOM_TestAll.py
1151 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
1152 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
1155 ## Create a disk with specified dimensions along OX-OY coordinate axes.
1156 # @param theR Radius of Face.
1157 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
1158 # @return New GEOM_Object, containing the created disk.
1160 # @ref tui_creation_face "Example"
1161 def MakeDiskR(self,theR, theOrientation):
1162 # Example: see GEOM_TestAll.py
1163 theR,Parameters = ParseParameters(theR)
1164 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
1165 RaiseIfFailed("MakeDiskR", self.PrimOp)
1166 anObj.SetParameters(Parameters)
1169 ## Create a cylinder with given base point, axis, radius and height.
1170 # @param thePnt Central point of cylinder base.
1171 # @param theAxis Cylinder axis.
1172 # @param theR Cylinder radius.
1173 # @param theH Cylinder height.
1174 # @return New GEOM_Object, containing the created cylinder.
1176 # @ref tui_creation_cylinder "Example"
1177 def MakeCylinder(self,thePnt, theAxis, theR, theH):
1178 # Example: see GEOM_TestAll.py
1179 theR,theH,Parameters = ParseParameters(theR, theH)
1180 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
1181 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
1182 anObj.SetParameters(Parameters)
1185 ## Create a cylinder with given radius and height at
1186 # the origin of coordinate system. Axis of the cylinder
1187 # will be collinear to the OZ axis of the coordinate system.
1188 # @param theR Cylinder radius.
1189 # @param theH Cylinder height.
1190 # @return New GEOM_Object, containing the created cylinder.
1192 # @ref tui_creation_cylinder "Example"
1193 def MakeCylinderRH(self,theR, theH):
1194 # Example: see GEOM_TestAll.py
1195 theR,theH,Parameters = ParseParameters(theR, theH)
1196 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
1197 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
1198 anObj.SetParameters(Parameters)
1201 ## Create a sphere with given center and radius.
1202 # @param thePnt Sphere center.
1203 # @param theR Sphere radius.
1204 # @return New GEOM_Object, containing the created sphere.
1206 # @ref tui_creation_sphere "Example"
1207 def MakeSpherePntR(self, thePnt, theR):
1208 # Example: see GEOM_TestAll.py
1209 theR,Parameters = ParseParameters(theR)
1210 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
1211 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
1212 anObj.SetParameters(Parameters)
1215 ## Create a sphere with given center and radius.
1216 # @param x,y,z Coordinates of sphere center.
1217 # @param theR Sphere radius.
1218 # @return New GEOM_Object, containing the created sphere.
1220 # @ref tui_creation_sphere "Example"
1221 def MakeSphere(self, x, y, z, theR):
1222 # Example: see GEOM_TestAll.py
1223 point = self.MakeVertex(x, y, z)
1224 anObj = self.MakeSpherePntR(point, theR)
1227 ## Create a sphere with given radius at the origin of coordinate system.
1228 # @param theR Sphere radius.
1229 # @return New GEOM_Object, containing the created sphere.
1231 # @ref tui_creation_sphere "Example"
1232 def MakeSphereR(self, theR):
1233 # Example: see GEOM_TestAll.py
1234 theR,Parameters = ParseParameters(theR)
1235 anObj = self.PrimOp.MakeSphereR(theR)
1236 RaiseIfFailed("MakeSphereR", self.PrimOp)
1237 anObj.SetParameters(Parameters)
1240 ## Create a cone with given base point, axis, height and radiuses.
1241 # @param thePnt Central point of the first cone base.
1242 # @param theAxis Cone axis.
1243 # @param theR1 Radius of the first cone base.
1244 # @param theR2 Radius of the second cone base.
1245 # \note If both radiuses are non-zero, the cone will be truncated.
1246 # \note If the radiuses are equal, a cylinder will be created instead.
1247 # @param theH Cone height.
1248 # @return New GEOM_Object, containing the created cone.
1250 # @ref tui_creation_cone "Example"
1251 def MakeCone(self,thePnt, theAxis, theR1, theR2, theH):
1252 # Example: see GEOM_TestAll.py
1253 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
1254 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
1255 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
1256 anObj.SetParameters(Parameters)
1259 ## Create a cone with given height and radiuses at
1260 # the origin of coordinate system. Axis of the cone will
1261 # be collinear to the OZ axis of the coordinate system.
1262 # @param theR1 Radius of the first cone base.
1263 # @param theR2 Radius of the second cone base.
1264 # \note If both radiuses are non-zero, the cone will be truncated.
1265 # \note If the radiuses are equal, a cylinder will be created instead.
1266 # @param theH Cone height.
1267 # @return New GEOM_Object, containing the created cone.
1269 # @ref tui_creation_cone "Example"
1270 def MakeConeR1R2H(self,theR1, theR2, theH):
1271 # Example: see GEOM_TestAll.py
1272 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
1273 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
1274 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
1275 anObj.SetParameters(Parameters)
1278 ## Create a torus with given center, normal vector and radiuses.
1279 # @param thePnt Torus central point.
1280 # @param theVec Torus axis of symmetry.
1281 # @param theRMajor Torus major radius.
1282 # @param theRMinor Torus minor radius.
1283 # @return New GEOM_Object, containing the created torus.
1285 # @ref tui_creation_torus "Example"
1286 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor):
1287 # Example: see GEOM_TestAll.py
1288 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
1289 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
1290 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
1291 anObj.SetParameters(Parameters)
1294 ## Create a torus with given radiuses at the origin of coordinate system.
1295 # @param theRMajor Torus major radius.
1296 # @param theRMinor Torus minor radius.
1297 # @return New GEOM_Object, containing the created torus.
1299 # @ref tui_creation_torus "Example"
1300 def MakeTorusRR(self, theRMajor, theRMinor):
1301 # Example: see GEOM_TestAll.py
1302 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
1303 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
1304 RaiseIfFailed("MakeTorusRR", self.PrimOp)
1305 anObj.SetParameters(Parameters)
1308 # end of l3_3d_primitives
1311 ## @addtogroup l3_complex
1314 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
1315 # @param theBase Base shape to be extruded.
1316 # @param thePoint1 First end of extrusion vector.
1317 # @param thePoint2 Second end of extrusion vector.
1318 # @param theScaleFactor Use it to make prism with scaled second base.
1319 # Nagative value means not scaled second base.
1320 # @return New GEOM_Object, containing the created prism.
1322 # @ref tui_creation_prism "Example"
1323 def MakePrism(self, theBase, thePoint1, thePoint2, theScaleFactor = -1.0):
1324 # Example: see GEOM_TestAll.py
1327 if theScaleFactor > 0:
1328 theScaleFactor,Parameters = ParseParameters(theScaleFactor)
1329 anObj = self.PrimOp.MakePrismTwoPntWithScaling(theBase, thePoint1, thePoint2, theScaleFactor)
1331 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
1332 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
1333 anObj.SetParameters(Parameters)
1336 ## Create a shape by extrusion of the base shape along a
1337 # vector, defined by two points, in 2 Ways (forward/backward).
1338 # @param theBase Base shape to be extruded.
1339 # @param thePoint1 First end of extrusion vector.
1340 # @param thePoint2 Second end of extrusion vector.
1341 # @return New GEOM_Object, containing the created prism.
1343 # @ref tui_creation_prism "Example"
1344 def MakePrism2Ways(self, theBase, thePoint1, thePoint2):
1345 # Example: see GEOM_TestAll.py
1346 anObj = self.PrimOp.MakePrismTwoPnt2Ways(theBase, thePoint1, thePoint2)
1347 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
1350 ## Create a shape by extrusion of the base shape along the vector,
1351 # i.e. all the space, transfixed by the base shape during its translation
1352 # along the vector on the given distance.
1353 # @param theBase Base shape to be extruded.
1354 # @param theVec Direction of extrusion.
1355 # @param theH Prism dimension along theVec.
1356 # @param theScaleFactor Use it to make prism with scaled second base.
1357 # Nagative value means not scaled second base.
1358 # @return New GEOM_Object, containing the created prism.
1360 # @ref tui_creation_prism "Example"
1361 def MakePrismVecH(self, theBase, theVec, theH, theScaleFactor = -1.0):
1362 # Example: see GEOM_TestAll.py
1365 if theScaleFactor > 0:
1366 theH,theScaleFactor,Parameters = ParseParameters(theH,theScaleFactor)
1367 anObj = self.PrimOp.MakePrismVecHWithScaling(theBase, theVec, theH, theScaleFactor)
1369 theH,Parameters = ParseParameters(theH)
1370 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
1371 RaiseIfFailed("MakePrismVecH", self.PrimOp)
1372 anObj.SetParameters(Parameters)
1375 ## Create a shape by extrusion of the base shape along the vector,
1376 # i.e. all the space, transfixed by the base shape during its translation
1377 # along the vector on the given distance in 2 Ways (forward/backward).
1378 # @param theBase Base shape to be extruded.
1379 # @param theVec Direction of extrusion.
1380 # @param theH Prism dimension along theVec in forward direction.
1381 # @return New GEOM_Object, containing the created prism.
1383 # @ref tui_creation_prism "Example"
1384 def MakePrismVecH2Ways(self, theBase, theVec, theH):
1385 # Example: see GEOM_TestAll.py
1386 theH,Parameters = ParseParameters(theH)
1387 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
1388 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
1389 anObj.SetParameters(Parameters)
1392 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
1393 # @param theBase Base shape to be extruded.
1394 # @param theDX, theDY, theDZ Directions of extrusion.
1395 # @param theScaleFactor Use it to make prism with scaled second base.
1396 # Nagative value means not scaled second base.
1397 # @return New GEOM_Object, containing the created prism.
1399 # @ref tui_creation_prism "Example"
1400 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ, theScaleFactor = -1.0):
1401 # Example: see GEOM_TestAll.py
1404 if theScaleFactor > 0:
1405 theDX,theDY,theDZ,theScaleFactor,Parameters = ParseParameters(theDX, theDY, theDZ, theScaleFactor)
1406 anObj = self.PrimOp.MakePrismDXDYDZWithScaling(theBase, theDX, theDY, theDZ, theScaleFactor)
1408 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1409 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
1410 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
1411 anObj.SetParameters(Parameters)
1414 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
1415 # i.e. all the space, transfixed by the base shape during its translation
1416 # along the vector on the given distance in 2 Ways (forward/backward).
1417 # @param theBase Base shape to be extruded.
1418 # @param theDX, theDY, theDZ Directions of extrusion.
1419 # @return New GEOM_Object, containing the created prism.
1421 # @ref tui_creation_prism "Example"
1422 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ):
1423 # Example: see GEOM_TestAll.py
1424 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1425 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
1426 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
1427 anObj.SetParameters(Parameters)
1430 ## Create a shape by revolution of the base shape around the axis
1431 # on the given angle, i.e. all the space, transfixed by the base
1432 # shape during its rotation around the axis on the given angle.
1433 # @param theBase Base shape to be rotated.
1434 # @param theAxis Rotation axis.
1435 # @param theAngle Rotation angle in radians.
1436 # @return New GEOM_Object, containing the created revolution.
1438 # @ref tui_creation_revolution "Example"
1439 def MakeRevolution(self, theBase, theAxis, theAngle):
1440 # Example: see GEOM_TestAll.py
1441 theAngle,Parameters = ParseParameters(theAngle)
1442 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
1443 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
1444 anObj.SetParameters(Parameters)
1447 ## The Same Revolution but in both ways forward&backward.
1448 def MakeRevolution2Ways(self, theBase, theAxis, theAngle):
1449 theAngle,Parameters = ParseParameters(theAngle)
1450 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
1451 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
1452 anObj.SetParameters(Parameters)
1455 ## Create a filling from the given compound of contours.
1456 # @param theShape the compound of contours
1457 # @param theMinDeg a minimal degree of BSpline surface to create
1458 # @param theMaxDeg a maximal degree of BSpline surface to create
1459 # @param theTol2D a 2d tolerance to be reached
1460 # @param theTol3D a 3d tolerance to be reached
1461 # @param theNbIter a number of iteration of approximation algorithm
1462 # @param theMethod Kind of method to perform filling operation:
1463 # GEOM.FOM_Default - Default - standard behaviour
1464 # /GEOM.FOM_UseOri - Use edges orientation - orientation of edges is
1465 # used: if the edge is reversed, the curve from this edge
1466 # is reversed before using it in the filling algorithm.
1467 # /GEOM.FOM_AutoCorrect - Auto-correct orientation - changes the orientation
1468 # of the curves using minimization of sum of distances
1469 # between the end points of the edges.
1470 # @param isApprox if True, BSpline curves are generated in the process
1471 # of surface construction. By default it is False, that means
1472 # the surface is created using Besier curves. The usage of
1473 # Approximation makes the algorithm work slower, but allows
1474 # building the surface for rather complex cases
1475 # @return New GEOM_Object, containing the created filling surface.
1477 # @ref tui_creation_filling "Example"
1478 def MakeFilling(self, theShape, theMinDeg, theMaxDeg, theTol2D,
1479 theTol3D, theNbIter, theMethod=GEOM.FOM_Default, isApprox=0):
1480 # Example: see GEOM_TestAll.py
1481 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
1482 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
1483 theTol2D, theTol3D, theNbIter,
1484 theMethod, isApprox)
1485 RaiseIfFailed("MakeFilling", self.PrimOp)
1486 anObj.SetParameters(Parameters)
1489 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
1490 # @param theSeqSections - set of specified sections.
1491 # @param theModeSolid - mode defining building solid or shell
1492 # @param thePreci - precision 3D used for smoothing by default 1.e-6
1493 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
1494 # @return New GEOM_Object, containing the created shell or solid.
1496 # @ref swig_todo "Example"
1497 def MakeThruSections(self,theSeqSections,theModeSolid,thePreci,theRuled):
1498 # Example: see GEOM_TestAll.py
1499 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
1500 RaiseIfFailed("MakeThruSections", self.PrimOp)
1503 ## Create a shape by extrusion of the base shape along
1504 # the path shape. The path shape can be a wire or an edge.
1505 # @param theBase Base shape to be extruded.
1506 # @param thePath Path shape to extrude the base shape along it.
1507 # @return New GEOM_Object, containing the created pipe.
1509 # @ref tui_creation_pipe "Example"
1510 def MakePipe(self,theBase, thePath):
1511 # Example: see GEOM_TestAll.py
1512 anObj = self.PrimOp.MakePipe(theBase, thePath)
1513 RaiseIfFailed("MakePipe", self.PrimOp)
1516 ## Create a shape by extrusion of the profile shape along
1517 # the path shape. The path shape can be a wire or an edge.
1518 # the several profiles can be specified in the several locations of path.
1519 # @param theSeqBases - list of Bases shape to be extruded.
1520 # @param theLocations - list of locations on the path corresponding
1521 # specified list of the Bases shapes. Number of locations
1522 # should be equal to number of bases or list of locations can be empty.
1523 # @param thePath - Path shape to extrude the base shape along it.
1524 # @param theWithContact - the mode defining that the section is translated to be in
1525 # contact with the spine.
1526 # @param theWithCorrection - defining that the section is rotated to be
1527 # orthogonal to the spine tangent in the correspondent point
1528 # @return New GEOM_Object, containing the created pipe.
1530 # @ref tui_creation_pipe_with_diff_sec "Example"
1531 def MakePipeWithDifferentSections(self, theSeqBases,
1532 theLocations, thePath,
1533 theWithContact, theWithCorrection):
1534 anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
1535 theLocations, thePath,
1536 theWithContact, theWithCorrection)
1537 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
1540 ## Create a shape by extrusion of the profile shape along
1541 # the path shape. The path shape can be a wire or a edge.
1542 # the several profiles can be specified in the several locations of path.
1543 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
1544 # shell or face. If number of faces in neighbour sections
1545 # aren't coincided result solid between such sections will
1546 # be created using external boundaries of this shells.
1547 # @param theSeqSubBases - list of corresponding subshapes of section shapes.
1548 # This list is used for searching correspondences between
1549 # faces in the sections. Size of this list must be equal
1550 # to size of list of base shapes.
1551 # @param theLocations - list of locations on the path corresponding
1552 # specified list of the Bases shapes. Number of locations
1553 # should be equal to number of bases. First and last
1554 # locations must be coincided with first and last vertexes
1555 # of path correspondingly.
1556 # @param thePath - Path shape to extrude the base shape along it.
1557 # @param theWithContact - the mode defining that the section is translated to be in
1558 # contact with the spine.
1559 # @param theWithCorrection - defining that the section is rotated to be
1560 # orthogonal to the spine tangent in the correspondent point
1561 # @return New GEOM_Object, containing the created solids.
1563 # @ref tui_creation_pipe_with_shell_sec "Example"
1564 def MakePipeWithShellSections(self,theSeqBases, theSeqSubBases,
1565 theLocations, thePath,
1566 theWithContact, theWithCorrection):
1567 anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
1568 theLocations, thePath,
1569 theWithContact, theWithCorrection)
1570 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
1573 ## Create a shape by extrusion of the profile shape along
1574 # the path shape. This function is used only for debug pipe
1575 # functionality - it is a version of previous function
1576 # (MakePipeWithShellSections(...)) which give a possibility to
1577 # recieve information about creating pipe between each pair of
1578 # sections step by step.
1579 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
1580 theLocations, thePath,
1581 theWithContact, theWithCorrection):
1583 nbsect = len(theSeqBases)
1584 nbsubsect = len(theSeqSubBases)
1585 #print "nbsect = ",nbsect
1586 for i in range(1,nbsect):
1588 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
1589 tmpLocations = [ theLocations[i-1], theLocations[i] ]
1591 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
1592 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
1593 tmpLocations, thePath,
1594 theWithContact, theWithCorrection)
1595 if self.PrimOp.IsDone() == 0:
1596 print "Problems with pipe creation between ",i," and ",i+1," sections"
1597 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
1600 print "Pipe between ",i," and ",i+1," sections is OK"
1605 resc = self.MakeCompound(res)
1606 #resc = self.MakeSewing(res, 0.001)
1607 #print "resc: ",resc
1610 ## Create solids between given sections
1611 # @param theSeqBases - list of sections (shell or face).
1612 # @param theLocations - list of corresponding vertexes
1613 # @return New GEOM_Object, containing the created solids.
1615 # @ref tui_creation_pipe_without_path "Example"
1616 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations):
1617 anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
1618 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
1621 ## Create a shape by extrusion of the base shape along
1622 # the path shape with constant bi-normal direction along the given vector.
1623 # The path shape can be a wire or an edge.
1624 # @param theBase Base shape to be extruded.
1625 # @param thePath Path shape to extrude the base shape along it.
1626 # @param theVec Vector defines a constant binormal direction to keep the
1627 # same angle beetween the direction and the sections
1628 # along the sweep surface.
1629 # @return New GEOM_Object, containing the created pipe.
1631 # @ref tui_creation_pipe "Example"
1632 def MakePipeBiNormalAlongVector(self,theBase, thePath, theVec):
1633 # Example: see GEOM_TestAll.py
1634 anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
1635 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
1641 ## @addtogroup l3_advanced
1644 ## Create a linear edge with specified ends.
1645 # @param thePnt1 Point for the first end of edge.
1646 # @param thePnt2 Point for the second end of edge.
1647 # @return New GEOM_Object, containing the created edge.
1649 # @ref tui_creation_edge "Example"
1650 def MakeEdge(self,thePnt1, thePnt2):
1651 # Example: see GEOM_TestAll.py
1652 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
1653 RaiseIfFailed("MakeEdge", self.ShapesOp)
1656 ## Create a new edge, corresponding to the given length on the given curve.
1657 # @param theRefCurve The referenced curve (edge).
1658 # @param theLength Length on the referenced curve. It can be negative.
1659 # @param theStartPoint Any point can be selected for it, the new edge will begin
1660 # at the end of \a theRefCurve, close to the selected point.
1661 # If None, start from the first point of \a theRefCurve.
1662 # @return New GEOM_Object, containing the created edge.
1664 # @ref tui_creation_edge "Example"
1665 def MakeEdgeOnCurveByLength(self, theRefCurve, theLength, theStartPoint = None):
1666 # Example: see GEOM_TestAll.py
1667 theLength, Parameters = ParseParameters(theLength)
1668 anObj = self.ShapesOp.MakeEdgeOnCurveByLength(theRefCurve, theLength, theStartPoint)
1669 RaiseIfFailed("MakeEdgeOnCurveByLength", self.ShapesOp)
1670 anObj.SetParameters(Parameters)
1673 ## Create an edge from specified wire.
1674 # @param theWire source Wire.
1675 # @param theLinearTolerance linear tolerance value.
1676 # @param theAngularTolerance angular tolerance value.
1677 # @return New GEOM_Object, containing the created edge.
1679 # @ref tui_creation_edge "Example"
1680 def MakeEdgeWire(self, theWire, theLinearTolerance = 1e-07, theAngularTolerance = 1e-12):
1681 # Example: see GEOM_TestAll.py
1682 anObj = self.ShapesOp.MakeEdgeWire(theWire, theLinearTolerance, theAngularTolerance)
1683 RaiseIfFailed("MakeEdgeWire", self.ShapesOp)
1686 ## Create a wire from the set of edges and wires.
1687 # @param theEdgesAndWires List of edges and/or wires.
1688 # @param theTolerance Maximum distance between vertices, that will be merged.
1689 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
1690 # @return New GEOM_Object, containing the created wire.
1692 # @ref tui_creation_wire "Example"
1693 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07):
1694 # Example: see GEOM_TestAll.py
1695 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
1696 RaiseIfFailed("MakeWire", self.ShapesOp)
1699 ## Create a face on the given wire.
1700 # @param theWire closed Wire or Edge to build the face on.
1701 # @param isPlanarWanted If TRUE, only planar face will be built.
1702 # If impossible, NULL object will be returned.
1703 # @return New GEOM_Object, containing the created face.
1705 # @ref tui_creation_face "Example"
1706 def MakeFace(self,theWire, isPlanarWanted):
1707 # Example: see GEOM_TestAll.py
1708 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
1709 RaiseIfFailed("MakeFace", self.ShapesOp)
1712 ## Create a face on the given wires set.
1713 # @param theWires List of closed wires or edges to build the face on.
1714 # @param isPlanarWanted If TRUE, only planar face will be built.
1715 # If impossible, NULL object will be returned.
1716 # @return New GEOM_Object, containing the created face.
1718 # @ref tui_creation_face "Example"
1719 def MakeFaceWires(self,theWires, isPlanarWanted):
1720 # Example: see GEOM_TestAll.py
1721 anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
1722 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
1725 ## Shortcut to MakeFaceWires()
1727 # @ref tui_creation_face "Example 1"
1728 # \n @ref swig_MakeFaces "Example 2"
1729 def MakeFaces(self,theWires, isPlanarWanted):
1730 # Example: see GEOM_TestOthers.py
1731 anObj = self.MakeFaceWires(theWires, isPlanarWanted)
1734 ## Create a shell from the set of faces and shells.
1735 # @param theFacesAndShells List of faces and/or shells.
1736 # @return New GEOM_Object, containing the created shell.
1738 # @ref tui_creation_shell "Example"
1739 def MakeShell(self,theFacesAndShells):
1740 # Example: see GEOM_TestAll.py
1741 anObj = self.ShapesOp.MakeShell(theFacesAndShells)
1742 RaiseIfFailed("MakeShell", self.ShapesOp)
1745 ## Create a solid, bounded by the given shells.
1746 # @param theShells Sequence of bounding shells.
1747 # @return New GEOM_Object, containing the created solid.
1749 # @ref tui_creation_solid "Example"
1750 def MakeSolid(self,theShells):
1751 # Example: see GEOM_TestAll.py
1752 anObj = self.ShapesOp.MakeSolidShells(theShells)
1753 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
1756 ## Create a compound of the given shapes.
1757 # @param theShapes List of shapes to put in compound.
1758 # @return New GEOM_Object, containing the created compound.
1760 # @ref tui_creation_compound "Example"
1761 def MakeCompound(self,theShapes):
1762 # Example: see GEOM_TestAll.py
1763 anObj = self.ShapesOp.MakeCompound(theShapes)
1764 RaiseIfFailed("MakeCompound", self.ShapesOp)
1767 # end of l3_advanced
1770 ## @addtogroup l2_measure
1773 ## Gives quantity of faces in the given shape.
1774 # @param theShape Shape to count faces of.
1775 # @return Quantity of faces.
1777 # @ref swig_NumberOf "Example"
1778 def NumberOfFaces(self, theShape):
1779 # Example: see GEOM_TestOthers.py
1780 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
1781 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
1784 ## Gives quantity of edges in the given shape.
1785 # @param theShape Shape to count edges of.
1786 # @return Quantity of edges.
1788 # @ref swig_NumberOf "Example"
1789 def NumberOfEdges(self, theShape):
1790 # Example: see GEOM_TestOthers.py
1791 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
1792 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
1795 ## Gives quantity of subshapes of type theShapeType in the given shape.
1796 # @param theShape Shape to count subshapes of.
1797 # @param theShapeType Type of subshapes to count.
1798 # @return Quantity of subshapes of given type.
1800 # @ref swig_NumberOf "Example"
1801 def NumberOfSubShapes(self, theShape, theShapeType):
1802 # Example: see GEOM_TestOthers.py
1803 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
1804 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
1807 ## Gives quantity of solids in the given shape.
1808 # @param theShape Shape to count solids in.
1809 # @return Quantity of solids.
1811 # @ref swig_NumberOf "Example"
1812 def NumberOfSolids(self, theShape):
1813 # Example: see GEOM_TestOthers.py
1814 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, ShapeType["SOLID"])
1815 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
1821 ## @addtogroup l3_healing
1824 ## Reverses an orientation the given shape.
1825 # @param theShape Shape to be reversed.
1826 # @return The reversed copy of theShape.
1828 # @ref swig_ChangeOrientation "Example"
1829 def ChangeOrientation(self,theShape):
1830 # Example: see GEOM_TestAll.py
1831 anObj = self.ShapesOp.ChangeOrientation(theShape)
1832 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
1835 ## Shortcut to ChangeOrientation()
1837 # @ref swig_OrientationChange "Example"
1838 def OrientationChange(self,theShape):
1839 # Example: see GEOM_TestOthers.py
1840 anObj = self.ChangeOrientation(theShape)
1846 ## @addtogroup l4_obtain
1849 ## Retrieve all free faces from the given shape.
1850 # Free face is a face, which is not shared between two shells of the shape.
1851 # @param theShape Shape to find free faces in.
1852 # @return List of IDs of all free faces, contained in theShape.
1854 # @ref tui_measurement_tools_page "Example"
1855 def GetFreeFacesIDs(self,theShape):
1856 # Example: see GEOM_TestOthers.py
1857 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
1858 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
1861 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
1862 # @param theShape1 Shape to find sub-shapes in.
1863 # @param theShape2 Shape to find shared sub-shapes with.
1864 # @param theShapeType Type of sub-shapes to be retrieved.
1865 # @return List of sub-shapes of theShape1, shared with theShape2.
1867 # @ref swig_GetSharedShapes "Example"
1868 def GetSharedShapes(self,theShape1, theShape2, theShapeType):
1869 # Example: see GEOM_TestOthers.py
1870 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
1871 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
1874 ## Get all sub-shapes, shared by all shapes in the list <VAR>theShapes</VAR>.
1875 # @param theShapes Shapes to find common sub-shapes of.
1876 # @param theShapeType Type of sub-shapes to be retrieved.
1877 # @return List of objects, that are sub-shapes of all given shapes.
1879 # @ref swig_GetSharedShapes "Example"
1880 def GetSharedShapesMulti(self, theShapes, theShapeType):
1881 # Example: see GEOM_TestOthers.py
1882 aList = self.ShapesOp.GetSharedShapesMulti(theShapes, theShapeType)
1883 RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
1886 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
1887 # situated relatively the specified plane by the certain way,
1888 # defined through <VAR>theState</VAR> parameter.
1889 # @param theShape Shape to find sub-shapes of.
1890 # @param theShapeType Type of sub-shapes to be retrieved.
1891 # @param theAx1 Vector (or line, or linear edge), specifying normal
1892 # direction and location of the plane to find shapes on.
1893 # @param theState The state of the subshapes to find. It can be one of
1894 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1895 # @return List of all found sub-shapes.
1897 # @ref swig_GetShapesOnPlane "Example"
1898 def GetShapesOnPlane(self,theShape, theShapeType, theAx1, theState):
1899 # Example: see GEOM_TestOthers.py
1900 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
1901 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
1904 ## Works like the above method, but returns list of sub-shapes indices
1906 # @ref swig_GetShapesOnPlaneIDs "Example"
1907 def GetShapesOnPlaneIDs(self,theShape, theShapeType, theAx1, theState):
1908 # Example: see GEOM_TestOthers.py
1909 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
1910 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
1913 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
1914 # situated relatively the specified plane by the certain way,
1915 # defined through <VAR>theState</VAR> parameter.
1916 # @param theShape Shape to find sub-shapes of.
1917 # @param theShapeType Type of sub-shapes to be retrieved.
1918 # @param theAx1 Vector (or line, or linear edge), specifying normal
1919 # direction of the plane to find shapes on.
1920 # @param thePnt Point specifying location of the plane to find shapes on.
1921 # @param theState The state of the subshapes to find. It can be one of
1922 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1923 # @return List of all found sub-shapes.
1925 # @ref swig_GetShapesOnPlaneWithLocation "Example"
1926 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState):
1927 # Example: see GEOM_TestOthers.py
1928 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
1929 theAx1, thePnt, theState)
1930 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
1933 ## Works like the above method, but returns list of sub-shapes indices
1935 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
1936 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
1937 # Example: see GEOM_TestOthers.py
1938 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
1939 theAx1, thePnt, theState)
1940 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
1943 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1944 # the specified cylinder by the certain way, defined through \a theState parameter.
1945 # @param theShape Shape to find sub-shapes of.
1946 # @param theShapeType Type of sub-shapes to be retrieved.
1947 # @param theAxis Vector (or line, or linear edge), specifying
1948 # axis of the cylinder to find shapes on.
1949 # @param theRadius Radius of the cylinder to find shapes on.
1950 # @param theState The state of the subshapes to find. It can be one of
1951 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1952 # @return List of all found sub-shapes.
1954 # @ref swig_GetShapesOnCylinder "Example"
1955 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState):
1956 # Example: see GEOM_TestOthers.py
1957 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
1958 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
1961 ## Works like the above method, but returns list of sub-shapes indices
1963 # @ref swig_GetShapesOnCylinderIDs "Example"
1964 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
1965 # Example: see GEOM_TestOthers.py
1966 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
1967 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
1970 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1971 # the specified cylinder by the certain way, defined through \a theState parameter.
1972 # @param theShape Shape to find sub-shapes of.
1973 # @param theShapeType Type of sub-shapes to be retrieved.
1974 # @param theAxis Vector (or line, or linear edge), specifying
1975 # axis of the cylinder to find shapes on.
1976 # @param thePnt Point specifying location of the bottom of the cylinder.
1977 # @param theRadius Radius of the cylinder to find shapes on.
1978 # @param theState The state of the subshapes to find. It can be one of
1979 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1980 # @return List of all found sub-shapes.
1982 # @ref swig_GetShapesOnCylinderWithLocation "Example"
1983 def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
1984 # Example: see GEOM_TestOthers.py
1985 aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
1986 RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
1989 ## Works like the above method, but returns list of sub-shapes indices
1991 # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
1992 def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
1993 # Example: see GEOM_TestOthers.py
1994 aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
1995 RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
1998 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1999 # the specified sphere by the certain way, defined through \a theState parameter.
2000 # @param theShape Shape to find sub-shapes of.
2001 # @param theShapeType Type of sub-shapes to be retrieved.
2002 # @param theCenter Point, specifying center of the sphere to find shapes on.
2003 # @param theRadius Radius of the sphere to find shapes on.
2004 # @param theState The state of the subshapes to find. It can be one of
2005 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
2006 # @return List of all found sub-shapes.
2008 # @ref swig_GetShapesOnSphere "Example"
2009 def GetShapesOnSphere(self,theShape, theShapeType, theCenter, theRadius, theState):
2010 # Example: see GEOM_TestOthers.py
2011 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
2012 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
2015 ## Works like the above method, but returns list of sub-shapes indices
2017 # @ref swig_GetShapesOnSphereIDs "Example"
2018 def GetShapesOnSphereIDs(self,theShape, theShapeType, theCenter, theRadius, theState):
2019 # Example: see GEOM_TestOthers.py
2020 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
2021 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
2024 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
2025 # the specified quadrangle by the certain way, defined through \a theState parameter.
2026 # @param theShape Shape to find sub-shapes of.
2027 # @param theShapeType Type of sub-shapes to be retrieved.
2028 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
2029 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
2030 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
2031 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
2032 # @param theState The state of the subshapes to find. It can be one of
2033 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
2034 # @return List of all found sub-shapes.
2036 # @ref swig_GetShapesOnQuadrangle "Example"
2037 def GetShapesOnQuadrangle(self, theShape, theShapeType,
2038 theTopLeftPoint, theTopRigthPoint,
2039 theBottomLeftPoint, theBottomRigthPoint, theState):
2040 # Example: see GEOM_TestOthers.py
2041 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
2042 theTopLeftPoint, theTopRigthPoint,
2043 theBottomLeftPoint, theBottomRigthPoint, theState)
2044 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
2047 ## Works like the above method, but returns list of sub-shapes indices
2049 # @ref swig_GetShapesOnQuadrangleIDs "Example"
2050 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
2051 theTopLeftPoint, theTopRigthPoint,
2052 theBottomLeftPoint, theBottomRigthPoint, theState):
2053 # Example: see GEOM_TestOthers.py
2054 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
2055 theTopLeftPoint, theTopRigthPoint,
2056 theBottomLeftPoint, theBottomRigthPoint, theState)
2057 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
2060 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
2061 # the specified \a theBox by the certain way, defined through \a theState parameter.
2062 # @param theBox Shape for relative comparing.
2063 # @param theShape Shape to find sub-shapes of.
2064 # @param theShapeType Type of sub-shapes to be retrieved.
2065 # @param theState The state of the subshapes to find. It can be one of
2066 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
2067 # @return List of all found sub-shapes.
2069 # @ref swig_GetShapesOnBox "Example"
2070 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState):
2071 # Example: see GEOM_TestOthers.py
2072 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
2073 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
2076 ## Works like the above method, but returns list of sub-shapes indices
2078 # @ref swig_GetShapesOnBoxIDs "Example"
2079 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
2080 # Example: see GEOM_TestOthers.py
2081 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
2082 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
2085 ## Find in \a theShape all sub-shapes of type \a theShapeType,
2086 # situated relatively the specified \a theCheckShape by the
2087 # certain way, defined through \a theState parameter.
2088 # @param theCheckShape Shape for relative comparing. It must be a solid.
2089 # @param theShape Shape to find sub-shapes of.
2090 # @param theShapeType Type of sub-shapes to be retrieved.
2091 # @param theState The state of the subshapes to find. It can be one of
2092 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
2093 # @return List of all found sub-shapes.
2095 # @ref swig_GetShapesOnShape "Example"
2096 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState):
2097 # Example: see GEOM_TestOthers.py
2098 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
2099 theShapeType, theState)
2100 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
2103 ## Works like the above method, but returns result as compound
2105 # @ref swig_GetShapesOnShapeAsCompound "Example"
2106 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState):
2107 # Example: see GEOM_TestOthers.py
2108 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
2109 theShapeType, theState)
2110 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
2113 ## Works like the above method, but returns list of sub-shapes indices
2115 # @ref swig_GetShapesOnShapeIDs "Example"
2116 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
2117 # Example: see GEOM_TestOthers.py
2118 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
2119 theShapeType, theState)
2120 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
2123 ## Get sub-shape(s) of theShapeWhere, which are
2124 # coincident with \a theShapeWhat or could be a part of it.
2125 # @param theShapeWhere Shape to find sub-shapes of.
2126 # @param theShapeWhat Shape, specifying what to find.
2127 # @return Group of all found sub-shapes or a single found sub-shape.
2129 # @note This function has a restriction on argument shapes.
2130 # If \a theShapeWhere has curved parts with significantly
2131 # outstanding centres (i.e. the mass centre of a part is closer to
2132 # \a theShapeWhat than to the part), such parts will not be found.
2133 # @image html get_in_place_lost_part.png
2135 # @ref swig_GetInPlace "Example"
2136 def GetInPlace(self, theShapeWhere, theShapeWhat):
2137 # Example: see GEOM_TestOthers.py
2138 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
2139 RaiseIfFailed("GetInPlace", self.ShapesOp)
2142 ## Get sub-shape(s) of \a theShapeWhere, which are
2143 # coincident with \a theShapeWhat or could be a part of it.
2145 # Implementation of this method is based on a saved history of an operation,
2146 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
2147 # arguments (an argument shape or a sub-shape of an argument shape).
2148 # The operation could be the Partition or one of boolean operations,
2149 # performed on simple shapes (not on compounds).
2151 # @param theShapeWhere Shape to find sub-shapes of.
2152 # @param theShapeWhat Shape, specifying what to find (must be in the
2153 # building history of the ShapeWhere).
2154 # @return Group of all found sub-shapes or a single found sub-shape.
2156 # @ref swig_GetInPlace "Example"
2157 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat):
2158 # Example: see GEOM_TestOthers.py
2159 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
2160 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
2163 ## Get sub-shape of theShapeWhere, which is
2164 # equal to \a theShapeWhat.
2165 # @param theShapeWhere Shape to find sub-shape of.
2166 # @param theShapeWhat Shape, specifying what to find.
2167 # @return New GEOM_Object for found sub-shape.
2169 # @ref swig_GetSame "Example"
2170 def GetSame(self,theShapeWhere, theShapeWhat):
2171 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
2172 RaiseIfFailed("GetSame", self.ShapesOp)
2178 ## @addtogroup l4_access
2181 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
2182 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
2184 # @ref swig_all_decompose "Example"
2185 def GetSubShape(self, aShape, ListOfID):
2186 # Example: see GEOM_TestAll.py
2187 anObj = self.AddSubShape(aShape,ListOfID)
2190 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
2192 # @ref swig_all_decompose "Example"
2193 def GetSubShapeID(self, aShape, aSubShape):
2194 # Example: see GEOM_TestAll.py
2195 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
2196 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
2202 ## @addtogroup l4_decompose
2205 ## Get all sub-shapes and groups of \a theShape,
2206 # that were created already by any other methods.
2207 # @param theShape Any shape.
2208 # @param theGroupsOnly If this parameter is TRUE, only groups will be
2209 # returned, else all found sub-shapes and groups.
2210 # @return List of existing sub-objects of \a theShape.
2212 # @ref swig_all_decompose "Example"
2213 def GetExistingSubObjects(self, theShape, theGroupsOnly = False):
2214 # Example: see GEOM_TestAll.py
2215 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, theGroupsOnly)
2216 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
2219 ## Get all groups of \a theShape,
2220 # that were created already by any other methods.
2221 # @param theShape Any shape.
2222 # @return List of existing groups of \a theShape.
2224 # @ref swig_all_decompose "Example"
2225 def GetGroups(self, theShape):
2226 # Example: see GEOM_TestAll.py
2227 ListObj = self.ShapesOp.GetExistingSubObjects(theShape, True)
2228 RaiseIfFailed("GetExistingSubObjects", self.ShapesOp)
2231 ## Explode a shape on subshapes of a given type.
2232 # If the shape itself matches the type, it is also returned.
2233 # @param aShape Shape to be exploded.
2234 # @param aType Type of sub-shapes to be retrieved.
2235 # @return List of sub-shapes of type theShapeType, contained in theShape.
2237 # @ref swig_all_decompose "Example"
2238 def SubShapeAll(self, aShape, aType):
2239 # Example: see GEOM_TestAll.py
2240 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, aType, False)
2241 RaiseIfFailed("SubShapeAll", self.ShapesOp)
2244 ## Explode a shape on subshapes of a given type.
2245 # @param aShape Shape to be exploded.
2246 # @param aType Type of sub-shapes to be retrieved.
2247 # @return List of IDs of sub-shapes.
2249 # @ref swig_all_decompose "Example"
2250 def SubShapeAllIDs(self, aShape, aType):
2251 ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, aType, False)
2252 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
2255 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
2256 # selected by they indices in list of all sub-shapes of type <VAR>aType</VAR>.
2257 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
2259 # @ref swig_all_decompose "Example"
2260 def SubShape(self, aShape, aType, ListOfInd):
2261 # Example: see GEOM_TestAll.py
2263 AllShapeIDsList = self.SubShapeAllIDs(aShape, aType)
2264 for ind in ListOfInd:
2265 ListOfIDs.append(AllShapeIDsList[ind - 1])
2266 anObj = self.GetSubShape(aShape, ListOfIDs)
2269 ## Explode a shape on subshapes of a given type.
2270 # Sub-shapes will be sorted by coordinates of their gravity centers.
2271 # If the shape itself matches the type, it is also returned.
2272 # @param aShape Shape to be exploded.
2273 # @param aType Type of sub-shapes to be retrieved.
2274 # @return List of sub-shapes of type theShapeType, contained in theShape.
2276 # @ref swig_SubShapeAllSorted "Example"
2277 def SubShapeAllSortedCentres(self, aShape, aType):
2278 # Example: see GEOM_TestAll.py
2279 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, aType, True)
2280 RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
2283 ## Explode a shape on subshapes of a given type.
2284 # Sub-shapes will be sorted by coordinates of their gravity centers.
2285 # @param aShape Shape to be exploded.
2286 # @param aType Type of sub-shapes to be retrieved.
2287 # @return List of IDs of sub-shapes.
2289 # @ref swig_all_decompose "Example"
2290 def SubShapeAllSortedCentresIDs(self, aShape, aType):
2291 ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, aType, True)
2292 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
2295 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
2296 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
2297 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
2299 # @ref swig_all_decompose "Example"
2300 def SubShapeSortedCentres(self, aShape, aType, ListOfInd):
2301 # Example: see GEOM_TestAll.py
2303 AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, aType)
2304 for ind in ListOfInd:
2305 ListOfIDs.append(AllShapeIDsList[ind - 1])
2306 anObj = self.GetSubShape(aShape, ListOfIDs)
2309 ## Extract shapes (excluding the main shape) of given type.
2310 # @param aShape The shape.
2311 # @param aType The shape type.
2312 # @param isSorted Boolean flag to switch sorting on/off.
2313 # @return List of sub-shapes of type aType, contained in aShape.
2315 # @ref swig_FilletChamfer "Example"
2316 def ExtractShapes(self, aShape, aType, isSorted = False):
2317 # Example: see GEOM_TestAll.py
2318 ListObj = self.ShapesOp.ExtractSubShapes(aShape, aType, isSorted)
2319 RaiseIfFailed("ExtractSubShapes", self.ShapesOp)
2322 # end of l4_decompose
2325 ## @addtogroup l4_decompose_d
2328 ## Deprecated method
2329 # It works like SubShapeAllSortedCentres, but wrongly
2330 # defines centres of faces, shells and solids.
2331 def SubShapeAllSorted(self, aShape, aType):
2332 ListObj = self.ShapesOp.MakeExplode(aShape, aType, True)
2333 RaiseIfFailed("MakeExplode", self.ShapesOp)
2336 ## Deprecated method
2337 # It works like SubShapeAllSortedCentresIDs, but wrongly
2338 # defines centres of faces, shells and solids.
2339 def SubShapeAllSortedIDs(self, aShape, aType):
2340 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, aType, True)
2341 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
2344 ## Deprecated method
2345 # It works like SubShapeSortedCentres, but has a bug
2346 # (wrongly defines centres of faces, shells and solids).
2347 def SubShapeSorted(self, aShape, aType, ListOfInd):
2349 AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, aType)
2350 for ind in ListOfInd:
2351 ListOfIDs.append(AllShapeIDsList[ind - 1])
2352 anObj = self.GetSubShape(aShape, ListOfIDs)
2355 # end of l4_decompose_d
2358 ## @addtogroup l3_healing
2361 ## Apply a sequence of Shape Healing operators to the given object.
2362 # @param theShape Shape to be processed.
2363 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
2364 # @param theParameters List of names of parameters
2365 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
2366 # @param theValues List of values of parameters, in the same order
2367 # as parameters are listed in <VAR>theParameters</VAR> list.
2368 # @return New GEOM_Object, containing processed shape.
2370 # @ref tui_shape_processing "Example"
2371 def ProcessShape(self, theShape, theOperators, theParameters, theValues):
2372 # Example: see GEOM_TestHealing.py
2373 theValues,Parameters = ParseList(theValues)
2374 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
2375 # To avoid script failure in case of good argument shape
2376 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
2378 RaiseIfFailed("ProcessShape", self.HealOp)
2379 for string in (theOperators + theParameters):
2380 Parameters = ":" + Parameters
2382 anObj.SetParameters(Parameters)
2385 ## Remove faces from the given object (shape).
2386 # @param theObject Shape to be processed.
2387 # @param theFaces Indices of faces to be removed, if EMPTY then the method
2388 # removes ALL faces of the given object.
2389 # @return New GEOM_Object, containing processed shape.
2391 # @ref tui_suppress_faces "Example"
2392 def SuppressFaces(self,theObject, theFaces):
2393 # Example: see GEOM_TestHealing.py
2394 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
2395 RaiseIfFailed("SuppressFaces", self.HealOp)
2398 ## Sewing of some shapes into single shape.
2400 # @ref tui_sewing "Example"
2401 def MakeSewing(self, ListShape, theTolerance):
2402 # Example: see GEOM_TestHealing.py
2403 comp = self.MakeCompound(ListShape)
2404 anObj = self.Sew(comp, theTolerance)
2407 ## Sewing of the given object.
2408 # @param theObject Shape to be processed.
2409 # @param theTolerance Required tolerance value.
2410 # @return New GEOM_Object, containing processed shape.
2411 def Sew(self, theObject, theTolerance):
2412 # Example: see MakeSewing() above
2413 theTolerance,Parameters = ParseParameters(theTolerance)
2414 anObj = self.HealOp.Sew(theObject, theTolerance)
2415 RaiseIfFailed("Sew", self.HealOp)
2416 anObj.SetParameters(Parameters)
2419 ## Remove internal wires and edges from the given object (face).
2420 # @param theObject Shape to be processed.
2421 # @param theWires Indices of wires to be removed, if EMPTY then the method
2422 # removes ALL internal wires of the given object.
2423 # @return New GEOM_Object, containing processed shape.
2425 # @ref tui_suppress_internal_wires "Example"
2426 def SuppressInternalWires(self,theObject, theWires):
2427 # Example: see GEOM_TestHealing.py
2428 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
2429 RaiseIfFailed("RemoveIntWires", self.HealOp)
2432 ## Remove internal closed contours (holes) from the given object.
2433 # @param theObject Shape to be processed.
2434 # @param theWires Indices of wires to be removed, if EMPTY then the method
2435 # removes ALL internal holes of the given object
2436 # @return New GEOM_Object, containing processed shape.
2438 # @ref tui_suppress_holes "Example"
2439 def SuppressHoles(self,theObject, theWires):
2440 # Example: see GEOM_TestHealing.py
2441 anObj = self.HealOp.FillHoles(theObject, theWires)
2442 RaiseIfFailed("FillHoles", self.HealOp)
2445 ## Close an open wire.
2446 # @param theObject Shape to be processed.
2447 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
2448 # if [ ], then <VAR>theObject</VAR> itself is a wire.
2449 # @param isCommonVertex If True : closure by creation of a common vertex,
2450 # If False : closure by creation of an edge between ends.
2451 # @return New GEOM_Object, containing processed shape.
2453 # @ref tui_close_contour "Example"
2454 def CloseContour(self,theObject, theWires, isCommonVertex):
2455 # Example: see GEOM_TestHealing.py
2456 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
2457 RaiseIfFailed("CloseContour", self.HealOp)
2460 ## Addition of a point to a given edge object.
2461 # @param theObject Shape to be processed.
2462 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
2463 # if -1, then theObject itself is the edge.
2464 # @param theValue Value of parameter on edge or length parameter,
2465 # depending on \a isByParameter.
2466 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1],
2467 # if FALSE : \a theValue is treated as a length parameter [0..1]
2468 # @return New GEOM_Object, containing processed shape.
2470 # @ref tui_add_point_on_edge "Example"
2471 def DivideEdge(self,theObject, theEdgeIndex, theValue, isByParameter):
2472 # Example: see GEOM_TestHealing.py
2473 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
2474 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
2475 RaiseIfFailed("DivideEdge", self.HealOp)
2476 anObj.SetParameters(Parameters)
2479 ## Change orientation of the given object. Updates given shape.
2480 # @param theObject Shape to be processed.
2482 # @ref swig_todo "Example"
2483 def ChangeOrientationShell(self,theObject):
2484 theObject = self.HealOp.ChangeOrientation(theObject)
2485 RaiseIfFailed("ChangeOrientation", self.HealOp)
2488 ## Change orientation of the given object.
2489 # @param theObject Shape to be processed.
2490 # @return New GEOM_Object, containing processed shape.
2492 # @ref swig_todo "Example"
2493 def ChangeOrientationShellCopy(self, theObject):
2494 anObj = self.HealOp.ChangeOrientationCopy(theObject)
2495 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
2498 ## Try to limit tolerance of the given object by value \a theTolerance.
2499 # @param theObject Shape to be processed.
2500 # @param theTolerance Required tolerance value.
2501 # @return New GEOM_Object, containing processed shape.
2503 # @ref tui_limit_tolerance "Example"
2504 def LimitTolerance(self, theObject, theTolerance = 1e-07):
2505 anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
2506 RaiseIfFailed("LimitTolerance", self.HealOp)
2509 ## Get a list of wires (wrapped in GEOM_Object-s),
2510 # that constitute a free boundary of the given shape.
2511 # @param theObject Shape to get free boundary of.
2512 # @return [status, theClosedWires, theOpenWires]
2513 # status: FALSE, if an error(s) occured during the method execution.
2514 # theClosedWires: Closed wires on the free boundary of the given shape.
2515 # theOpenWires: Open wires on the free boundary of the given shape.
2517 # @ref tui_measurement_tools_page "Example"
2518 def GetFreeBoundary(self, theObject):
2519 # Example: see GEOM_TestHealing.py
2520 anObj = self.HealOp.GetFreeBoundary(theObject)
2521 RaiseIfFailed("GetFreeBoundary", self.HealOp)
2524 ## Replace coincident faces in theShape by one face.
2525 # @param theShape Initial shape.
2526 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
2527 # @param doKeepNonSolids If FALSE, only solids will present in the result,
2528 # otherwise all initial shapes.
2529 # @return New GEOM_Object, containing a copy of theShape without coincident faces.
2531 # @ref tui_glue_faces "Example"
2532 def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True):
2533 # Example: see GEOM_Spanner.py
2534 theTolerance,Parameters = ParseParameters(theTolerance)
2535 anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
2537 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
2538 anObj.SetParameters(Parameters)
2541 ## Find coincident faces in theShape for possible gluing.
2542 # @param theShape Initial shape.
2543 # @param theTolerance Maximum distance between faces,
2544 # which can be considered as coincident.
2547 # @ref swig_todo "Example"
2548 def GetGlueFaces(self, theShape, theTolerance):
2549 # Example: see GEOM_Spanner.py
2550 anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
2551 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
2554 ## Replace coincident faces in theShape by one face
2555 # in compliance with given list of faces
2556 # @param theShape Initial shape.
2557 # @param theTolerance Maximum distance between faces,
2558 # which can be considered as coincident.
2559 # @param theFaces List of faces for gluing.
2560 # @param doKeepNonSolids If FALSE, only solids will present in the result,
2561 # otherwise all initial shapes.
2562 # @return New GEOM_Object, containing a copy of theShape
2563 # without some faces.
2565 # @ref swig_todo "Example"
2566 def MakeGlueFacesByList(self, theShape, theTolerance, theFaces, doKeepNonSolids=True):
2567 # Example: see GEOM_Spanner.py
2568 anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces, doKeepNonSolids)
2570 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
2576 ## @addtogroup l3_boolean Boolean Operations
2579 # -----------------------------------------------------------------------------
2580 # Boolean (Common, Cut, Fuse, Section)
2581 # -----------------------------------------------------------------------------
2583 ## Perform one of boolean operations on two given shapes.
2584 # @param theShape1 First argument for boolean operation.
2585 # @param theShape2 Second argument for boolean operation.
2586 # @param theOperation Indicates the operation to be done:
2587 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
2588 # @return New GEOM_Object, containing the result shape.
2590 # @ref tui_fuse "Example"
2591 def MakeBoolean(self,theShape1, theShape2, theOperation):
2592 # Example: see GEOM_TestAll.py
2593 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation)
2594 RaiseIfFailed("MakeBoolean", self.BoolOp)
2597 ## Shortcut to MakeBoolean(s1, s2, 1)
2599 # @ref tui_common "Example 1"
2600 # \n @ref swig_MakeCommon "Example 2"
2601 def MakeCommon(self, s1, s2):
2602 # Example: see GEOM_TestOthers.py
2603 return self.MakeBoolean(s1, s2, 1)
2605 ## Shortcut to MakeBoolean(s1, s2, 2)
2607 # @ref tui_cut "Example 1"
2608 # \n @ref swig_MakeCommon "Example 2"
2609 def MakeCut(self, s1, s2):
2610 # Example: see GEOM_TestOthers.py
2611 return self.MakeBoolean(s1, s2, 2)
2613 ## Shortcut to MakeBoolean(s1, s2, 3)
2615 # @ref tui_fuse "Example 1"
2616 # \n @ref swig_MakeCommon "Example 2"
2617 def MakeFuse(self, s1, s2):
2618 # Example: see GEOM_TestOthers.py
2619 return self.MakeBoolean(s1, s2, 3)
2621 ## Shortcut to MakeBoolean(s1, s2, 4)
2623 # @ref tui_section "Example 1"
2624 # \n @ref swig_MakeCommon "Example 2"
2625 def MakeSection(self, s1, s2):
2626 # Example: see GEOM_TestOthers.py
2627 return self.MakeBoolean(s1, s2, 4)
2632 ## @addtogroup l3_basic_op
2635 ## Perform partition operation.
2636 # @param ListShapes Shapes to be intersected.
2637 # @param ListTools Shapes to intersect theShapes.
2638 # !!!NOTE: Each compound from ListShapes and ListTools will be exploded
2639 # in order to avoid possible intersection between shapes from
2641 # @param Limit Type of resulting shapes (corresponding to TopAbs_ShapeEnum).
2642 # If this parameter is set to -1 ("Auto"), most appropriate shape limit
2643 # type will be detected automatically.
2644 # @param KeepNonlimitShapes: if this parameter == 0, then only shapes of
2645 # target type (equal to Limit) are kept in the result,
2646 # else standalone shapes of lower dimension
2647 # are kept also (if they exist).
2649 # After implementation new version of PartitionAlgo (October 2006)
2650 # other parameters are ignored by current functionality. They are kept
2651 # in this function only for support old versions.
2652 # Ignored parameters:
2653 # @param ListKeepInside Shapes, outside which the results will be deleted.
2654 # Each shape from theKeepInside must belong to theShapes also.
2655 # @param ListRemoveInside Shapes, inside which the results will be deleted.
2656 # Each shape from theRemoveInside must belong to theShapes also.
2657 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
2658 # @param ListMaterials Material indices for each shape. Make sence,
2659 # only if theRemoveWebs is TRUE.
2661 # @return New GEOM_Object, containing the result shapes.
2663 # @ref tui_partition "Example"
2664 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
2665 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
2666 KeepNonlimitShapes=0):
2667 # Example: see GEOM_TestAll.py
2668 if Limit == ShapeType["AUTO"]:
2669 # automatic detection of the most appropriate shape limit type
2671 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
2672 Limit = EnumToLong(lim)
2674 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
2675 ListKeepInside, ListRemoveInside,
2676 Limit, RemoveWebs, ListMaterials,
2677 KeepNonlimitShapes);
2678 RaiseIfFailed("MakePartition", self.BoolOp)
2681 ## Perform partition operation.
2682 # This method may be useful if it is needed to make a partition for
2683 # compound contains nonintersected shapes. Performance will be better
2684 # since intersection between shapes from compound is not performed.
2686 # Description of all parameters as in previous method MakePartition()
2688 # !!!NOTE: Passed compounds (via ListShapes or via ListTools)
2689 # have to consist of nonintersecting shapes.
2691 # @return New GEOM_Object, containing the result shapes.
2693 # @ref swig_todo "Example"
2694 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
2695 ListKeepInside=[], ListRemoveInside=[],
2696 Limit=ShapeType["AUTO"], RemoveWebs=0,
2697 ListMaterials=[], KeepNonlimitShapes=0):
2698 if Limit == ShapeType["AUTO"]:
2699 # automatic detection of the most appropriate shape limit type
2701 for s in ListShapes: lim = min( lim, s.GetMaxShapeType() )
2702 Limit = EnumToLong(lim)
2704 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
2705 ListKeepInside, ListRemoveInside,
2706 Limit, RemoveWebs, ListMaterials,
2707 KeepNonlimitShapes);
2708 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
2711 ## Shortcut to MakePartition()
2713 # @ref tui_partition "Example 1"
2714 # \n @ref swig_Partition "Example 2"
2715 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
2716 Limit=ShapeType["AUTO"], RemoveWebs=0, ListMaterials=[],
2717 KeepNonlimitShapes=0):
2718 # Example: see GEOM_TestOthers.py
2719 anObj = self.MakePartition(ListShapes, ListTools,
2720 ListKeepInside, ListRemoveInside,
2721 Limit, RemoveWebs, ListMaterials,
2722 KeepNonlimitShapes);
2725 ## Perform partition of the Shape with the Plane
2726 # @param theShape Shape to be intersected.
2727 # @param thePlane Tool shape, to intersect theShape.
2728 # @return New GEOM_Object, containing the result shape.
2730 # @ref tui_partition "Example"
2731 def MakeHalfPartition(self,theShape, thePlane):
2732 # Example: see GEOM_TestAll.py
2733 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
2734 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
2737 # end of l3_basic_op
2740 ## @addtogroup l3_transform
2743 ## Translate the given object along the vector, specified
2744 # by its end points, creating its copy before the translation.
2745 # @param theObject The object to be translated.
2746 # @param thePoint1 Start point of translation vector.
2747 # @param thePoint2 End point of translation vector.
2748 # @return New GEOM_Object, containing the translated object.
2750 # @ref tui_translation "Example 1"
2751 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
2752 def MakeTranslationTwoPoints(self,theObject, thePoint1, thePoint2):
2753 # Example: see GEOM_TestAll.py
2754 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
2755 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
2758 ## Translate the given object along the vector, specified by its components.
2759 # @param theObject The object to be translated.
2760 # @param theDX,theDY,theDZ Components of translation vector.
2761 # @return Translated GEOM_Object.
2763 # @ref tui_translation "Example"
2764 def TranslateDXDYDZ(self,theObject, theDX, theDY, theDZ):
2765 # Example: see GEOM_TestAll.py
2766 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
2767 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
2768 anObj.SetParameters(Parameters)
2769 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
2772 ## Translate the given object along the vector, specified
2773 # by its components, creating its copy before the translation.
2774 # @param theObject The object to be translated.
2775 # @param theDX,theDY,theDZ Components of translation vector.
2776 # @return New GEOM_Object, containing the translated object.
2778 # @ref tui_translation "Example"
2779 def MakeTranslation(self,theObject, theDX, theDY, theDZ):
2780 # Example: see GEOM_TestAll.py
2781 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
2782 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
2783 anObj.SetParameters(Parameters)
2784 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
2787 ## Translate the given object along the given vector,
2788 # creating its copy before the translation.
2789 # @param theObject The object to be translated.
2790 # @param theVector The translation vector.
2791 # @return New GEOM_Object, containing the translated object.
2793 # @ref tui_translation "Example"
2794 def MakeTranslationVector(self,theObject, theVector):
2795 # Example: see GEOM_TestAll.py
2796 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
2797 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
2800 ## Translate the given object along the given vector on given distance.
2801 # @param theObject The object to be translated.
2802 # @param theVector The translation vector.
2803 # @param theDistance The translation distance.
2804 # @param theCopy Flag used to translate object itself or create a copy.
2805 # @return Translated GEOM_Object.
2807 # @ref tui_translation "Example"
2808 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy):
2809 # Example: see GEOM_TestAll.py
2810 theDistance,Parameters = ParseParameters(theDistance)
2811 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
2812 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
2813 anObj.SetParameters(Parameters)
2816 ## Translate the given object along the given vector on given distance,
2817 # creating its copy before the translation.
2818 # @param theObject The object to be translated.
2819 # @param theVector The translation vector.
2820 # @param theDistance The translation distance.
2821 # @return New GEOM_Object, containing the translated object.
2823 # @ref tui_translation "Example"
2824 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance):
2825 # Example: see GEOM_TestAll.py
2826 theDistance,Parameters = ParseParameters(theDistance)
2827 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
2828 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
2829 anObj.SetParameters(Parameters)
2832 ## Rotate the given object around the given axis on the given angle.
2833 # @param theObject The object to be rotated.
2834 # @param theAxis Rotation axis.
2835 # @param theAngle Rotation angle in radians.
2836 # @return Rotated GEOM_Object.
2838 # @ref tui_rotation "Example"
2839 def Rotate(self,theObject, theAxis, theAngle):
2840 # Example: see GEOM_TestAll.py
2842 if isinstance(theAngle,str):
2844 theAngle, Parameters = ParseParameters(theAngle)
2846 theAngle = theAngle*math.pi/180.0
2847 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
2848 RaiseIfFailed("RotateCopy", self.TrsfOp)
2849 anObj.SetParameters(Parameters)
2852 ## Rotate the given object around the given axis
2853 # on the given angle, creating its copy before the rotatation.
2854 # @param theObject The object to be rotated.
2855 # @param theAxis Rotation axis.
2856 # @param theAngle Rotation angle in radians.
2857 # @return New GEOM_Object, containing the rotated object.
2859 # @ref tui_rotation "Example"
2860 def MakeRotation(self,theObject, theAxis, theAngle):
2861 # Example: see GEOM_TestAll.py
2863 if isinstance(theAngle,str):
2865 theAngle, Parameters = ParseParameters(theAngle)
2867 theAngle = theAngle*math.pi/180.0
2868 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
2869 RaiseIfFailed("RotateCopy", self.TrsfOp)
2870 anObj.SetParameters(Parameters)
2873 ## Rotate given object around vector perpendicular to plane
2874 # containing three points, creating its copy before the rotatation.
2875 # @param theObject The object to be rotated.
2876 # @param theCentPoint central point - the axis is the vector perpendicular to the plane
2877 # containing the three points.
2878 # @param thePoint1,thePoint2 - in a perpendicular plane of the axis.
2879 # @return New GEOM_Object, containing the rotated object.
2881 # @ref tui_rotation "Example"
2882 def MakeRotationThreePoints(self,theObject, theCentPoint, thePoint1, thePoint2):
2883 # Example: see GEOM_TestAll.py
2884 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
2885 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
2888 ## Scale the given object by the factor, creating its copy before the scaling.
2889 # @param theObject The object to be scaled.
2890 # @param thePoint Center point for scaling.
2891 # Passing None for it means scaling relatively the origin of global CS.
2892 # @param theFactor Scaling factor value.
2893 # @return New GEOM_Object, containing the scaled shape.
2895 # @ref tui_scale "Example"
2896 def MakeScaleTransform(self, theObject, thePoint, theFactor):
2897 # Example: see GEOM_TestAll.py
2898 theFactor, Parameters = ParseParameters(theFactor)
2899 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
2900 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
2901 anObj.SetParameters(Parameters)
2904 ## Scale the given object by different factors along coordinate axes,
2905 # creating its copy before the scaling.
2906 # @param theObject The object to be scaled.
2907 # @param thePoint Center point for scaling.
2908 # Passing None for it means scaling relatively the origin of global CS.
2909 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
2910 # @return New GEOM_Object, containing the scaled shape.
2912 # @ref swig_scale "Example"
2913 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ):
2914 # Example: see GEOM_TestAll.py
2915 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
2916 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
2917 theFactorX, theFactorY, theFactorZ)
2918 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
2919 anObj.SetParameters(Parameters)
2922 ## Create an object, symmetrical
2923 # to the given one relatively the given plane.
2924 # @param theObject The object to be mirrored.
2925 # @param thePlane Plane of symmetry.
2926 # @return New GEOM_Object, containing the mirrored shape.
2928 # @ref tui_mirror "Example"
2929 def MakeMirrorByPlane(self,theObject, thePlane):
2930 # Example: see GEOM_TestAll.py
2931 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
2932 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
2935 ## Create an object, symmetrical
2936 # to the given one relatively the given axis.
2937 # @param theObject The object to be mirrored.
2938 # @param theAxis Axis of symmetry.
2939 # @return New GEOM_Object, containing the mirrored shape.
2941 # @ref tui_mirror "Example"
2942 def MakeMirrorByAxis(self,theObject, theAxis):
2943 # Example: see GEOM_TestAll.py
2944 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
2945 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
2948 ## Create an object, symmetrical
2949 # to the given one relatively the given point.
2950 # @param theObject The object to be mirrored.
2951 # @param thePoint Point of symmetry.
2952 # @return New GEOM_Object, containing the mirrored shape.
2954 # @ref tui_mirror "Example"
2955 def MakeMirrorByPoint(self,theObject, thePoint):
2956 # Example: see GEOM_TestAll.py
2957 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
2958 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
2961 ## Modify the Location of the given object by LCS,
2962 # creating its copy before the setting.
2963 # @param theObject The object to be displaced.
2964 # @param theStartLCS Coordinate system to perform displacement from it.
2965 # If \a theStartLCS is NULL, displacement
2966 # will be performed from global CS.
2967 # If \a theObject itself is used as \a theStartLCS,
2968 # its location will be changed to \a theEndLCS.
2969 # @param theEndLCS Coordinate system to perform displacement to it.
2970 # @return New GEOM_Object, containing the displaced shape.
2972 # @ref tui_modify_location "Example"
2973 def MakePosition(self,theObject, theStartLCS, theEndLCS):
2974 # Example: see GEOM_TestAll.py
2975 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
2976 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
2979 ## Modify the Location of the given object by Path,
2980 # @param theObject The object to be displaced.
2981 # @param thePath Wire or Edge along that the object will be translated.
2982 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
2983 # @param theCopy is to create a copy objects if true.
2984 # @param theReverse - 0 for usual direction, 1 to reverse path direction.
2985 # @return New GEOM_Object, containing the displaced shape.
2987 # @ref tui_modify_location "Example"
2988 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
2989 # Example: see GEOM_TestAll.py
2990 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
2991 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
2994 ## Create new object as offset of the given one.
2995 # @param theObject The base object for the offset.
2996 # @param theOffset Offset value.
2997 # @return New GEOM_Object, containing the offset object.
2999 # @ref tui_offset "Example"
3000 def MakeOffset(self,theObject, theOffset):
3001 # Example: see GEOM_TestAll.py
3002 theOffset, Parameters = ParseParameters(theOffset)
3003 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
3004 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
3005 anObj.SetParameters(Parameters)
3008 # -----------------------------------------------------------------------------
3010 # -----------------------------------------------------------------------------
3012 ## Translate the given object along the given vector a given number times
3013 # @param theObject The object to be translated.
3014 # @param theVector Direction of the translation.
3015 # @param theStep Distance to translate on.
3016 # @param theNbTimes Quantity of translations to be done.
3017 # @return New GEOM_Object, containing compound of all
3018 # the shapes, obtained after each translation.
3020 # @ref tui_multi_translation "Example"
3021 def MakeMultiTranslation1D(self,theObject, theVector, theStep, theNbTimes):
3022 # Example: see GEOM_TestAll.py
3023 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
3024 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
3025 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
3026 anObj.SetParameters(Parameters)
3029 ## Conseqently apply two specified translations to theObject specified number of times.
3030 # @param theObject The object to be translated.
3031 # @param theVector1 Direction of the first translation.
3032 # @param theStep1 Step of the first translation.
3033 # @param theNbTimes1 Quantity of translations to be done along theVector1.
3034 # @param theVector2 Direction of the second translation.
3035 # @param theStep2 Step of the second translation.
3036 # @param theNbTimes2 Quantity of translations to be done along theVector2.
3037 # @return New GEOM_Object, containing compound of all
3038 # the shapes, obtained after each translation.
3040 # @ref tui_multi_translation "Example"
3041 def MakeMultiTranslation2D(self,theObject, theVector1, theStep1, theNbTimes1,
3042 theVector2, theStep2, theNbTimes2):
3043 # Example: see GEOM_TestAll.py
3044 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
3045 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
3046 theVector2, theStep2, theNbTimes2)
3047 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
3048 anObj.SetParameters(Parameters)
3051 ## Rotate the given object around the given axis a given number times.
3052 # Rotation angle will be 2*PI/theNbTimes.
3053 # @param theObject The object to be rotated.
3054 # @param theAxis The rotation axis.
3055 # @param theNbTimes Quantity of rotations to be done.
3056 # @return New GEOM_Object, containing compound of all the
3057 # shapes, obtained after each rotation.
3059 # @ref tui_multi_rotation "Example"
3060 def MultiRotate1D(self,theObject, theAxis, theNbTimes):
3061 # Example: see GEOM_TestAll.py
3062 theAxis, theNbTimes, Parameters = ParseParameters(theAxis, theNbTimes)
3063 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
3064 RaiseIfFailed("MultiRotate1D", self.TrsfOp)
3065 anObj.SetParameters(Parameters)
3068 ## Rotate the given object around the
3069 # given axis on the given angle a given number
3070 # times and multi-translate each rotation result.
3071 # Translation direction passes through center of gravity
3072 # of rotated shape and its projection on the rotation axis.
3073 # @param theObject The object to be rotated.
3074 # @param theAxis Rotation axis.
3075 # @param theAngle Rotation angle in graduces.
3076 # @param theNbTimes1 Quantity of rotations to be done.
3077 # @param theStep Translation distance.
3078 # @param theNbTimes2 Quantity of translations to be done.
3079 # @return New GEOM_Object, containing compound of all the
3080 # shapes, obtained after each transformation.
3082 # @ref tui_multi_rotation "Example"
3083 def MultiRotate2D(self,theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2):
3084 # Example: see GEOM_TestAll.py
3085 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
3086 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
3087 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
3088 anObj.SetParameters(Parameters)
3091 ## The same, as MultiRotate1D(), but axis is given by direction and point
3092 # @ref swig_MakeMultiRotation "Example"
3093 def MakeMultiRotation1D(self,aShape,aDir,aPoint,aNbTimes):
3094 # Example: see GEOM_TestOthers.py
3095 aVec = self.MakeLine(aPoint,aDir)
3096 anObj = self.MultiRotate1D(aShape,aVec,aNbTimes)
3099 ## The same, as MultiRotate2D(), but axis is given by direction and point
3100 # @ref swig_MakeMultiRotation "Example"
3101 def MakeMultiRotation2D(self,aShape,aDir,aPoint,anAngle,nbtimes1,aStep,nbtimes2):
3102 # Example: see GEOM_TestOthers.py
3103 aVec = self.MakeLine(aPoint,aDir)
3104 anObj = self.MultiRotate2D(aShape,aVec,anAngle,nbtimes1,aStep,nbtimes2)
3107 # end of l3_transform
3110 ## @addtogroup l3_local
3113 ## Perform a fillet on all edges of the given shape.
3114 # @param theShape Shape, to perform fillet on.
3115 # @param theR Fillet radius.
3116 # @return New GEOM_Object, containing the result shape.
3118 # @ref tui_fillet "Example 1"
3119 # \n @ref swig_MakeFilletAll "Example 2"
3120 def MakeFilletAll(self,theShape, theR):
3121 # Example: see GEOM_TestOthers.py
3122 theR,Parameters = ParseParameters(theR)
3123 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
3124 RaiseIfFailed("MakeFilletAll", self.LocalOp)
3125 anObj.SetParameters(Parameters)
3128 ## Perform a fillet on the specified edges/faces of the given shape
3129 # @param theShape Shape, to perform fillet on.
3130 # @param theR Fillet radius.
3131 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR>.
3132 # @param theListShapes Global indices of edges/faces to perform fillet on.
3133 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
3134 # @return New GEOM_Object, containing the result shape.
3136 # @ref tui_fillet "Example"
3137 def MakeFillet(self,theShape, theR, theShapeType, theListShapes):
3138 # Example: see GEOM_TestAll.py
3139 theR,Parameters = ParseParameters(theR)
3141 if theShapeType == ShapeType["EDGE"]:
3142 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
3143 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
3145 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
3146 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
3147 anObj.SetParameters(Parameters)
3150 ## The same that MakeFillet but with two Fillet Radius R1 and R2
3151 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes):
3152 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
3154 if theShapeType == ShapeType["EDGE"]:
3155 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
3156 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
3158 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
3159 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
3160 anObj.SetParameters(Parameters)
3163 ## Perform a fillet on the specified edges of the given shape
3164 # @param theShape - Wire Shape to perform fillet on.
3165 # @param theR - Fillet radius.
3166 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
3167 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
3168 # \note The list of vertices could be empty,
3169 # in this case fillet will done done at all vertices in wire
3170 # @return New GEOM_Object, containing the result shape.
3172 # @ref tui_fillet2d "Example"
3173 def MakeFillet1D(self,theShape, theR, theListOfVertexes):
3174 # Example: see GEOM_TestAll.py
3175 theR,Parameters = ParseParameters(theR)
3176 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes)
3177 RaiseIfFailed("MakeFillet1D", self.LocalOp)
3178 anObj.SetParameters(Parameters)
3181 ## Perform a fillet on the specified edges/faces of the given shape
3182 # @param theShape - Face Shape to perform fillet on.
3183 # @param theR - Fillet radius.
3184 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
3185 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
3186 # @return New GEOM_Object, containing the result shape.
3188 # @ref tui_fillet2d "Example"
3189 def MakeFillet2D(self,theShape, theR, theListOfVertexes):
3190 # Example: see GEOM_TestAll.py
3191 theR,Parameters = ParseParameters(theR)
3192 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
3193 RaiseIfFailed("MakeFillet2D", self.LocalOp)
3194 anObj.SetParameters(Parameters)
3197 ## Perform a symmetric chamfer on all edges of the given shape.
3198 # @param theShape Shape, to perform chamfer on.
3199 # @param theD Chamfer size along each face.
3200 # @return New GEOM_Object, containing the result shape.
3202 # @ref tui_chamfer "Example 1"
3203 # \n @ref swig_MakeChamferAll "Example 2"
3204 def MakeChamferAll(self,theShape, theD):
3205 # Example: see GEOM_TestOthers.py
3206 theD,Parameters = ParseParameters(theD)
3207 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
3208 RaiseIfFailed("MakeChamferAll", self.LocalOp)
3209 anObj.SetParameters(Parameters)
3212 ## Perform a chamfer on edges, common to the specified faces,
3213 # with distance D1 on the Face1
3214 # @param theShape Shape, to perform chamfer on.
3215 # @param theD1 Chamfer size along \a theFace1.
3216 # @param theD2 Chamfer size along \a theFace2.
3217 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
3218 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
3219 # @return New GEOM_Object, containing the result shape.
3221 # @ref tui_chamfer "Example"
3222 def MakeChamferEdge(self,theShape, theD1, theD2, theFace1, theFace2):
3223 # Example: see GEOM_TestAll.py
3224 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
3225 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
3226 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
3227 anObj.SetParameters(Parameters)
3230 ## The Same that MakeChamferEdge but with params theD is chamfer length and
3231 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
3232 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2):
3234 if isinstance(theAngle,str):
3236 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
3238 theAngle = theAngle*math.pi/180.0
3239 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
3240 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
3241 anObj.SetParameters(Parameters)
3244 ## Perform a chamfer on all edges of the specified faces,
3245 # with distance D1 on the first specified face (if several for one edge)
3246 # @param theShape Shape, to perform chamfer on.
3247 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
3248 # connected to the edge, are in \a theFaces, \a theD1
3249 # will be get along face, which is nearer to \a theFaces beginning.
3250 # @param theD2 Chamfer size along another of two faces, connected to the edge.
3251 # @param theFaces Sequence of global indices of faces of \a theShape.
3252 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
3253 # @return New GEOM_Object, containing the result shape.
3255 # @ref tui_chamfer "Example"
3256 def MakeChamferFaces(self,theShape, theD1, theD2, theFaces):
3257 # Example: see GEOM_TestAll.py
3258 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
3259 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
3260 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
3261 anObj.SetParameters(Parameters)
3264 ## The Same that MakeChamferFaces but with params theD is chamfer lenght and
3265 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
3267 # @ref swig_FilletChamfer "Example"
3268 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces):
3270 if isinstance(theAngle,str):
3272 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
3274 theAngle = theAngle*math.pi/180.0
3275 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
3276 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
3277 anObj.SetParameters(Parameters)
3280 ## Perform a chamfer on edges,
3281 # with distance D1 on the first specified face (if several for one edge)
3282 # @param theShape Shape, to perform chamfer on.
3283 # @param theD1,theD2 Chamfer size
3284 # @param theEdges Sequence of edges of \a theShape.
3285 # @return New GEOM_Object, containing the result shape.
3287 # @ref swig_FilletChamfer "Example"
3288 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges):
3289 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
3290 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
3291 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
3292 anObj.SetParameters(Parameters)
3295 ## The Same that MakeChamferEdges but with params theD is chamfer lenght and
3296 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
3297 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges):
3299 if isinstance(theAngle,str):
3301 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
3303 theAngle = theAngle*math.pi/180.0
3304 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
3305 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
3306 anObj.SetParameters(Parameters)
3309 ## Shortcut to MakeChamferEdge() and MakeChamferFaces()
3311 # @ref swig_MakeChamfer "Example"
3312 def MakeChamfer(self,aShape,d1,d2,aShapeType,ListShape):
3313 # Example: see GEOM_TestOthers.py
3315 if aShapeType == ShapeType["EDGE"]:
3316 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1])
3318 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape)
3324 ## @addtogroup l3_basic_op
3327 ## Perform an Archimde operation on the given shape with given parameters.
3328 # The object presenting the resulting face is returned.
3329 # @param theShape Shape to be put in water.
3330 # @param theWeight Weight og the shape.
3331 # @param theWaterDensity Density of the water.
3332 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
3333 # @return New GEOM_Object, containing a section of \a theShape
3334 # by a plane, corresponding to water level.
3336 # @ref tui_archimede "Example"
3337 def Archimede(self,theShape, theWeight, theWaterDensity, theMeshDeflection):
3338 # Example: see GEOM_TestAll.py
3339 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
3340 theWeight,theWaterDensity,theMeshDeflection)
3341 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
3342 RaiseIfFailed("MakeArchimede", self.LocalOp)
3343 anObj.SetParameters(Parameters)
3346 # end of l3_basic_op
3349 ## @addtogroup l2_measure
3352 ## Get point coordinates
3355 # @ref tui_measurement_tools_page "Example"
3356 def PointCoordinates(self,Point):
3357 # Example: see GEOM_TestMeasures.py
3358 aTuple = self.MeasuOp.PointCoordinates(Point)
3359 RaiseIfFailed("PointCoordinates", self.MeasuOp)
3362 ## Get summarized length of all wires,
3363 # area of surface and volume of the given shape.
3364 # @param theShape Shape to define properties of.
3365 # @return [theLength, theSurfArea, theVolume]
3366 # theLength: Summarized length of all wires of the given shape.
3367 # theSurfArea: Area of surface of the given shape.
3368 # theVolume: Volume of the given shape.
3370 # @ref tui_measurement_tools_page "Example"
3371 def BasicProperties(self,theShape):
3372 # Example: see GEOM_TestMeasures.py
3373 aTuple = self.MeasuOp.GetBasicProperties(theShape)
3374 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
3377 ## Get parameters of bounding box of the given shape
3378 # @param theShape Shape to obtain bounding box of.
3379 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
3380 # Xmin,Xmax: Limits of shape along OX axis.
3381 # Ymin,Ymax: Limits of shape along OY axis.
3382 # Zmin,Zmax: Limits of shape along OZ axis.
3384 # @ref tui_measurement_tools_page "Example"
3385 def BoundingBox(self,theShape):
3386 # Example: see GEOM_TestMeasures.py
3387 aTuple = self.MeasuOp.GetBoundingBox(theShape)
3388 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
3391 ## Get inertia matrix and moments of inertia of theShape.
3392 # @param theShape Shape to calculate inertia of.
3393 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
3394 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
3395 # Ix,Iy,Iz: Moments of inertia of the given shape.
3397 # @ref tui_measurement_tools_page "Example"
3398 def Inertia(self,theShape):
3399 # Example: see GEOM_TestMeasures.py
3400 aTuple = self.MeasuOp.GetInertia(theShape)
3401 RaiseIfFailed("GetInertia", self.MeasuOp)
3404 ## Get if coords are included in the shape (ST_IN or ST_ON)
3405 # @param theShape Shape
3406 # @param coords list of points coordinates [x1, y1, z1, x2, y2, z2, ...]
3407 # @param tolerance to be used (default is 1.0e-7)
3408 # @return list_of_boolean = [res1, res2, ...]
3409 def AreCoordsInside(self, theShape, coords, tolerance=1.e-7):
3410 return self.MeasuOp.AreCoordsInside(theShape, coords, tolerance)
3412 ## Get minimal distance between the given shapes.
3413 # @param theShape1,theShape2 Shapes to find minimal distance between.
3414 # @return Value of the minimal distance between the given shapes.
3416 # @ref tui_measurement_tools_page "Example"
3417 def MinDistance(self, theShape1, theShape2):
3418 # Example: see GEOM_TestMeasures.py
3419 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
3420 RaiseIfFailed("GetMinDistance", self.MeasuOp)
3423 ## Get minimal distance between the given shapes.
3424 # @param theShape1,theShape2 Shapes to find minimal distance between.
3425 # @return Value of the minimal distance between the given shapes.
3427 # @ref swig_all_measure "Example"
3428 def MinDistanceComponents(self, theShape1, theShape2):
3429 # Example: see GEOM_TestMeasures.py
3430 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
3431 RaiseIfFailed("GetMinDistance", self.MeasuOp)
3432 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
3435 ## Get angle between the given shapes in degrees.
3436 # @param theShape1,theShape2 Lines or linear edges to find angle between.
3437 # @return Value of the angle between the given shapes in degrees.
3439 # @ref tui_measurement_tools_page "Example"
3440 def GetAngle(self, theShape1, theShape2):
3441 # Example: see GEOM_TestMeasures.py
3442 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
3443 RaiseIfFailed("GetAngle", self.MeasuOp)
3445 ## Get angle between the given shapes in radians.
3446 # @param theShape1,theShape2 Lines or linear edges to find angle between.
3447 # @return Value of the angle between the given shapes in radians.
3449 # @ref tui_measurement_tools_page "Example"
3450 def GetAngleRadians(self, theShape1, theShape2):
3451 # Example: see GEOM_TestMeasures.py
3452 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
3453 RaiseIfFailed("GetAngle", self.MeasuOp)
3456 ## @name Curve Curvature Measurement
3457 # Methods for receiving radius of curvature of curves
3458 # in the given point
3461 ## Measure curvature of a curve at a point, set by parameter.
3462 # @ref swig_todo "Example"
3463 def CurveCurvatureByParam(self, theCurve, theParam):
3464 # Example: see GEOM_TestMeasures.py
3465 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
3466 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
3470 # @ref swig_todo "Example"
3471 def CurveCurvatureByPoint(self, theCurve, thePoint):
3472 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
3473 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
3477 ## @name Surface Curvature Measurement
3478 # Methods for receiving max and min radius of curvature of surfaces
3479 # in the given point
3483 ## @ref swig_todo "Example"
3484 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
3485 # Example: see GEOM_TestMeasures.py
3486 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
3487 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
3491 ## @ref swig_todo "Example"
3492 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
3493 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
3494 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
3498 ## @ref swig_todo "Example"
3499 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
3500 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
3501 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
3505 ## @ref swig_todo "Example"
3506 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
3507 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
3508 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
3512 ## Get min and max tolerances of sub-shapes of theShape
3513 # @param theShape Shape, to get tolerances of.
3514 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
3515 # FaceMin,FaceMax: Min and max tolerances of the faces.
3516 # EdgeMin,EdgeMax: Min and max tolerances of the edges.
3517 # VertMin,VertMax: Min and max tolerances of the vertices.
3519 # @ref tui_measurement_tools_page "Example"
3520 def Tolerance(self,theShape):
3521 # Example: see GEOM_TestMeasures.py
3522 aTuple = self.MeasuOp.GetTolerance(theShape)
3523 RaiseIfFailed("GetTolerance", self.MeasuOp)
3526 ## Obtain description of the given shape (number of sub-shapes of each type)
3527 # @param theShape Shape to be described.
3528 # @return Description of the given shape.
3530 # @ref tui_measurement_tools_page "Example"
3531 def WhatIs(self,theShape):
3532 # Example: see GEOM_TestMeasures.py
3533 aDescr = self.MeasuOp.WhatIs(theShape)
3534 RaiseIfFailed("WhatIs", self.MeasuOp)
3537 ## Obtain quantity of shapes of the given type in \a theShape.
3538 # If \a theShape is of type \a theType, it is also counted.
3539 # @param theShape Shape to be described.
3540 # @return Quantity of shapes of type \a theType in \a theShape.
3542 # @ref tui_measurement_tools_page "Example"
3543 def NbShapes (self, theShape, theType):
3544 # Example: see GEOM_TestMeasures.py
3545 listSh = self.SubShapeAllIDs(theShape, theType)
3547 t = EnumToLong(theShape.GetShapeType())
3548 theType = EnumToLong(theType)
3554 ## Obtain quantity of shapes of each type in \a theShape.
3555 # The \a theShape is also counted.
3556 # @param theShape Shape to be described.
3557 # @return Dictionary of shape types with bound quantities of shapes.
3559 # @ref tui_measurement_tools_page "Example"
3560 def ShapeInfo (self, theShape):
3561 # Example: see GEOM_TestMeasures.py
3563 for typeSh in ShapeType:
3564 if typeSh in ( "AUTO", "SHAPE" ): continue
3565 listSh = self.SubShapeAllIDs(theShape, ShapeType[typeSh])
3567 if EnumToLong(theShape.GetShapeType()) == ShapeType[typeSh]:
3574 ## Get a point, situated at the centre of mass of theShape.
3575 # @param theShape Shape to define centre of mass of.
3576 # @return New GEOM_Object, containing the created point.
3578 # @ref tui_measurement_tools_page "Example"
3579 def MakeCDG(self,theShape):
3580 # Example: see GEOM_TestMeasures.py
3581 anObj = self.MeasuOp.GetCentreOfMass(theShape)
3582 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
3585 ## Get a vertex subshape by index depended with orientation.
3586 # @param theShape Shape to find subshape.
3587 # @param theIndex Index to find vertex by this index.
3588 # @return New GEOM_Object, containing the created vertex.
3590 # @ref tui_measurement_tools_page "Example"
3591 def GetVertexByIndex(self,theShape, theIndex):
3592 # Example: see GEOM_TestMeasures.py
3593 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
3594 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
3597 ## Get the first vertex of wire/edge depended orientation.
3598 # @param theShape Shape to find first vertex.
3599 # @return New GEOM_Object, containing the created vertex.
3601 # @ref tui_measurement_tools_page "Example"
3602 def GetFirstVertex(self,theShape):
3603 # Example: see GEOM_TestMeasures.py
3604 anObj = self.GetVertexByIndex(theShape, 0)
3605 RaiseIfFailed("GetFirstVertex", self.MeasuOp)
3608 ## Get the last vertex of wire/edge depended orientation.
3609 # @param theShape Shape to find last vertex.
3610 # @return New GEOM_Object, containing the created vertex.
3612 # @ref tui_measurement_tools_page "Example"
3613 def GetLastVertex(self,theShape):
3614 # Example: see GEOM_TestMeasures.py
3615 nb_vert = self.ShapesOp.NumberOfSubShapes(theShape, ShapeType["VERTEX"])
3616 anObj = self.GetVertexByIndex(theShape, (nb_vert-1))
3617 RaiseIfFailed("GetLastVertex", self.MeasuOp)
3620 ## Get a normale to the given face. If the point is not given,
3621 # the normale is calculated at the center of mass.
3622 # @param theFace Face to define normale of.
3623 # @param theOptionalPoint Point to compute the normale at.
3624 # @return New GEOM_Object, containing the created vector.
3626 # @ref swig_todo "Example"
3627 def GetNormal(self, theFace, theOptionalPoint = None):
3628 # Example: see GEOM_TestMeasures.py
3629 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
3630 RaiseIfFailed("GetNormal", self.MeasuOp)
3633 ## Check a topology of the given shape.
3634 # @param theShape Shape to check validity of.
3635 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked,
3636 # if TRUE, the shape's geometry will be checked also.
3637 # @return TRUE, if the shape "seems to be valid".
3638 # If theShape is invalid, prints a description of problem.
3640 # @ref tui_measurement_tools_page "Example"
3641 def CheckShape(self,theShape, theIsCheckGeom = 0):
3642 # Example: see GEOM_TestMeasures.py
3644 (IsValid, Status) = self.MeasuOp.CheckShapeWithGeometry(theShape)
3645 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
3647 (IsValid, Status) = self.MeasuOp.CheckShape(theShape)
3648 RaiseIfFailed("CheckShape", self.MeasuOp)
3653 ## Get position (LCS) of theShape.
3655 # Origin of the LCS is situated at the shape's center of mass.
3656 # Axes of the LCS are obtained from shape's location or,
3657 # if the shape is a planar face, from position of its plane.
3659 # @param theShape Shape to calculate position of.
3660 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
3661 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
3662 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
3663 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
3665 # @ref swig_todo "Example"
3666 def GetPosition(self,theShape):
3667 # Example: see GEOM_TestMeasures.py
3668 aTuple = self.MeasuOp.GetPosition(theShape)
3669 RaiseIfFailed("GetPosition", self.MeasuOp)
3672 ## Get kind of theShape.
3674 # @param theShape Shape to get a kind of.
3675 # @return Returns a kind of shape in terms of <VAR>GEOM_IKindOfShape.shape_kind</VAR> enumeration
3676 # and a list of parameters, describing the shape.
3677 # @note Concrete meaning of each value, returned via \a theIntegers
3678 # or \a theDoubles list depends on the kind of the shape.
3679 # The full list of possible outputs is:
3681 # - geompy.kind.COMPOUND nb_solids nb_faces nb_edges nb_vertices
3682 # - geompy.kind.COMPSOLID nb_solids nb_faces nb_edges nb_vertices
3684 # - geompy.kind.SHELL geompy.info.CLOSED nb_faces nb_edges nb_vertices
3685 # - geompy.kind.SHELL geompy.info.UNCLOSED nb_faces nb_edges nb_vertices
3687 # - geompy.kind.WIRE geompy.info.CLOSED nb_edges nb_vertices
3688 # - geompy.kind.WIRE geompy.info.UNCLOSED nb_edges nb_vertices
3690 # - geompy.kind.SPHERE xc yc zc R
3691 # - geompy.kind.CYLINDER xb yb zb dx dy dz R H
3692 # - geompy.kind.BOX xc yc zc ax ay az
3693 # - geompy.kind.ROTATED_BOX xc yc zc zx zy zz xx xy xz ax ay az
3694 # - geompy.kind.TORUS xc yc zc dx dy dz R_1 R_2
3695 # - geompy.kind.CONE xb yb zb dx dy dz R_1 R_2 H
3696 # - geompy.kind.POLYHEDRON nb_faces nb_edges nb_vertices
3697 # - geompy.kind.SOLID nb_faces nb_edges nb_vertices
3699 # - geompy.kind.SPHERE2D xc yc zc R
3700 # - geompy.kind.CYLINDER2D xb yb zb dx dy dz R H
3701 # - geompy.kind.TORUS2D xc yc zc dx dy dz R_1 R_2
3702 # - geompy.kind.CONE2D xc yc zc dx dy dz R_1 R_2 H
3703 # - geompy.kind.DISK_CIRCLE xc yc zc dx dy dz R
3704 # - geompy.kind.DISK_ELLIPSE xc yc zc dx dy dz R_1 R_2
3705 # - geompy.kind.POLYGON xo yo zo dx dy dz nb_edges nb_vertices
3706 # - geompy.kind.PLANE xo yo zo dx dy dz
3707 # - geompy.kind.PLANAR xo yo zo dx dy dz nb_edges nb_vertices
3708 # - geompy.kind.FACE nb_edges nb_vertices
3710 # - geompy.kind.CIRCLE xc yc zc dx dy dz R
3711 # - geompy.kind.ARC_CIRCLE xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2
3712 # - geompy.kind.ELLIPSE xc yc zc dx dy dz R_1 R_2
3713 # - geompy.kind.ARC_ELLIPSE xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2
3714 # - geompy.kind.LINE xo yo zo dx dy dz
3715 # - geompy.kind.SEGMENT x1 y1 z1 x2 y2 z2
3716 # - geompy.kind.EDGE nb_vertices
3718 # - geompy.kind.VERTEX x y z
3720 # @ref swig_todo "Example"
3721 def KindOfShape(self,theShape):
3722 # Example: see GEOM_TestMeasures.py
3723 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
3724 RaiseIfFailed("KindOfShape", self.MeasuOp)
3726 aKind = aRoughTuple[0]
3727 anInts = aRoughTuple[1]
3728 aDbls = aRoughTuple[2]
3730 # Now there is no exception from this rule:
3731 aKindTuple = [aKind] + aDbls + anInts
3733 # If they are we will regroup parameters for such kind of shape.
3735 #if aKind == kind.SOME_KIND:
3736 # # SOME_KIND int int double int double double
3737 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
3744 ## @addtogroup l2_import_export
3747 ## Import a shape from the BREP or IGES or STEP file
3748 # (depends on given format) with given name.
3749 # @param theFileName The file, containing the shape.
3750 # @param theFormatName Specify format for the file reading.
3751 # Available formats can be obtained with InsertOp.ImportTranslators() method.
3752 # If format 'IGES_SCALE' is used instead 'IGES' length unit will be
3753 # set to 'meter' and result model will be scaled.
3754 # @return New GEOM_Object, containing the imported shape.
3756 # @ref swig_Import_Export "Example"
3757 def ImportFile(self,theFileName, theFormatName):
3758 # Example: see GEOM_TestOthers.py
3759 anObj = self.InsertOp.ImportFile(theFileName, theFormatName)
3760 RaiseIfFailed("Import", self.InsertOp)
3763 ## Deprecated analog of ImportFile
3764 def Import(self,theFileName, theFormatName):
3765 print "WARNING: Function Import is deprecated, use ImportFile instead"
3766 anObj = self.InsertOp.ImportFile(theFileName, theFormatName)
3767 RaiseIfFailed("Import", self.InsertOp)
3770 ## Shortcut to ImportFile() for BREP format
3772 # @ref swig_Import_Export "Example"
3773 def ImportBREP(self,theFileName):
3774 # Example: see GEOM_TestOthers.py
3775 return self.ImportFile(theFileName, "BREP")
3777 ## Shortcut to ImportFile() for IGES format
3779 # @ref swig_Import_Export "Example"
3780 def ImportIGES(self,theFileName):
3781 # Example: see GEOM_TestOthers.py
3782 return self.ImportFile(theFileName, "IGES")
3784 ## Return length unit from given IGES file
3786 # @ref swig_Import_Export "Example"
3787 def GetIGESUnit(self,theFileName):
3788 # Example: see GEOM_TestOthers.py
3789 anObj = self.InsertOp.ImportFile(theFileName, "IGES_UNIT")
3790 #RaiseIfFailed("Import", self.InsertOp)
3791 # recieve name using returned vertex
3793 if anObj.GetShapeType() == GEOM.VERTEX:
3796 vertices = self.SubShapeAll(anObj,ShapeType["VERTEX"])
3798 p = self.PointCoordinates(vertices[0])
3799 if abs(p[0]-0.01) < 1.e-6:
3801 elif abs(p[0]-0.001) < 1.e-6:
3805 ## Shortcut to ImportFile() for STEP format
3807 # @ref swig_Import_Export "Example"
3808 def ImportSTEP(self,theFileName):
3809 # Example: see GEOM_TestOthers.py
3810 return self.ImportFile(theFileName, "STEP")
3812 ## Export the given shape into a file with given name.
3813 # @param theObject Shape to be stored in the file.
3814 # @param theFileName Name of the file to store the given shape in.
3815 # @param theFormatName Specify format for the shape storage.
3816 # Available formats can be obtained with InsertOp.ImportTranslators() method.
3818 # @ref swig_Import_Export "Example"
3819 def Export(self,theObject, theFileName, theFormatName):
3820 # Example: see GEOM_TestOthers.py
3821 self.InsertOp.Export(theObject, theFileName, theFormatName)
3822 if self.InsertOp.IsDone() == 0:
3823 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
3827 ## Shortcut to Export() for BREP format
3829 # @ref swig_Import_Export "Example"
3830 def ExportBREP(self,theObject, theFileName):
3831 # Example: see GEOM_TestOthers.py
3832 return self.Export(theObject, theFileName, "BREP")
3834 ## Shortcut to Export() for IGES format
3836 # @ref swig_Import_Export "Example"
3837 def ExportIGES(self,theObject, theFileName):
3838 # Example: see GEOM_TestOthers.py
3839 return self.Export(theObject, theFileName, "IGES")
3841 ## Shortcut to Export() for STEP format
3843 # @ref swig_Import_Export "Example"
3844 def ExportSTEP(self,theObject, theFileName):
3845 # Example: see GEOM_TestOthers.py
3846 return self.Export(theObject, theFileName, "STEP")
3848 # end of l2_import_export
3851 ## @addtogroup l3_blocks
3854 ## Create a quadrangle face from four edges. Order of Edges is not
3855 # important. It is not necessary that edges share the same vertex.
3856 # @param E1,E2,E3,E4 Edges for the face bound.
3857 # @return New GEOM_Object, containing the created face.
3859 # @ref tui_building_by_blocks_page "Example"
3860 def MakeQuad(self,E1, E2, E3, E4):
3861 # Example: see GEOM_Spanner.py
3862 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
3863 RaiseIfFailed("MakeQuad", self.BlocksOp)
3866 ## Create a quadrangle face on two edges.
3867 # The missing edges will be built by creating the shortest ones.
3868 # @param E1,E2 Two opposite edges for the face.
3869 # @return New GEOM_Object, containing the created face.
3871 # @ref tui_building_by_blocks_page "Example"
3872 def MakeQuad2Edges(self,E1, E2):
3873 # Example: see GEOM_Spanner.py
3874 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
3875 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
3878 ## Create a quadrangle face with specified corners.
3879 # The missing edges will be built by creating the shortest ones.
3880 # @param V1,V2,V3,V4 Corner vertices for the face.
3881 # @return New GEOM_Object, containing the created face.
3883 # @ref tui_building_by_blocks_page "Example 1"
3884 # \n @ref swig_MakeQuad4Vertices "Example 2"
3885 def MakeQuad4Vertices(self,V1, V2, V3, V4):
3886 # Example: see GEOM_Spanner.py
3887 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
3888 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
3891 ## Create a hexahedral solid, bounded by the six given faces. Order of
3892 # faces is not important. It is not necessary that Faces share the same edge.
3893 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
3894 # @return New GEOM_Object, containing the created solid.
3896 # @ref tui_building_by_blocks_page "Example 1"
3897 # \n @ref swig_MakeHexa "Example 2"
3898 def MakeHexa(self,F1, F2, F3, F4, F5, F6):
3899 # Example: see GEOM_Spanner.py
3900 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
3901 RaiseIfFailed("MakeHexa", self.BlocksOp)
3904 ## Create a hexahedral solid between two given faces.
3905 # The missing faces will be built by creating the smallest ones.
3906 # @param F1,F2 Two opposite faces for the hexahedral solid.
3907 # @return New GEOM_Object, containing the created solid.
3909 # @ref tui_building_by_blocks_page "Example 1"
3910 # \n @ref swig_MakeHexa2Faces "Example 2"
3911 def MakeHexa2Faces(self,F1, F2):
3912 # Example: see GEOM_Spanner.py
3913 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
3914 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
3920 ## @addtogroup l3_blocks_op
3923 ## Get a vertex, found in the given shape by its coordinates.
3924 # @param theShape Block or a compound of blocks.
3925 # @param theX,theY,theZ Coordinates of the sought vertex.
3926 # @param theEpsilon Maximum allowed distance between the resulting
3927 # vertex and point with the given coordinates.
3928 # @return New GEOM_Object, containing the found vertex.
3930 # @ref swig_GetPoint "Example"
3931 def GetPoint(self, theShape, theX, theY, theZ, theEpsilon):
3932 # Example: see GEOM_TestOthers.py
3933 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
3934 RaiseIfFailed("GetPoint", self.BlocksOp)
3937 ## Find a vertex of the given shape, which has minimal distance to the given point.
3938 # @param theShape Any shape.
3939 # @param thePoint Point, close to the desired vertex.
3940 # @return New GEOM_Object, containing the found vertex.
3942 # @ref swig_GetVertexNearPoint "Example"
3943 def GetVertexNearPoint(self, theShape, thePoint):
3944 # Example: see GEOM_TestOthers.py
3945 anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
3946 RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
3949 ## Get an edge, found in the given shape by two given vertices.
3950 # @param theShape Block or a compound of blocks.
3951 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
3952 # @return New GEOM_Object, containing the found edge.
3954 # @ref swig_GetEdge "Example"
3955 def GetEdge(self, theShape, thePoint1, thePoint2):
3956 # Example: see GEOM_Spanner.py
3957 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
3958 RaiseIfFailed("GetEdge", self.BlocksOp)
3961 ## Find an edge of the given shape, which has minimal distance to the given point.
3962 # @param theShape Block or a compound of blocks.
3963 # @param thePoint Point, close to the desired edge.
3964 # @return New GEOM_Object, containing the found edge.
3966 # @ref swig_GetEdgeNearPoint "Example"
3967 def GetEdgeNearPoint(self, theShape, thePoint):
3968 # Example: see GEOM_TestOthers.py
3969 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
3970 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
3973 ## Returns a face, found in the given shape by four given corner vertices.
3974 # @param theShape Block or a compound of blocks.
3975 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
3976 # @return New GEOM_Object, containing the found face.
3978 # @ref swig_todo "Example"
3979 def GetFaceByPoints(self,theShape, thePoint1, thePoint2, thePoint3, thePoint4):
3980 # Example: see GEOM_Spanner.py
3981 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
3982 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
3985 ## Get a face of block, found in the given shape by two given edges.
3986 # @param theShape Block or a compound of blocks.
3987 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
3988 # @return New GEOM_Object, containing the found face.
3990 # @ref swig_todo "Example"
3991 def GetFaceByEdges(self,theShape, theEdge1, theEdge2):
3992 # Example: see GEOM_Spanner.py
3993 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
3994 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
3997 ## Find a face, opposite to the given one in the given block.
3998 # @param theBlock Must be a hexahedral solid.
3999 # @param theFace Face of \a theBlock, opposite to the desired face.
4000 # @return New GEOM_Object, containing the found face.
4002 # @ref swig_GetOppositeFace "Example"
4003 def GetOppositeFace(self,theBlock, theFace):
4004 # Example: see GEOM_Spanner.py
4005 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
4006 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
4009 ## Find a face of the given shape, which has minimal distance to the given point.
4010 # @param theShape Block or a compound of blocks.
4011 # @param thePoint Point, close to the desired face.
4012 # @return New GEOM_Object, containing the found face.
4014 # @ref swig_GetFaceNearPoint "Example"
4015 def GetFaceNearPoint(self, theShape, thePoint):
4016 # Example: see GEOM_Spanner.py
4017 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
4018 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
4021 ## Find a face of block, whose outside normale has minimal angle with the given vector.
4022 # @param theBlock Block or a compound of blocks.
4023 # @param theVector Vector, close to the normale of the desired face.
4024 # @return New GEOM_Object, containing the found face.
4026 # @ref swig_todo "Example"
4027 def GetFaceByNormale(self, theBlock, theVector):
4028 # Example: see GEOM_Spanner.py
4029 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
4030 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
4033 ## Find all subshapes of type \a theShapeType of the given shape,
4034 # which have minimal distance to the given point.
4035 # @param theShape Any shape.
4036 # @param thePoint Point, close to the desired shape.
4037 # @param theShapeType Defines what kind of subshapes is searched.
4038 # @param theTolerance The tolerance for distances comparison. All shapes
4039 # with distances to the given point in interval
4040 # [minimal_distance, minimal_distance + theTolerance] will be gathered.
4041 # @return New GEOM_Object, containing a group of all found shapes.
4043 # @ref swig_GetShapesNearPoint "Example"
4044 def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07):
4045 # Example: see GEOM_TestOthers.py
4046 anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
4047 RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
4050 # end of l3_blocks_op
4053 ## @addtogroup l4_blocks_measure
4056 ## Check, if the compound of blocks is given.
4057 # To be considered as a compound of blocks, the
4058 # given shape must satisfy the following conditions:
4059 # - Each element of the compound should be a Block (6 faces and 12 edges).
4060 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
4061 # - The compound should be connexe.
4062 # - The glue between two quadrangle faces should be applied.
4063 # @param theCompound The compound to check.
4064 # @return TRUE, if the given shape is a compound of blocks.
4065 # If theCompound is not valid, prints all discovered errors.
4067 # @ref tui_measurement_tools_page "Example 1"
4068 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
4069 def CheckCompoundOfBlocks(self,theCompound):
4070 # Example: see GEOM_Spanner.py
4071 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
4072 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
4074 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
4078 ## Remove all seam and degenerated edges from \a theShape.
4079 # Unite faces and edges, sharing one surface. It means that
4080 # this faces must have references to one C++ surface object (handle).
4081 # @param theShape The compound or single solid to remove irregular edges from.
4082 # @param doUnionFaces If True, then unite faces. If False (the default value),
4083 # do not unite faces.
4084 # @return Improved shape.
4086 # @ref swig_RemoveExtraEdges "Example"
4087 def RemoveExtraEdges(self, theShape, doUnionFaces=False):
4088 # Example: see GEOM_TestOthers.py
4089 nbFacesOptimum = -1 # -1 means do not unite faces
4090 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
4091 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
4092 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
4095 ## Check, if the given shape is a blocks compound.
4096 # Fix all detected errors.
4097 # \note Single block can be also fixed by this method.
4098 # @param theShape The compound to check and improve.
4099 # @return Improved compound.
4101 # @ref swig_CheckAndImprove "Example"
4102 def CheckAndImprove(self,theShape):
4103 # Example: see GEOM_TestOthers.py
4104 anObj = self.BlocksOp.CheckAndImprove(theShape)
4105 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
4108 # end of l4_blocks_measure
4111 ## @addtogroup l3_blocks_op
4114 ## Get all the blocks, contained in the given compound.
4115 # @param theCompound The compound to explode.
4116 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
4117 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
4118 # \note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
4119 # @return List of GEOM_Objects, containing the retrieved blocks.
4121 # @ref tui_explode_on_blocks "Example 1"
4122 # \n @ref swig_MakeBlockExplode "Example 2"
4123 def MakeBlockExplode(self,theCompound, theMinNbFaces, theMaxNbFaces):
4124 # Example: see GEOM_TestOthers.py
4125 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
4126 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
4127 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
4129 anObj.SetParameters(Parameters)
4133 ## Find block, containing the given point inside its volume or on boundary.
4134 # @param theCompound Compound, to find block in.
4135 # @param thePoint Point, close to the desired block. If the point lays on
4136 # boundary between some blocks, we return block with nearest center.
4137 # @return New GEOM_Object, containing the found block.
4139 # @ref swig_todo "Example"
4140 def GetBlockNearPoint(self,theCompound, thePoint):
4141 # Example: see GEOM_Spanner.py
4142 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
4143 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
4146 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
4147 # @param theCompound Compound, to find block in.
4148 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
4149 # @return New GEOM_Object, containing the found block.
4151 # @ref swig_GetBlockByParts "Example"
4152 def GetBlockByParts(self,theCompound, theParts):
4153 # Example: see GEOM_TestOthers.py
4154 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
4155 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
4158 ## Return all blocks, containing all the elements, passed as the parts.
4159 # @param theCompound Compound, to find blocks in.
4160 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
4161 # @return List of GEOM_Objects, containing the found blocks.
4163 # @ref swig_todo "Example"
4164 def GetBlocksByParts(self,theCompound, theParts):
4165 # Example: see GEOM_Spanner.py
4166 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
4167 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
4170 ## Multi-transformate block and glue the result.
4171 # Transformation is defined so, as to superpose direction faces.
4172 # @param Block Hexahedral solid to be multi-transformed.
4173 # @param DirFace1 ID of First direction face.
4174 # @param DirFace2 ID of Second direction face.
4175 # @param NbTimes Quantity of transformations to be done.
4176 # \note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
4177 # @return New GEOM_Object, containing the result shape.
4179 # @ref tui_multi_transformation "Example"
4180 def MakeMultiTransformation1D(self,Block, DirFace1, DirFace2, NbTimes):
4181 # Example: see GEOM_Spanner.py
4182 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
4183 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
4184 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
4185 anObj.SetParameters(Parameters)
4188 ## Multi-transformate block and glue the result.
4189 # @param Block Hexahedral solid to be multi-transformed.
4190 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
4191 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
4192 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
4193 # @return New GEOM_Object, containing the result shape.
4195 # @ref tui_multi_transformation "Example"
4196 def MakeMultiTransformation2D(self,Block, DirFace1U, DirFace2U, NbTimesU,
4197 DirFace1V, DirFace2V, NbTimesV):
4198 # Example: see GEOM_Spanner.py
4199 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
4200 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
4201 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
4202 DirFace1V, DirFace2V, NbTimesV)
4203 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
4204 anObj.SetParameters(Parameters)
4207 ## Build all possible propagation groups.
4208 # Propagation group is a set of all edges, opposite to one (main)
4209 # edge of this group directly or through other opposite edges.
4210 # Notion of Opposite Edge make sence only on quadrangle face.
4211 # @param theShape Shape to build propagation groups on.
4212 # @return List of GEOM_Objects, each of them is a propagation group.
4214 # @ref swig_Propagate "Example"
4215 def Propagate(self,theShape):
4216 # Example: see GEOM_TestOthers.py
4217 listChains = self.BlocksOp.Propagate(theShape)
4218 RaiseIfFailed("Propagate", self.BlocksOp)
4221 # end of l3_blocks_op
4224 ## @addtogroup l3_groups
4227 ## Creates a new group which will store sub shapes of theMainShape
4228 # @param theMainShape is a GEOM object on which the group is selected
4229 # @param theShapeType defines a shape type of the group
4230 # @return a newly created GEOM group
4232 # @ref tui_working_with_groups_page "Example 1"
4233 # \n @ref swig_CreateGroup "Example 2"
4234 def CreateGroup(self,theMainShape, theShapeType):
4235 # Example: see GEOM_TestOthers.py
4236 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
4237 RaiseIfFailed("CreateGroup", self.GroupOp)
4240 ## Adds a sub object with ID theSubShapeId to the group
4241 # @param theGroup is a GEOM group to which the new sub shape is added
4242 # @param theSubShapeID is a sub shape ID in the main object.
4243 # \note Use method GetSubShapeID() to get an unique ID of the sub shape
4245 # @ref tui_working_with_groups_page "Example"
4246 def AddObject(self,theGroup, theSubShapeID):
4247 # Example: see GEOM_TestOthers.py
4248 self.GroupOp.AddObject(theGroup, theSubShapeID)
4249 if self.GroupOp.GetErrorCode() != "PAL_ELEMENT_ALREADY_PRESENT":
4250 RaiseIfFailed("AddObject", self.GroupOp)
4254 ## Removes a sub object with ID \a theSubShapeId from the group
4255 # @param theGroup is a GEOM group from which the new sub shape is removed
4256 # @param theSubShapeID is a sub shape ID in the main object.
4257 # \note Use method GetSubShapeID() to get an unique ID of the sub shape
4259 # @ref tui_working_with_groups_page "Example"
4260 def RemoveObject(self,theGroup, theSubShapeID):
4261 # Example: see GEOM_TestOthers.py
4262 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
4263 RaiseIfFailed("RemoveObject", self.GroupOp)
4266 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
4267 # @param theGroup is a GEOM group to which the new sub shapes are added.
4268 # @param theSubShapes is a list of sub shapes to be added.
4270 # @ref tui_working_with_groups_page "Example"
4271 def UnionList (self,theGroup, theSubShapes):
4272 # Example: see GEOM_TestOthers.py
4273 self.GroupOp.UnionList(theGroup, theSubShapes)
4274 RaiseIfFailed("UnionList", self.GroupOp)
4277 ## Works like the above method, but argument
4278 # theSubShapes here is a list of sub-shapes indices
4280 # @ref swig_UnionIDs "Example"
4281 def UnionIDs(self,theGroup, theSubShapes):
4282 # Example: see GEOM_TestOthers.py
4283 self.GroupOp.UnionIDs(theGroup, theSubShapes)
4284 RaiseIfFailed("UnionIDs", self.GroupOp)
4287 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
4288 # @param theGroup is a GEOM group from which the sub-shapes are removed.
4289 # @param theSubShapes is a list of sub-shapes to be removed.
4291 # @ref tui_working_with_groups_page "Example"
4292 def DifferenceList (self,theGroup, theSubShapes):
4293 # Example: see GEOM_TestOthers.py
4294 self.GroupOp.DifferenceList(theGroup, theSubShapes)
4295 RaiseIfFailed("DifferenceList", self.GroupOp)
4298 ## Works like the above method, but argument
4299 # theSubShapes here is a list of sub-shapes indices
4301 # @ref swig_DifferenceIDs "Example"
4302 def DifferenceIDs(self,theGroup, theSubShapes):
4303 # Example: see GEOM_TestOthers.py
4304 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
4305 RaiseIfFailed("DifferenceIDs", self.GroupOp)
4308 ## Returns a list of sub objects ID stored in the group
4309 # @param theGroup is a GEOM group for which a list of IDs is requested
4311 # @ref swig_GetObjectIDs "Example"
4312 def GetObjectIDs(self,theGroup):
4313 # Example: see GEOM_TestOthers.py
4314 ListIDs = self.GroupOp.GetObjects(theGroup)
4315 RaiseIfFailed("GetObjects", self.GroupOp)
4318 ## Returns a type of sub objects stored in the group
4319 # @param theGroup is a GEOM group which type is returned.
4321 # @ref swig_GetType "Example"
4322 def GetType(self,theGroup):
4323 # Example: see GEOM_TestOthers.py
4324 aType = self.GroupOp.GetType(theGroup)
4325 RaiseIfFailed("GetType", self.GroupOp)
4328 ## Convert a type of geom object from id to string value
4329 # @param theId is a GEOM obect type id.
4331 # @ref swig_GetType "Example"
4332 def ShapeIdToType(self, theId):
4406 return "FREE_BOUNDS"
4414 return "THRUSECTIONS"
4416 return "COMPOUNDFILTER"
4418 return "SHAPES_ON_SHAPE"
4420 return "ELLIPSE_ARC"
4427 return "Shape Id not exist."
4429 ## Returns a main shape associated with the group
4430 # @param theGroup is a GEOM group for which a main shape object is requested
4431 # @return a GEOM object which is a main shape for theGroup
4433 # @ref swig_GetMainShape "Example"
4434 def GetMainShape(self,theGroup):
4435 # Example: see GEOM_TestOthers.py
4436 anObj = self.GroupOp.GetMainShape(theGroup)
4437 RaiseIfFailed("GetMainShape", self.GroupOp)
4440 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
4441 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
4443 # @ref swig_todo "Example"
4444 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1):
4445 edges = self.SubShapeAll(theShape, ShapeType["EDGE"])
4448 Props = self.BasicProperties(edge)
4449 if min_length <= Props[0] and Props[0] <= max_length:
4450 if (not include_min) and (min_length == Props[0]):
4453 if (not include_max) and (Props[0] == max_length):
4456 edges_in_range.append(edge)
4458 if len(edges_in_range) <= 0:
4459 print "No edges found by given criteria"
4462 group_edges = self.CreateGroup(theShape, ShapeType["EDGE"])
4463 self.UnionList(group_edges, edges_in_range)
4467 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
4468 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
4470 # @ref swig_todo "Example"
4471 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
4472 nb_selected = sg.SelectedCount()
4474 print "Select a shape before calling this function, please."
4477 print "Only one shape must be selected"
4480 id_shape = sg.getSelected(0)
4481 shape = IDToObject( id_shape )
4483 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
4487 if include_min: left_str = " <= "
4488 if include_max: right_str = " <= "
4490 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
4491 + left_str + "length" + right_str + `max_length`)
4493 sg.updateObjBrowser(1)
4500 ## @addtogroup l4_advanced
4503 ## Create a T-shape object with specified caracteristics for the main
4504 # and the incident pipes (radius, width, half-length).
4505 # The extremities of the main pipe are located on junctions points P1 and P2.
4506 # The extremity of the incident pipe is located on junction point P3.
4507 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
4508 # the main plane of the T-shape is XOY.
4509 # @param theR1 Internal radius of main pipe
4510 # @param theW1 Width of main pipe
4511 # @param theL1 Half-length of main pipe
4512 # @param theR2 Internal radius of incident pipe (R2 < R1)
4513 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
4514 # @param theL2 Half-length of incident pipe
4515 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
4516 # @param theP1 1st junction point of main pipe
4517 # @param theP2 2nd junction point of main pipe
4518 # @param theP3 Junction point of incident pipe
4519 # @return List of GEOM_Objects, containing the created shape and propagation groups.
4521 # @ref tui_creation_pipetshape "Example"
4522 def MakePipeTShape(self, theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh=True, theP1=None, theP2=None, theP3=None):
4523 theR1, theW1, theL1, theR2, theW2, theL2, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2)
4524 if (theP1 and theP2 and theP3):
4525 anObj = self.AdvOp.MakePipeTShapeWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh, theP1, theP2, theP3)
4527 anObj = self.AdvOp.MakePipeTShape(theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh)
4528 RaiseIfFailed("MakePipeTShape", self.AdvOp)
4529 if Parameters: anObj[0].SetParameters(Parameters)
4532 ## Create a T-shape object with chamfer and with specified caracteristics for the main
4533 # and the incident pipes (radius, width, half-length). The chamfer is
4534 # created on the junction of the pipes.
4535 # The extremities of the main pipe are located on junctions points P1 and P2.
4536 # The extremity of the incident pipe is located on junction point P3.
4537 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
4538 # the main plane of the T-shape is XOY.
4539 # @param theR1 Internal radius of main pipe
4540 # @param theW1 Width of main pipe
4541 # @param theL1 Half-length of main pipe
4542 # @param theR2 Internal radius of incident pipe (R2 < R1)
4543 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
4544 # @param theL2 Half-length of incident pipe
4545 # @param theH Height of the chamfer.
4546 # @param theW Width of the chamfer.
4547 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
4548 # @param theP1 1st junction point of main pipe
4549 # @param theP2 2nd junction point of main pipe
4550 # @param theP3 Junction point of incident pipe
4551 # @return List of GEOM_Objects, containing the created shape and propagation groups.
4553 # @ref tui_creation_pipetshape "Example"
4554 def MakePipeTShapeChamfer(self, theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh=True, theP1=None, theP2=None, theP3=None):
4555 theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW)
4556 if (theP1 and theP2 and theP3):
4557 anObj = self.AdvOp.MakePipeTShapeChamferWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh, theP1, theP2, theP3)
4559 anObj = self.AdvOp.MakePipeTShapeChamfer(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh)
4560 RaiseIfFailed("MakePipeTShapeChamfer", self.AdvOp)
4561 if Parameters: anObj[0].SetParameters(Parameters)
4564 ## Create a T-shape object with fillet and with specified caracteristics for the main
4565 # and the incident pipes (radius, width, half-length). The fillet is
4566 # created on the junction of the pipes.
4567 # The extremities of the main pipe are located on junctions points P1 and P2.
4568 # The extremity of the incident pipe is located on junction point P3.
4569 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
4570 # the main plane of the T-shape is XOY.
4571 # @param theR1 Internal radius of main pipe
4572 # @param theW1 Width of main pipe
4573 # @param theL1 Half-length of main pipe
4574 # @param theR2 Internal radius of incident pipe (R2 < R1)
4575 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
4576 # @param theL2 Half-length of incident pipe
4577 # @param theRF Radius of curvature of fillet.
4578 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
4579 # @param theP1 1st junction point of main pipe
4580 # @param theP2 2nd junction point of main pipe
4581 # @param theP3 Junction point of incident pipe
4582 # @return List of GEOM_Objects, containing the created shape and propagation groups.
4584 # @ref tui_creation_pipetshape "Example"
4585 def MakePipeTShapeFillet(self, theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh=True, theP1=None, theP2=None, theP3=None):
4586 theR1, theW1, theL1, theR2, theW2, theL2, theRF, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theRF)
4587 if (theP1 and theP2 and theP3):
4588 anObj = self.AdvOp.MakePipeTShapeFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh, theP1, theP2, theP3)
4590 anObj = self.AdvOp.MakePipeTShapeFillet(theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh)
4591 RaiseIfFailed("MakePipeTShapeFillet", self.AdvOp)
4592 if Parameters: anObj[0].SetParameters(Parameters)
4595 #@@ insert new functions before this line @@ do not remove this line @@#
4597 # end of l4_advanced
4600 ## Create a copy of the given object
4601 # @ingroup l1_geompy_auxiliary
4603 # @ref swig_all_advanced "Example"
4604 def MakeCopy(self,theOriginal):
4605 # Example: see GEOM_TestAll.py
4606 anObj = self.InsertOp.MakeCopy(theOriginal)
4607 RaiseIfFailed("MakeCopy", self.InsertOp)
4610 ## Add Path to load python scripts from
4611 # @ingroup l1_geompy_auxiliary
4612 def addPath(self,Path):
4613 if (sys.path.count(Path) < 1):
4614 sys.path.append(Path)
4618 ## Load marker texture from the file
4619 # @param Path a path to the texture file
4620 # @return unique texture identifier
4621 # @ingroup l1_geompy_auxiliary
4622 def LoadTexture(self, Path):
4623 # Example: see GEOM_TestAll.py
4624 ID = self.InsertOp.LoadTexture(Path)
4625 RaiseIfFailed("LoadTexture", self.InsertOp)
4628 ## Add marker texture. @a Width and @a Height parameters
4629 # specify width and height of the texture in pixels.
4630 # If @a RowData is @c True, @a Texture parameter should represent texture data
4631 # packed into the byte array. If @a RowData is @c False (default), @a Texture
4632 # parameter should be unpacked string, in which '1' symbols represent opaque
4633 # pixels and '0' represent transparent pixels of the texture bitmap.
4635 # @param Width texture width in pixels
4636 # @param Height texture height in pixels
4637 # @param Texture texture data
4638 # @param RowData if @c True, @a Texture data are packed in the byte stream
4639 # @ingroup l1_geompy_auxiliary
4640 def AddTexture(self, Width, Height, Texture, RowData=False):
4641 # Example: see GEOM_TestAll.py
4642 if not RowData: Texture = PackData(Texture)
4643 ID = self.InsertOp.AddTexture(Width, Height, Texture)
4644 RaiseIfFailed("AddTexture", self.InsertOp)
4648 #Register the new proxy for GEOM_Gen
4649 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geompyDC)