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
21 # GEOM GEOM_SWIG : binding of C++ omplementaion with Python
23 # Author : Paul RASCLE, EDF
31 ## @defgroup l1_geompy_auxiliary Auxiliary data structures and methods
33 ## @defgroup l1_geompy_purpose All package methods, grouped by their purpose
35 ## @defgroup l2_import_export Importing/exporting geometrical objects
36 ## @defgroup l2_creating Creating geometrical objects
38 ## @defgroup l3_basic_go Creating Basic Geometric Objects
40 ## @defgroup l4_curves Creating Curves
43 ## @defgroup l3_3d_primitives Creating 3D Primitives
44 ## @defgroup l3_complex Creating Complex Objects
45 ## @defgroup l3_groups Working with groups
46 ## @defgroup l3_blocks Building by blocks
48 ## @defgroup l4_blocks_measure Check and Improve
51 ## @defgroup l3_sketcher Sketcher
52 ## @defgroup l3_advanced Creating Advanced Geometrical Objects
54 ## @defgroup l4_decompose Decompose objects
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 = {"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 ## Kinds of shape enumeration
263 # @ingroup l1_geompy_auxiliary
264 kind = GEOM.GEOM_IKindOfShape
266 ## Information about closed/unclosed state of shell or wire
267 # @ingroup l1_geompy_auxiliary
273 class geompyDC(GEOM._objref_GEOM_Gen):
276 GEOM._objref_GEOM_Gen.__init__(self)
277 self.myBuilder = None
296 ## @addtogroup l1_geompy_auxiliary
298 def init_geom(self,theStudy):
299 self.myStudy = theStudy
300 self.myStudyId = self.myStudy._get_StudyId()
301 self.myBuilder = self.myStudy.NewBuilder()
302 self.father = self.myStudy.FindComponent("GEOM")
303 if self.father is None:
304 self.father = self.myBuilder.NewComponent("GEOM")
305 A1 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributeName")
306 FName = A1._narrow(SALOMEDS.AttributeName)
307 FName.SetValue("Geometry")
308 A2 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributePixMap")
309 aPixmap = A2._narrow(SALOMEDS.AttributePixMap)
310 aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry")
311 self.myBuilder.DefineComponentInstance(self.father,self)
313 self.BasicOp = self.GetIBasicOperations (self.myStudyId)
314 self.CurvesOp = self.GetICurvesOperations (self.myStudyId)
315 self.PrimOp = self.GetI3DPrimOperations (self.myStudyId)
316 self.ShapesOp = self.GetIShapesOperations (self.myStudyId)
317 self.HealOp = self.GetIHealingOperations (self.myStudyId)
318 self.InsertOp = self.GetIInsertOperations (self.myStudyId)
319 self.BoolOp = self.GetIBooleanOperations (self.myStudyId)
320 self.TrsfOp = self.GetITransformOperations(self.myStudyId)
321 self.LocalOp = self.GetILocalOperations (self.myStudyId)
322 self.MeasuOp = self.GetIMeasureOperations (self.myStudyId)
323 self.BlocksOp = self.GetIBlocksOperations (self.myStudyId)
324 self.GroupOp = self.GetIGroupOperations (self.myStudyId)
325 self.AdvOp = self.GetIAdvancedOperations (self.myStudyId)
328 ## Get name for sub-shape aSubObj of shape aMainObj
330 # @ref swig_SubShapeAllSorted "Example"
331 def SubShapeName(self,aSubObj, aMainObj):
332 # Example: see GEOM_TestAll.py
334 #aSubId = orb.object_to_string(aSubObj)
335 #aMainId = orb.object_to_string(aMainObj)
336 #index = gg.getIndexTopology(aSubId, aMainId)
337 #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
338 index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
339 name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
342 ## Publish in study aShape with name aName
344 # \param aShape the shape to be published
345 # \param aName the name for the shape
346 # \param doRestoreSubShapes if True, finds and publishes also
347 # sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
348 # and published sub-shapes of arguments
349 # \param theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes for
350 # these arguments description
351 # \return study entry of the published shape in form of string
353 # @ref swig_MakeQuad4Vertices "Example"
354 def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
355 theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
356 # Example: see GEOM_TestAll.py
358 aSObject = self.AddInStudy(self.myStudy, aShape, aName, None)
359 if doRestoreSubShapes:
360 self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs,
361 theFindMethod, theInheritFirstArg, True )
363 print "addToStudy() failed"
365 return aShape.GetStudyEntry()
367 ## Publish in study aShape with name aName as sub-object of previously published aFather
369 # @ref swig_SubShapeAllSorted "Example"
370 def addToStudyInFather(self, aFather, aShape, aName):
371 # Example: see GEOM_TestAll.py
373 aSObject = self.AddInStudy(self.myStudy, aShape, aName, aFather)
375 print "addToStudyInFather() failed"
377 return aShape.GetStudyEntry()
379 # end of l1_geompy_auxiliary
382 ## @addtogroup l3_restore_ss
385 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
386 # To be used from python scripts out of geompy.addToStudy (non-default usage)
387 # \param theObject published GEOM object, arguments of which will be published
388 # \param theArgs list of GEOM_Object, operation arguments to be published.
389 # If this list is empty, all operation arguments will be published
390 # \param theFindMethod method to search subshapes, corresponding to arguments and
391 # their subshapes. Value from enumeration GEOM::find_shape_method.
392 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
393 # Do not publish subshapes in place of arguments, but only
394 # in place of subshapes of the first argument,
395 # because the whole shape corresponds to the first argument.
396 # Mainly to be used after transformations, but it also can be
397 # usefull after partition with one object shape, and some other
398 # operations, where only the first argument has to be considered.
399 # If theObject has only one argument shape, this flag is automatically
400 # considered as True, not regarding really passed value.
401 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
402 # and prefix "from_subshapes_of_" to names of partially restored subshapes.
403 # \return list of published sub-shapes
405 # @ref tui_restore_prs_params "Example"
406 def RestoreSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
407 theInheritFirstArg=False, theAddPrefix=True):
408 # Example: see GEOM_TestAll.py
409 return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
410 theFindMethod, theInheritFirstArg, theAddPrefix)
412 # end of l3_restore_ss
415 ## @addtogroup l3_basic_go
418 ## Create point by three coordinates.
419 # @param theX The X coordinate of the point.
420 # @param theY The Y coordinate of the point.
421 # @param theZ The Z coordinate of the point.
422 # @return New GEOM_Object, containing the created point.
424 # @ref tui_creation_point "Example"
425 def MakeVertex(self,theX, theY, theZ):
426 # Example: see GEOM_TestAll.py
427 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
428 anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
429 RaiseIfFailed("MakePointXYZ", self.BasicOp)
430 anObj.SetParameters(Parameters)
433 ## Create a point, distant from the referenced point
434 # on the given distances along the coordinate axes.
435 # @param theReference The referenced point.
436 # @param theX Displacement from the referenced point along OX axis.
437 # @param theY Displacement from the referenced point along OY axis.
438 # @param theZ Displacement from the referenced point along OZ axis.
439 # @return New GEOM_Object, containing the created point.
441 # @ref tui_creation_point "Example"
442 def MakeVertexWithRef(self,theReference, theX, theY, theZ):
443 # Example: see GEOM_TestAll.py
444 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
445 anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
446 RaiseIfFailed("MakePointWithReference", self.BasicOp)
447 anObj.SetParameters(Parameters)
450 ## Create a point, corresponding to the given parameter on the given curve.
451 # @param theRefCurve The referenced curve.
452 # @param theParameter Value of parameter on the referenced curve.
453 # @return New GEOM_Object, containing the created point.
455 # @ref tui_creation_point "Example"
456 def MakeVertexOnCurve(self,theRefCurve, theParameter):
457 # Example: see GEOM_TestAll.py
458 theParameter, Parameters = ParseParameters(theParameter)
459 anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter)
460 RaiseIfFailed("MakePointOnCurve", self.BasicOp)
461 anObj.SetParameters(Parameters)
464 ## Create a point by projection give coordinates on the given curve
465 # @param theRefCurve The referenced curve.
466 # @param theX X-coordinate in 3D space
467 # @param theY Y-coordinate in 3D space
468 # @param theZ Z-coordinate in 3D space
469 # @return New GEOM_Object, containing the created point.
471 # @ref tui_creation_point "Example"
472 def MakeVertexOnCurveByCoord(self,theRefCurve, theX, theY, theZ):
473 # Example: see GEOM_TestAll.py
474 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
475 anObj = self.BasicOp.MakePointOnCurveByCoord(theRefCurve, theX, theY, theZ)
476 RaiseIfFailed("MakeVertexOnCurveByCoord", self.BasicOp)
477 anObj.SetParameters(Parameters)
480 ## Create a point, corresponding to the given parameters on the
482 # @param theRefSurf The referenced surface.
483 # @param theUParameter Value of U-parameter on the referenced surface.
484 # @param theVParameter Value of V-parameter on the referenced surface.
485 # @return New GEOM_Object, containing the created point.
487 # @ref swig_MakeVertexOnSurface "Example"
488 def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter):
489 theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
490 # Example: see GEOM_TestAll.py
491 anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
492 RaiseIfFailed("MakePointOnSurface", self.BasicOp)
493 anObj.SetParameters(Parameters);
496 ## Create a point by projection give coordinates on the given surface
497 # @param theRefSurf The referenced surface.
498 # @param theX X-coordinate in 3D space
499 # @param theY Y-coordinate in 3D space
500 # @param theZ Z-coordinate in 3D space
501 # @return New GEOM_Object, containing the created point.
503 # @ref swig_MakeVertexOnSurfaceByCoord "Example"
504 def MakeVertexOnSurfaceByCoord(self, theRefSurf, theX, theY, theZ):
505 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
506 # Example: see GEOM_TestAll.py
507 anObj = self.BasicOp.MakePointOnSurfaceByCoord(theRefSurf, theX, theY, theZ)
508 RaiseIfFailed("MakeVertexOnSurfaceByCoord", self.BasicOp)
509 anObj.SetParameters(Parameters);
512 ## Create a point on intersection of two lines.
513 # @param theRefLine1, theRefLine2 The referenced lines.
514 # @return New GEOM_Object, containing the created point.
516 # @ref swig_MakeVertexOnLinesIntersection "Example"
517 def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2):
518 # Example: see GEOM_TestAll.py
519 anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
520 RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
523 ## Create a tangent, corresponding to the given parameter on the given curve.
524 # @param theRefCurve The referenced curve.
525 # @param theParameter Value of parameter on the referenced curve.
526 # @return New GEOM_Object, containing the created tangent.
528 # @ref swig_MakeTangentOnCurve "Example"
529 def MakeTangentOnCurve(self, theRefCurve, theParameter):
530 anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
531 RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
534 ## Create a tangent plane, corresponding to the given parameter on the given face.
535 # @param theFace The face for which tangent plane should be built.
536 # @param theParameterV vertical value of the center point (0.0 - 1.0).
537 # @param theParameterU horisontal value of the center point (0.0 - 1.0).
538 # @param theTrimSize the size of plane.
539 # @return New GEOM_Object, containing the created tangent.
541 # @ref swig_MakeTangentPlaneOnFace "Example"
542 def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize):
543 anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
544 RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
547 ## Create a vector with the given components.
548 # @param theDX X component of the vector.
549 # @param theDY Y component of the vector.
550 # @param theDZ Z component of the vector.
551 # @return New GEOM_Object, containing the created vector.
553 # @ref tui_creation_vector "Example"
554 def MakeVectorDXDYDZ(self,theDX, theDY, theDZ):
555 # Example: see GEOM_TestAll.py
556 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
557 anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
558 RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
559 anObj.SetParameters(Parameters)
562 ## Create a vector between two points.
563 # @param thePnt1 Start point for the vector.
564 # @param thePnt2 End point for the vector.
565 # @return New GEOM_Object, containing the created vector.
567 # @ref tui_creation_vector "Example"
568 def MakeVector(self,thePnt1, thePnt2):
569 # Example: see GEOM_TestAll.py
570 anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
571 RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
574 ## Create a line, passing through the given point
575 # and parrallel to the given direction
576 # @param thePnt Point. The resulting line will pass through it.
577 # @param theDir Direction. The resulting line will be parallel to it.
578 # @return New GEOM_Object, containing the created line.
580 # @ref tui_creation_line "Example"
581 def MakeLine(self,thePnt, theDir):
582 # Example: see GEOM_TestAll.py
583 anObj = self.BasicOp.MakeLine(thePnt, theDir)
584 RaiseIfFailed("MakeLine", self.BasicOp)
587 ## Create a line, passing through the given points
588 # @param thePnt1 First of two points, defining the line.
589 # @param thePnt2 Second of two points, defining the line.
590 # @return New GEOM_Object, containing the created line.
592 # @ref tui_creation_line "Example"
593 def MakeLineTwoPnt(self,thePnt1, thePnt2):
594 # Example: see GEOM_TestAll.py
595 anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
596 RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
599 ## Create a line on two faces intersection.
600 # @param theFace1 First of two faces, defining the line.
601 # @param theFace2 Second of two faces, defining the line.
602 # @return New GEOM_Object, containing the created line.
604 # @ref swig_MakeLineTwoFaces "Example"
605 def MakeLineTwoFaces(self, theFace1, theFace2):
606 # Example: see GEOM_TestAll.py
607 anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
608 RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
611 ## Create a plane, passing through the given point
612 # and normal to the given vector.
613 # @param thePnt Point, the plane has to pass through.
614 # @param theVec Vector, defining the plane normal direction.
615 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
616 # @return New GEOM_Object, containing the created plane.
618 # @ref tui_creation_plane "Example"
619 def MakePlane(self,thePnt, theVec, theTrimSize):
620 # Example: see GEOM_TestAll.py
621 theTrimSize, Parameters = ParseParameters(theTrimSize);
622 anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
623 RaiseIfFailed("MakePlanePntVec", self.BasicOp)
624 anObj.SetParameters(Parameters)
627 ## Create a plane, passing through the three given points
628 # @param thePnt1 First of three points, defining the plane.
629 # @param thePnt2 Second of three points, defining the plane.
630 # @param thePnt3 Fird of three points, defining the plane.
631 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
632 # @return New GEOM_Object, containing the created plane.
634 # @ref tui_creation_plane "Example"
635 def MakePlaneThreePnt(self,thePnt1, thePnt2, thePnt3, theTrimSize):
636 # Example: see GEOM_TestAll.py
637 theTrimSize, Parameters = ParseParameters(theTrimSize);
638 anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
639 RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
640 anObj.SetParameters(Parameters)
643 ## Create a plane, similar to the existing one, but with another size of representing face.
644 # @param theFace Referenced plane or LCS(Marker).
645 # @param theTrimSize New half size of a side of quadrangle face, representing the plane.
646 # @return New GEOM_Object, containing the created plane.
648 # @ref tui_creation_plane "Example"
649 def MakePlaneFace(self,theFace, theTrimSize):
650 # Example: see GEOM_TestAll.py
651 theTrimSize, Parameters = ParseParameters(theTrimSize);
652 anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
653 RaiseIfFailed("MakePlaneFace", self.BasicOp)
654 anObj.SetParameters(Parameters)
657 ## Create a plane, passing through the 2 vectors
658 # with center in a start point of the first vector.
659 # @param theVec1 Vector, defining center point and plane direction.
660 # @param theVec2 Vector, defining the plane normal direction.
661 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
662 # @return New GEOM_Object, containing the created plane.
664 # @ref tui_creation_plane "Example"
665 def MakePlane2Vec(self,theVec1, theVec2, theTrimSize):
666 # Example: see GEOM_TestAll.py
667 theTrimSize, Parameters = ParseParameters(theTrimSize);
668 anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
669 RaiseIfFailed("MakePlane2Vec", self.BasicOp)
670 anObj.SetParameters(Parameters)
673 ## Create a plane, based on a Local coordinate system.
674 # @param theLCS coordinate system, defining plane.
675 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
676 # @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
677 # @return New GEOM_Object, containing the created plane.
679 # @ref tui_creation_plane "Example"
680 def MakePlaneLCS(self,theLCS, theTrimSize, theOrientation):
681 # Example: see GEOM_TestAll.py
682 theTrimSize, Parameters = ParseParameters(theTrimSize);
683 anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
684 RaiseIfFailed("MakePlaneLCS", self.BasicOp)
685 anObj.SetParameters(Parameters)
688 ## Create a local coordinate system.
689 # @param OX,OY,OZ Three coordinates of coordinate system origin.
690 # @param XDX,XDY,XDZ Three components of OX direction
691 # @param YDX,YDY,YDZ Three components of OY direction
692 # @return New GEOM_Object, containing the created coordinate system.
694 # @ref swig_MakeMarker "Example"
695 def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ):
696 # Example: see GEOM_TestAll.py
697 OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
698 anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
699 RaiseIfFailed("MakeMarker", self.BasicOp)
700 anObj.SetParameters(Parameters)
703 ## Create a local coordinate system from shape.
704 # @param theShape The initial shape to detect the coordinate system.
705 # @return New GEOM_Object, containing the created coordinate system.
707 # @ref tui_creation_lcs "Example"
708 def MakeMarkerFromShape(self, theShape):
709 anObj = self.BasicOp.MakeMarkerFromShape(theShape)
710 RaiseIfFailed("MakeMarkerFromShape", self.BasicOp)
713 ## Create a local coordinate system from point and two vectors.
714 # @param theOrigin Point of coordinate system origin.
715 # @param theXVec Vector of X direction
716 # @param theYVec Vector of Y direction
717 # @return New GEOM_Object, containing the created coordinate system.
719 # @ref tui_creation_lcs "Example"
720 def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec):
721 anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec)
722 RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp)
728 ## @addtogroup l4_curves
731 ## Create an arc of circle, passing through three given points.
732 # @param thePnt1 Start point of the arc.
733 # @param thePnt2 Middle point of the arc.
734 # @param thePnt3 End point of the arc.
735 # @return New GEOM_Object, containing the created arc.
737 # @ref swig_MakeArc "Example"
738 def MakeArc(self,thePnt1, thePnt2, thePnt3):
739 # Example: see GEOM_TestAll.py
740 anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
741 RaiseIfFailed("MakeArc", self.CurvesOp)
744 ## Create an arc of circle from a center and 2 points.
745 # @param thePnt1 Center of the arc
746 # @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
747 # @param thePnt3 End point of the arc (Gives also a direction)
748 # @param theSense Orientation of the arc
749 # @return New GEOM_Object, containing the created arc.
751 # @ref swig_MakeArc "Example"
752 def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False):
753 # Example: see GEOM_TestAll.py
754 anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
755 RaiseIfFailed("MakeArcCenter", self.CurvesOp)
758 ## Create an arc of ellipse, of center and two points.
759 # @param theCenter Center of the arc.
760 # @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
761 # @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
762 # @return New GEOM_Object, containing the created arc.
764 # @ref swig_MakeArc "Example"
765 def MakeArcOfEllipse(self,theCenter, thePnt1, thePnt2):
766 # Example: see GEOM_TestAll.py
767 anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
768 RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
771 ## Create a circle with given center, normal vector and radius.
772 # @param thePnt Circle center.
773 # @param theVec Vector, normal to the plane of the circle.
774 # @param theR Circle radius.
775 # @return New GEOM_Object, containing the created circle.
777 # @ref tui_creation_circle "Example"
778 def MakeCircle(self, thePnt, theVec, theR):
779 # Example: see GEOM_TestAll.py
780 theR, Parameters = ParseParameters(theR)
781 anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
782 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
783 anObj.SetParameters(Parameters)
786 ## Create a circle with given radius.
787 # Center of the circle will be in the origin of global
788 # coordinate system and normal vector will be codirected with Z axis
789 # @param theR Circle radius.
790 # @return New GEOM_Object, containing the created circle.
791 def MakeCircleR(self, theR):
792 anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
793 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
796 ## Create a circle, passing through three given points
797 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
798 # @return New GEOM_Object, containing the created circle.
800 # @ref tui_creation_circle "Example"
801 def MakeCircleThreePnt(self,thePnt1, thePnt2, thePnt3):
802 # Example: see GEOM_TestAll.py
803 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
804 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
807 ## Create a circle, with given point1 as center,
808 # passing through the point2 as radius and laying in the plane,
809 # defined by all three given points.
810 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
811 # @return New GEOM_Object, containing the created circle.
813 # @ref swig_MakeCircle "Example"
814 def MakeCircleCenter2Pnt(self,thePnt1, thePnt2, thePnt3):
815 # Example: see GEOM_example6.py
816 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
817 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
820 ## Create an ellipse with given center, normal vector and radiuses.
821 # @param thePnt Ellipse center.
822 # @param theVec Vector, normal to the plane of the ellipse.
823 # @param theRMajor Major ellipse radius.
824 # @param theRMinor Minor ellipse radius.
825 # @param theVecMaj Vector, direction of the ellipse's main axis.
826 # @return New GEOM_Object, containing the created ellipse.
828 # @ref tui_creation_ellipse "Example"
829 def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None):
830 # Example: see GEOM_TestAll.py
831 theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
832 if theVecMaj is not None:
833 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
835 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
837 RaiseIfFailed("MakeEllipse", self.CurvesOp)
838 anObj.SetParameters(Parameters)
841 ## Create an ellipse with given radiuses.
842 # Center of the ellipse will be in the origin of global
843 # coordinate system and normal vector will be codirected with Z axis
844 # @param theRMajor Major ellipse radius.
845 # @param theRMinor Minor ellipse radius.
846 # @return New GEOM_Object, containing the created ellipse.
847 def MakeEllipseRR(self, theRMajor, theRMinor):
848 anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
849 RaiseIfFailed("MakeEllipse", self.CurvesOp)
852 ## Create a polyline on the set of points.
853 # @param thePoints Sequence of points for the polyline.
854 # @return New GEOM_Object, containing the created polyline.
856 # @ref tui_creation_curve "Example"
857 def MakePolyline(self,thePoints):
858 # Example: see GEOM_TestAll.py
859 anObj = self.CurvesOp.MakePolyline(thePoints)
860 RaiseIfFailed("MakePolyline", self.CurvesOp)
863 ## Create bezier curve on the set of points.
864 # @param thePoints Sequence of points for the bezier curve.
865 # @return New GEOM_Object, containing the created bezier curve.
867 # @ref tui_creation_curve "Example"
868 def MakeBezier(self,thePoints):
869 # Example: see GEOM_TestAll.py
870 anObj = self.CurvesOp.MakeSplineBezier(thePoints)
871 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
874 ## Create B-Spline curve on the set of points.
875 # @param thePoints Sequence of points for the B-Spline curve.
876 # @param theIsClosed If True, build a closed curve.
877 # @return New GEOM_Object, containing the created B-Spline curve.
879 # @ref tui_creation_curve "Example"
880 def MakeInterpol(self, thePoints, theIsClosed=False):
881 # Example: see GEOM_TestAll.py
882 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed)
883 RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
889 ## @addtogroup l3_sketcher
892 ## Create a sketcher (wire or face), following the textual description,
893 # passed through <VAR>theCommand</VAR> argument. \n
894 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
895 # Format of the description string have to be the following:
897 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
900 # - x1, y1 are coordinates of the first sketcher point (zero by default),
902 # - "R angle" : Set the direction by angle
903 # - "D dx dy" : Set the direction by DX & DY
906 # - "TT x y" : Create segment by point at X & Y
907 # - "T dx dy" : Create segment by point with DX & DY
908 # - "L length" : Create segment by direction & Length
909 # - "IX x" : Create segment by direction & Intersect. X
910 # - "IY y" : Create segment by direction & Intersect. Y
913 # - "C radius length" : Create arc by direction, radius and length(in degree)
916 # - "WW" : Close Wire (to finish)
917 # - "WF" : Close Wire and build face (to finish)
919 # @param theCommand String, defining the sketcher in local
920 # coordinates of the working plane.
921 # @param theWorkingPlane Nine double values, defining origin,
922 # OZ and OX directions of the working plane.
923 # @return New GEOM_Object, containing the created wire.
925 # @ref tui_sketcher_page "Example"
926 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0]):
927 # Example: see GEOM_TestAll.py
928 theCommand,Parameters = ParseSketcherCommand(theCommand)
929 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
930 RaiseIfFailed("MakeSketcher", self.CurvesOp)
931 anObj.SetParameters(Parameters)
934 ## Create a sketcher (wire or face), following the textual description,
935 # passed through <VAR>theCommand</VAR> argument. \n
936 # For format of the description string see the previous method.\n
937 # @param theCommand String, defining the sketcher in local
938 # coordinates of the working plane.
939 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
940 # @return New GEOM_Object, containing the created wire.
942 # @ref tui_sketcher_page "Example"
943 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane):
944 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
945 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
948 ## Create a sketcher wire, following the numerical description,
949 # passed through <VAR>theCoordinates</VAR> argument. \n
950 # @param theCoordinates double values, defining points to create a wire,
952 # @return New GEOM_Object, containing the created wire.
954 # @ref tui_sketcher_page "Example"
955 def Make3DSketcher(self, theCoordinates):
956 theCoordinates,Parameters = ParseParameters(theCoordinates)
957 anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
958 RaiseIfFailed("Make3DSketcher", self.CurvesOp)
959 anObj.SetParameters(Parameters)
965 ## @addtogroup l3_3d_primitives
968 ## Create a box by coordinates of two opposite vertices.
970 # @ref tui_creation_box "Example"
971 def MakeBox(self,x1,y1,z1,x2,y2,z2):
972 # Example: see GEOM_TestAll.py
973 pnt1 = self.MakeVertex(x1,y1,z1)
974 pnt2 = self.MakeVertex(x2,y2,z2)
975 return self.MakeBoxTwoPnt(pnt1,pnt2)
977 ## Create a box with specified dimensions along the coordinate axes
978 # and with edges, parallel to the coordinate axes.
979 # Center of the box will be at point (DX/2, DY/2, DZ/2).
980 # @param theDX Length of Box edges, parallel to OX axis.
981 # @param theDY Length of Box edges, parallel to OY axis.
982 # @param theDZ Length of Box edges, parallel to OZ axis.
983 # @return New GEOM_Object, containing the created box.
985 # @ref tui_creation_box "Example"
986 def MakeBoxDXDYDZ(self,theDX, theDY, theDZ):
987 # Example: see GEOM_TestAll.py
988 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
989 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
990 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
991 anObj.SetParameters(Parameters)
994 ## Create a box with two specified opposite vertices,
995 # and with edges, parallel to the coordinate axes
996 # @param thePnt1 First of two opposite vertices.
997 # @param thePnt2 Second of two opposite vertices.
998 # @return New GEOM_Object, containing the created box.
1000 # @ref tui_creation_box "Example"
1001 def MakeBoxTwoPnt(self,thePnt1, thePnt2):
1002 # Example: see GEOM_TestAll.py
1003 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
1004 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
1007 ## Create a face with specified dimensions along OX-OY coordinate axes,
1008 # with edges, parallel to this coordinate axes.
1009 # @param theH height of Face.
1010 # @param theW width of Face.
1011 # @param theOrientation orientation belong axis OXY OYZ OZX
1012 # @return New GEOM_Object, containing the created face.
1014 # @ref tui_creation_face "Example"
1015 def MakeFaceHW(self,theH, theW, theOrientation):
1016 # Example: see GEOM_TestAll.py
1017 theH,theW,Parameters = ParseParameters(theH, theW)
1018 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
1019 RaiseIfFailed("MakeFaceHW", self.PrimOp)
1020 anObj.SetParameters(Parameters)
1023 ## Create a face from another plane and two sizes,
1024 # vertical size and horisontal size.
1025 # @param theObj Normale vector to the creating face or
1027 # @param theH Height (vertical size).
1028 # @param theW Width (horisontal size).
1029 # @return New GEOM_Object, containing the created face.
1031 # @ref tui_creation_face "Example"
1032 def MakeFaceObjHW(self, theObj, theH, theW):
1033 # Example: see GEOM_TestAll.py
1034 theH,theW,Parameters = ParseParameters(theH, theW)
1035 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
1036 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
1037 anObj.SetParameters(Parameters)
1040 ## Create a disk with given center, normal vector and radius.
1041 # @param thePnt Disk center.
1042 # @param theVec Vector, normal to the plane of the disk.
1043 # @param theR Disk radius.
1044 # @return New GEOM_Object, containing the created disk.
1046 # @ref tui_creation_disk "Example"
1047 def MakeDiskPntVecR(self,thePnt, theVec, theR):
1048 # Example: see GEOM_TestAll.py
1049 theR,Parameters = ParseParameters(theR)
1050 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
1051 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
1052 anObj.SetParameters(Parameters)
1055 ## Create a disk, passing through three given points
1056 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
1057 # @return New GEOM_Object, containing the created disk.
1059 # @ref tui_creation_disk "Example"
1060 def MakeDiskThreePnt(self,thePnt1, thePnt2, thePnt3):
1061 # Example: see GEOM_TestAll.py
1062 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
1063 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
1066 ## Create a disk with specified dimensions along OX-OY coordinate axes.
1067 # @param theR Radius of Face.
1068 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
1069 # @return New GEOM_Object, containing the created disk.
1071 # @ref tui_creation_face "Example"
1072 def MakeDiskR(self,theR, theOrientation):
1073 # Example: see GEOM_TestAll.py
1074 theR,Parameters = ParseParameters(theR)
1075 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
1076 RaiseIfFailed("MakeDiskR", self.PrimOp)
1077 anObj.SetParameters(Parameters)
1080 ## Create a cylinder with given base point, axis, radius and height.
1081 # @param thePnt Central point of cylinder base.
1082 # @param theAxis Cylinder axis.
1083 # @param theR Cylinder radius.
1084 # @param theH Cylinder height.
1085 # @return New GEOM_Object, containing the created cylinder.
1087 # @ref tui_creation_cylinder "Example"
1088 def MakeCylinder(self,thePnt, theAxis, theR, theH):
1089 # Example: see GEOM_TestAll.py
1090 theR,theH,Parameters = ParseParameters(theR, theH)
1091 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
1092 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
1093 anObj.SetParameters(Parameters)
1096 ## Create a cylinder with given radius and height at
1097 # the origin of coordinate system. Axis of the cylinder
1098 # will be collinear to the OZ axis of the coordinate system.
1099 # @param theR Cylinder radius.
1100 # @param theH Cylinder height.
1101 # @return New GEOM_Object, containing the created cylinder.
1103 # @ref tui_creation_cylinder "Example"
1104 def MakeCylinderRH(self,theR, theH):
1105 # Example: see GEOM_TestAll.py
1106 theR,theH,Parameters = ParseParameters(theR, theH)
1107 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
1108 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
1109 anObj.SetParameters(Parameters)
1112 ## Create a sphere with given center and radius.
1113 # @param thePnt Sphere center.
1114 # @param theR Sphere radius.
1115 # @return New GEOM_Object, containing the created sphere.
1117 # @ref tui_creation_sphere "Example"
1118 def MakeSpherePntR(self, thePnt, theR):
1119 # Example: see GEOM_TestAll.py
1120 theR,Parameters = ParseParameters(theR)
1121 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
1122 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
1123 anObj.SetParameters(Parameters)
1126 ## Create a sphere with given center and radius.
1127 # @param x,y,z Coordinates of sphere center.
1128 # @param theR Sphere radius.
1129 # @return New GEOM_Object, containing the created sphere.
1131 # @ref tui_creation_sphere "Example"
1132 def MakeSphere(self, x, y, z, theR):
1133 # Example: see GEOM_TestAll.py
1134 point = self.MakeVertex(x, y, z)
1135 anObj = self.MakeSpherePntR(point, theR)
1138 ## Create a sphere with given radius at the origin of coordinate system.
1139 # @param theR Sphere radius.
1140 # @return New GEOM_Object, containing the created sphere.
1142 # @ref tui_creation_sphere "Example"
1143 def MakeSphereR(self, theR):
1144 # Example: see GEOM_TestAll.py
1145 theR,Parameters = ParseParameters(theR)
1146 anObj = self.PrimOp.MakeSphereR(theR)
1147 RaiseIfFailed("MakeSphereR", self.PrimOp)
1148 anObj.SetParameters(Parameters)
1151 ## Create a cone with given base point, axis, height and radiuses.
1152 # @param thePnt Central point of the first cone base.
1153 # @param theAxis Cone axis.
1154 # @param theR1 Radius of the first cone base.
1155 # @param theR2 Radius of the second cone base.
1156 # \note If both radiuses are non-zero, the cone will be truncated.
1157 # \note If the radiuses are equal, a cylinder will be created instead.
1158 # @param theH Cone height.
1159 # @return New GEOM_Object, containing the created cone.
1161 # @ref tui_creation_cone "Example"
1162 def MakeCone(self,thePnt, theAxis, theR1, theR2, theH):
1163 # Example: see GEOM_TestAll.py
1164 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
1165 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
1166 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
1167 anObj.SetParameters(Parameters)
1170 ## Create a cone with given height and radiuses at
1171 # the origin of coordinate system. Axis of the cone will
1172 # be collinear to the OZ axis of the coordinate system.
1173 # @param theR1 Radius of the first cone base.
1174 # @param theR2 Radius of the second cone base.
1175 # \note If both radiuses are non-zero, the cone will be truncated.
1176 # \note If the radiuses are equal, a cylinder will be created instead.
1177 # @param theH Cone height.
1178 # @return New GEOM_Object, containing the created cone.
1180 # @ref tui_creation_cone "Example"
1181 def MakeConeR1R2H(self,theR1, theR2, theH):
1182 # Example: see GEOM_TestAll.py
1183 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
1184 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
1185 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
1186 anObj.SetParameters(Parameters)
1189 ## Create a torus with given center, normal vector and radiuses.
1190 # @param thePnt Torus central point.
1191 # @param theVec Torus axis of symmetry.
1192 # @param theRMajor Torus major radius.
1193 # @param theRMinor Torus minor radius.
1194 # @return New GEOM_Object, containing the created torus.
1196 # @ref tui_creation_torus "Example"
1197 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor):
1198 # Example: see GEOM_TestAll.py
1199 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
1200 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
1201 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
1202 anObj.SetParameters(Parameters)
1205 ## Create a torus with given radiuses at the origin of coordinate system.
1206 # @param theRMajor Torus major radius.
1207 # @param theRMinor Torus minor radius.
1208 # @return New GEOM_Object, containing the created torus.
1210 # @ref tui_creation_torus "Example"
1211 def MakeTorusRR(self, theRMajor, theRMinor):
1212 # Example: see GEOM_TestAll.py
1213 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
1214 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
1215 RaiseIfFailed("MakeTorusRR", self.PrimOp)
1216 anObj.SetParameters(Parameters)
1219 # end of l3_3d_primitives
1222 ## @addtogroup l3_complex
1225 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
1226 # @param theBase Base shape to be extruded.
1227 # @param thePoint1 First end of extrusion vector.
1228 # @param thePoint2 Second end of extrusion vector.
1229 # @return New GEOM_Object, containing the created prism.
1231 # @ref tui_creation_prism "Example"
1232 def MakePrism(self, theBase, thePoint1, thePoint2):
1233 # Example: see GEOM_TestAll.py
1234 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
1235 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
1238 ## Create a shape by extrusion of the base shape along the vector,
1239 # i.e. all the space, transfixed by the base shape during its translation
1240 # along the vector on the given distance.
1241 # @param theBase Base shape to be extruded.
1242 # @param theVec Direction of extrusion.
1243 # @param theH Prism dimension along theVec.
1244 # @return New GEOM_Object, containing the created prism.
1246 # @ref tui_creation_prism "Example"
1247 def MakePrismVecH(self, theBase, theVec, theH):
1248 # Example: see GEOM_TestAll.py
1249 theH,Parameters = ParseParameters(theH)
1250 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
1251 RaiseIfFailed("MakePrismVecH", self.PrimOp)
1252 anObj.SetParameters(Parameters)
1255 ## Create a shape by extrusion of the base shape along the vector,
1256 # i.e. all the space, transfixed by the base shape during its translation
1257 # along the vector on the given distance in 2 Ways (forward/backward) .
1258 # @param theBase Base shape to be extruded.
1259 # @param theVec Direction of extrusion.
1260 # @param theH Prism dimension along theVec in forward direction.
1261 # @return New GEOM_Object, containing the created prism.
1263 # @ref tui_creation_prism "Example"
1264 def MakePrismVecH2Ways(self, theBase, theVec, theH):
1265 # Example: see GEOM_TestAll.py
1266 theH,Parameters = ParseParameters(theH)
1267 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
1268 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
1269 anObj.SetParameters(Parameters)
1272 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
1273 # @param theBase Base shape to be extruded.
1274 # @param theDX, theDY, theDZ Directions of extrusion.
1275 # @return New GEOM_Object, containing the created prism.
1277 # @ref tui_creation_prism "Example"
1278 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ):
1279 # Example: see GEOM_TestAll.py
1280 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1281 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
1282 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
1283 anObj.SetParameters(Parameters)
1286 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
1287 # i.e. all the space, transfixed by the base shape during its translation
1288 # along the vector on the given distance in 2 Ways (forward/backward) .
1289 # @param theBase Base shape to be extruded.
1290 # @param theDX, theDY, theDZ Directions of extrusion.
1291 # @return New GEOM_Object, containing the created prism.
1293 # @ref tui_creation_prism "Example"
1294 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ):
1295 # Example: see GEOM_TestAll.py
1296 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1297 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
1298 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
1299 anObj.SetParameters(Parameters)
1302 ## Create a shape by revolution of the base shape around the axis
1303 # on the given angle, i.e. all the space, transfixed by the base
1304 # shape during its rotation around the axis on the given angle.
1305 # @param theBase Base shape to be rotated.
1306 # @param theAxis Rotation axis.
1307 # @param theAngle Rotation angle in radians.
1308 # @return New GEOM_Object, containing the created revolution.
1310 # @ref tui_creation_revolution "Example"
1311 def MakeRevolution(self, theBase, theAxis, theAngle):
1312 # Example: see GEOM_TestAll.py
1313 theAngle,Parameters = ParseParameters(theAngle)
1314 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
1315 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
1316 anObj.SetParameters(Parameters)
1319 ## The Same Revolution but in both ways forward&backward.
1320 def MakeRevolution2Ways(self, theBase, theAxis, theAngle):
1321 theAngle,Parameters = ParseParameters(theAngle)
1322 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
1323 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
1324 anObj.SetParameters(Parameters)
1327 ## Create a filling from the given compound of contours.
1328 # @param theShape the compound of contours
1329 # @param theMinDeg a minimal degree of BSpline surface to create
1330 # @param theMaxDeg a maximal degree of BSpline surface to create
1331 # @param theTol2D a 2d tolerance to be reached
1332 # @param theTol3D a 3d tolerance to be reached
1333 # @param theNbIter a number of iteration of approximation algorithm
1334 # @param theMethod Kind of method to perform filling operation:
1335 # 0 - Default - standard behaviour
1336 # 1 - Use edges orientation - orientation of edges are
1337 # used: if edge is reversed curve from this edge
1338 # is reversed before using in filling algorithm.
1339 # 2 - Auto-correct orientation - change orientation
1340 # of curves using minimization of sum of distances
1341 # between ends points of edges.
1342 # @param isApprox if True, BSpline curves are generated in the process
1343 # of surface construction. By default it is False, that means
1344 # the surface is created using Besier curves. The usage of
1345 # Approximation makes the algorithm work slower, but allows
1346 # building the surface for rather complex cases
1347 # @return New GEOM_Object, containing the created filling surface.
1349 # @ref tui_creation_filling "Example"
1350 def MakeFilling(self, theShape, theMinDeg, theMaxDeg, theTol2D,
1351 theTol3D, theNbIter, theMethod=GEOM.FOM_Default, isApprox=0):
1352 # Example: see GEOM_TestAll.py
1353 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
1354 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
1355 theTol2D, theTol3D, theNbIter,
1356 theMethod, isApprox)
1357 RaiseIfFailed("MakeFilling", self.PrimOp)
1358 anObj.SetParameters(Parameters)
1361 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
1362 # @param theSeqSections - set of specified sections.
1363 # @param theModeSolid - mode defining building solid or shell
1364 # @param thePreci - precision 3D used for smoothing by default 1.e-6
1365 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
1366 # @return New GEOM_Object, containing the created shell or solid.
1368 # @ref swig_todo "Example"
1369 def MakeThruSections(self,theSeqSections,theModeSolid,thePreci,theRuled):
1370 # Example: see GEOM_TestAll.py
1371 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
1372 RaiseIfFailed("MakeThruSections", self.PrimOp)
1375 ## Create a shape by extrusion of the base shape along
1376 # the path shape. The path shape can be a wire or an edge.
1377 # @param theBase Base shape to be extruded.
1378 # @param thePath Path shape to extrude the base shape along it.
1379 # @return New GEOM_Object, containing the created pipe.
1381 # @ref tui_creation_pipe "Example"
1382 def MakePipe(self,theBase, thePath):
1383 # Example: see GEOM_TestAll.py
1384 anObj = self.PrimOp.MakePipe(theBase, thePath)
1385 RaiseIfFailed("MakePipe", self.PrimOp)
1388 ## Create a shape by extrusion of the profile shape along
1389 # the path shape. The path shape can be a wire or an edge.
1390 # the several profiles can be specified in the several locations of path.
1391 # @param theSeqBases - list of Bases shape to be extruded.
1392 # @param theLocations - list of locations on the path corresponding
1393 # specified list of the Bases shapes. Number of locations
1394 # should be equal to number of bases or list of locations can be empty.
1395 # @param thePath - Path shape to extrude the base shape along it.
1396 # @param theWithContact - the mode defining that the section is translated to be in
1397 # contact with the spine.
1398 # @param theWithCorrection - defining that the section is rotated to be
1399 # orthogonal to the spine tangent in the correspondent point
1400 # @return New GEOM_Object, containing the created pipe.
1402 # @ref tui_creation_pipe_with_diff_sec "Example"
1403 def MakePipeWithDifferentSections(self, theSeqBases,
1404 theLocations, thePath,
1405 theWithContact, theWithCorrection):
1406 anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
1407 theLocations, thePath,
1408 theWithContact, theWithCorrection)
1409 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
1412 ## Create a shape by extrusion of the profile shape along
1413 # the path shape. The path shape can be a wire or a edge.
1414 # the several profiles can be specified in the several locations of path.
1415 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
1416 # shell or face. If number of faces in neighbour sections
1417 # aren't coincided result solid between such sections will
1418 # be created using external boundaries of this shells.
1419 # @param theSeqSubBases - list of corresponding subshapes of section shapes.
1420 # This list is used for searching correspondences between
1421 # faces in the sections. Size of this list must be equal
1422 # to size of list of base shapes.
1423 # @param theLocations - list of locations on the path corresponding
1424 # specified list of the Bases shapes. Number of locations
1425 # should be equal to number of bases. First and last
1426 # locations must be coincided with first and last vertexes
1427 # of path correspondingly.
1428 # @param thePath - Path shape to extrude the base shape along it.
1429 # @param theWithContact - the mode defining that the section is translated to be in
1430 # contact with the spine.
1431 # @param theWithCorrection - defining that the section is rotated to be
1432 # orthogonal to the spine tangent in the correspondent point
1433 # @return New GEOM_Object, containing the created solids.
1435 # @ref tui_creation_pipe_with_shell_sec "Example"
1436 def MakePipeWithShellSections(self,theSeqBases, theSeqSubBases,
1437 theLocations, thePath,
1438 theWithContact, theWithCorrection):
1439 anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
1440 theLocations, thePath,
1441 theWithContact, theWithCorrection)
1442 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
1445 ## Create a shape by extrusion of the profile shape along
1446 # the path shape. This function is used only for debug pipe
1447 # functionality - it is a version of previous function
1448 # (MakePipeWithShellSections(...)) which give a possibility to
1449 # recieve information about creating pipe between each pair of
1450 # sections step by step.
1451 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
1452 theLocations, thePath,
1453 theWithContact, theWithCorrection):
1455 nbsect = len(theSeqBases)
1456 nbsubsect = len(theSeqSubBases)
1457 #print "nbsect = ",nbsect
1458 for i in range(1,nbsect):
1460 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
1461 tmpLocations = [ theLocations[i-1], theLocations[i] ]
1463 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
1464 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
1465 tmpLocations, thePath,
1466 theWithContact, theWithCorrection)
1467 if self.PrimOp.IsDone() == 0:
1468 print "Problems with pipe creation between ",i," and ",i+1," sections"
1469 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
1472 print "Pipe between ",i," and ",i+1," sections is OK"
1477 resc = self.MakeCompound(res)
1478 #resc = self.MakeSewing(res, 0.001)
1479 #print "resc: ",resc
1482 ## Create solids between given sections
1483 # @param theSeqBases - list of sections (shell or face).
1484 # @param theLocations - list of corresponding vertexes
1485 # @return New GEOM_Object, containing the created solids.
1487 # @ref tui_creation_pipe_without_path "Example"
1488 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations):
1489 anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
1490 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
1493 ## Create a shape by extrusion of the base shape along
1494 # the path shape with constant bi-normal direction along the given vector.
1495 # The path shape can be a wire or an edge.
1496 # @param theBase Base shape to be extruded.
1497 # @param thePath Path shape to extrude the base shape along it.
1498 # @param theVec Vector defines a constant binormal direction to keep the
1499 # same angle beetween the direction and the sections
1500 # along the sweep surface.
1501 # @return New GEOM_Object, containing the created pipe.
1503 # @ref tui_creation_pipe "Example"
1504 def MakePipeBiNormalAlongVector(self,theBase, thePath, theVec):
1505 # Example: see GEOM_TestAll.py
1506 anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
1507 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
1513 ## @addtogroup l3_advanced
1516 ## Create a linear edge with specified ends.
1517 # @param thePnt1 Point for the first end of edge.
1518 # @param thePnt2 Point for the second end of edge.
1519 # @return New GEOM_Object, containing the created edge.
1521 # @ref tui_creation_edge "Example"
1522 def MakeEdge(self,thePnt1, thePnt2):
1523 # Example: see GEOM_TestAll.py
1524 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
1525 RaiseIfFailed("MakeEdge", self.ShapesOp)
1528 ## Create a wire from the set of edges and wires.
1529 # @param theEdgesAndWires List of edges and/or wires.
1530 # @param theTolerance Maximum distance between vertices, that will be merged.
1531 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
1532 # @return New GEOM_Object, containing the created wire.
1534 # @ref tui_creation_wire "Example"
1535 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07):
1536 # Example: see GEOM_TestAll.py
1537 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
1538 RaiseIfFailed("MakeWire", self.ShapesOp)
1541 ## Create a face on the given wire.
1542 # @param theWire closed Wire or Edge to build the face on.
1543 # @param isPlanarWanted If TRUE, only planar face will be built.
1544 # If impossible, NULL object will be returned.
1545 # @return New GEOM_Object, containing the created face.
1547 # @ref tui_creation_face "Example"
1548 def MakeFace(self,theWire, isPlanarWanted):
1549 # Example: see GEOM_TestAll.py
1550 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
1551 RaiseIfFailed("MakeFace", self.ShapesOp)
1554 ## Create a face on the given wires set.
1555 # @param theWires List of closed wires or edges to build the face on.
1556 # @param isPlanarWanted If TRUE, only planar face will be built.
1557 # If impossible, NULL object will be returned.
1558 # @return New GEOM_Object, containing the created face.
1560 # @ref tui_creation_face "Example"
1561 def MakeFaceWires(self,theWires, isPlanarWanted):
1562 # Example: see GEOM_TestAll.py
1563 anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
1564 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
1567 ## Shortcut to MakeFaceWires()
1569 # @ref tui_creation_face "Example 1"
1570 # \n @ref swig_MakeFaces "Example 2"
1571 def MakeFaces(self,theWires, isPlanarWanted):
1572 # Example: see GEOM_TestOthers.py
1573 anObj = self.MakeFaceWires(theWires, isPlanarWanted)
1576 ## Create a shell from the set of faces and shells.
1577 # @param theFacesAndShells List of faces and/or shells.
1578 # @return New GEOM_Object, containing the created shell.
1580 # @ref tui_creation_shell "Example"
1581 def MakeShell(self,theFacesAndShells):
1582 # Example: see GEOM_TestAll.py
1583 anObj = self.ShapesOp.MakeShell(theFacesAndShells)
1584 RaiseIfFailed("MakeShell", self.ShapesOp)
1587 ## Create a solid, bounded by the given shells.
1588 # @param theShells Sequence of bounding shells.
1589 # @return New GEOM_Object, containing the created solid.
1591 # @ref tui_creation_solid "Example"
1592 def MakeSolid(self,theShells):
1593 # Example: see GEOM_TestAll.py
1594 anObj = self.ShapesOp.MakeSolidShells(theShells)
1595 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
1598 ## Create a compound of the given shapes.
1599 # @param theShapes List of shapes to put in compound.
1600 # @return New GEOM_Object, containing the created compound.
1602 # @ref tui_creation_compound "Example"
1603 def MakeCompound(self,theShapes):
1604 # Example: see GEOM_TestAll.py
1605 anObj = self.ShapesOp.MakeCompound(theShapes)
1606 RaiseIfFailed("MakeCompound", self.ShapesOp)
1609 # end of l3_advanced
1612 ## @addtogroup l2_measure
1615 ## Gives quantity of faces in the given shape.
1616 # @param theShape Shape to count faces of.
1617 # @return Quantity of faces.
1619 # @ref swig_NumberOf "Example"
1620 def NumberOfFaces(self, theShape):
1621 # Example: see GEOM_TestOthers.py
1622 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
1623 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
1626 ## Gives quantity of edges in the given shape.
1627 # @param theShape Shape to count edges of.
1628 # @return Quantity of edges.
1630 # @ref swig_NumberOf "Example"
1631 def NumberOfEdges(self, theShape):
1632 # Example: see GEOM_TestOthers.py
1633 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
1634 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
1637 ## Gives quantity of subshapes of type theShapeType in the given shape.
1638 # @param theShape Shape to count subshapes of.
1639 # @param theShapeType Type of subshapes to count.
1640 # @return Quantity of subshapes of given type.
1642 # @ref swig_NumberOf "Example"
1643 def NumberOfSubShapes(self, theShape, theShapeType):
1644 # Example: see GEOM_TestOthers.py
1645 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
1646 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
1649 ## Gives quantity of solids in the given shape.
1650 # @param theShape Shape to count solids in.
1651 # @return Quantity of solids.
1653 # @ref swig_NumberOf "Example"
1654 def NumberOfSolids(self, theShape):
1655 # Example: see GEOM_TestOthers.py
1656 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, ShapeType["SOLID"])
1657 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
1663 ## @addtogroup l3_healing
1666 ## Reverses an orientation the given shape.
1667 # @param theShape Shape to be reversed.
1668 # @return The reversed copy of theShape.
1670 # @ref swig_ChangeOrientation "Example"
1671 def ChangeOrientation(self,theShape):
1672 # Example: see GEOM_TestAll.py
1673 anObj = self.ShapesOp.ChangeOrientation(theShape)
1674 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
1677 ## Shortcut to ChangeOrientation()
1679 # @ref swig_OrientationChange "Example"
1680 def OrientationChange(self,theShape):
1681 # Example: see GEOM_TestOthers.py
1682 anObj = self.ChangeOrientation(theShape)
1688 ## @addtogroup l4_obtain
1691 ## Retrieve all free faces from the given shape.
1692 # Free face is a face, which is not shared between two shells of the shape.
1693 # @param theShape Shape to find free faces in.
1694 # @return List of IDs of all free faces, contained in theShape.
1696 # @ref tui_measurement_tools_page "Example"
1697 def GetFreeFacesIDs(self,theShape):
1698 # Example: see GEOM_TestOthers.py
1699 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
1700 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
1703 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
1704 # @param theShape1 Shape to find sub-shapes in.
1705 # @param theShape2 Shape to find shared sub-shapes with.
1706 # @param theShapeType Type of sub-shapes to be retrieved.
1707 # @return List of sub-shapes of theShape1, shared with theShape2.
1709 # @ref swig_GetSharedShapes "Example"
1710 def GetSharedShapes(self,theShape1, theShape2, theShapeType):
1711 # Example: see GEOM_TestOthers.py
1712 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
1713 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
1716 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
1717 # situated relatively the specified plane by the certain way,
1718 # defined through <VAR>theState</VAR> parameter.
1719 # @param theShape Shape to find sub-shapes of.
1720 # @param theShapeType Type of sub-shapes to be retrieved.
1721 # @param theAx1 Vector (or line, or linear edge), specifying normal
1722 # direction and location of the plane to find shapes on.
1723 # @param theState The state of the subshapes to find. It can be one of
1724 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1725 # @return List of all found sub-shapes.
1727 # @ref swig_GetShapesOnPlane "Example"
1728 def GetShapesOnPlane(self,theShape, theShapeType, theAx1, theState):
1729 # Example: see GEOM_TestOthers.py
1730 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
1731 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
1734 ## Works like the above method, but returns list of sub-shapes indices
1736 # @ref swig_GetShapesOnPlaneIDs "Example"
1737 def GetShapesOnPlaneIDs(self,theShape, theShapeType, theAx1, theState):
1738 # Example: see GEOM_TestOthers.py
1739 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
1740 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
1743 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
1744 # situated relatively the specified plane by the certain way,
1745 # defined through <VAR>theState</VAR> parameter.
1746 # @param theShape Shape to find sub-shapes of.
1747 # @param theShapeType Type of sub-shapes to be retrieved.
1748 # @param theAx1 Vector (or line, or linear edge), specifying normal
1749 # direction of the plane to find shapes on.
1750 # @param thePnt Point specifying location of the plane to find shapes on.
1751 # @param theState The state of the subshapes to find. It can be one of
1752 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1753 # @return List of all found sub-shapes.
1755 # @ref swig_GetShapesOnPlaneWithLocation "Example"
1756 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState):
1757 # Example: see GEOM_TestOthers.py
1758 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
1759 theAx1, thePnt, theState)
1760 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
1763 ## Works like the above method, but returns list of sub-shapes indices
1765 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
1766 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
1767 # Example: see GEOM_TestOthers.py
1768 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
1769 theAx1, thePnt, theState)
1770 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
1773 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1774 # the specified cylinder by the certain way, defined through \a theState parameter.
1775 # @param theShape Shape to find sub-shapes of.
1776 # @param theShapeType Type of sub-shapes to be retrieved.
1777 # @param theAxis Vector (or line, or linear edge), specifying
1778 # axis of the cylinder to find shapes on.
1779 # @param theRadius Radius of the cylinder to find shapes on.
1780 # @param theState The state of the subshapes to find. It can be one of
1781 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1782 # @return List of all found sub-shapes.
1784 # @ref swig_GetShapesOnCylinder "Example"
1785 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState):
1786 # Example: see GEOM_TestOthers.py
1787 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
1788 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
1791 ## Works like the above method, but returns list of sub-shapes indices
1793 # @ref swig_GetShapesOnCylinderIDs "Example"
1794 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
1795 # Example: see GEOM_TestOthers.py
1796 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
1797 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
1800 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1801 # the specified cylinder by the certain way, defined through \a theState parameter.
1802 # @param theShape Shape to find sub-shapes of.
1803 # @param theShapeType Type of sub-shapes to be retrieved.
1804 # @param theAxis Vector (or line, or linear edge), specifying
1805 # axis of the cylinder to find shapes on.
1806 # @param thePnt Point specifying location of the bottom of the cylinder.
1807 # @param theRadius Radius of the cylinder to find shapes on.
1808 # @param theState The state of the subshapes to find. It can be one of
1809 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1810 # @return List of all found sub-shapes.
1812 # @ref swig_GetShapesOnCylinderWithLocation "Example"
1813 def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
1814 # Example: see GEOM_TestOthers.py
1815 aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
1816 RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
1819 ## Works like the above method, but returns list of sub-shapes indices
1821 # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
1822 def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
1823 # Example: see GEOM_TestOthers.py
1824 aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
1825 RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
1828 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1829 # the specified sphere by the certain way, defined through \a theState parameter.
1830 # @param theShape Shape to find sub-shapes of.
1831 # @param theShapeType Type of sub-shapes to be retrieved.
1832 # @param theCenter Point, specifying center of the sphere to find shapes on.
1833 # @param theRadius Radius of the sphere to find shapes on.
1834 # @param theState The state of the subshapes to find. It can be one of
1835 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1836 # @return List of all found sub-shapes.
1838 # @ref swig_GetShapesOnSphere "Example"
1839 def GetShapesOnSphere(self,theShape, theShapeType, theCenter, theRadius, theState):
1840 # Example: see GEOM_TestOthers.py
1841 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
1842 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
1845 ## Works like the above method, but returns list of sub-shapes indices
1847 # @ref swig_GetShapesOnSphereIDs "Example"
1848 def GetShapesOnSphereIDs(self,theShape, theShapeType, theCenter, theRadius, theState):
1849 # Example: see GEOM_TestOthers.py
1850 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
1851 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
1854 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1855 # the specified quadrangle by the certain way, defined through \a theState parameter.
1856 # @param theShape Shape to find sub-shapes of.
1857 # @param theShapeType Type of sub-shapes to be retrieved.
1858 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
1859 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
1860 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
1861 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
1862 # @param theState The state of the subshapes to find. It can be one of
1863 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1864 # @return List of all found sub-shapes.
1866 # @ref swig_GetShapesOnQuadrangle "Example"
1867 def GetShapesOnQuadrangle(self, theShape, theShapeType,
1868 theTopLeftPoint, theTopRigthPoint,
1869 theBottomLeftPoint, theBottomRigthPoint, theState):
1870 # Example: see GEOM_TestOthers.py
1871 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
1872 theTopLeftPoint, theTopRigthPoint,
1873 theBottomLeftPoint, theBottomRigthPoint, theState)
1874 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
1877 ## Works like the above method, but returns list of sub-shapes indices
1879 # @ref swig_GetShapesOnQuadrangleIDs "Example"
1880 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
1881 theTopLeftPoint, theTopRigthPoint,
1882 theBottomLeftPoint, theBottomRigthPoint, theState):
1883 # Example: see GEOM_TestOthers.py
1884 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
1885 theTopLeftPoint, theTopRigthPoint,
1886 theBottomLeftPoint, theBottomRigthPoint, theState)
1887 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
1890 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1891 # the specified \a theBox by the certain way, defined through \a theState parameter.
1892 # @param theBox Shape for relative comparing.
1893 # @param theShape Shape to find sub-shapes of.
1894 # @param theShapeType Type of sub-shapes to be retrieved.
1895 # @param theState The state of the subshapes to find. It can be one of
1896 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1897 # @return List of all found sub-shapes.
1899 # @ref swig_GetShapesOnBox "Example"
1900 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState):
1901 # Example: see GEOM_TestOthers.py
1902 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
1903 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
1906 ## Works like the above method, but returns list of sub-shapes indices
1908 # @ref swig_GetShapesOnBoxIDs "Example"
1909 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
1910 # Example: see GEOM_TestOthers.py
1911 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
1912 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
1915 ## Find in \a theShape all sub-shapes of type \a theShapeType,
1916 # situated relatively the specified \a theCheckShape by the
1917 # certain way, defined through \a theState parameter.
1918 # @param theCheckShape Shape for relative comparing. It must be a solid.
1919 # @param theShape Shape to find sub-shapes of.
1920 # @param theShapeType Type of sub-shapes to be retrieved.
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_GetShapesOnShape "Example"
1926 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState):
1927 # Example: see GEOM_TestOthers.py
1928 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
1929 theShapeType, theState)
1930 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
1933 ## Works like the above method, but returns result as compound
1935 # @ref swig_GetShapesOnShapeAsCompound "Example"
1936 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState):
1937 # Example: see GEOM_TestOthers.py
1938 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
1939 theShapeType, theState)
1940 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
1943 ## Works like the above method, but returns list of sub-shapes indices
1945 # @ref swig_GetShapesOnShapeIDs "Example"
1946 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
1947 # Example: see GEOM_TestOthers.py
1948 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
1949 theShapeType, theState)
1950 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
1953 ## Get sub-shape(s) of theShapeWhere, which are
1954 # coincident with \a theShapeWhat or could be a part of it.
1955 # @param theShapeWhere Shape to find sub-shapes of.
1956 # @param theShapeWhat Shape, specifying what to find.
1957 # @return Group of all found sub-shapes or a single found sub-shape.
1959 # @ref swig_GetInPlace "Example"
1960 def GetInPlace(self,theShapeWhere, theShapeWhat):
1961 # Example: see GEOM_TestOthers.py
1962 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
1963 RaiseIfFailed("GetInPlace", self.ShapesOp)
1966 ## Get sub-shape(s) of \a theShapeWhere, which are
1967 # coincident with \a theShapeWhat or could be a part of it.
1969 # Implementation of this method is based on a saved history of an operation,
1970 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
1971 # arguments (an argument shape or a sub-shape of an argument shape).
1972 # The operation could be the Partition or one of boolean operations,
1973 # performed on simple shapes (not on compounds).
1975 # @param theShapeWhere Shape to find sub-shapes of.
1976 # @param theShapeWhat Shape, specifying what to find (must be in the
1977 # building history of the ShapeWhere).
1978 # @return Group of all found sub-shapes or a single found sub-shape.
1980 # @ref swig_GetInPlace "Example"
1981 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat):
1982 # Example: see GEOM_TestOthers.py
1983 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
1984 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
1987 ## Get sub-shape of theShapeWhere, which is
1988 # equal to \a theShapeWhat.
1989 # @param theShapeWhere Shape to find sub-shape of.
1990 # @param theShapeWhat Shape, specifying what to find.
1991 # @return New GEOM_Object for found sub-shape.
1993 # @ref swig_GetSame "Example"
1994 def GetSame(self,theShapeWhere, theShapeWhat):
1995 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
1996 RaiseIfFailed("GetSame", self.ShapesOp)
2002 ## @addtogroup l4_access
2005 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
2006 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
2008 # @ref swig_all_decompose "Example"
2009 def GetSubShape(self, aShape, ListOfID):
2010 # Example: see GEOM_TestAll.py
2011 anObj = self.AddSubShape(aShape,ListOfID)
2014 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
2016 # @ref swig_all_decompose "Example"
2017 def GetSubShapeID(self, aShape, aSubShape):
2018 # Example: see GEOM_TestAll.py
2019 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
2020 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
2026 ## @addtogroup l4_decompose
2029 ## Explode a shape on subshapes of a given type.
2030 # @param aShape Shape to be exploded.
2031 # @param aType Type of sub-shapes to be retrieved.
2032 # @return List of sub-shapes of type theShapeType, contained in theShape.
2034 # @ref swig_all_decompose "Example"
2035 def SubShapeAll(self, aShape, aType):
2036 # Example: see GEOM_TestAll.py
2037 ListObj = self.ShapesOp.MakeExplode(aShape,aType,0)
2038 RaiseIfFailed("MakeExplode", self.ShapesOp)
2041 ## Explode a shape on subshapes of a given type.
2042 # @param aShape Shape to be exploded.
2043 # @param aType Type of sub-shapes to be retrieved.
2044 # @return List of IDs of sub-shapes.
2046 # @ref swig_all_decompose "Example"
2047 def SubShapeAllIDs(self, aShape, aType):
2048 ListObj = self.ShapesOp.SubShapeAllIDs(aShape,aType,0)
2049 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
2052 ## Explode a shape on subshapes of a given type.
2053 # Sub-shapes will be sorted by coordinates of their gravity centers.
2054 # @param aShape Shape to be exploded.
2055 # @param aType Type of sub-shapes to be retrieved.
2056 # @return List of sub-shapes of type theShapeType, contained in theShape.
2058 # @ref swig_SubShapeAllSorted "Example"
2059 def SubShapeAllSorted(self, aShape, aType):
2060 # Example: see GEOM_TestAll.py
2061 ListObj = self.ShapesOp.MakeExplode(aShape,aType,1)
2062 RaiseIfFailed("MakeExplode", self.ShapesOp)
2065 ## Explode a shape on subshapes of a given type.
2066 # Sub-shapes will be sorted by coordinates of their gravity centers.
2067 # @param aShape Shape to be exploded.
2068 # @param aType Type of sub-shapes to be retrieved.
2069 # @return List of IDs of sub-shapes.
2071 # @ref swig_all_decompose "Example"
2072 def SubShapeAllSortedIDs(self, aShape, aType):
2073 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape,aType,1)
2074 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
2077 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
2078 # selected by they indices in list of all sub-shapes of type <VAR>aType</VAR>.
2079 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
2081 # @ref swig_all_decompose "Example"
2082 def SubShape(self, aShape, aType, ListOfInd):
2083 # Example: see GEOM_TestAll.py
2085 AllShapeList = self.SubShapeAll(aShape, aType)
2086 for ind in ListOfInd:
2087 ListOfIDs.append(self.GetSubShapeID(aShape, AllShapeList[ind - 1]))
2088 anObj = self.GetSubShape(aShape, ListOfIDs)
2091 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
2092 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
2093 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
2095 # @ref swig_all_decompose "Example"
2096 def SubShapeSorted(self,aShape, aType, ListOfInd):
2097 # Example: see GEOM_TestAll.py
2099 AllShapeList = self.SubShapeAllSorted(aShape, aType)
2100 for ind in ListOfInd:
2101 ListOfIDs.append(self.GetSubShapeID(aShape, AllShapeList[ind - 1]))
2102 anObj = self.GetSubShape(aShape, ListOfIDs)
2105 # end of l4_decompose
2108 ## @addtogroup l3_healing
2111 ## Apply a sequence of Shape Healing operators to the given object.
2112 # @param theShape Shape to be processed.
2113 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
2114 # @param theParameters List of names of parameters
2115 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
2116 # @param theValues List of values of parameters, in the same order
2117 # as parameters are listed in <VAR>theParameters</VAR> list.
2118 # @return New GEOM_Object, containing processed shape.
2120 # @ref tui_shape_processing "Example"
2121 def ProcessShape(self,theShape, theOperators, theParameters, theValues):
2122 # Example: see GEOM_TestHealing.py
2123 theValues,Parameters = ParseList(theValues)
2124 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
2125 RaiseIfFailed("ProcessShape", self.HealOp)
2126 for string in (theOperators + theParameters):
2127 Parameters = ":" + Parameters
2129 anObj.SetParameters(Parameters)
2132 ## Remove faces from the given object (shape).
2133 # @param theObject Shape to be processed.
2134 # @param theFaces Indices of faces to be removed, if EMPTY then the method
2135 # removes ALL faces of the given object.
2136 # @return New GEOM_Object, containing processed shape.
2138 # @ref tui_suppress_faces "Example"
2139 def SuppressFaces(self,theObject, theFaces):
2140 # Example: see GEOM_TestHealing.py
2141 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
2142 RaiseIfFailed("SuppressFaces", self.HealOp)
2145 ## Sewing of some shapes into single shape.
2147 # @ref tui_sewing "Example"
2148 def MakeSewing(self, ListShape, theTolerance):
2149 # Example: see GEOM_TestHealing.py
2150 comp = self.MakeCompound(ListShape)
2151 anObj = self.Sew(comp, theTolerance)
2154 ## Sewing of the given object.
2155 # @param theObject Shape to be processed.
2156 # @param theTolerance Required tolerance value.
2157 # @return New GEOM_Object, containing processed shape.
2158 def Sew(self, theObject, theTolerance):
2159 # Example: see MakeSewing() above
2160 theTolerance,Parameters = ParseParameters(theTolerance)
2161 anObj = self.HealOp.Sew(theObject, theTolerance)
2162 RaiseIfFailed("Sew", self.HealOp)
2163 anObj.SetParameters(Parameters)
2166 ## Remove internal wires and edges from the given object (face).
2167 # @param theObject Shape to be processed.
2168 # @param theWires Indices of wires to be removed, if EMPTY then the method
2169 # removes ALL internal wires of the given object.
2170 # @return New GEOM_Object, containing processed shape.
2172 # @ref tui_suppress_internal_wires "Example"
2173 def SuppressInternalWires(self,theObject, theWires):
2174 # Example: see GEOM_TestHealing.py
2175 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
2176 RaiseIfFailed("RemoveIntWires", self.HealOp)
2179 ## Remove internal closed contours (holes) from the given object.
2180 # @param theObject Shape to be processed.
2181 # @param theWires Indices of wires to be removed, if EMPTY then the method
2182 # removes ALL internal holes of the given object
2183 # @return New GEOM_Object, containing processed shape.
2185 # @ref tui_suppress_holes "Example"
2186 def SuppressHoles(self,theObject, theWires):
2187 # Example: see GEOM_TestHealing.py
2188 anObj = self.HealOp.FillHoles(theObject, theWires)
2189 RaiseIfFailed("FillHoles", self.HealOp)
2192 ## Close an open wire.
2193 # @param theObject Shape to be processed.
2194 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
2195 # if -1, then <VAR>theObject</VAR> itself is a wire.
2196 # @param isCommonVertex If TRUE : closure by creation of a common vertex,
2197 # If FALS : closure by creation of an edge between ends.
2198 # @return New GEOM_Object, containing processed shape.
2200 # @ref tui_close_contour "Example"
2201 def CloseContour(self,theObject, theWires, isCommonVertex):
2202 # Example: see GEOM_TestHealing.py
2203 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
2204 RaiseIfFailed("CloseContour", self.HealOp)
2207 ## Addition of a point to a given edge object.
2208 # @param theObject Shape to be processed.
2209 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
2210 # if -1, then theObject itself is the edge.
2211 # @param theValue Value of parameter on edge or length parameter,
2212 # depending on \a isByParameter.
2213 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1],
2214 # if FALSE : \a theValue is treated as a length parameter [0..1]
2215 # @return New GEOM_Object, containing processed shape.
2217 # @ref tui_add_point_on_edge "Example"
2218 def DivideEdge(self,theObject, theEdgeIndex, theValue, isByParameter):
2219 # Example: see GEOM_TestHealing.py
2220 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
2221 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
2222 RaiseIfFailed("DivideEdge", self.HealOp)
2223 anObj.SetParameters(Parameters)
2226 ## Change orientation of the given object. Updates given shape.
2227 # @param theObject Shape to be processed.
2229 # @ref swig_todo "Example"
2230 def ChangeOrientationShell(self,theObject):
2231 theObject = self.HealOp.ChangeOrientation(theObject)
2232 RaiseIfFailed("ChangeOrientation", self.HealOp)
2235 ## Change orientation of the given object.
2236 # @param theObject Shape to be processed.
2237 # @return New GEOM_Object, containing processed shape.
2239 # @ref swig_todo "Example"
2240 def ChangeOrientationShellCopy(self,theObject):
2241 anObj = self.HealOp.ChangeOrientationCopy(theObject)
2242 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
2245 ## Get a list of wires (wrapped in GEOM_Object-s),
2246 # that constitute a free boundary of the given shape.
2247 # @param theObject Shape to get free boundary of.
2248 # @return [status, theClosedWires, theOpenWires]
2249 # status: FALSE, if an error(s) occured during the method execution.
2250 # theClosedWires: Closed wires on the free boundary of the given shape.
2251 # theOpenWires: Open wires on the free boundary of the given shape.
2253 # @ref tui_measurement_tools_page "Example"
2254 def GetFreeBoundary(self,theObject):
2255 # Example: see GEOM_TestHealing.py
2256 anObj = self.HealOp.GetFreeBoundary(theObject)
2257 RaiseIfFailed("GetFreeBoundary", self.HealOp)
2260 ## Replace coincident faces in theShape by one face.
2261 # @param theShape Initial shape.
2262 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
2263 # @param doKeepNonSolids If FALSE, only solids will present in the result,
2264 # otherwise all initial shapes.
2265 # @return New GEOM_Object, containing a copy of theShape without coincident faces.
2267 # @ref tui_glue_faces "Example"
2268 def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True):
2269 # Example: see GEOM_Spanner.py
2270 theTolerance,Parameters = ParseParameters(theTolerance)
2271 anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
2273 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
2274 anObj.SetParameters(Parameters)
2277 ## Find coincident faces in theShape for possible gluing.
2278 # @param theShape Initial shape.
2279 # @param theTolerance Maximum distance between faces,
2280 # which can be considered as coincident.
2283 # @ref swig_todo "Example"
2284 def GetGlueFaces(self, theShape, theTolerance):
2285 # Example: see GEOM_Spanner.py
2286 anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
2287 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
2290 ## Replace coincident faces in theShape by one face
2291 # in compliance with given list of faces
2292 # @param theShape Initial shape.
2293 # @param theTolerance Maximum distance between faces,
2294 # which can be considered as coincident.
2295 # @param theFaces List of faces for gluing.
2296 # @param doKeepNonSolids If FALSE, only solids will present in the result,
2297 # otherwise all initial shapes.
2298 # @return New GEOM_Object, containing a copy of theShape
2299 # without some faces.
2301 # @ref swig_todo "Example"
2302 def MakeGlueFacesByList(self, theShape, theTolerance, theFaces, doKeepNonSolids=True):
2303 # Example: see GEOM_Spanner.py
2304 anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces, doKeepNonSolids)
2306 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
2312 ## @addtogroup l3_boolean Boolean Operations
2315 # -----------------------------------------------------------------------------
2316 # Boolean (Common, Cut, Fuse, Section)
2317 # -----------------------------------------------------------------------------
2319 ## Perform one of boolean operations on two given shapes.
2320 # @param theShape1 First argument for boolean operation.
2321 # @param theShape2 Second argument for boolean operation.
2322 # @param theOperation Indicates the operation to be done:
2323 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
2324 # @return New GEOM_Object, containing the result shape.
2326 # @ref tui_fuse "Example"
2327 def MakeBoolean(self,theShape1, theShape2, theOperation):
2328 # Example: see GEOM_TestAll.py
2329 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation)
2330 RaiseIfFailed("MakeBoolean", self.BoolOp)
2333 ## Shortcut to MakeBoolean(s1, s2, 1)
2335 # @ref tui_common "Example 1"
2336 # \n @ref swig_MakeCommon "Example 2"
2337 def MakeCommon(self, s1, s2):
2338 # Example: see GEOM_TestOthers.py
2339 return self.MakeBoolean(s1, s2, 1)
2341 ## Shortcut to MakeBoolean(s1, s2, 2)
2343 # @ref tui_cut "Example 1"
2344 # \n @ref swig_MakeCommon "Example 2"
2345 def MakeCut(self, s1, s2):
2346 # Example: see GEOM_TestOthers.py
2347 return self.MakeBoolean(s1, s2, 2)
2349 ## Shortcut to MakeBoolean(s1, s2, 3)
2351 # @ref tui_fuse "Example 1"
2352 # \n @ref swig_MakeCommon "Example 2"
2353 def MakeFuse(self, s1, s2):
2354 # Example: see GEOM_TestOthers.py
2355 return self.MakeBoolean(s1, s2, 3)
2357 ## Shortcut to MakeBoolean(s1, s2, 4)
2359 # @ref tui_section "Example 1"
2360 # \n @ref swig_MakeCommon "Example 2"
2361 def MakeSection(self, s1, s2):
2362 # Example: see GEOM_TestOthers.py
2363 return self.MakeBoolean(s1, s2, 4)
2368 ## @addtogroup l3_basic_op
2371 ## Perform partition operation.
2372 # @param ListShapes Shapes to be intersected.
2373 # @param ListTools Shapes to intersect theShapes.
2374 # !!!NOTE: Each compound from ListShapes and ListTools will be exploded
2375 # in order to avoid possible intersection between shapes from
2377 # @param Limit Type of resulting shapes (corresponding to TopAbs_ShapeEnum).
2378 # @param KeepNonlimitShapes: if this parameter == 0 - only shapes with
2379 # type <= Limit are kept in the result,
2380 # else - shapes with type > Limit are kept
2381 # also (if they exist)
2383 # After implementation new version of PartitionAlgo (October 2006)
2384 # other parameters are ignored by current functionality. They are kept
2385 # in this function only for support old versions.
2386 # Ignored parameters:
2387 # @param ListKeepInside Shapes, outside which the results will be deleted.
2388 # Each shape from theKeepInside must belong to theShapes also.
2389 # @param ListRemoveInside Shapes, inside which the results will be deleted.
2390 # Each shape from theRemoveInside must belong to theShapes also.
2391 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
2392 # @param ListMaterials Material indices for each shape. Make sence,
2393 # only if theRemoveWebs is TRUE.
2395 # @return New GEOM_Object, containing the result shapes.
2397 # @ref tui_partition "Example"
2398 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
2399 Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
2400 KeepNonlimitShapes=0):
2401 # Example: see GEOM_TestAll.py
2402 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
2403 ListKeepInside, ListRemoveInside,
2404 Limit, RemoveWebs, ListMaterials,
2405 KeepNonlimitShapes);
2406 RaiseIfFailed("MakePartition", self.BoolOp)
2409 ## Perform partition operation.
2410 # This method may be useful if it is needed to make a partition for
2411 # compound contains nonintersected shapes. Performance will be better
2412 # since intersection between shapes from compound is not performed.
2414 # Description of all parameters as in previous method MakePartition()
2416 # !!!NOTE: Passed compounds (via ListShapes or via ListTools)
2417 # have to consist of nonintersecting shapes.
2419 # @return New GEOM_Object, containing the result shapes.
2421 # @ref swig_todo "Example"
2422 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
2423 ListKeepInside=[], ListRemoveInside=[],
2424 Limit=ShapeType["SHAPE"], RemoveWebs=0,
2425 ListMaterials=[], KeepNonlimitShapes=0):
2426 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
2427 ListKeepInside, ListRemoveInside,
2428 Limit, RemoveWebs, ListMaterials,
2429 KeepNonlimitShapes);
2430 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
2433 ## Shortcut to MakePartition()
2435 # @ref tui_partition "Example 1"
2436 # \n @ref swig_Partition "Example 2"
2437 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
2438 Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
2439 KeepNonlimitShapes=0):
2440 # Example: see GEOM_TestOthers.py
2441 anObj = self.MakePartition(ListShapes, ListTools,
2442 ListKeepInside, ListRemoveInside,
2443 Limit, RemoveWebs, ListMaterials,
2444 KeepNonlimitShapes);
2447 ## Perform partition of the Shape with the Plane
2448 # @param theShape Shape to be intersected.
2449 # @param thePlane Tool shape, to intersect theShape.
2450 # @return New GEOM_Object, containing the result shape.
2452 # @ref tui_partition "Example"
2453 def MakeHalfPartition(self,theShape, thePlane):
2454 # Example: see GEOM_TestAll.py
2455 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
2456 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
2459 # end of l3_basic_op
2462 ## @addtogroup l3_transform
2465 ## Translate the given object along the vector, specified
2466 # by its end points, creating its copy before the translation.
2467 # @param theObject The object to be translated.
2468 # @param thePoint1 Start point of translation vector.
2469 # @param thePoint2 End point of translation vector.
2470 # @return New GEOM_Object, containing the translated object.
2472 # @ref tui_translation "Example 1"
2473 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
2474 def MakeTranslationTwoPoints(self,theObject, thePoint1, thePoint2):
2475 # Example: see GEOM_TestAll.py
2476 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
2477 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
2480 ## Translate the given object along the vector, specified by its components.
2481 # @param theObject The object to be translated.
2482 # @param theDX,theDY,theDZ Components of translation vector.
2483 # @return Translated GEOM_Object.
2485 # @ref tui_translation "Example"
2486 def TranslateDXDYDZ(self,theObject, theDX, theDY, theDZ):
2487 # Example: see GEOM_TestAll.py
2488 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
2489 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
2490 anObj.SetParameters(Parameters)
2491 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
2494 ## Translate the given object along the vector, specified
2495 # by its components, creating its copy before the translation.
2496 # @param theObject The object to be translated.
2497 # @param theDX,theDY,theDZ Components of translation vector.
2498 # @return New GEOM_Object, containing the translated object.
2500 # @ref tui_translation "Example"
2501 def MakeTranslation(self,theObject, theDX, theDY, theDZ):
2502 # Example: see GEOM_TestAll.py
2503 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
2504 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
2505 anObj.SetParameters(Parameters)
2506 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
2509 ## Translate the given object along the given vector,
2510 # creating its copy before the translation.
2511 # @param theObject The object to be translated.
2512 # @param theVector The translation vector.
2513 # @return New GEOM_Object, containing the translated object.
2515 # @ref tui_translation "Example"
2516 def MakeTranslationVector(self,theObject, theVector):
2517 # Example: see GEOM_TestAll.py
2518 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
2519 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
2522 ## Translate the given object along the given vector on given distance.
2523 # @param theObject The object to be translated.
2524 # @param theVector The translation vector.
2525 # @param theDistance The translation distance.
2526 # @param theCopy Flag used to translate object itself or create a copy.
2527 # @return Translated GEOM_Object.
2529 # @ref tui_translation "Example"
2530 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy):
2531 # Example: see GEOM_TestAll.py
2532 theDistance,Parameters = ParseParameters(theDistance)
2533 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
2534 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
2535 anObj.SetParameters(Parameters)
2538 ## Translate the given object along the given vector on given distance,
2539 # creating its copy before the translation.
2540 # @param theObject The object to be translated.
2541 # @param theVector The translation vector.
2542 # @param theDistance The translation distance.
2543 # @return New GEOM_Object, containing the translated object.
2545 # @ref tui_translation "Example"
2546 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance):
2547 # Example: see GEOM_TestAll.py
2548 theDistance,Parameters = ParseParameters(theDistance)
2549 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
2550 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
2551 anObj.SetParameters(Parameters)
2554 ## Rotate the given object around the given axis on the given angle.
2555 # @param theObject The object to be rotated.
2556 # @param theAxis Rotation axis.
2557 # @param theAngle Rotation angle in radians.
2558 # @return Rotated GEOM_Object.
2560 # @ref tui_rotation "Example"
2561 def Rotate(self,theObject, theAxis, theAngle):
2562 # Example: see GEOM_TestAll.py
2564 if isinstance(theAngle,str):
2566 theAngle, Parameters = ParseParameters(theAngle)
2568 theAngle = theAngle*math.pi/180.0
2569 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
2570 RaiseIfFailed("RotateCopy", self.TrsfOp)
2571 anObj.SetParameters(Parameters)
2574 ## Rotate the given object around the given axis
2575 # on the given angle, creating its copy before the rotatation.
2576 # @param theObject The object to be rotated.
2577 # @param theAxis Rotation axis.
2578 # @param theAngle Rotation angle in radians.
2579 # @return New GEOM_Object, containing the rotated object.
2581 # @ref tui_rotation "Example"
2582 def MakeRotation(self,theObject, theAxis, theAngle):
2583 # Example: see GEOM_TestAll.py
2585 if isinstance(theAngle,str):
2587 theAngle, Parameters = ParseParameters(theAngle)
2589 theAngle = theAngle*math.pi/180.0
2590 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
2591 RaiseIfFailed("RotateCopy", self.TrsfOp)
2592 anObj.SetParameters(Parameters)
2595 ## Rotate given object around vector perpendicular to plane
2596 # containing three points, creating its copy before the rotatation.
2597 # @param theObject The object to be rotated.
2598 # @param theCentPoint central point - the axis is the vector perpendicular to the plane
2599 # containing the three points.
2600 # @param thePoint1,thePoint2 - in a perpendicular plane of the axis.
2601 # @return New GEOM_Object, containing the rotated object.
2603 # @ref tui_rotation "Example"
2604 def MakeRotationThreePoints(self,theObject, theCentPoint, thePoint1, thePoint2):
2605 # Example: see GEOM_TestAll.py
2606 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
2607 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
2610 ## Scale the given object by the factor, creating its copy before the scaling.
2611 # @param theObject The object to be scaled.
2612 # @param thePoint Center point for scaling.
2613 # Passing None for it means scaling relatively the origin of global CS.
2614 # @param theFactor Scaling factor value.
2615 # @return New GEOM_Object, containing the scaled shape.
2617 # @ref tui_scale "Example"
2618 def MakeScaleTransform(self, theObject, thePoint, theFactor):
2619 # Example: see GEOM_TestAll.py
2620 theFactor, Parameters = ParseParameters(theFactor)
2621 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
2622 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
2623 anObj.SetParameters(Parameters)
2626 ## Scale the given object by different factors along coordinate axes,
2627 # creating its copy before the scaling.
2628 # @param theObject The object to be scaled.
2629 # @param thePoint Center point for scaling.
2630 # Passing None for it means scaling relatively the origin of global CS.
2631 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
2632 # @return New GEOM_Object, containing the scaled shape.
2634 # @ref swig_scale "Example"
2635 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ):
2636 # Example: see GEOM_TestAll.py
2637 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
2638 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
2639 theFactorX, theFactorY, theFactorZ)
2640 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
2641 anObj.SetParameters(Parameters)
2644 ## Create an object, symmetrical
2645 # to the given one relatively the given plane.
2646 # @param theObject The object to be mirrored.
2647 # @param thePlane Plane of symmetry.
2648 # @return New GEOM_Object, containing the mirrored shape.
2650 # @ref tui_mirror "Example"
2651 def MakeMirrorByPlane(self,theObject, thePlane):
2652 # Example: see GEOM_TestAll.py
2653 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
2654 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
2657 ## Create an object, symmetrical
2658 # to the given one relatively the given axis.
2659 # @param theObject The object to be mirrored.
2660 # @param theAxis Axis of symmetry.
2661 # @return New GEOM_Object, containing the mirrored shape.
2663 # @ref tui_mirror "Example"
2664 def MakeMirrorByAxis(self,theObject, theAxis):
2665 # Example: see GEOM_TestAll.py
2666 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
2667 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
2670 ## Create an object, symmetrical
2671 # to the given one relatively the given point.
2672 # @param theObject The object to be mirrored.
2673 # @param thePoint Point of symmetry.
2674 # @return New GEOM_Object, containing the mirrored shape.
2676 # @ref tui_mirror "Example"
2677 def MakeMirrorByPoint(self,theObject, thePoint):
2678 # Example: see GEOM_TestAll.py
2679 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
2680 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
2683 ## Modify the Location of the given object by LCS,
2684 # creating its copy before the setting.
2685 # @param theObject The object to be displaced.
2686 # @param theStartLCS Coordinate system to perform displacement from it.
2687 # If \a theStartLCS is NULL, displacement
2688 # will be performed from global CS.
2689 # If \a theObject itself is used as \a theStartLCS,
2690 # its location will be changed to \a theEndLCS.
2691 # @param theEndLCS Coordinate system to perform displacement to it.
2692 # @return New GEOM_Object, containing the displaced shape.
2694 # @ref tui_modify_location "Example"
2695 def MakePosition(self,theObject, theStartLCS, theEndLCS):
2696 # Example: see GEOM_TestAll.py
2697 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
2698 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
2701 ## Modify the Location of the given object by Path,
2702 # @param theObject The object to be displaced.
2703 # @param thePath Wire or Edge along that the object will be translated.
2704 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
2705 # @param theCopy is to create a copy objects if true.
2706 # @param theReverse - 0 for usual direction, 1 to reverse path direction.
2707 # @return New GEOM_Object, containing the displaced shape.
2709 # @ref tui_modify_location "Example"
2710 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
2711 # Example: see GEOM_TestAll.py
2712 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
2713 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
2716 ## Create new object as offset of the given one.
2717 # @param theObject The base object for the offset.
2718 # @param theOffset Offset value.
2719 # @return New GEOM_Object, containing the offset object.
2721 # @ref tui_offset "Example"
2722 def MakeOffset(self,theObject, theOffset):
2723 # Example: see GEOM_TestAll.py
2724 theOffset, Parameters = ParseParameters(theOffset)
2725 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
2726 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
2727 anObj.SetParameters(Parameters)
2730 # -----------------------------------------------------------------------------
2732 # -----------------------------------------------------------------------------
2734 ## Translate the given object along the given vector a given number times
2735 # @param theObject The object to be translated.
2736 # @param theVector Direction of the translation.
2737 # @param theStep Distance to translate on.
2738 # @param theNbTimes Quantity of translations to be done.
2739 # @return New GEOM_Object, containing compound of all
2740 # the shapes, obtained after each translation.
2742 # @ref tui_multi_translation "Example"
2743 def MakeMultiTranslation1D(self,theObject, theVector, theStep, theNbTimes):
2744 # Example: see GEOM_TestAll.py
2745 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
2746 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
2747 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
2748 anObj.SetParameters(Parameters)
2751 ## Conseqently apply two specified translations to theObject specified number of times.
2752 # @param theObject The object to be translated.
2753 # @param theVector1 Direction of the first translation.
2754 # @param theStep1 Step of the first translation.
2755 # @param theNbTimes1 Quantity of translations to be done along theVector1.
2756 # @param theVector2 Direction of the second translation.
2757 # @param theStep2 Step of the second translation.
2758 # @param theNbTimes2 Quantity of translations to be done along theVector2.
2759 # @return New GEOM_Object, containing compound of all
2760 # the shapes, obtained after each translation.
2762 # @ref tui_multi_translation "Example"
2763 def MakeMultiTranslation2D(self,theObject, theVector1, theStep1, theNbTimes1,
2764 theVector2, theStep2, theNbTimes2):
2765 # Example: see GEOM_TestAll.py
2766 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
2767 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
2768 theVector2, theStep2, theNbTimes2)
2769 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
2770 anObj.SetParameters(Parameters)
2773 ## Rotate the given object around the given axis a given number times.
2774 # Rotation angle will be 2*PI/theNbTimes.
2775 # @param theObject The object to be rotated.
2776 # @param theAxis The rotation axis.
2777 # @param theNbTimes Quantity of rotations to be done.
2778 # @return New GEOM_Object, containing compound of all the
2779 # shapes, obtained after each rotation.
2781 # @ref tui_multi_rotation "Example"
2782 def MultiRotate1D(self,theObject, theAxis, theNbTimes):
2783 # Example: see GEOM_TestAll.py
2784 theAxis, theNbTimes, Parameters = ParseParameters(theAxis, theNbTimes)
2785 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
2786 RaiseIfFailed("MultiRotate1D", self.TrsfOp)
2787 anObj.SetParameters(Parameters)
2790 ## Rotate the given object around the
2791 # given axis on the given angle a given number
2792 # times and multi-translate each rotation result.
2793 # Translation direction passes through center of gravity
2794 # of rotated shape and its projection on the rotation axis.
2795 # @param theObject The object to be rotated.
2796 # @param theAxis Rotation axis.
2797 # @param theAngle Rotation angle in graduces.
2798 # @param theNbTimes1 Quantity of rotations to be done.
2799 # @param theStep Translation distance.
2800 # @param theNbTimes2 Quantity of translations to be done.
2801 # @return New GEOM_Object, containing compound of all the
2802 # shapes, obtained after each transformation.
2804 # @ref tui_multi_rotation "Example"
2805 def MultiRotate2D(self,theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2):
2806 # Example: see GEOM_TestAll.py
2807 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
2808 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
2809 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
2810 anObj.SetParameters(Parameters)
2813 ## The same, as MultiRotate1D(), but axis is given by direction and point
2814 # @ref swig_MakeMultiRotation "Example"
2815 def MakeMultiRotation1D(self,aShape,aDir,aPoint,aNbTimes):
2816 # Example: see GEOM_TestOthers.py
2817 aVec = self.MakeLine(aPoint,aDir)
2818 anObj = self.MultiRotate1D(aShape,aVec,aNbTimes)
2821 ## The same, as MultiRotate2D(), but axis is given by direction and point
2822 # @ref swig_MakeMultiRotation "Example"
2823 def MakeMultiRotation2D(self,aShape,aDir,aPoint,anAngle,nbtimes1,aStep,nbtimes2):
2824 # Example: see GEOM_TestOthers.py
2825 aVec = self.MakeLine(aPoint,aDir)
2826 anObj = self.MultiRotate2D(aShape,aVec,anAngle,nbtimes1,aStep,nbtimes2)
2829 # end of l3_transform
2832 ## @addtogroup l3_local
2835 ## Perform a fillet on all edges of the given shape.
2836 # @param theShape Shape, to perform fillet on.
2837 # @param theR Fillet radius.
2838 # @return New GEOM_Object, containing the result shape.
2840 # @ref tui_fillet "Example 1"
2841 # \n @ref swig_MakeFilletAll "Example 2"
2842 def MakeFilletAll(self,theShape, theR):
2843 # Example: see GEOM_TestOthers.py
2844 theR,Parameters = ParseParameters(theR)
2845 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
2846 RaiseIfFailed("MakeFilletAll", self.LocalOp)
2847 anObj.SetParameters(Parameters)
2850 ## Perform a fillet on the specified edges/faces of the given shape
2851 # @param theShape Shape, to perform fillet on.
2852 # @param theR Fillet radius.
2853 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR>.
2854 # @param theListShapes Global indices of edges/faces to perform fillet on.
2855 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2856 # @return New GEOM_Object, containing the result shape.
2858 # @ref tui_fillet "Example"
2859 def MakeFillet(self,theShape, theR, theShapeType, theListShapes):
2860 # Example: see GEOM_TestAll.py
2861 theR,Parameters = ParseParameters(theR)
2863 if theShapeType == ShapeType["EDGE"]:
2864 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
2865 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
2867 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
2868 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
2869 anObj.SetParameters(Parameters)
2872 ## The same that MakeFillet but with two Fillet Radius R1 and R2
2873 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes):
2874 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
2876 if theShapeType == ShapeType["EDGE"]:
2877 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
2878 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
2880 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
2881 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
2882 anObj.SetParameters(Parameters)
2885 ## Perform a fillet on the specified edges of the given shape
2886 # @param theShape - Wire Shape to perform fillet on.
2887 # @param theR - Fillet radius.
2888 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
2889 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2890 # \note The list of vertices could be empty,
2891 # in this case fillet will done done at all vertices in wire
2892 # @return New GEOM_Object, containing the result shape.
2894 # @ref tui_fillet2d "Example"
2895 def MakeFillet1D(self,theShape, theR, theListOfVertexes):
2896 # Example: see GEOM_TestAll.py
2897 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes)
2898 RaiseIfFailed("MakeFillet1D", self.LocalOp)
2901 ## Perform a fillet on the specified edges/faces of the given shape
2902 # @param theShape - Face Shape to perform fillet on.
2903 # @param theR - Fillet radius.
2904 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
2905 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2906 # @return New GEOM_Object, containing the result shape.
2908 # @ref tui_fillet2d "Example"
2909 def MakeFillet2D(self,theShape, theR, theListOfVertexes):
2910 # Example: see GEOM_TestAll.py
2911 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
2912 RaiseIfFailed("MakeFillet2D", self.LocalOp)
2915 ## Perform a symmetric chamfer on all edges of the given shape.
2916 # @param theShape Shape, to perform chamfer on.
2917 # @param theD Chamfer size along each face.
2918 # @return New GEOM_Object, containing the result shape.
2920 # @ref tui_chamfer "Example 1"
2921 # \n @ref swig_MakeChamferAll "Example 2"
2922 def MakeChamferAll(self,theShape, theD):
2923 # Example: see GEOM_TestOthers.py
2924 theD,Parameters = ParseParameters(theD)
2925 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
2926 RaiseIfFailed("MakeChamferAll", self.LocalOp)
2927 anObj.SetParameters(Parameters)
2930 ## Perform a chamfer on edges, common to the specified faces,
2931 # with distance D1 on the Face1
2932 # @param theShape Shape, to perform chamfer on.
2933 # @param theD1 Chamfer size along \a theFace1.
2934 # @param theD2 Chamfer size along \a theFace2.
2935 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
2936 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2937 # @return New GEOM_Object, containing the result shape.
2939 # @ref tui_chamfer "Example"
2940 def MakeChamferEdge(self,theShape, theD1, theD2, theFace1, theFace2):
2941 # Example: see GEOM_TestAll.py
2942 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
2943 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
2944 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
2945 anObj.SetParameters(Parameters)
2948 ## The Same that MakeChamferEdge but with params theD is chamfer length and
2949 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
2950 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2):
2952 if isinstance(theAngle,str):
2954 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
2956 theAngle = theAngle*math.pi/180.0
2957 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
2958 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
2959 anObj.SetParameters(Parameters)
2962 ## Perform a chamfer on all edges of the specified faces,
2963 # with distance D1 on the first specified face (if several for one edge)
2964 # @param theShape Shape, to perform chamfer on.
2965 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
2966 # connected to the edge, are in \a theFaces, \a theD1
2967 # will be get along face, which is nearer to \a theFaces beginning.
2968 # @param theD2 Chamfer size along another of two faces, connected to the edge.
2969 # @param theFaces Sequence of global indices of faces of \a theShape.
2970 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2971 # @return New GEOM_Object, containing the result shape.
2973 # @ref tui_chamfer "Example"
2974 def MakeChamferFaces(self,theShape, theD1, theD2, theFaces):
2975 # Example: see GEOM_TestAll.py
2976 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
2977 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
2978 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
2979 anObj.SetParameters(Parameters)
2982 ## The Same that MakeChamferFaces but with params theD is chamfer lenght and
2983 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
2985 # @ref swig_FilletChamfer "Example"
2986 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces):
2988 if isinstance(theAngle,str):
2990 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
2992 theAngle = theAngle*math.pi/180.0
2993 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
2994 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
2995 anObj.SetParameters(Parameters)
2998 ## Perform a chamfer on edges,
2999 # with distance D1 on the first specified face (if several for one edge)
3000 # @param theShape Shape, to perform chamfer on.
3001 # @param theD1,theD2 Chamfer size
3002 # @param theEdges Sequence of edges of \a theShape.
3003 # @return New GEOM_Object, containing the result shape.
3005 # @ref swig_FilletChamfer "Example"
3006 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges):
3007 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
3008 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
3009 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
3010 anObj.SetParameters(Parameters)
3013 ## The Same that MakeChamferEdges but with params theD is chamfer lenght and
3014 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
3015 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges):
3017 if isinstance(theAngle,str):
3019 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
3021 theAngle = theAngle*math.pi/180.0
3022 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
3023 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
3024 anObj.SetParameters(Parameters)
3027 ## Shortcut to MakeChamferEdge() and MakeChamferFaces()
3029 # @ref swig_MakeChamfer "Example"
3030 def MakeChamfer(self,aShape,d1,d2,aShapeType,ListShape):
3031 # Example: see GEOM_TestOthers.py
3033 if aShapeType == ShapeType["EDGE"]:
3034 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1])
3036 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape)
3042 ## @addtogroup l3_basic_op
3045 ## Perform an Archimde operation on the given shape with given parameters.
3046 # The object presenting the resulting face is returned.
3047 # @param theShape Shape to be put in water.
3048 # @param theWeight Weight og the shape.
3049 # @param theWaterDensity Density of the water.
3050 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
3051 # @return New GEOM_Object, containing a section of \a theShape
3052 # by a plane, corresponding to water level.
3054 # @ref tui_archimede "Example"
3055 def Archimede(self,theShape, theWeight, theWaterDensity, theMeshDeflection):
3056 # Example: see GEOM_TestAll.py
3057 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
3058 theWeight,theWaterDensity,theMeshDeflection)
3059 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
3060 RaiseIfFailed("MakeArchimede", self.LocalOp)
3061 anObj.SetParameters(Parameters)
3064 # end of l3_basic_op
3067 ## @addtogroup l2_measure
3070 ## Get point coordinates
3073 # @ref tui_measurement_tools_page "Example"
3074 def PointCoordinates(self,Point):
3075 # Example: see GEOM_TestMeasures.py
3076 aTuple = self.MeasuOp.PointCoordinates(Point)
3077 RaiseIfFailed("PointCoordinates", self.MeasuOp)
3080 ## Get summarized length of all wires,
3081 # area of surface and volume of the given shape.
3082 # @param theShape Shape to define properties of.
3083 # @return [theLength, theSurfArea, theVolume]
3084 # theLength: Summarized length of all wires of the given shape.
3085 # theSurfArea: Area of surface of the given shape.
3086 # theVolume: Volume of the given shape.
3088 # @ref tui_measurement_tools_page "Example"
3089 def BasicProperties(self,theShape):
3090 # Example: see GEOM_TestMeasures.py
3091 aTuple = self.MeasuOp.GetBasicProperties(theShape)
3092 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
3095 ## Get parameters of bounding box of the given shape
3096 # @param theShape Shape to obtain bounding box of.
3097 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
3098 # Xmin,Xmax: Limits of shape along OX axis.
3099 # Ymin,Ymax: Limits of shape along OY axis.
3100 # Zmin,Zmax: Limits of shape along OZ axis.
3102 # @ref tui_measurement_tools_page "Example"
3103 def BoundingBox(self,theShape):
3104 # Example: see GEOM_TestMeasures.py
3105 aTuple = self.MeasuOp.GetBoundingBox(theShape)
3106 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
3109 ## Get inertia matrix and moments of inertia of theShape.
3110 # @param theShape Shape to calculate inertia of.
3111 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
3112 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
3113 # Ix,Iy,Iz: Moments of inertia of the given shape.
3115 # @ref tui_measurement_tools_page "Example"
3116 def Inertia(self,theShape):
3117 # Example: see GEOM_TestMeasures.py
3118 aTuple = self.MeasuOp.GetInertia(theShape)
3119 RaiseIfFailed("GetInertia", self.MeasuOp)
3122 ## Get minimal distance between the given shapes.
3123 # @param theShape1,theShape2 Shapes to find minimal distance between.
3124 # @return Value of the minimal distance between the given shapes.
3126 # @ref tui_measurement_tools_page "Example"
3127 def MinDistance(self, theShape1, theShape2):
3128 # Example: see GEOM_TestMeasures.py
3129 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
3130 RaiseIfFailed("GetMinDistance", self.MeasuOp)
3133 ## Get minimal distance between the given shapes.
3134 # @param theShape1,theShape2 Shapes to find minimal distance between.
3135 # @return Value of the minimal distance between the given shapes.
3137 # @ref swig_all_measure "Example"
3138 def MinDistanceComponents(self, theShape1, theShape2):
3139 # Example: see GEOM_TestMeasures.py
3140 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
3141 RaiseIfFailed("GetMinDistance", self.MeasuOp)
3142 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
3145 ## Get angle between the given shapes in degrees.
3146 # @param theShape1,theShape2 Lines or linear edges to find angle between.
3147 # @return Value of the angle between the given shapes in degrees.
3149 # @ref tui_measurement_tools_page "Example"
3150 def GetAngle(self, theShape1, theShape2):
3151 # Example: see GEOM_TestMeasures.py
3152 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
3153 RaiseIfFailed("GetAngle", self.MeasuOp)
3155 ## Get angle between the given shapes in radians.
3156 # @param theShape1,theShape2 Lines or linear edges to find angle between.
3157 # @return Value of the angle between the given shapes in radians.
3159 # @ref tui_measurement_tools_page "Example"
3160 def GetAngleRadians(self, theShape1, theShape2):
3161 # Example: see GEOM_TestMeasures.py
3162 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
3163 RaiseIfFailed("GetAngle", self.MeasuOp)
3166 ## @name Curve Curvature Measurement
3167 # Methods for receiving radius of curvature of curves
3168 # in the given point
3171 ## Measure curvature of a curve at a point, set by parameter.
3172 # @ref swig_todo "Example"
3173 def CurveCurvatureByParam(self, theCurve, theParam):
3174 # Example: see GEOM_TestMeasures.py
3175 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
3176 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
3180 # @ref swig_todo "Example"
3181 def CurveCurvatureByPoint(self, theCurve, thePoint):
3182 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
3183 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
3187 ## @name Surface Curvature Measurement
3188 # Methods for receiving max and min radius of curvature of surfaces
3189 # in the given point
3193 ## @ref swig_todo "Example"
3194 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
3195 # Example: see GEOM_TestMeasures.py
3196 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
3197 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
3201 ## @ref swig_todo "Example"
3202 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
3203 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
3204 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
3208 ## @ref swig_todo "Example"
3209 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
3210 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
3211 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
3215 ## @ref swig_todo "Example"
3216 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
3217 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
3218 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
3222 ## Get min and max tolerances of sub-shapes of theShape
3223 # @param theShape Shape, to get tolerances of.
3224 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
3225 # FaceMin,FaceMax: Min and max tolerances of the faces.
3226 # EdgeMin,EdgeMax: Min and max tolerances of the edges.
3227 # VertMin,VertMax: Min and max tolerances of the vertices.
3229 # @ref tui_measurement_tools_page "Example"
3230 def Tolerance(self,theShape):
3231 # Example: see GEOM_TestMeasures.py
3232 aTuple = self.MeasuOp.GetTolerance(theShape)
3233 RaiseIfFailed("GetTolerance", self.MeasuOp)
3236 ## Obtain description of the given shape (number of sub-shapes of each type)
3237 # @param theShape Shape to be described.
3238 # @return Description of the given shape.
3240 # @ref tui_measurement_tools_page "Example"
3241 def WhatIs(self,theShape):
3242 # Example: see GEOM_TestMeasures.py
3243 aDescr = self.MeasuOp.WhatIs(theShape)
3244 RaiseIfFailed("WhatIs", self.MeasuOp)
3247 ## Get a point, situated at the centre of mass of theShape.
3248 # @param theShape Shape to define centre of mass of.
3249 # @return New GEOM_Object, containing the created point.
3251 # @ref tui_measurement_tools_page "Example"
3252 def MakeCDG(self,theShape):
3253 # Example: see GEOM_TestMeasures.py
3254 anObj = self.MeasuOp.GetCentreOfMass(theShape)
3255 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
3258 ## Get a vertex subshape by index depended with orientation.
3259 # @param theShape Shape to find subshape.
3260 # @param theIndex Index to find vertex by this index.
3261 # @return New GEOM_Object, containing the created vertex.
3263 # @ref tui_measurement_tools_page "Example"
3264 def GetVertexByIndex(self,theShape, theIndex):
3265 # Example: see GEOM_TestMeasures.py
3266 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
3267 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
3270 ## Get the first vertex of wire/edge depended orientation.
3271 # @param theShape Shape to find first vertex.
3272 # @return New GEOM_Object, containing the created vertex.
3274 # @ref tui_measurement_tools_page "Example"
3275 def GetFirstVertex(self,theShape):
3276 # Example: see GEOM_TestMeasures.py
3277 anObj = self.GetVertexByIndex(theShape, 0)
3278 RaiseIfFailed("GetFirstVertex", self.MeasuOp)
3281 ## Get the last vertex of wire/edge depended orientation.
3282 # @param theShape Shape to find last vertex.
3283 # @return New GEOM_Object, containing the created vertex.
3285 # @ref tui_measurement_tools_page "Example"
3286 def GetLastVertex(self,theShape):
3287 # Example: see GEOM_TestMeasures.py
3288 nb_vert = self.ShapesOp.NumberOfSubShapes(theShape, ShapeType["VERTEX"])
3289 anObj = self.GetVertexByIndex(theShape, (nb_vert-1))
3290 RaiseIfFailed("GetLastVertex", self.MeasuOp)
3293 ## Get a normale to the given face. If the point is not given,
3294 # the normale is calculated at the center of mass.
3295 # @param theFace Face to define normale of.
3296 # @param theOptionalPoint Point to compute the normale at.
3297 # @return New GEOM_Object, containing the created vector.
3299 # @ref swig_todo "Example"
3300 def GetNormal(self, theFace, theOptionalPoint = None):
3301 # Example: see GEOM_TestMeasures.py
3302 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
3303 RaiseIfFailed("GetNormal", self.MeasuOp)
3306 ## Check a topology of the given shape.
3307 # @param theShape Shape to check validity of.
3308 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked,
3309 # if TRUE, the shape's geometry will be checked also.
3310 # @return TRUE, if the shape "seems to be valid".
3311 # If theShape is invalid, prints a description of problem.
3313 # @ref tui_measurement_tools_page "Example"
3314 def CheckShape(self,theShape, theIsCheckGeom = 0):
3315 # Example: see GEOM_TestMeasures.py
3317 (IsValid, Status) = self.MeasuOp.CheckShapeWithGeometry(theShape)
3318 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
3320 (IsValid, Status) = self.MeasuOp.CheckShape(theShape)
3321 RaiseIfFailed("CheckShape", self.MeasuOp)
3326 ## Get position (LCS) of theShape.
3328 # Origin of the LCS is situated at the shape's center of mass.
3329 # Axes of the LCS are obtained from shape's location or,
3330 # if the shape is a planar face, from position of its plane.
3332 # @param theShape Shape to calculate position of.
3333 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
3334 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
3335 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
3336 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
3338 # @ref swig_todo "Example"
3339 def GetPosition(self,theShape):
3340 # Example: see GEOM_TestMeasures.py
3341 aTuple = self.MeasuOp.GetPosition(theShape)
3342 RaiseIfFailed("GetPosition", self.MeasuOp)
3345 ## Get kind of theShape.
3347 # @param theShape Shape to get a kind of.
3348 # @return Returns a kind of shape in terms of <VAR>GEOM_IKindOfShape.shape_kind</VAR> enumeration
3349 # and a list of parameters, describing the shape.
3350 # @note Concrete meaning of each value, returned via \a theIntegers
3351 # or \a theDoubles list depends on the kind of the shape.
3352 # The full list of possible outputs is:
3354 # - geompy.kind.COMPOUND nb_solids nb_faces nb_edges nb_vertices
3355 # - geompy.kind.COMPSOLID nb_solids nb_faces nb_edges nb_vertices
3357 # - geompy.kind.SHELL geompy.info.CLOSED nb_faces nb_edges nb_vertices
3358 # - geompy.kind.SHELL geompy.info.UNCLOSED nb_faces nb_edges nb_vertices
3360 # - geompy.kind.WIRE geompy.info.CLOSED nb_edges nb_vertices
3361 # - geompy.kind.WIRE geompy.info.UNCLOSED nb_edges nb_vertices
3363 # - geompy.kind.SPHERE xc yc zc R
3364 # - geompy.kind.CYLINDER xb yb zb dx dy dz R H
3365 # - geompy.kind.BOX xc yc zc ax ay az
3366 # - geompy.kind.ROTATED_BOX xc yc zc zx zy zz xx xy xz ax ay az
3367 # - geompy.kind.TORUS xc yc zc dx dy dz R_1 R_2
3368 # - geompy.kind.CONE xb yb zb dx dy dz R_1 R_2 H
3369 # - geompy.kind.POLYHEDRON nb_faces nb_edges nb_vertices
3370 # - geompy.kind.SOLID nb_faces nb_edges nb_vertices
3372 # - geompy.kind.SPHERE2D xc yc zc R
3373 # - geompy.kind.CYLINDER2D xb yb zb dx dy dz R H
3374 # - geompy.kind.TORUS2D xc yc zc dx dy dz R_1 R_2
3375 # - geompy.kind.CONE2D xc yc zc dx dy dz R_1 R_2 H
3376 # - geompy.kind.DISK_CIRCLE xc yc zc dx dy dz R
3377 # - geompy.kind.DISK_ELLIPSE xc yc zc dx dy dz R_1 R_2
3378 # - geompy.kind.POLYGON xo yo zo dx dy dz nb_edges nb_vertices
3379 # - geompy.kind.PLANE xo yo zo dx dy dz
3380 # - geompy.kind.PLANAR xo yo zo dx dy dz nb_edges nb_vertices
3381 # - geompy.kind.FACE nb_edges nb_vertices
3383 # - geompy.kind.CIRCLE xc yc zc dx dy dz R
3384 # - geompy.kind.ARC_CIRCLE xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2
3385 # - geompy.kind.ELLIPSE xc yc zc dx dy dz R_1 R_2
3386 # - geompy.kind.ARC_ELLIPSE xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2
3387 # - geompy.kind.LINE xo yo zo dx dy dz
3388 # - geompy.kind.SEGMENT x1 y1 z1 x2 y2 z2
3389 # - geompy.kind.EDGE nb_vertices
3391 # - geompy.kind.VERTEX x y z
3393 # @ref swig_todo "Example"
3394 def KindOfShape(self,theShape):
3395 # Example: see GEOM_TestMeasures.py
3396 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
3397 RaiseIfFailed("KindOfShape", self.MeasuOp)
3399 aKind = aRoughTuple[0]
3400 anInts = aRoughTuple[1]
3401 aDbls = aRoughTuple[2]
3403 # Now there is no exception from this rule:
3404 aKindTuple = [aKind] + aDbls + anInts
3406 # If they are we will regroup parameters for such kind of shape.
3408 #if aKind == kind.SOME_KIND:
3409 # # SOME_KIND int int double int double double
3410 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
3417 ## @addtogroup l2_import_export
3420 ## Import a shape from the BREP or IGES or STEP file
3421 # (depends on given format) with given name.
3422 # @param theFileName The file, containing the shape.
3423 # @param theFormatName Specify format for the file reading.
3424 # Available formats can be obtained with InsertOp.ImportTranslators() method.
3425 # If format 'IGES_SCALE' is used instead 'IGES' length unit will be
3426 # set to 'meter' and result model will be scaled.
3427 # @return New GEOM_Object, containing the imported shape.
3429 # @ref swig_Import_Export "Example"
3430 def Import(self,theFileName, theFormatName):
3431 # Example: see GEOM_TestOthers.py
3432 anObj = self.InsertOp.Import(theFileName, theFormatName)
3433 RaiseIfFailed("Import", self.InsertOp)
3436 ## Shortcut to Import() for BREP format
3438 # @ref swig_Import_Export "Example"
3439 def ImportBREP(self,theFileName):
3440 # Example: see GEOM_TestOthers.py
3441 return self.Import(theFileName, "BREP")
3443 ## Shortcut to Import() for IGES format
3445 # @ref swig_Import_Export "Example"
3446 def ImportIGES(self,theFileName):
3447 # Example: see GEOM_TestOthers.py
3448 return self.Import(theFileName, "IGES")
3450 ## Return length unit from given IGES file
3452 # @ref swig_Import_Export "Example"
3453 def GetIGESUnit(self,theFileName):
3454 # Example: see GEOM_TestOthers.py
3455 anObj = self.InsertOp.Import(theFileName, "IGES_UNIT")
3456 #RaiseIfFailed("Import", self.InsertOp)
3457 # recieve name using returned vertex
3459 vertices = self.SubShapeAll(anObj,ShapeType["VERTEX"])
3461 p = self.PointCoordinates(vertices[0])
3462 if abs(p[0]-0.01) < 1.e-6:
3464 elif abs(p[0]-0.001) < 1.e-6:
3468 ## Shortcut to Import() for STEP format
3470 # @ref swig_Import_Export "Example"
3471 def ImportSTEP(self,theFileName):
3472 # Example: see GEOM_TestOthers.py
3473 return self.Import(theFileName, "STEP")
3475 ## Export the given shape into a file with given name.
3476 # @param theObject Shape to be stored in the file.
3477 # @param theFileName Name of the file to store the given shape in.
3478 # @param theFormatName Specify format for the shape storage.
3479 # Available formats can be obtained with InsertOp.ImportTranslators() method.
3481 # @ref swig_Import_Export "Example"
3482 def Export(self,theObject, theFileName, theFormatName):
3483 # Example: see GEOM_TestOthers.py
3484 self.InsertOp.Export(theObject, theFileName, theFormatName)
3485 if self.InsertOp.IsDone() == 0:
3486 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
3490 ## Shortcut to Export() for BREP format
3492 # @ref swig_Import_Export "Example"
3493 def ExportBREP(self,theObject, theFileName):
3494 # Example: see GEOM_TestOthers.py
3495 return self.Export(theObject, theFileName, "BREP")
3497 ## Shortcut to Export() for IGES format
3499 # @ref swig_Import_Export "Example"
3500 def ExportIGES(self,theObject, theFileName):
3501 # Example: see GEOM_TestOthers.py
3502 return self.Export(theObject, theFileName, "IGES")
3504 ## Shortcut to Export() for STEP format
3506 # @ref swig_Import_Export "Example"
3507 def ExportSTEP(self,theObject, theFileName):
3508 # Example: see GEOM_TestOthers.py
3509 return self.Export(theObject, theFileName, "STEP")
3511 # end of l2_import_export
3514 ## @addtogroup l3_blocks
3517 ## Create a quadrangle face from four edges. Order of Edges is not
3518 # important. It is not necessary that edges share the same vertex.
3519 # @param E1,E2,E3,E4 Edges for the face bound.
3520 # @return New GEOM_Object, containing the created face.
3522 # @ref tui_building_by_blocks_page "Example"
3523 def MakeQuad(self,E1, E2, E3, E4):
3524 # Example: see GEOM_Spanner.py
3525 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
3526 RaiseIfFailed("MakeQuad", self.BlocksOp)
3529 ## Create a quadrangle face on two edges.
3530 # The missing edges will be built by creating the shortest ones.
3531 # @param E1,E2 Two opposite edges for the face.
3532 # @return New GEOM_Object, containing the created face.
3534 # @ref tui_building_by_blocks_page "Example"
3535 def MakeQuad2Edges(self,E1, E2):
3536 # Example: see GEOM_Spanner.py
3537 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
3538 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
3541 ## Create a quadrangle face with specified corners.
3542 # The missing edges will be built by creating the shortest ones.
3543 # @param V1,V2,V3,V4 Corner vertices for the face.
3544 # @return New GEOM_Object, containing the created face.
3546 # @ref tui_building_by_blocks_page "Example 1"
3547 # \n @ref swig_MakeQuad4Vertices "Example 2"
3548 def MakeQuad4Vertices(self,V1, V2, V3, V4):
3549 # Example: see GEOM_Spanner.py
3550 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
3551 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
3554 ## Create a hexahedral solid, bounded by the six given faces. Order of
3555 # faces is not important. It is not necessary that Faces share the same edge.
3556 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
3557 # @return New GEOM_Object, containing the created solid.
3559 # @ref tui_building_by_blocks_page "Example 1"
3560 # \n @ref swig_MakeHexa "Example 2"
3561 def MakeHexa(self,F1, F2, F3, F4, F5, F6):
3562 # Example: see GEOM_Spanner.py
3563 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
3564 RaiseIfFailed("MakeHexa", self.BlocksOp)
3567 ## Create a hexahedral solid between two given faces.
3568 # The missing faces will be built by creating the smallest ones.
3569 # @param F1,F2 Two opposite faces for the hexahedral solid.
3570 # @return New GEOM_Object, containing the created solid.
3572 # @ref tui_building_by_blocks_page "Example 1"
3573 # \n @ref swig_MakeHexa2Faces "Example 2"
3574 def MakeHexa2Faces(self,F1, F2):
3575 # Example: see GEOM_Spanner.py
3576 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
3577 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
3583 ## @addtogroup l3_blocks_op
3586 ## Get a vertex, found in the given shape by its coordinates.
3587 # @param theShape Block or a compound of blocks.
3588 # @param theX,theY,theZ Coordinates of the sought vertex.
3589 # @param theEpsilon Maximum allowed distance between the resulting
3590 # vertex and point with the given coordinates.
3591 # @return New GEOM_Object, containing the found vertex.
3593 # @ref swig_GetPoint "Example"
3594 def GetPoint(self,theShape, theX, theY, theZ, theEpsilon):
3595 # Example: see GEOM_TestOthers.py
3596 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
3597 RaiseIfFailed("GetPoint", self.BlocksOp)
3600 ## Get an edge, found in the given shape by two given vertices.
3601 # @param theShape Block or a compound of blocks.
3602 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
3603 # @return New GEOM_Object, containing the found edge.
3605 # @ref swig_todo "Example"
3606 def GetEdge(self,theShape, thePoint1, thePoint2):
3607 # Example: see GEOM_Spanner.py
3608 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
3609 RaiseIfFailed("GetEdge", self.BlocksOp)
3612 ## Find an edge of the given shape, which has minimal distance to the given point.
3613 # @param theShape Block or a compound of blocks.
3614 # @param thePoint Point, close to the desired edge.
3615 # @return New GEOM_Object, containing the found edge.
3617 # @ref swig_GetEdgeNearPoint "Example"
3618 def GetEdgeNearPoint(self,theShape, thePoint):
3619 # Example: see GEOM_TestOthers.py
3620 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
3621 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
3624 ## Returns a face, found in the given shape by four given corner vertices.
3625 # @param theShape Block or a compound of blocks.
3626 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
3627 # @return New GEOM_Object, containing the found face.
3629 # @ref swig_todo "Example"
3630 def GetFaceByPoints(self,theShape, thePoint1, thePoint2, thePoint3, thePoint4):
3631 # Example: see GEOM_Spanner.py
3632 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
3633 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
3636 ## Get a face of block, found in the given shape by two given edges.
3637 # @param theShape Block or a compound of blocks.
3638 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
3639 # @return New GEOM_Object, containing the found face.
3641 # @ref swig_todo "Example"
3642 def GetFaceByEdges(self,theShape, theEdge1, theEdge2):
3643 # Example: see GEOM_Spanner.py
3644 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
3645 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
3648 ## Find a face, opposite to the given one in the given block.
3649 # @param theBlock Must be a hexahedral solid.
3650 # @param theFace Face of \a theBlock, opposite to the desired face.
3651 # @return New GEOM_Object, containing the found face.
3653 # @ref swig_GetOppositeFace "Example"
3654 def GetOppositeFace(self,theBlock, theFace):
3655 # Example: see GEOM_Spanner.py
3656 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
3657 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
3660 ## Find a face of the given shape, which has minimal distance to the given point.
3661 # @param theShape Block or a compound of blocks.
3662 # @param thePoint Point, close to the desired face.
3663 # @return New GEOM_Object, containing the found face.
3665 # @ref swig_GetFaceNearPoint "Example"
3666 def GetFaceNearPoint(self,theShape, thePoint):
3667 # Example: see GEOM_Spanner.py
3668 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
3669 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
3672 ## Find a face of block, whose outside normale has minimal angle with the given vector.
3673 # @param theBlock Block or a compound of blocks.
3674 # @param theVector Vector, close to the normale of the desired face.
3675 # @return New GEOM_Object, containing the found face.
3677 # @ref swig_todo "Example"
3678 def GetFaceByNormale(self, theBlock, theVector):
3679 # Example: see GEOM_Spanner.py
3680 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
3681 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
3684 # end of l3_blocks_op
3687 ## @addtogroup l4_blocks_measure
3690 ## Check, if the compound of blocks is given.
3691 # To be considered as a compound of blocks, the
3692 # given shape must satisfy the following conditions:
3693 # - Each element of the compound should be a Block (6 faces and 12 edges).
3694 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
3695 # - The compound should be connexe.
3696 # - The glue between two quadrangle faces should be applied.
3697 # @param theCompound The compound to check.
3698 # @return TRUE, if the given shape is a compound of blocks.
3699 # If theCompound is not valid, prints all discovered errors.
3701 # @ref tui_measurement_tools_page "Example 1"
3702 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
3703 def CheckCompoundOfBlocks(self,theCompound):
3704 # Example: see GEOM_Spanner.py
3705 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
3706 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
3708 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
3712 ## Remove all seam and degenerated edges from \a theShape.
3713 # Unite faces and edges, sharing one surface. It means that
3714 # this faces must have references to one C++ surface object (handle).
3715 # @param theShape The compound or single solid to remove irregular edges from.
3716 # @param doUnionFaces If True, then unite faces. If False (the default value),
3717 # do not unite faces.
3718 # @return Improved shape.
3720 # @ref swig_RemoveExtraEdges "Example"
3721 def RemoveExtraEdges(self, theShape, doUnionFaces=False):
3722 # Example: see GEOM_TestOthers.py
3723 nbFacesOptimum = -1 # -1 means do not unite faces
3724 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
3725 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
3726 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
3729 ## Check, if the given shape is a blocks compound.
3730 # Fix all detected errors.
3731 # \note Single block can be also fixed by this method.
3732 # @param theShape The compound to check and improve.
3733 # @return Improved compound.
3735 # @ref swig_CheckAndImprove "Example"
3736 def CheckAndImprove(self,theShape):
3737 # Example: see GEOM_TestOthers.py
3738 anObj = self.BlocksOp.CheckAndImprove(theShape)
3739 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
3742 # end of l4_blocks_measure
3745 ## @addtogroup l3_blocks_op
3748 ## Get all the blocks, contained in the given compound.
3749 # @param theCompound The compound to explode.
3750 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
3751 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
3752 # \note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
3753 # @return List of GEOM_Objects, containing the retrieved blocks.
3755 # @ref tui_explode_on_blocks "Example 1"
3756 # \n @ref swig_MakeBlockExplode "Example 2"
3757 def MakeBlockExplode(self,theCompound, theMinNbFaces, theMaxNbFaces):
3758 # Example: see GEOM_TestOthers.py
3759 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
3760 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
3761 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
3763 anObj.SetParameters(Parameters)
3767 ## Find block, containing the given point inside its volume or on boundary.
3768 # @param theCompound Compound, to find block in.
3769 # @param thePoint Point, close to the desired block. If the point lays on
3770 # boundary between some blocks, we return block with nearest center.
3771 # @return New GEOM_Object, containing the found block.
3773 # @ref swig_todo "Example"
3774 def GetBlockNearPoint(self,theCompound, thePoint):
3775 # Example: see GEOM_Spanner.py
3776 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
3777 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
3780 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
3781 # @param theCompound Compound, to find block in.
3782 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
3783 # @return New GEOM_Object, containing the found block.
3785 # @ref swig_GetBlockByParts "Example"
3786 def GetBlockByParts(self,theCompound, theParts):
3787 # Example: see GEOM_TestOthers.py
3788 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
3789 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
3792 ## Return all blocks, containing all the elements, passed as the parts.
3793 # @param theCompound Compound, to find blocks in.
3794 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
3795 # @return List of GEOM_Objects, containing the found blocks.
3797 # @ref swig_todo "Example"
3798 def GetBlocksByParts(self,theCompound, theParts):
3799 # Example: see GEOM_Spanner.py
3800 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
3801 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
3804 ## Multi-transformate block and glue the result.
3805 # Transformation is defined so, as to superpose direction faces.
3806 # @param Block Hexahedral solid to be multi-transformed.
3807 # @param DirFace1 ID of First direction face.
3808 # @param DirFace2 ID of Second direction face.
3809 # @param NbTimes Quantity of transformations to be done.
3810 # \note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
3811 # @return New GEOM_Object, containing the result shape.
3813 # @ref tui_multi_transformation "Example"
3814 def MakeMultiTransformation1D(self,Block, DirFace1, DirFace2, NbTimes):
3815 # Example: see GEOM_Spanner.py
3816 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
3817 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
3818 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
3819 anObj.SetParameters(Parameters)
3822 ## Multi-transformate block and glue the result.
3823 # @param Block Hexahedral solid to be multi-transformed.
3824 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
3825 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
3826 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
3827 # @return New GEOM_Object, containing the result shape.
3829 # @ref tui_multi_transformation "Example"
3830 def MakeMultiTransformation2D(self,Block, DirFace1U, DirFace2U, NbTimesU,
3831 DirFace1V, DirFace2V, NbTimesV):
3832 # Example: see GEOM_Spanner.py
3833 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
3834 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
3835 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
3836 DirFace1V, DirFace2V, NbTimesV)
3837 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
3838 anObj.SetParameters(Parameters)
3841 ## Build all possible propagation groups.
3842 # Propagation group is a set of all edges, opposite to one (main)
3843 # edge of this group directly or through other opposite edges.
3844 # Notion of Opposite Edge make sence only on quadrangle face.
3845 # @param theShape Shape to build propagation groups on.
3846 # @return List of GEOM_Objects, each of them is a propagation group.
3848 # @ref swig_Propagate "Example"
3849 def Propagate(self,theShape):
3850 # Example: see GEOM_TestOthers.py
3851 listChains = self.BlocksOp.Propagate(theShape)
3852 RaiseIfFailed("Propagate", self.BlocksOp)
3855 # end of l3_blocks_op
3858 ## @addtogroup l3_groups
3861 ## Creates a new group which will store sub shapes of theMainShape
3862 # @param theMainShape is a GEOM object on which the group is selected
3863 # @param theShapeType defines a shape type of the group
3864 # @return a newly created GEOM group
3866 # @ref tui_working_with_groups_page "Example 1"
3867 # \n @ref swig_CreateGroup "Example 2"
3868 def CreateGroup(self,theMainShape, theShapeType):
3869 # Example: see GEOM_TestOthers.py
3870 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
3871 RaiseIfFailed("CreateGroup", self.GroupOp)
3874 ## Adds a sub object with ID theSubShapeId to the group
3875 # @param theGroup is a GEOM group to which the new sub shape is added
3876 # @param theSubShapeID is a sub shape ID in the main object.
3877 # \note Use method GetSubShapeID() to get an unique ID of the sub shape
3879 # @ref tui_working_with_groups_page "Example"
3880 def AddObject(self,theGroup, theSubShapeID):
3881 # Example: see GEOM_TestOthers.py
3882 self.GroupOp.AddObject(theGroup, theSubShapeID)
3883 RaiseIfFailed("AddObject", self.GroupOp)
3886 ## Removes a sub object with ID \a theSubShapeId from the group
3887 # @param theGroup is a GEOM group from which the new sub shape is removed
3888 # @param theSubShapeID is a sub shape ID in the main object.
3889 # \note Use method GetSubShapeID() to get an unique ID of the sub shape
3891 # @ref tui_working_with_groups_page "Example"
3892 def RemoveObject(self,theGroup, theSubShapeID):
3893 # Example: see GEOM_TestOthers.py
3894 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
3895 RaiseIfFailed("RemoveObject", self.GroupOp)
3898 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
3899 # @param theGroup is a GEOM group to which the new sub shapes are added.
3900 # @param theSubShapes is a list of sub shapes to be added.
3902 # @ref tui_working_with_groups_page "Example"
3903 def UnionList (self,theGroup, theSubShapes):
3904 # Example: see GEOM_TestOthers.py
3905 self.GroupOp.UnionList(theGroup, theSubShapes)
3906 RaiseIfFailed("UnionList", self.GroupOp)
3909 ## Works like the above method, but argument
3910 # theSubShapes here is a list of sub-shapes indices
3912 # @ref swig_UnionIDs "Example"
3913 def UnionIDs(self,theGroup, theSubShapes):
3914 # Example: see GEOM_TestOthers.py
3915 self.GroupOp.UnionIDs(theGroup, theSubShapes)
3916 RaiseIfFailed("UnionIDs", self.GroupOp)
3919 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
3920 # @param theGroup is a GEOM group from which the sub-shapes are removed.
3921 # @param theSubShapes is a list of sub-shapes to be removed.
3923 # @ref tui_working_with_groups_page "Example"
3924 def DifferenceList (self,theGroup, theSubShapes):
3925 # Example: see GEOM_TestOthers.py
3926 self.GroupOp.DifferenceList(theGroup, theSubShapes)
3927 RaiseIfFailed("DifferenceList", self.GroupOp)
3930 ## Works like the above method, but argument
3931 # theSubShapes here is a list of sub-shapes indices
3933 # @ref swig_DifferenceIDs "Example"
3934 def DifferenceIDs(self,theGroup, theSubShapes):
3935 # Example: see GEOM_TestOthers.py
3936 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
3937 RaiseIfFailed("DifferenceIDs", self.GroupOp)
3940 ## Returns a list of sub objects ID stored in the group
3941 # @param theGroup is a GEOM group for which a list of IDs is requested
3943 # @ref swig_GetObjectIDs "Example"
3944 def GetObjectIDs(self,theGroup):
3945 # Example: see GEOM_TestOthers.py
3946 ListIDs = self.GroupOp.GetObjects(theGroup)
3947 RaiseIfFailed("GetObjects", self.GroupOp)
3950 ## Returns a type of sub objects stored in the group
3951 # @param theGroup is a GEOM group which type is returned.
3953 # @ref swig_GetType "Example"
3954 def GetType(self,theGroup):
3955 # Example: see GEOM_TestOthers.py
3956 aType = self.GroupOp.GetType(theGroup)
3957 RaiseIfFailed("GetType", self.GroupOp)
3960 ## Convert a type of geom object from id to string value
3961 # @param theId is a GEOM obect type id.
3963 # @ref swig_GetType "Example"
3964 def ShapeIdToType(self, theId):
4038 return "FREE_BOUNDS"
4046 return "THRUSECTIONS"
4048 return "COMPOUNDFILTER"
4050 return "SHAPES_ON_SHAPE"
4052 return "ELLIPSE_ARC"
4059 return "Shape Id not exist."
4061 ## Returns a main shape associated with the group
4062 # @param theGroup is a GEOM group for which a main shape object is requested
4063 # @return a GEOM object which is a main shape for theGroup
4065 # @ref swig_GetMainShape "Example"
4066 def GetMainShape(self,theGroup):
4067 # Example: see GEOM_TestOthers.py
4068 anObj = self.GroupOp.GetMainShape(theGroup)
4069 RaiseIfFailed("GetMainShape", self.GroupOp)
4072 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
4073 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
4075 # @ref swig_todo "Example"
4076 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1):
4077 edges = self.SubShapeAll(theShape, ShapeType["EDGE"])
4080 Props = self.BasicProperties(edge)
4081 if min_length <= Props[0] and Props[0] <= max_length:
4082 if (not include_min) and (min_length == Props[0]):
4085 if (not include_max) and (Props[0] == max_length):
4088 edges_in_range.append(edge)
4090 if len(edges_in_range) <= 0:
4091 print "No edges found by given criteria"
4094 group_edges = self.CreateGroup(theShape, ShapeType["EDGE"])
4095 self.UnionList(group_edges, edges_in_range)
4099 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
4100 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
4102 # @ref swig_todo "Example"
4103 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
4104 nb_selected = sg.SelectedCount()
4106 print "Select a shape before calling this function, please."
4109 print "Only one shape must be selected"
4112 id_shape = sg.getSelected(0)
4113 shape = IDToObject( id_shape )
4115 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
4119 if include_min: left_str = " <= "
4120 if include_max: right_str = " <= "
4122 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
4123 + left_str + "length" + right_str + `max_length`)
4125 sg.updateObjBrowser(1)
4132 ## @addtogroup l4_advanced
4135 ## Create a T-shape object with specified caracteristics for the main
4136 # and the incident pipes (radius, width, half-length).
4137 # The extremities of the main pipe are located on junctions points P1 and P2.
4138 # The extremity of the incident pipe is located on junction point P3.
4139 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
4140 # the main plane of the T-shape is XOY.
4141 # @param theR1 Internal radius of main pipe
4142 # @param theW1 Width of main pipe
4143 # @param theL1 Half-length of main pipe
4144 # @param theR2 Internal radius of incident pipe (R2 < R1)
4145 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
4146 # @param theL2 Half-length of incident pipe
4147 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
4148 # @param theP1 1st junction point of main pipe
4149 # @param theP2 2nd junction point of main pipe
4150 # @param theP3 Junction point of incident pipe
4151 # @return List of GEOM_Objects, containing the created shape and propagation groups.
4153 # @ref tui_creation_pipetshape "Example"
4154 def MakePipeTShape(self, theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh=True, theP1=None, theP2=None, theP3=None):
4155 theR1, theW1, theL1, theR2, theW2, theL2, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2)
4156 if (theP1 and theP2 and theP3):
4157 anObj = self.AdvOp.MakePipeTShapeWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh, theP1, theP2, theP3)
4159 anObj = self.AdvOp.MakePipeTShape(theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh)
4160 RaiseIfFailed("MakePipeTShape", self.AdvOp)
4161 if Parameters: anObj[0].SetParameters(Parameters)
4164 ## Create a T-shape object with chamfer and with specified caracteristics for the main
4165 # and the incident pipes (radius, width, half-length). The chamfer is
4166 # created on the junction of the pipes.
4167 # The extremities of the main pipe are located on junctions points P1 and P2.
4168 # The extremity of the incident pipe is located on junction point P3.
4169 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
4170 # the main plane of the T-shape is XOY.
4171 # @param theR1 Internal radius of main pipe
4172 # @param theW1 Width of main pipe
4173 # @param theL1 Half-length of main pipe
4174 # @param theR2 Internal radius of incident pipe (R2 < R1)
4175 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
4176 # @param theL2 Half-length of incident pipe
4177 # @param theH Height of the chamfer.
4178 # @param theW Width of the chamfer.
4179 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
4180 # @param theP1 1st junction point of main pipe
4181 # @param theP2 2nd junction point of main pipe
4182 # @param theP3 Junction point of incident pipe
4183 # @return List of GEOM_Objects, containing the created shape and propagation groups.
4185 # @ref tui_creation_pipetshape "Example"
4186 def MakePipeTShapeChamfer(self, theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh=True, theP1=None, theP2=None, theP3=None):
4187 theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW)
4188 if (theP1 and theP2 and theP3):
4189 anObj = self.AdvOp.MakePipeTShapeChamferWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh, theP1, theP2, theP3)
4191 anObj = self.AdvOp.MakePipeTShapeChamfer(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh)
4192 RaiseIfFailed("MakePipeTShapeChamfer", self.AdvOp)
4193 if Parameters: anObj[0].SetParameters(Parameters)
4196 ## Create a T-shape object with fillet and with specified caracteristics for the main
4197 # and the incident pipes (radius, width, half-length). The fillet is
4198 # created on the junction of the pipes.
4199 # The extremities of the main pipe are located on junctions points P1 and P2.
4200 # The extremity of the incident pipe is located on junction point P3.
4201 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
4202 # the main plane of the T-shape is XOY.
4203 # @param theR1 Internal radius of main pipe
4204 # @param theW1 Width of main pipe
4205 # @param theL1 Half-length of main pipe
4206 # @param theR2 Internal radius of incident pipe (R2 < R1)
4207 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
4208 # @param theL2 Half-length of incident pipe
4209 # @param theRF Radius of curvature of fillet.
4210 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
4211 # @param theP1 1st junction point of main pipe
4212 # @param theP2 2nd junction point of main pipe
4213 # @param theP3 Junction point of incident pipe
4214 # @return List of GEOM_Objects, containing the created shape and propagation groups.
4216 # @ref tui_creation_pipetshape "Example"
4217 def MakePipeTShapeFillet(self, theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh=True, theP1=None, theP2=None, theP3=None):
4218 theR1, theW1, theL1, theR2, theW2, theL2, theRF, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theRF)
4219 if (theP1 and theP2 and theP3):
4220 anObj = self.AdvOp.MakePipeTShapeFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh, theP1, theP2, theP3)
4222 anObj = self.AdvOp.MakePipeTShapeFillet(theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh)
4223 RaiseIfFailed("MakePipeTShapeFillet", self.AdvOp)
4224 if Parameters: anObj[0].SetParameters(Parameters)
4227 #@@ insert new functions before this line @@ do not remove this line @@#
4229 # end of l4_advanced
4232 ## Create a copy of the given object
4233 # @ingroup l1_geompy_auxiliary
4235 # @ref swig_all_advanced "Example"
4236 def MakeCopy(self,theOriginal):
4237 # Example: see GEOM_TestAll.py
4238 anObj = self.InsertOp.MakeCopy(theOriginal)
4239 RaiseIfFailed("MakeCopy", self.InsertOp)
4242 ## Add Path to load python scripts from
4243 # @ingroup l1_geompy_auxiliary
4244 def addPath(self,Path):
4245 if (sys.path.count(Path) < 1):
4246 sys.path.append(Path)
4250 ## Load marker texture from the file
4251 # @param Path a path to the texture file
4252 # @return unique texture identifier
4253 # @ingroup l1_geompy_auxiliary
4254 def LoadTexture(self, Path):
4255 # Example: see GEOM_TestAll.py
4256 ID = self.InsertOp.LoadTexture(Path)
4257 RaiseIfFailed("LoadTexture", self.InsertOp)
4260 ## Add marker texture. @a Width and @a Height parameters
4261 # specify width and height of the texture in pixels.
4262 # If @a RowData is @c True, @a Texture parameter should represent texture data
4263 # packed into the byte array. If @a RowData is @c False (default), @a Texture
4264 # parameter should be unpacked string, in which '1' symbols represent opaque
4265 # pixels and '0' represent transparent pixels of the texture bitmap.
4267 # @param Width texture width in pixels
4268 # @param Height texture height in pixels
4269 # @param Texture texture data
4270 # @param RowData if @c True, @a Texture data are packed in the byte stream
4271 # @ingroup l1_geompy_auxiliary
4272 def AddTexture(self, Width, Height, Texture, RowData=False):
4273 # Example: see GEOM_TestAll.py
4274 if not RowData: Texture = PackData(Texture)
4275 ID = self.InsertOp.AddTexture(Width, Height, Texture)
4276 RaiseIfFailed("AddTexture", self.InsertOp)
4280 #Register the new proxy for GEOM_Gen
4281 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geompyDC)