1 # -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License.
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 # GEOM GEOM_SWIG : binding of C++ omplementaion with Python
22 # Author : Paul RASCLE, EDF
30 ## @defgroup l1_geompy_auxiliary Auxiliary data structures and methods
32 ## @defgroup l1_geompy_purpose All package methods, grouped by their purpose
34 ## @defgroup l2_import_export Importing/exporting geometrical objects
35 ## @defgroup l2_creating Creating geometrical objects
37 ## @defgroup l3_basic_go Creating Basic Geometric Objects
39 ## @defgroup l4_curves Creating Curves
42 ## @defgroup l3_3d_primitives Creating 3D Primitives
43 ## @defgroup l3_complex Creating Complex Objects
44 ## @defgroup l3_groups Working with groups
45 ## @defgroup l3_blocks Building by blocks
47 ## @defgroup l4_blocks_measure Check and Improve
50 ## @defgroup l3_sketcher Sketcher
51 ## @defgroup l3_advanced Creating Advanced Geometrical Objects
53 ## @defgroup l4_decompose Decompose objects
54 ## @defgroup l4_decompose_d Decompose objects deprecated methods
55 ## @defgroup l4_access Access to sub-shapes by their unique IDs inside the main shape
56 ## @defgroup l4_obtain Access to subshapes by a criteria
57 ## @defgroup l4_advanced Advanced objects creation functions
62 ## @defgroup l2_transforming Transforming geometrical objects
64 ## @defgroup l3_basic_op Basic Operations
65 ## @defgroup l3_boolean Boolean Operations
66 ## @defgroup l3_transform Transformation Operations
67 ## @defgroup l3_local Local Operations (Fillet and Chamfer)
68 ## @defgroup l3_blocks_op Blocks Operations
69 ## @defgroup l3_healing Repairing Operations
70 ## @defgroup l3_restore_ss Restore presentation parameters and a tree of subshapes
73 ## @defgroup l2_measure Using measurement tools
81 from salome_notebook import *
86 ## Enumeration ShapeType as a dictionary
87 # @ingroup l1_geompy_auxiliary
88 ShapeType = {"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)
914 # - "AA x y": Create arc by point at X & Y
915 # - "A dx dy" : Create arc by point with DX & DY
918 # - "WW" : Close Wire (to finish)
919 # - "WF" : Close Wire and build face (to finish)
921 # @param theCommand String, defining the sketcher in local
922 # coordinates of the working plane.
923 # @param theWorkingPlane Nine double values, defining origin,
924 # OZ and OX directions of the working plane.
925 # @return New GEOM_Object, containing the created wire.
927 # @ref tui_sketcher_page "Example"
928 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0]):
929 # Example: see GEOM_TestAll.py
930 theCommand,Parameters = ParseSketcherCommand(theCommand)
931 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
932 RaiseIfFailed("MakeSketcher", self.CurvesOp)
933 anObj.SetParameters(Parameters)
936 ## Create a sketcher (wire or face), following the textual description,
937 # passed through <VAR>theCommand</VAR> argument. \n
938 # For format of the description string see the previous method.\n
939 # @param theCommand String, defining the sketcher in local
940 # coordinates of the working plane.
941 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
942 # @return New GEOM_Object, containing the created wire.
944 # @ref tui_sketcher_page "Example"
945 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane):
946 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
947 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
950 ## Create a sketcher wire, following the numerical description,
951 # passed through <VAR>theCoordinates</VAR> argument. \n
952 # @param theCoordinates double values, defining points to create a wire,
954 # @return New GEOM_Object, containing the created wire.
956 # @ref tui_sketcher_page "Example"
957 def Make3DSketcher(self, theCoordinates):
958 theCoordinates,Parameters = ParseParameters(theCoordinates)
959 anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
960 RaiseIfFailed("Make3DSketcher", self.CurvesOp)
961 anObj.SetParameters(Parameters)
967 ## @addtogroup l3_3d_primitives
970 ## Create a box by coordinates of two opposite vertices.
972 # @ref tui_creation_box "Example"
973 def MakeBox(self,x1,y1,z1,x2,y2,z2):
974 # Example: see GEOM_TestAll.py
975 pnt1 = self.MakeVertex(x1,y1,z1)
976 pnt2 = self.MakeVertex(x2,y2,z2)
977 return self.MakeBoxTwoPnt(pnt1,pnt2)
979 ## Create a box with specified dimensions along the coordinate axes
980 # and with edges, parallel to the coordinate axes.
981 # Center of the box will be at point (DX/2, DY/2, DZ/2).
982 # @param theDX Length of Box edges, parallel to OX axis.
983 # @param theDY Length of Box edges, parallel to OY axis.
984 # @param theDZ Length of Box edges, parallel to OZ axis.
985 # @return New GEOM_Object, containing the created box.
987 # @ref tui_creation_box "Example"
988 def MakeBoxDXDYDZ(self,theDX, theDY, theDZ):
989 # Example: see GEOM_TestAll.py
990 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
991 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
992 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
993 anObj.SetParameters(Parameters)
996 ## Create a box with two specified opposite vertices,
997 # and with edges, parallel to the coordinate axes
998 # @param thePnt1 First of two opposite vertices.
999 # @param thePnt2 Second of two opposite vertices.
1000 # @return New GEOM_Object, containing the created box.
1002 # @ref tui_creation_box "Example"
1003 def MakeBoxTwoPnt(self,thePnt1, thePnt2):
1004 # Example: see GEOM_TestAll.py
1005 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
1006 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
1009 ## Create a face with specified dimensions along OX-OY coordinate axes,
1010 # with edges, parallel to this coordinate axes.
1011 # @param theH height of Face.
1012 # @param theW width of Face.
1013 # @param theOrientation orientation belong axis OXY OYZ OZX
1014 # @return New GEOM_Object, containing the created face.
1016 # @ref tui_creation_face "Example"
1017 def MakeFaceHW(self,theH, theW, theOrientation):
1018 # Example: see GEOM_TestAll.py
1019 theH,theW,Parameters = ParseParameters(theH, theW)
1020 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
1021 RaiseIfFailed("MakeFaceHW", self.PrimOp)
1022 anObj.SetParameters(Parameters)
1025 ## Create a face from another plane and two sizes,
1026 # vertical size and horisontal size.
1027 # @param theObj Normale vector to the creating face or
1029 # @param theH Height (vertical size).
1030 # @param theW Width (horisontal size).
1031 # @return New GEOM_Object, containing the created face.
1033 # @ref tui_creation_face "Example"
1034 def MakeFaceObjHW(self, theObj, theH, theW):
1035 # Example: see GEOM_TestAll.py
1036 theH,theW,Parameters = ParseParameters(theH, theW)
1037 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
1038 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
1039 anObj.SetParameters(Parameters)
1042 ## Create a disk with given center, normal vector and radius.
1043 # @param thePnt Disk center.
1044 # @param theVec Vector, normal to the plane of the disk.
1045 # @param theR Disk radius.
1046 # @return New GEOM_Object, containing the created disk.
1048 # @ref tui_creation_disk "Example"
1049 def MakeDiskPntVecR(self,thePnt, theVec, theR):
1050 # Example: see GEOM_TestAll.py
1051 theR,Parameters = ParseParameters(theR)
1052 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
1053 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
1054 anObj.SetParameters(Parameters)
1057 ## Create a disk, passing through three given points
1058 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
1059 # @return New GEOM_Object, containing the created disk.
1061 # @ref tui_creation_disk "Example"
1062 def MakeDiskThreePnt(self,thePnt1, thePnt2, thePnt3):
1063 # Example: see GEOM_TestAll.py
1064 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
1065 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
1068 ## Create a disk with specified dimensions along OX-OY coordinate axes.
1069 # @param theR Radius of Face.
1070 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
1071 # @return New GEOM_Object, containing the created disk.
1073 # @ref tui_creation_face "Example"
1074 def MakeDiskR(self,theR, theOrientation):
1075 # Example: see GEOM_TestAll.py
1076 theR,Parameters = ParseParameters(theR)
1077 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
1078 RaiseIfFailed("MakeDiskR", self.PrimOp)
1079 anObj.SetParameters(Parameters)
1082 ## Create a cylinder with given base point, axis, radius and height.
1083 # @param thePnt Central point of cylinder base.
1084 # @param theAxis Cylinder axis.
1085 # @param theR Cylinder radius.
1086 # @param theH Cylinder height.
1087 # @return New GEOM_Object, containing the created cylinder.
1089 # @ref tui_creation_cylinder "Example"
1090 def MakeCylinder(self,thePnt, theAxis, theR, theH):
1091 # Example: see GEOM_TestAll.py
1092 theR,theH,Parameters = ParseParameters(theR, theH)
1093 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
1094 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
1095 anObj.SetParameters(Parameters)
1098 ## Create a cylinder with given radius and height at
1099 # the origin of coordinate system. Axis of the cylinder
1100 # will be collinear to the OZ axis of the coordinate system.
1101 # @param theR Cylinder radius.
1102 # @param theH Cylinder height.
1103 # @return New GEOM_Object, containing the created cylinder.
1105 # @ref tui_creation_cylinder "Example"
1106 def MakeCylinderRH(self,theR, theH):
1107 # Example: see GEOM_TestAll.py
1108 theR,theH,Parameters = ParseParameters(theR, theH)
1109 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
1110 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
1111 anObj.SetParameters(Parameters)
1114 ## Create a sphere with given center and radius.
1115 # @param thePnt Sphere center.
1116 # @param theR Sphere radius.
1117 # @return New GEOM_Object, containing the created sphere.
1119 # @ref tui_creation_sphere "Example"
1120 def MakeSpherePntR(self, thePnt, theR):
1121 # Example: see GEOM_TestAll.py
1122 theR,Parameters = ParseParameters(theR)
1123 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
1124 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
1125 anObj.SetParameters(Parameters)
1128 ## Create a sphere with given center and radius.
1129 # @param x,y,z Coordinates of sphere center.
1130 # @param theR Sphere radius.
1131 # @return New GEOM_Object, containing the created sphere.
1133 # @ref tui_creation_sphere "Example"
1134 def MakeSphere(self, x, y, z, theR):
1135 # Example: see GEOM_TestAll.py
1136 point = self.MakeVertex(x, y, z)
1137 anObj = self.MakeSpherePntR(point, theR)
1140 ## Create a sphere with given radius at the origin of coordinate system.
1141 # @param theR Sphere radius.
1142 # @return New GEOM_Object, containing the created sphere.
1144 # @ref tui_creation_sphere "Example"
1145 def MakeSphereR(self, theR):
1146 # Example: see GEOM_TestAll.py
1147 theR,Parameters = ParseParameters(theR)
1148 anObj = self.PrimOp.MakeSphereR(theR)
1149 RaiseIfFailed("MakeSphereR", self.PrimOp)
1150 anObj.SetParameters(Parameters)
1153 ## Create a cone with given base point, axis, height and radiuses.
1154 # @param thePnt Central point of the first cone base.
1155 # @param theAxis Cone axis.
1156 # @param theR1 Radius of the first cone base.
1157 # @param theR2 Radius of the second cone base.
1158 # \note If both radiuses are non-zero, the cone will be truncated.
1159 # \note If the radiuses are equal, a cylinder will be created instead.
1160 # @param theH Cone height.
1161 # @return New GEOM_Object, containing the created cone.
1163 # @ref tui_creation_cone "Example"
1164 def MakeCone(self,thePnt, theAxis, theR1, theR2, theH):
1165 # Example: see GEOM_TestAll.py
1166 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
1167 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
1168 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
1169 anObj.SetParameters(Parameters)
1172 ## Create a cone with given height and radiuses at
1173 # the origin of coordinate system. Axis of the cone will
1174 # be collinear to the OZ axis of the coordinate system.
1175 # @param theR1 Radius of the first cone base.
1176 # @param theR2 Radius of the second cone base.
1177 # \note If both radiuses are non-zero, the cone will be truncated.
1178 # \note If the radiuses are equal, a cylinder will be created instead.
1179 # @param theH Cone height.
1180 # @return New GEOM_Object, containing the created cone.
1182 # @ref tui_creation_cone "Example"
1183 def MakeConeR1R2H(self,theR1, theR2, theH):
1184 # Example: see GEOM_TestAll.py
1185 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
1186 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
1187 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
1188 anObj.SetParameters(Parameters)
1191 ## Create a torus with given center, normal vector and radiuses.
1192 # @param thePnt Torus central point.
1193 # @param theVec Torus axis of symmetry.
1194 # @param theRMajor Torus major radius.
1195 # @param theRMinor Torus minor radius.
1196 # @return New GEOM_Object, containing the created torus.
1198 # @ref tui_creation_torus "Example"
1199 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor):
1200 # Example: see GEOM_TestAll.py
1201 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
1202 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
1203 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
1204 anObj.SetParameters(Parameters)
1207 ## Create a torus with given radiuses at the origin of coordinate system.
1208 # @param theRMajor Torus major radius.
1209 # @param theRMinor Torus minor radius.
1210 # @return New GEOM_Object, containing the created torus.
1212 # @ref tui_creation_torus "Example"
1213 def MakeTorusRR(self, theRMajor, theRMinor):
1214 # Example: see GEOM_TestAll.py
1215 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
1216 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
1217 RaiseIfFailed("MakeTorusRR", self.PrimOp)
1218 anObj.SetParameters(Parameters)
1221 # end of l3_3d_primitives
1224 ## @addtogroup l3_complex
1227 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
1228 # @param theBase Base shape to be extruded.
1229 # @param thePoint1 First end of extrusion vector.
1230 # @param thePoint2 Second end of extrusion vector.
1231 # @return New GEOM_Object, containing the created prism.
1233 # @ref tui_creation_prism "Example"
1234 def MakePrism(self, theBase, thePoint1, thePoint2):
1235 # Example: see GEOM_TestAll.py
1236 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
1237 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
1240 ## Create a shape by extrusion of the base shape along the vector,
1241 # i.e. all the space, transfixed by the base shape during its translation
1242 # along the vector on the given distance.
1243 # @param theBase Base shape to be extruded.
1244 # @param theVec Direction of extrusion.
1245 # @param theH Prism dimension along theVec.
1246 # @return New GEOM_Object, containing the created prism.
1248 # @ref tui_creation_prism "Example"
1249 def MakePrismVecH(self, theBase, theVec, theH):
1250 # Example: see GEOM_TestAll.py
1251 theH,Parameters = ParseParameters(theH)
1252 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
1253 RaiseIfFailed("MakePrismVecH", self.PrimOp)
1254 anObj.SetParameters(Parameters)
1257 ## Create a shape by extrusion of the base shape along the vector,
1258 # i.e. all the space, transfixed by the base shape during its translation
1259 # along the vector on the given distance in 2 Ways (forward/backward) .
1260 # @param theBase Base shape to be extruded.
1261 # @param theVec Direction of extrusion.
1262 # @param theH Prism dimension along theVec in forward direction.
1263 # @return New GEOM_Object, containing the created prism.
1265 # @ref tui_creation_prism "Example"
1266 def MakePrismVecH2Ways(self, theBase, theVec, theH):
1267 # Example: see GEOM_TestAll.py
1268 theH,Parameters = ParseParameters(theH)
1269 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
1270 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
1271 anObj.SetParameters(Parameters)
1274 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
1275 # @param theBase Base shape to be extruded.
1276 # @param theDX, theDY, theDZ Directions of extrusion.
1277 # @return New GEOM_Object, containing the created prism.
1279 # @ref tui_creation_prism "Example"
1280 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ):
1281 # Example: see GEOM_TestAll.py
1282 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1283 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
1284 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
1285 anObj.SetParameters(Parameters)
1288 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
1289 # i.e. all the space, transfixed by the base shape during its translation
1290 # along the vector on the given distance in 2 Ways (forward/backward) .
1291 # @param theBase Base shape to be extruded.
1292 # @param theDX, theDY, theDZ Directions of extrusion.
1293 # @return New GEOM_Object, containing the created prism.
1295 # @ref tui_creation_prism "Example"
1296 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ):
1297 # Example: see GEOM_TestAll.py
1298 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1299 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
1300 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
1301 anObj.SetParameters(Parameters)
1304 ## Create a shape by revolution of the base shape around the axis
1305 # on the given angle, i.e. all the space, transfixed by the base
1306 # shape during its rotation around the axis on the given angle.
1307 # @param theBase Base shape to be rotated.
1308 # @param theAxis Rotation axis.
1309 # @param theAngle Rotation angle in radians.
1310 # @return New GEOM_Object, containing the created revolution.
1312 # @ref tui_creation_revolution "Example"
1313 def MakeRevolution(self, theBase, theAxis, theAngle):
1314 # Example: see GEOM_TestAll.py
1315 theAngle,Parameters = ParseParameters(theAngle)
1316 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
1317 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
1318 anObj.SetParameters(Parameters)
1321 ## The Same Revolution but in both ways forward&backward.
1322 def MakeRevolution2Ways(self, theBase, theAxis, theAngle):
1323 theAngle,Parameters = ParseParameters(theAngle)
1324 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
1325 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
1326 anObj.SetParameters(Parameters)
1329 ## Create a filling from the given compound of contours.
1330 # @param theShape the compound of contours
1331 # @param theMinDeg a minimal degree of BSpline surface to create
1332 # @param theMaxDeg a maximal degree of BSpline surface to create
1333 # @param theTol2D a 2d tolerance to be reached
1334 # @param theTol3D a 3d tolerance to be reached
1335 # @param theNbIter a number of iteration of approximation algorithm
1336 # @param theMethod Kind of method to perform filling operation:
1337 # 0 - Default - standard behaviour
1338 # 1 - Use edges orientation - orientation of edges are
1339 # used: if edge is reversed curve from this edge
1340 # is reversed before using in filling algorithm.
1341 # 2 - Auto-correct orientation - change orientation
1342 # of curves using minimization of sum of distances
1343 # between ends points of edges.
1344 # @param isApprox if True, BSpline curves are generated in the process
1345 # of surface construction. By default it is False, that means
1346 # the surface is created using Besier curves. The usage of
1347 # Approximation makes the algorithm work slower, but allows
1348 # building the surface for rather complex cases
1349 # @return New GEOM_Object, containing the created filling surface.
1351 # @ref tui_creation_filling "Example"
1352 def MakeFilling(self, theShape, theMinDeg, theMaxDeg, theTol2D,
1353 theTol3D, theNbIter, theMethod=GEOM.FOM_Default, isApprox=0):
1354 # Example: see GEOM_TestAll.py
1355 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
1356 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
1357 theTol2D, theTol3D, theNbIter,
1358 theMethod, isApprox)
1359 RaiseIfFailed("MakeFilling", self.PrimOp)
1360 anObj.SetParameters(Parameters)
1363 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
1364 # @param theSeqSections - set of specified sections.
1365 # @param theModeSolid - mode defining building solid or shell
1366 # @param thePreci - precision 3D used for smoothing by default 1.e-6
1367 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
1368 # @return New GEOM_Object, containing the created shell or solid.
1370 # @ref swig_todo "Example"
1371 def MakeThruSections(self,theSeqSections,theModeSolid,thePreci,theRuled):
1372 # Example: see GEOM_TestAll.py
1373 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
1374 RaiseIfFailed("MakeThruSections", self.PrimOp)
1377 ## Create a shape by extrusion of the base shape along
1378 # the path shape. The path shape can be a wire or an edge.
1379 # @param theBase Base shape to be extruded.
1380 # @param thePath Path shape to extrude the base shape along it.
1381 # @return New GEOM_Object, containing the created pipe.
1383 # @ref tui_creation_pipe "Example"
1384 def MakePipe(self,theBase, thePath):
1385 # Example: see GEOM_TestAll.py
1386 anObj = self.PrimOp.MakePipe(theBase, thePath)
1387 RaiseIfFailed("MakePipe", self.PrimOp)
1390 ## Create a shape by extrusion of the profile shape along
1391 # the path shape. The path shape can be a wire or an edge.
1392 # the several profiles can be specified in the several locations of path.
1393 # @param theSeqBases - list of Bases shape to be extruded.
1394 # @param theLocations - list of locations on the path corresponding
1395 # specified list of the Bases shapes. Number of locations
1396 # should be equal to number of bases or list of locations can be empty.
1397 # @param thePath - Path shape to extrude the base shape along it.
1398 # @param theWithContact - the mode defining that the section is translated to be in
1399 # contact with the spine.
1400 # @param theWithCorrection - defining that the section is rotated to be
1401 # orthogonal to the spine tangent in the correspondent point
1402 # @return New GEOM_Object, containing the created pipe.
1404 # @ref tui_creation_pipe_with_diff_sec "Example"
1405 def MakePipeWithDifferentSections(self, theSeqBases,
1406 theLocations, thePath,
1407 theWithContact, theWithCorrection):
1408 anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
1409 theLocations, thePath,
1410 theWithContact, theWithCorrection)
1411 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
1414 ## Create a shape by extrusion of the profile shape along
1415 # the path shape. The path shape can be a wire or a edge.
1416 # the several profiles can be specified in the several locations of path.
1417 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
1418 # shell or face. If number of faces in neighbour sections
1419 # aren't coincided result solid between such sections will
1420 # be created using external boundaries of this shells.
1421 # @param theSeqSubBases - list of corresponding subshapes of section shapes.
1422 # This list is used for searching correspondences between
1423 # faces in the sections. Size of this list must be equal
1424 # to size of list of base shapes.
1425 # @param theLocations - list of locations on the path corresponding
1426 # specified list of the Bases shapes. Number of locations
1427 # should be equal to number of bases. First and last
1428 # locations must be coincided with first and last vertexes
1429 # of path correspondingly.
1430 # @param thePath - Path shape to extrude the base shape along it.
1431 # @param theWithContact - the mode defining that the section is translated to be in
1432 # contact with the spine.
1433 # @param theWithCorrection - defining that the section is rotated to be
1434 # orthogonal to the spine tangent in the correspondent point
1435 # @return New GEOM_Object, containing the created solids.
1437 # @ref tui_creation_pipe_with_shell_sec "Example"
1438 def MakePipeWithShellSections(self,theSeqBases, theSeqSubBases,
1439 theLocations, thePath,
1440 theWithContact, theWithCorrection):
1441 anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
1442 theLocations, thePath,
1443 theWithContact, theWithCorrection)
1444 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
1447 ## Create a shape by extrusion of the profile shape along
1448 # the path shape. This function is used only for debug pipe
1449 # functionality - it is a version of previous function
1450 # (MakePipeWithShellSections(...)) which give a possibility to
1451 # recieve information about creating pipe between each pair of
1452 # sections step by step.
1453 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
1454 theLocations, thePath,
1455 theWithContact, theWithCorrection):
1457 nbsect = len(theSeqBases)
1458 nbsubsect = len(theSeqSubBases)
1459 #print "nbsect = ",nbsect
1460 for i in range(1,nbsect):
1462 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
1463 tmpLocations = [ theLocations[i-1], theLocations[i] ]
1465 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
1466 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
1467 tmpLocations, thePath,
1468 theWithContact, theWithCorrection)
1469 if self.PrimOp.IsDone() == 0:
1470 print "Problems with pipe creation between ",i," and ",i+1," sections"
1471 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
1474 print "Pipe between ",i," and ",i+1," sections is OK"
1479 resc = self.MakeCompound(res)
1480 #resc = self.MakeSewing(res, 0.001)
1481 #print "resc: ",resc
1484 ## Create solids between given sections
1485 # @param theSeqBases - list of sections (shell or face).
1486 # @param theLocations - list of corresponding vertexes
1487 # @return New GEOM_Object, containing the created solids.
1489 # @ref tui_creation_pipe_without_path "Example"
1490 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations):
1491 anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
1492 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
1495 ## Create a shape by extrusion of the base shape along
1496 # the path shape with constant bi-normal direction along the given vector.
1497 # The path shape can be a wire or an edge.
1498 # @param theBase Base shape to be extruded.
1499 # @param thePath Path shape to extrude the base shape along it.
1500 # @param theVec Vector defines a constant binormal direction to keep the
1501 # same angle beetween the direction and the sections
1502 # along the sweep surface.
1503 # @return New GEOM_Object, containing the created pipe.
1505 # @ref tui_creation_pipe "Example"
1506 def MakePipeBiNormalAlongVector(self,theBase, thePath, theVec):
1507 # Example: see GEOM_TestAll.py
1508 anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
1509 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
1515 ## @addtogroup l3_advanced
1518 ## Create a linear edge with specified ends.
1519 # @param thePnt1 Point for the first end of edge.
1520 # @param thePnt2 Point for the second end of edge.
1521 # @return New GEOM_Object, containing the created edge.
1523 # @ref tui_creation_edge "Example"
1524 def MakeEdge(self,thePnt1, thePnt2):
1525 # Example: see GEOM_TestAll.py
1526 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
1527 RaiseIfFailed("MakeEdge", self.ShapesOp)
1530 ## Create a wire from the set of edges and wires.
1531 # @param theEdgesAndWires List of edges and/or wires.
1532 # @param theTolerance Maximum distance between vertices, that will be merged.
1533 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
1534 # @return New GEOM_Object, containing the created wire.
1536 # @ref tui_creation_wire "Example"
1537 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07):
1538 # Example: see GEOM_TestAll.py
1539 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
1540 RaiseIfFailed("MakeWire", self.ShapesOp)
1543 ## Create a face on the given wire.
1544 # @param theWire closed Wire or Edge to build the face on.
1545 # @param isPlanarWanted If TRUE, only planar face will be built.
1546 # If impossible, NULL object will be returned.
1547 # @return New GEOM_Object, containing the created face.
1549 # @ref tui_creation_face "Example"
1550 def MakeFace(self,theWire, isPlanarWanted):
1551 # Example: see GEOM_TestAll.py
1552 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
1553 RaiseIfFailed("MakeFace", self.ShapesOp)
1556 ## Create a face on the given wires set.
1557 # @param theWires List of closed wires or edges to build the face on.
1558 # @param isPlanarWanted If TRUE, only planar face will be built.
1559 # If impossible, NULL object will be returned.
1560 # @return New GEOM_Object, containing the created face.
1562 # @ref tui_creation_face "Example"
1563 def MakeFaceWires(self,theWires, isPlanarWanted):
1564 # Example: see GEOM_TestAll.py
1565 anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
1566 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
1569 ## Shortcut to MakeFaceWires()
1571 # @ref tui_creation_face "Example 1"
1572 # \n @ref swig_MakeFaces "Example 2"
1573 def MakeFaces(self,theWires, isPlanarWanted):
1574 # Example: see GEOM_TestOthers.py
1575 anObj = self.MakeFaceWires(theWires, isPlanarWanted)
1578 ## Create a shell from the set of faces and shells.
1579 # @param theFacesAndShells List of faces and/or shells.
1580 # @return New GEOM_Object, containing the created shell.
1582 # @ref tui_creation_shell "Example"
1583 def MakeShell(self,theFacesAndShells):
1584 # Example: see GEOM_TestAll.py
1585 anObj = self.ShapesOp.MakeShell(theFacesAndShells)
1586 RaiseIfFailed("MakeShell", self.ShapesOp)
1589 ## Create a solid, bounded by the given shells.
1590 # @param theShells Sequence of bounding shells.
1591 # @return New GEOM_Object, containing the created solid.
1593 # @ref tui_creation_solid "Example"
1594 def MakeSolid(self,theShells):
1595 # Example: see GEOM_TestAll.py
1596 anObj = self.ShapesOp.MakeSolidShells(theShells)
1597 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
1600 ## Create a compound of the given shapes.
1601 # @param theShapes List of shapes to put in compound.
1602 # @return New GEOM_Object, containing the created compound.
1604 # @ref tui_creation_compound "Example"
1605 def MakeCompound(self,theShapes):
1606 # Example: see GEOM_TestAll.py
1607 anObj = self.ShapesOp.MakeCompound(theShapes)
1608 RaiseIfFailed("MakeCompound", self.ShapesOp)
1611 # end of l3_advanced
1614 ## @addtogroup l2_measure
1617 ## Gives quantity of faces in the given shape.
1618 # @param theShape Shape to count faces of.
1619 # @return Quantity of faces.
1621 # @ref swig_NumberOf "Example"
1622 def NumberOfFaces(self, theShape):
1623 # Example: see GEOM_TestOthers.py
1624 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
1625 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
1628 ## Gives quantity of edges in the given shape.
1629 # @param theShape Shape to count edges of.
1630 # @return Quantity of edges.
1632 # @ref swig_NumberOf "Example"
1633 def NumberOfEdges(self, theShape):
1634 # Example: see GEOM_TestOthers.py
1635 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
1636 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
1639 ## Gives quantity of subshapes of type theShapeType in the given shape.
1640 # @param theShape Shape to count subshapes of.
1641 # @param theShapeType Type of subshapes to count.
1642 # @return Quantity of subshapes of given type.
1644 # @ref swig_NumberOf "Example"
1645 def NumberOfSubShapes(self, theShape, theShapeType):
1646 # Example: see GEOM_TestOthers.py
1647 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
1648 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
1651 ## Gives quantity of solids in the given shape.
1652 # @param theShape Shape to count solids in.
1653 # @return Quantity of solids.
1655 # @ref swig_NumberOf "Example"
1656 def NumberOfSolids(self, theShape):
1657 # Example: see GEOM_TestOthers.py
1658 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, ShapeType["SOLID"])
1659 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
1665 ## @addtogroup l3_healing
1668 ## Reverses an orientation the given shape.
1669 # @param theShape Shape to be reversed.
1670 # @return The reversed copy of theShape.
1672 # @ref swig_ChangeOrientation "Example"
1673 def ChangeOrientation(self,theShape):
1674 # Example: see GEOM_TestAll.py
1675 anObj = self.ShapesOp.ChangeOrientation(theShape)
1676 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
1679 ## Shortcut to ChangeOrientation()
1681 # @ref swig_OrientationChange "Example"
1682 def OrientationChange(self,theShape):
1683 # Example: see GEOM_TestOthers.py
1684 anObj = self.ChangeOrientation(theShape)
1690 ## @addtogroup l4_obtain
1693 ## Retrieve all free faces from the given shape.
1694 # Free face is a face, which is not shared between two shells of the shape.
1695 # @param theShape Shape to find free faces in.
1696 # @return List of IDs of all free faces, contained in theShape.
1698 # @ref tui_measurement_tools_page "Example"
1699 def GetFreeFacesIDs(self,theShape):
1700 # Example: see GEOM_TestOthers.py
1701 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
1702 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
1705 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
1706 # @param theShape1 Shape to find sub-shapes in.
1707 # @param theShape2 Shape to find shared sub-shapes with.
1708 # @param theShapeType Type of sub-shapes to be retrieved.
1709 # @return List of sub-shapes of theShape1, shared with theShape2.
1711 # @ref swig_GetSharedShapes "Example"
1712 def GetSharedShapes(self,theShape1, theShape2, theShapeType):
1713 # Example: see GEOM_TestOthers.py
1714 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
1715 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
1718 ## Get all sub-shapes, shared by all shapes in the list <VAR>theShapes</VAR>.
1719 # @param theShapes Shapes to find common sub-shapes of.
1720 # @param theShapeType Type of sub-shapes to be retrieved.
1721 # @return List of objects, that are sub-shapes of all given shapes.
1723 # @ref swig_GetSharedShapes "Example"
1724 def GetSharedShapesMulti(self, theShapes, theShapeType):
1725 # Example: see GEOM_TestOthers.py
1726 aList = self.ShapesOp.GetSharedShapesMulti(theShapes, theShapeType)
1727 RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
1730 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
1731 # situated relatively the specified plane by the certain way,
1732 # defined through <VAR>theState</VAR> parameter.
1733 # @param theShape Shape to find sub-shapes of.
1734 # @param theShapeType Type of sub-shapes to be retrieved.
1735 # @param theAx1 Vector (or line, or linear edge), specifying normal
1736 # direction and location of the plane to find shapes on.
1737 # @param theState The state of the subshapes to find. It can be one of
1738 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1739 # @return List of all found sub-shapes.
1741 # @ref swig_GetShapesOnPlane "Example"
1742 def GetShapesOnPlane(self,theShape, theShapeType, theAx1, theState):
1743 # Example: see GEOM_TestOthers.py
1744 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
1745 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
1748 ## Works like the above method, but returns list of sub-shapes indices
1750 # @ref swig_GetShapesOnPlaneIDs "Example"
1751 def GetShapesOnPlaneIDs(self,theShape, theShapeType, theAx1, theState):
1752 # Example: see GEOM_TestOthers.py
1753 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
1754 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
1757 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
1758 # situated relatively the specified plane by the certain way,
1759 # defined through <VAR>theState</VAR> parameter.
1760 # @param theShape Shape to find sub-shapes of.
1761 # @param theShapeType Type of sub-shapes to be retrieved.
1762 # @param theAx1 Vector (or line, or linear edge), specifying normal
1763 # direction of the plane to find shapes on.
1764 # @param thePnt Point specifying location of the plane to find shapes on.
1765 # @param theState The state of the subshapes to find. It can be one of
1766 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1767 # @return List of all found sub-shapes.
1769 # @ref swig_GetShapesOnPlaneWithLocation "Example"
1770 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState):
1771 # Example: see GEOM_TestOthers.py
1772 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
1773 theAx1, thePnt, theState)
1774 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
1777 ## Works like the above method, but returns list of sub-shapes indices
1779 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
1780 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
1781 # Example: see GEOM_TestOthers.py
1782 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
1783 theAx1, thePnt, theState)
1784 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
1787 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1788 # the specified cylinder by the certain way, defined through \a theState parameter.
1789 # @param theShape Shape to find sub-shapes of.
1790 # @param theShapeType Type of sub-shapes to be retrieved.
1791 # @param theAxis Vector (or line, or linear edge), specifying
1792 # axis of the cylinder to find shapes on.
1793 # @param theRadius Radius of the cylinder to find shapes on.
1794 # @param theState The state of the subshapes to find. It can be one of
1795 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1796 # @return List of all found sub-shapes.
1798 # @ref swig_GetShapesOnCylinder "Example"
1799 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState):
1800 # Example: see GEOM_TestOthers.py
1801 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
1802 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
1805 ## Works like the above method, but returns list of sub-shapes indices
1807 # @ref swig_GetShapesOnCylinderIDs "Example"
1808 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
1809 # Example: see GEOM_TestOthers.py
1810 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
1811 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
1814 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1815 # the specified cylinder by the certain way, defined through \a theState parameter.
1816 # @param theShape Shape to find sub-shapes of.
1817 # @param theShapeType Type of sub-shapes to be retrieved.
1818 # @param theAxis Vector (or line, or linear edge), specifying
1819 # axis of the cylinder to find shapes on.
1820 # @param thePnt Point specifying location of the bottom of the cylinder.
1821 # @param theRadius Radius of the cylinder to find shapes on.
1822 # @param theState The state of the subshapes to find. It can be one of
1823 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1824 # @return List of all found sub-shapes.
1826 # @ref swig_GetShapesOnCylinderWithLocation "Example"
1827 def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
1828 # Example: see GEOM_TestOthers.py
1829 aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
1830 RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
1833 ## Works like the above method, but returns list of sub-shapes indices
1835 # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
1836 def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
1837 # Example: see GEOM_TestOthers.py
1838 aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
1839 RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
1842 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1843 # the specified sphere by the certain way, defined through \a theState parameter.
1844 # @param theShape Shape to find sub-shapes of.
1845 # @param theShapeType Type of sub-shapes to be retrieved.
1846 # @param theCenter Point, specifying center of the sphere to find shapes on.
1847 # @param theRadius Radius of the sphere to find shapes on.
1848 # @param theState The state of the subshapes to find. It can be one of
1849 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1850 # @return List of all found sub-shapes.
1852 # @ref swig_GetShapesOnSphere "Example"
1853 def GetShapesOnSphere(self,theShape, theShapeType, theCenter, theRadius, theState):
1854 # Example: see GEOM_TestOthers.py
1855 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
1856 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
1859 ## Works like the above method, but returns list of sub-shapes indices
1861 # @ref swig_GetShapesOnSphereIDs "Example"
1862 def GetShapesOnSphereIDs(self,theShape, theShapeType, theCenter, theRadius, theState):
1863 # Example: see GEOM_TestOthers.py
1864 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
1865 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
1868 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1869 # the specified quadrangle by the certain way, defined through \a theState parameter.
1870 # @param theShape Shape to find sub-shapes of.
1871 # @param theShapeType Type of sub-shapes to be retrieved.
1872 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
1873 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
1874 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
1875 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
1876 # @param theState The state of the subshapes to find. It can be one of
1877 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1878 # @return List of all found sub-shapes.
1880 # @ref swig_GetShapesOnQuadrangle "Example"
1881 def GetShapesOnQuadrangle(self, theShape, theShapeType,
1882 theTopLeftPoint, theTopRigthPoint,
1883 theBottomLeftPoint, theBottomRigthPoint, theState):
1884 # Example: see GEOM_TestOthers.py
1885 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
1886 theTopLeftPoint, theTopRigthPoint,
1887 theBottomLeftPoint, theBottomRigthPoint, theState)
1888 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
1891 ## Works like the above method, but returns list of sub-shapes indices
1893 # @ref swig_GetShapesOnQuadrangleIDs "Example"
1894 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
1895 theTopLeftPoint, theTopRigthPoint,
1896 theBottomLeftPoint, theBottomRigthPoint, theState):
1897 # Example: see GEOM_TestOthers.py
1898 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
1899 theTopLeftPoint, theTopRigthPoint,
1900 theBottomLeftPoint, theBottomRigthPoint, theState)
1901 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
1904 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1905 # the specified \a theBox by the certain way, defined through \a theState parameter.
1906 # @param theBox Shape for relative comparing.
1907 # @param theShape Shape to find sub-shapes of.
1908 # @param theShapeType Type of sub-shapes to be retrieved.
1909 # @param theState The state of the subshapes to find. It can be one of
1910 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1911 # @return List of all found sub-shapes.
1913 # @ref swig_GetShapesOnBox "Example"
1914 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState):
1915 # Example: see GEOM_TestOthers.py
1916 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
1917 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
1920 ## Works like the above method, but returns list of sub-shapes indices
1922 # @ref swig_GetShapesOnBoxIDs "Example"
1923 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
1924 # Example: see GEOM_TestOthers.py
1925 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
1926 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
1929 ## Find in \a theShape all sub-shapes of type \a theShapeType,
1930 # situated relatively the specified \a theCheckShape by the
1931 # certain way, defined through \a theState parameter.
1932 # @param theCheckShape Shape for relative comparing. It must be a solid.
1933 # @param theShape Shape to find sub-shapes of.
1934 # @param theShapeType Type of sub-shapes to be retrieved.
1935 # @param theState The state of the subshapes to find. It can be one of
1936 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1937 # @return List of all found sub-shapes.
1939 # @ref swig_GetShapesOnShape "Example"
1940 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState):
1941 # Example: see GEOM_TestOthers.py
1942 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
1943 theShapeType, theState)
1944 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
1947 ## Works like the above method, but returns result as compound
1949 # @ref swig_GetShapesOnShapeAsCompound "Example"
1950 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState):
1951 # Example: see GEOM_TestOthers.py
1952 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
1953 theShapeType, theState)
1954 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
1957 ## Works like the above method, but returns list of sub-shapes indices
1959 # @ref swig_GetShapesOnShapeIDs "Example"
1960 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
1961 # Example: see GEOM_TestOthers.py
1962 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
1963 theShapeType, theState)
1964 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
1967 ## Get sub-shape(s) of theShapeWhere, which are
1968 # coincident with \a theShapeWhat or could be a part of it.
1969 # @param theShapeWhere Shape to find sub-shapes of.
1970 # @param theShapeWhat Shape, specifying what to find.
1971 # @return Group of all found sub-shapes or a single found sub-shape.
1973 # @ref swig_GetInPlace "Example"
1974 def GetInPlace(self,theShapeWhere, theShapeWhat):
1975 # Example: see GEOM_TestOthers.py
1976 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
1977 RaiseIfFailed("GetInPlace", self.ShapesOp)
1980 ## Get sub-shape(s) of \a theShapeWhere, which are
1981 # coincident with \a theShapeWhat or could be a part of it.
1983 # Implementation of this method is based on a saved history of an operation,
1984 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
1985 # arguments (an argument shape or a sub-shape of an argument shape).
1986 # The operation could be the Partition or one of boolean operations,
1987 # performed on simple shapes (not on compounds).
1989 # @param theShapeWhere Shape to find sub-shapes of.
1990 # @param theShapeWhat Shape, specifying what to find (must be in the
1991 # building history of the ShapeWhere).
1992 # @return Group of all found sub-shapes or a single found sub-shape.
1994 # @ref swig_GetInPlace "Example"
1995 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat):
1996 # Example: see GEOM_TestOthers.py
1997 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
1998 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
2001 ## Get sub-shape of theShapeWhere, which is
2002 # equal to \a theShapeWhat.
2003 # @param theShapeWhere Shape to find sub-shape of.
2004 # @param theShapeWhat Shape, specifying what to find.
2005 # @return New GEOM_Object for found sub-shape.
2007 # @ref swig_GetSame "Example"
2008 def GetSame(self,theShapeWhere, theShapeWhat):
2009 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
2010 RaiseIfFailed("GetSame", self.ShapesOp)
2016 ## @addtogroup l4_access
2019 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
2020 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
2022 # @ref swig_all_decompose "Example"
2023 def GetSubShape(self, aShape, ListOfID):
2024 # Example: see GEOM_TestAll.py
2025 anObj = self.AddSubShape(aShape,ListOfID)
2028 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
2030 # @ref swig_all_decompose "Example"
2031 def GetSubShapeID(self, aShape, aSubShape):
2032 # Example: see GEOM_TestAll.py
2033 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
2034 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
2040 ## @addtogroup l4_decompose
2043 ## Explode a shape on subshapes of a given type.
2044 # @param aShape Shape to be exploded.
2045 # @param aType Type of sub-shapes to be retrieved.
2046 # @return List of sub-shapes of type theShapeType, contained in theShape.
2048 # @ref swig_all_decompose "Example"
2049 def SubShapeAll(self, aShape, aType):
2050 # Example: see GEOM_TestAll.py
2051 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, aType, False)
2052 RaiseIfFailed("SubShapeAll", self.ShapesOp)
2055 ## Explode a shape on subshapes of a given type.
2056 # @param aShape Shape to be exploded.
2057 # @param aType Type of sub-shapes to be retrieved.
2058 # @return List of IDs of sub-shapes.
2060 # @ref swig_all_decompose "Example"
2061 def SubShapeAllIDs(self, aShape, aType):
2062 ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, aType, False)
2063 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
2066 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
2067 # selected by they indices in list of all sub-shapes of type <VAR>aType</VAR>.
2068 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
2070 # @ref swig_all_decompose "Example"
2071 def SubShape(self, aShape, aType, ListOfInd):
2072 # Example: see GEOM_TestAll.py
2074 AllShapeIDsList = self.SubShapeAllIDs(aShape, aType)
2075 for ind in ListOfInd:
2076 ListOfIDs.append(AllShapeIDsList[ind - 1])
2077 anObj = self.GetSubShape(aShape, ListOfIDs)
2080 ## Explode a shape on subshapes of a given type.
2081 # Sub-shapes will be sorted by coordinates of their gravity centers.
2082 # @param aShape Shape to be exploded.
2083 # @param aType Type of sub-shapes to be retrieved.
2084 # @return List of sub-shapes of type theShapeType, contained in theShape.
2086 # @ref swig_SubShapeAllSorted "Example"
2087 def SubShapeAllSortedCentres(self, aShape, aType):
2088 # Example: see GEOM_TestAll.py
2089 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, aType, True)
2090 RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
2093 ## Explode a shape on subshapes of a given type.
2094 # Sub-shapes will be sorted by coordinates of their gravity centers.
2095 # @param aShape Shape to be exploded.
2096 # @param aType Type of sub-shapes to be retrieved.
2097 # @return List of IDs of sub-shapes.
2099 # @ref swig_all_decompose "Example"
2100 def SubShapeAllSortedCentresIDs(self, aShape, aType):
2101 ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, aType, True)
2102 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
2105 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
2106 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
2107 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
2109 # @ref swig_all_decompose "Example"
2110 def SubShapeSortedCentres(self, aShape, aType, ListOfInd):
2111 # Example: see GEOM_TestAll.py
2113 AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, aType)
2114 for ind in ListOfInd:
2115 ListOfIDs.append(AllShapeIDsList[ind - 1])
2116 anObj = self.GetSubShape(aShape, ListOfIDs)
2119 # end of l4_decompose
2122 ## @addtogroup l4_decompose_d
2125 ## Deprecated method
2126 # It works like SubShapeAllSortedCentres, but wrongly
2127 # defines centres of faces, shells and solids.
2128 def SubShapeAllSorted(self, aShape, aType):
2129 ListObj = self.ShapesOp.MakeExplode(aShape, aType, True)
2130 RaiseIfFailed("MakeExplode", self.ShapesOp)
2133 ## Deprecated method
2134 # It works like SubShapeAllSortedCentresIDs, but wrongly
2135 # defines centres of faces, shells and solids.
2136 def SubShapeAllSortedIDs(self, aShape, aType):
2137 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, aType, True)
2138 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
2141 ## Deprecated method
2142 # It works like SubShapeSortedCentres, but has a bug
2143 # (wrongly defines centres of faces, shells and solids).
2144 def SubShapeSorted(self, aShape, aType, ListOfInd):
2146 AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, aType)
2147 for ind in ListOfInd:
2148 ListOfIDs.append(AllShapeIDsList[ind - 1])
2149 anObj = self.GetSubShape(aShape, ListOfIDs)
2152 # end of l4_decompose_d
2155 ## @addtogroup l3_healing
2158 ## Apply a sequence of Shape Healing operators to the given object.
2159 # @param theShape Shape to be processed.
2160 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
2161 # @param theParameters List of names of parameters
2162 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
2163 # @param theValues List of values of parameters, in the same order
2164 # as parameters are listed in <VAR>theParameters</VAR> list.
2165 # @return New GEOM_Object, containing processed shape.
2167 # @ref tui_shape_processing "Example"
2168 def ProcessShape(self, theShape, theOperators, theParameters, theValues):
2169 # Example: see GEOM_TestHealing.py
2170 theValues,Parameters = ParseList(theValues)
2171 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
2172 # To avoid script failure in case of good argument shape
2173 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
2175 RaiseIfFailed("ProcessShape", self.HealOp)
2176 for string in (theOperators + theParameters):
2177 Parameters = ":" + Parameters
2179 anObj.SetParameters(Parameters)
2182 ## Remove faces from the given object (shape).
2183 # @param theObject Shape to be processed.
2184 # @param theFaces Indices of faces to be removed, if EMPTY then the method
2185 # removes ALL faces of the given object.
2186 # @return New GEOM_Object, containing processed shape.
2188 # @ref tui_suppress_faces "Example"
2189 def SuppressFaces(self,theObject, theFaces):
2190 # Example: see GEOM_TestHealing.py
2191 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
2192 RaiseIfFailed("SuppressFaces", self.HealOp)
2195 ## Sewing of some shapes into single shape.
2197 # @ref tui_sewing "Example"
2198 def MakeSewing(self, ListShape, theTolerance):
2199 # Example: see GEOM_TestHealing.py
2200 comp = self.MakeCompound(ListShape)
2201 anObj = self.Sew(comp, theTolerance)
2204 ## Sewing of the given object.
2205 # @param theObject Shape to be processed.
2206 # @param theTolerance Required tolerance value.
2207 # @return New GEOM_Object, containing processed shape.
2208 def Sew(self, theObject, theTolerance):
2209 # Example: see MakeSewing() above
2210 theTolerance,Parameters = ParseParameters(theTolerance)
2211 anObj = self.HealOp.Sew(theObject, theTolerance)
2212 RaiseIfFailed("Sew", self.HealOp)
2213 anObj.SetParameters(Parameters)
2216 ## Remove internal wires and edges from the given object (face).
2217 # @param theObject Shape to be processed.
2218 # @param theWires Indices of wires to be removed, if EMPTY then the method
2219 # removes ALL internal wires of the given object.
2220 # @return New GEOM_Object, containing processed shape.
2222 # @ref tui_suppress_internal_wires "Example"
2223 def SuppressInternalWires(self,theObject, theWires):
2224 # Example: see GEOM_TestHealing.py
2225 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
2226 RaiseIfFailed("RemoveIntWires", self.HealOp)
2229 ## Remove internal closed contours (holes) from the given object.
2230 # @param theObject Shape to be processed.
2231 # @param theWires Indices of wires to be removed, if EMPTY then the method
2232 # removes ALL internal holes of the given object
2233 # @return New GEOM_Object, containing processed shape.
2235 # @ref tui_suppress_holes "Example"
2236 def SuppressHoles(self,theObject, theWires):
2237 # Example: see GEOM_TestHealing.py
2238 anObj = self.HealOp.FillHoles(theObject, theWires)
2239 RaiseIfFailed("FillHoles", self.HealOp)
2242 ## Close an open wire.
2243 # @param theObject Shape to be processed.
2244 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
2245 # if -1, then <VAR>theObject</VAR> itself is a wire.
2246 # @param isCommonVertex If TRUE : closure by creation of a common vertex,
2247 # If FALS : closure by creation of an edge between ends.
2248 # @return New GEOM_Object, containing processed shape.
2250 # @ref tui_close_contour "Example"
2251 def CloseContour(self,theObject, theWires, isCommonVertex):
2252 # Example: see GEOM_TestHealing.py
2253 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
2254 RaiseIfFailed("CloseContour", self.HealOp)
2257 ## Addition of a point to a given edge object.
2258 # @param theObject Shape to be processed.
2259 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
2260 # if -1, then theObject itself is the edge.
2261 # @param theValue Value of parameter on edge or length parameter,
2262 # depending on \a isByParameter.
2263 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1],
2264 # if FALSE : \a theValue is treated as a length parameter [0..1]
2265 # @return New GEOM_Object, containing processed shape.
2267 # @ref tui_add_point_on_edge "Example"
2268 def DivideEdge(self,theObject, theEdgeIndex, theValue, isByParameter):
2269 # Example: see GEOM_TestHealing.py
2270 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
2271 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
2272 RaiseIfFailed("DivideEdge", self.HealOp)
2273 anObj.SetParameters(Parameters)
2276 ## Change orientation of the given object. Updates given shape.
2277 # @param theObject Shape to be processed.
2279 # @ref swig_todo "Example"
2280 def ChangeOrientationShell(self,theObject):
2281 theObject = self.HealOp.ChangeOrientation(theObject)
2282 RaiseIfFailed("ChangeOrientation", self.HealOp)
2285 ## Change orientation of the given object.
2286 # @param theObject Shape to be processed.
2287 # @return New GEOM_Object, containing processed shape.
2289 # @ref swig_todo "Example"
2290 def ChangeOrientationShellCopy(self,theObject):
2291 anObj = self.HealOp.ChangeOrientationCopy(theObject)
2292 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
2295 ## Get a list of wires (wrapped in GEOM_Object-s),
2296 # that constitute a free boundary of the given shape.
2297 # @param theObject Shape to get free boundary of.
2298 # @return [status, theClosedWires, theOpenWires]
2299 # status: FALSE, if an error(s) occured during the method execution.
2300 # theClosedWires: Closed wires on the free boundary of the given shape.
2301 # theOpenWires: Open wires on the free boundary of the given shape.
2303 # @ref tui_measurement_tools_page "Example"
2304 def GetFreeBoundary(self,theObject):
2305 # Example: see GEOM_TestHealing.py
2306 anObj = self.HealOp.GetFreeBoundary(theObject)
2307 RaiseIfFailed("GetFreeBoundary", self.HealOp)
2310 ## Replace coincident faces in theShape by one face.
2311 # @param theShape Initial shape.
2312 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
2313 # @param doKeepNonSolids If FALSE, only solids will present in the result,
2314 # otherwise all initial shapes.
2315 # @return New GEOM_Object, containing a copy of theShape without coincident faces.
2317 # @ref tui_glue_faces "Example"
2318 def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True):
2319 # Example: see GEOM_Spanner.py
2320 theTolerance,Parameters = ParseParameters(theTolerance)
2321 anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
2323 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
2324 anObj.SetParameters(Parameters)
2327 ## Find coincident faces in theShape for possible gluing.
2328 # @param theShape Initial shape.
2329 # @param theTolerance Maximum distance between faces,
2330 # which can be considered as coincident.
2333 # @ref swig_todo "Example"
2334 def GetGlueFaces(self, theShape, theTolerance):
2335 # Example: see GEOM_Spanner.py
2336 anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
2337 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
2340 ## Replace coincident faces in theShape by one face
2341 # in compliance with given list of faces
2342 # @param theShape Initial shape.
2343 # @param theTolerance Maximum distance between faces,
2344 # which can be considered as coincident.
2345 # @param theFaces List of faces for gluing.
2346 # @param doKeepNonSolids If FALSE, only solids will present in the result,
2347 # otherwise all initial shapes.
2348 # @return New GEOM_Object, containing a copy of theShape
2349 # without some faces.
2351 # @ref swig_todo "Example"
2352 def MakeGlueFacesByList(self, theShape, theTolerance, theFaces, doKeepNonSolids=True):
2353 # Example: see GEOM_Spanner.py
2354 anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces, doKeepNonSolids)
2356 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
2362 ## @addtogroup l3_boolean Boolean Operations
2365 # -----------------------------------------------------------------------------
2366 # Boolean (Common, Cut, Fuse, Section)
2367 # -----------------------------------------------------------------------------
2369 ## Perform one of boolean operations on two given shapes.
2370 # @param theShape1 First argument for boolean operation.
2371 # @param theShape2 Second argument for boolean operation.
2372 # @param theOperation Indicates the operation to be done:
2373 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
2374 # @return New GEOM_Object, containing the result shape.
2376 # @ref tui_fuse "Example"
2377 def MakeBoolean(self,theShape1, theShape2, theOperation):
2378 # Example: see GEOM_TestAll.py
2379 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation)
2380 RaiseIfFailed("MakeBoolean", self.BoolOp)
2383 ## Shortcut to MakeBoolean(s1, s2, 1)
2385 # @ref tui_common "Example 1"
2386 # \n @ref swig_MakeCommon "Example 2"
2387 def MakeCommon(self, s1, s2):
2388 # Example: see GEOM_TestOthers.py
2389 return self.MakeBoolean(s1, s2, 1)
2391 ## Shortcut to MakeBoolean(s1, s2, 2)
2393 # @ref tui_cut "Example 1"
2394 # \n @ref swig_MakeCommon "Example 2"
2395 def MakeCut(self, s1, s2):
2396 # Example: see GEOM_TestOthers.py
2397 return self.MakeBoolean(s1, s2, 2)
2399 ## Shortcut to MakeBoolean(s1, s2, 3)
2401 # @ref tui_fuse "Example 1"
2402 # \n @ref swig_MakeCommon "Example 2"
2403 def MakeFuse(self, s1, s2):
2404 # Example: see GEOM_TestOthers.py
2405 return self.MakeBoolean(s1, s2, 3)
2407 ## Shortcut to MakeBoolean(s1, s2, 4)
2409 # @ref tui_section "Example 1"
2410 # \n @ref swig_MakeCommon "Example 2"
2411 def MakeSection(self, s1, s2):
2412 # Example: see GEOM_TestOthers.py
2413 return self.MakeBoolean(s1, s2, 4)
2418 ## @addtogroup l3_basic_op
2421 ## Perform partition operation.
2422 # @param ListShapes Shapes to be intersected.
2423 # @param ListTools Shapes to intersect theShapes.
2424 # !!!NOTE: Each compound from ListShapes and ListTools will be exploded
2425 # in order to avoid possible intersection between shapes from
2427 # @param Limit Type of resulting shapes (corresponding to TopAbs_ShapeEnum).
2428 # @param KeepNonlimitShapes: if this parameter == 0, then only shapes of
2429 # target type (equal to Limit) are kept in the result,
2430 # else standalone shapes of lower dimension
2431 # are kept also (if they exist).
2433 # After implementation new version of PartitionAlgo (October 2006)
2434 # other parameters are ignored by current functionality. They are kept
2435 # in this function only for support old versions.
2436 # Ignored parameters:
2437 # @param ListKeepInside Shapes, outside which the results will be deleted.
2438 # Each shape from theKeepInside must belong to theShapes also.
2439 # @param ListRemoveInside Shapes, inside which the results will be deleted.
2440 # Each shape from theRemoveInside must belong to theShapes also.
2441 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
2442 # @param ListMaterials Material indices for each shape. Make sence,
2443 # only if theRemoveWebs is TRUE.
2445 # @return New GEOM_Object, containing the result shapes.
2447 # @ref tui_partition "Example"
2448 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
2449 Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
2450 KeepNonlimitShapes=0):
2451 # Example: see GEOM_TestAll.py
2452 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
2453 ListKeepInside, ListRemoveInside,
2454 Limit, RemoveWebs, ListMaterials,
2455 KeepNonlimitShapes);
2456 RaiseIfFailed("MakePartition", self.BoolOp)
2459 ## Perform partition operation.
2460 # This method may be useful if it is needed to make a partition for
2461 # compound contains nonintersected shapes. Performance will be better
2462 # since intersection between shapes from compound is not performed.
2464 # Description of all parameters as in previous method MakePartition()
2466 # !!!NOTE: Passed compounds (via ListShapes or via ListTools)
2467 # have to consist of nonintersecting shapes.
2469 # @return New GEOM_Object, containing the result shapes.
2471 # @ref swig_todo "Example"
2472 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
2473 ListKeepInside=[], ListRemoveInside=[],
2474 Limit=ShapeType["SHAPE"], RemoveWebs=0,
2475 ListMaterials=[], KeepNonlimitShapes=0):
2476 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
2477 ListKeepInside, ListRemoveInside,
2478 Limit, RemoveWebs, ListMaterials,
2479 KeepNonlimitShapes);
2480 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
2483 ## Shortcut to MakePartition()
2485 # @ref tui_partition "Example 1"
2486 # \n @ref swig_Partition "Example 2"
2487 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
2488 Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
2489 KeepNonlimitShapes=0):
2490 # Example: see GEOM_TestOthers.py
2491 anObj = self.MakePartition(ListShapes, ListTools,
2492 ListKeepInside, ListRemoveInside,
2493 Limit, RemoveWebs, ListMaterials,
2494 KeepNonlimitShapes);
2497 ## Perform partition of the Shape with the Plane
2498 # @param theShape Shape to be intersected.
2499 # @param thePlane Tool shape, to intersect theShape.
2500 # @return New GEOM_Object, containing the result shape.
2502 # @ref tui_partition "Example"
2503 def MakeHalfPartition(self,theShape, thePlane):
2504 # Example: see GEOM_TestAll.py
2505 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
2506 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
2509 # end of l3_basic_op
2512 ## @addtogroup l3_transform
2515 ## Translate the given object along the vector, specified
2516 # by its end points, creating its copy before the translation.
2517 # @param theObject The object to be translated.
2518 # @param thePoint1 Start point of translation vector.
2519 # @param thePoint2 End point of translation vector.
2520 # @return New GEOM_Object, containing the translated object.
2522 # @ref tui_translation "Example 1"
2523 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
2524 def MakeTranslationTwoPoints(self,theObject, thePoint1, thePoint2):
2525 # Example: see GEOM_TestAll.py
2526 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
2527 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
2530 ## Translate the given object along the vector, specified by its components.
2531 # @param theObject The object to be translated.
2532 # @param theDX,theDY,theDZ Components of translation vector.
2533 # @return Translated GEOM_Object.
2535 # @ref tui_translation "Example"
2536 def TranslateDXDYDZ(self,theObject, theDX, theDY, theDZ):
2537 # Example: see GEOM_TestAll.py
2538 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
2539 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
2540 anObj.SetParameters(Parameters)
2541 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
2544 ## Translate the given object along the vector, specified
2545 # by its components, creating its copy before the translation.
2546 # @param theObject The object to be translated.
2547 # @param theDX,theDY,theDZ Components of translation vector.
2548 # @return New GEOM_Object, containing the translated object.
2550 # @ref tui_translation "Example"
2551 def MakeTranslation(self,theObject, theDX, theDY, theDZ):
2552 # Example: see GEOM_TestAll.py
2553 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
2554 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
2555 anObj.SetParameters(Parameters)
2556 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
2559 ## Translate the given object along the given vector,
2560 # creating its copy before the translation.
2561 # @param theObject The object to be translated.
2562 # @param theVector The translation vector.
2563 # @return New GEOM_Object, containing the translated object.
2565 # @ref tui_translation "Example"
2566 def MakeTranslationVector(self,theObject, theVector):
2567 # Example: see GEOM_TestAll.py
2568 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
2569 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
2572 ## Translate the given object along the given vector on given distance.
2573 # @param theObject The object to be translated.
2574 # @param theVector The translation vector.
2575 # @param theDistance The translation distance.
2576 # @param theCopy Flag used to translate object itself or create a copy.
2577 # @return Translated GEOM_Object.
2579 # @ref tui_translation "Example"
2580 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy):
2581 # Example: see GEOM_TestAll.py
2582 theDistance,Parameters = ParseParameters(theDistance)
2583 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
2584 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
2585 anObj.SetParameters(Parameters)
2588 ## Translate the given object along the given vector on given distance,
2589 # creating its copy before the translation.
2590 # @param theObject The object to be translated.
2591 # @param theVector The translation vector.
2592 # @param theDistance The translation distance.
2593 # @return New GEOM_Object, containing the translated object.
2595 # @ref tui_translation "Example"
2596 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance):
2597 # Example: see GEOM_TestAll.py
2598 theDistance,Parameters = ParseParameters(theDistance)
2599 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
2600 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
2601 anObj.SetParameters(Parameters)
2604 ## Rotate the given object around the given axis on the given angle.
2605 # @param theObject The object to be rotated.
2606 # @param theAxis Rotation axis.
2607 # @param theAngle Rotation angle in radians.
2608 # @return Rotated GEOM_Object.
2610 # @ref tui_rotation "Example"
2611 def Rotate(self,theObject, theAxis, theAngle):
2612 # Example: see GEOM_TestAll.py
2614 if isinstance(theAngle,str):
2616 theAngle, Parameters = ParseParameters(theAngle)
2618 theAngle = theAngle*math.pi/180.0
2619 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
2620 RaiseIfFailed("RotateCopy", self.TrsfOp)
2621 anObj.SetParameters(Parameters)
2624 ## Rotate the given object around the given axis
2625 # on the given angle, creating its copy before the rotatation.
2626 # @param theObject The object to be rotated.
2627 # @param theAxis Rotation axis.
2628 # @param theAngle Rotation angle in radians.
2629 # @return New GEOM_Object, containing the rotated object.
2631 # @ref tui_rotation "Example"
2632 def MakeRotation(self,theObject, theAxis, theAngle):
2633 # Example: see GEOM_TestAll.py
2635 if isinstance(theAngle,str):
2637 theAngle, Parameters = ParseParameters(theAngle)
2639 theAngle = theAngle*math.pi/180.0
2640 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
2641 RaiseIfFailed("RotateCopy", self.TrsfOp)
2642 anObj.SetParameters(Parameters)
2645 ## Rotate given object around vector perpendicular to plane
2646 # containing three points, creating its copy before the rotatation.
2647 # @param theObject The object to be rotated.
2648 # @param theCentPoint central point - the axis is the vector perpendicular to the plane
2649 # containing the three points.
2650 # @param thePoint1,thePoint2 - in a perpendicular plane of the axis.
2651 # @return New GEOM_Object, containing the rotated object.
2653 # @ref tui_rotation "Example"
2654 def MakeRotationThreePoints(self,theObject, theCentPoint, thePoint1, thePoint2):
2655 # Example: see GEOM_TestAll.py
2656 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
2657 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
2660 ## Scale the given object by the factor, creating its copy before the scaling.
2661 # @param theObject The object to be scaled.
2662 # @param thePoint Center point for scaling.
2663 # Passing None for it means scaling relatively the origin of global CS.
2664 # @param theFactor Scaling factor value.
2665 # @return New GEOM_Object, containing the scaled shape.
2667 # @ref tui_scale "Example"
2668 def MakeScaleTransform(self, theObject, thePoint, theFactor):
2669 # Example: see GEOM_TestAll.py
2670 theFactor, Parameters = ParseParameters(theFactor)
2671 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
2672 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
2673 anObj.SetParameters(Parameters)
2676 ## Scale the given object by different factors along coordinate axes,
2677 # creating its copy before the scaling.
2678 # @param theObject The object to be scaled.
2679 # @param thePoint Center point for scaling.
2680 # Passing None for it means scaling relatively the origin of global CS.
2681 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
2682 # @return New GEOM_Object, containing the scaled shape.
2684 # @ref swig_scale "Example"
2685 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ):
2686 # Example: see GEOM_TestAll.py
2687 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
2688 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
2689 theFactorX, theFactorY, theFactorZ)
2690 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
2691 anObj.SetParameters(Parameters)
2694 ## Create an object, symmetrical
2695 # to the given one relatively the given plane.
2696 # @param theObject The object to be mirrored.
2697 # @param thePlane Plane of symmetry.
2698 # @return New GEOM_Object, containing the mirrored shape.
2700 # @ref tui_mirror "Example"
2701 def MakeMirrorByPlane(self,theObject, thePlane):
2702 # Example: see GEOM_TestAll.py
2703 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
2704 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
2707 ## Create an object, symmetrical
2708 # to the given one relatively the given axis.
2709 # @param theObject The object to be mirrored.
2710 # @param theAxis Axis of symmetry.
2711 # @return New GEOM_Object, containing the mirrored shape.
2713 # @ref tui_mirror "Example"
2714 def MakeMirrorByAxis(self,theObject, theAxis):
2715 # Example: see GEOM_TestAll.py
2716 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
2717 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
2720 ## Create an object, symmetrical
2721 # to the given one relatively the given point.
2722 # @param theObject The object to be mirrored.
2723 # @param thePoint Point of symmetry.
2724 # @return New GEOM_Object, containing the mirrored shape.
2726 # @ref tui_mirror "Example"
2727 def MakeMirrorByPoint(self,theObject, thePoint):
2728 # Example: see GEOM_TestAll.py
2729 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
2730 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
2733 ## Modify the Location of the given object by LCS,
2734 # creating its copy before the setting.
2735 # @param theObject The object to be displaced.
2736 # @param theStartLCS Coordinate system to perform displacement from it.
2737 # If \a theStartLCS is NULL, displacement
2738 # will be performed from global CS.
2739 # If \a theObject itself is used as \a theStartLCS,
2740 # its location will be changed to \a theEndLCS.
2741 # @param theEndLCS Coordinate system to perform displacement to it.
2742 # @return New GEOM_Object, containing the displaced shape.
2744 # @ref tui_modify_location "Example"
2745 def MakePosition(self,theObject, theStartLCS, theEndLCS):
2746 # Example: see GEOM_TestAll.py
2747 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
2748 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
2751 ## Modify the Location of the given object by Path,
2752 # @param theObject The object to be displaced.
2753 # @param thePath Wire or Edge along that the object will be translated.
2754 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
2755 # @param theCopy is to create a copy objects if true.
2756 # @param theReverse - 0 for usual direction, 1 to reverse path direction.
2757 # @return New GEOM_Object, containing the displaced shape.
2759 # @ref tui_modify_location "Example"
2760 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
2761 # Example: see GEOM_TestAll.py
2762 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
2763 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
2766 ## Create new object as offset of the given one.
2767 # @param theObject The base object for the offset.
2768 # @param theOffset Offset value.
2769 # @return New GEOM_Object, containing the offset object.
2771 # @ref tui_offset "Example"
2772 def MakeOffset(self,theObject, theOffset):
2773 # Example: see GEOM_TestAll.py
2774 theOffset, Parameters = ParseParameters(theOffset)
2775 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
2776 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
2777 anObj.SetParameters(Parameters)
2780 # -----------------------------------------------------------------------------
2782 # -----------------------------------------------------------------------------
2784 ## Translate the given object along the given vector a given number times
2785 # @param theObject The object to be translated.
2786 # @param theVector Direction of the translation.
2787 # @param theStep Distance to translate on.
2788 # @param theNbTimes Quantity of translations to be done.
2789 # @return New GEOM_Object, containing compound of all
2790 # the shapes, obtained after each translation.
2792 # @ref tui_multi_translation "Example"
2793 def MakeMultiTranslation1D(self,theObject, theVector, theStep, theNbTimes):
2794 # Example: see GEOM_TestAll.py
2795 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
2796 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
2797 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
2798 anObj.SetParameters(Parameters)
2801 ## Conseqently apply two specified translations to theObject specified number of times.
2802 # @param theObject The object to be translated.
2803 # @param theVector1 Direction of the first translation.
2804 # @param theStep1 Step of the first translation.
2805 # @param theNbTimes1 Quantity of translations to be done along theVector1.
2806 # @param theVector2 Direction of the second translation.
2807 # @param theStep2 Step of the second translation.
2808 # @param theNbTimes2 Quantity of translations to be done along theVector2.
2809 # @return New GEOM_Object, containing compound of all
2810 # the shapes, obtained after each translation.
2812 # @ref tui_multi_translation "Example"
2813 def MakeMultiTranslation2D(self,theObject, theVector1, theStep1, theNbTimes1,
2814 theVector2, theStep2, theNbTimes2):
2815 # Example: see GEOM_TestAll.py
2816 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
2817 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
2818 theVector2, theStep2, theNbTimes2)
2819 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
2820 anObj.SetParameters(Parameters)
2823 ## Rotate the given object around the given axis a given number times.
2824 # Rotation angle will be 2*PI/theNbTimes.
2825 # @param theObject The object to be rotated.
2826 # @param theAxis The rotation axis.
2827 # @param theNbTimes Quantity of rotations to be done.
2828 # @return New GEOM_Object, containing compound of all the
2829 # shapes, obtained after each rotation.
2831 # @ref tui_multi_rotation "Example"
2832 def MultiRotate1D(self,theObject, theAxis, theNbTimes):
2833 # Example: see GEOM_TestAll.py
2834 theAxis, theNbTimes, Parameters = ParseParameters(theAxis, theNbTimes)
2835 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
2836 RaiseIfFailed("MultiRotate1D", self.TrsfOp)
2837 anObj.SetParameters(Parameters)
2840 ## Rotate the given object around the
2841 # given axis on the given angle a given number
2842 # times and multi-translate each rotation result.
2843 # Translation direction passes through center of gravity
2844 # of rotated shape and its projection on the rotation axis.
2845 # @param theObject The object to be rotated.
2846 # @param theAxis Rotation axis.
2847 # @param theAngle Rotation angle in graduces.
2848 # @param theNbTimes1 Quantity of rotations to be done.
2849 # @param theStep Translation distance.
2850 # @param theNbTimes2 Quantity of translations to be done.
2851 # @return New GEOM_Object, containing compound of all the
2852 # shapes, obtained after each transformation.
2854 # @ref tui_multi_rotation "Example"
2855 def MultiRotate2D(self,theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2):
2856 # Example: see GEOM_TestAll.py
2857 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
2858 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
2859 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
2860 anObj.SetParameters(Parameters)
2863 ## The same, as MultiRotate1D(), but axis is given by direction and point
2864 # @ref swig_MakeMultiRotation "Example"
2865 def MakeMultiRotation1D(self,aShape,aDir,aPoint,aNbTimes):
2866 # Example: see GEOM_TestOthers.py
2867 aVec = self.MakeLine(aPoint,aDir)
2868 anObj = self.MultiRotate1D(aShape,aVec,aNbTimes)
2871 ## The same, as MultiRotate2D(), but axis is given by direction and point
2872 # @ref swig_MakeMultiRotation "Example"
2873 def MakeMultiRotation2D(self,aShape,aDir,aPoint,anAngle,nbtimes1,aStep,nbtimes2):
2874 # Example: see GEOM_TestOthers.py
2875 aVec = self.MakeLine(aPoint,aDir)
2876 anObj = self.MultiRotate2D(aShape,aVec,anAngle,nbtimes1,aStep,nbtimes2)
2879 # end of l3_transform
2882 ## @addtogroup l3_local
2885 ## Perform a fillet on all edges of the given shape.
2886 # @param theShape Shape, to perform fillet on.
2887 # @param theR Fillet radius.
2888 # @return New GEOM_Object, containing the result shape.
2890 # @ref tui_fillet "Example 1"
2891 # \n @ref swig_MakeFilletAll "Example 2"
2892 def MakeFilletAll(self,theShape, theR):
2893 # Example: see GEOM_TestOthers.py
2894 theR,Parameters = ParseParameters(theR)
2895 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
2896 RaiseIfFailed("MakeFilletAll", self.LocalOp)
2897 anObj.SetParameters(Parameters)
2900 ## Perform a fillet on the specified edges/faces of the given shape
2901 # @param theShape Shape, to perform fillet on.
2902 # @param theR Fillet radius.
2903 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR>.
2904 # @param theListShapes Global indices of edges/faces 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_fillet "Example"
2909 def MakeFillet(self,theShape, theR, theShapeType, theListShapes):
2910 # Example: see GEOM_TestAll.py
2911 theR,Parameters = ParseParameters(theR)
2913 if theShapeType == ShapeType["EDGE"]:
2914 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
2915 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
2917 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
2918 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
2919 anObj.SetParameters(Parameters)
2922 ## The same that MakeFillet but with two Fillet Radius R1 and R2
2923 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes):
2924 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
2926 if theShapeType == ShapeType["EDGE"]:
2927 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
2928 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
2930 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
2931 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
2932 anObj.SetParameters(Parameters)
2935 ## Perform a fillet on the specified edges of the given shape
2936 # @param theShape - Wire Shape to perform fillet on.
2937 # @param theR - Fillet radius.
2938 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
2939 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2940 # \note The list of vertices could be empty,
2941 # in this case fillet will done done at all vertices in wire
2942 # @return New GEOM_Object, containing the result shape.
2944 # @ref tui_fillet2d "Example"
2945 def MakeFillet1D(self,theShape, theR, theListOfVertexes):
2946 # Example: see GEOM_TestAll.py
2947 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes)
2948 RaiseIfFailed("MakeFillet1D", self.LocalOp)
2951 ## Perform a fillet on the specified edges/faces of the given shape
2952 # @param theShape - Face Shape to perform fillet on.
2953 # @param theR - Fillet radius.
2954 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
2955 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2956 # @return New GEOM_Object, containing the result shape.
2958 # @ref tui_fillet2d "Example"
2959 def MakeFillet2D(self,theShape, theR, theListOfVertexes):
2960 # Example: see GEOM_TestAll.py
2961 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
2962 RaiseIfFailed("MakeFillet2D", self.LocalOp)
2965 ## Perform a symmetric chamfer on all edges of the given shape.
2966 # @param theShape Shape, to perform chamfer on.
2967 # @param theD Chamfer size along each face.
2968 # @return New GEOM_Object, containing the result shape.
2970 # @ref tui_chamfer "Example 1"
2971 # \n @ref swig_MakeChamferAll "Example 2"
2972 def MakeChamferAll(self,theShape, theD):
2973 # Example: see GEOM_TestOthers.py
2974 theD,Parameters = ParseParameters(theD)
2975 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
2976 RaiseIfFailed("MakeChamferAll", self.LocalOp)
2977 anObj.SetParameters(Parameters)
2980 ## Perform a chamfer on edges, common to the specified faces,
2981 # with distance D1 on the Face1
2982 # @param theShape Shape, to perform chamfer on.
2983 # @param theD1 Chamfer size along \a theFace1.
2984 # @param theD2 Chamfer size along \a theFace2.
2985 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
2986 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2987 # @return New GEOM_Object, containing the result shape.
2989 # @ref tui_chamfer "Example"
2990 def MakeChamferEdge(self,theShape, theD1, theD2, theFace1, theFace2):
2991 # Example: see GEOM_TestAll.py
2992 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
2993 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
2994 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
2995 anObj.SetParameters(Parameters)
2998 ## The Same that MakeChamferEdge but with params theD is chamfer length and
2999 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
3000 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2):
3002 if isinstance(theAngle,str):
3004 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
3006 theAngle = theAngle*math.pi/180.0
3007 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
3008 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
3009 anObj.SetParameters(Parameters)
3012 ## Perform a chamfer on all edges of the specified faces,
3013 # with distance D1 on the first specified face (if several for one edge)
3014 # @param theShape Shape, to perform chamfer on.
3015 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
3016 # connected to the edge, are in \a theFaces, \a theD1
3017 # will be get along face, which is nearer to \a theFaces beginning.
3018 # @param theD2 Chamfer size along another of two faces, connected to the edge.
3019 # @param theFaces Sequence of global indices of faces of \a theShape.
3020 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
3021 # @return New GEOM_Object, containing the result shape.
3023 # @ref tui_chamfer "Example"
3024 def MakeChamferFaces(self,theShape, theD1, theD2, theFaces):
3025 # Example: see GEOM_TestAll.py
3026 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
3027 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
3028 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
3029 anObj.SetParameters(Parameters)
3032 ## The Same that MakeChamferFaces but with params theD is chamfer lenght and
3033 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
3035 # @ref swig_FilletChamfer "Example"
3036 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces):
3038 if isinstance(theAngle,str):
3040 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
3042 theAngle = theAngle*math.pi/180.0
3043 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
3044 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
3045 anObj.SetParameters(Parameters)
3048 ## Perform a chamfer on edges,
3049 # with distance D1 on the first specified face (if several for one edge)
3050 # @param theShape Shape, to perform chamfer on.
3051 # @param theD1,theD2 Chamfer size
3052 # @param theEdges Sequence of edges of \a theShape.
3053 # @return New GEOM_Object, containing the result shape.
3055 # @ref swig_FilletChamfer "Example"
3056 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges):
3057 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
3058 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
3059 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
3060 anObj.SetParameters(Parameters)
3063 ## The Same that MakeChamferEdges but with params theD is chamfer lenght and
3064 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
3065 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges):
3067 if isinstance(theAngle,str):
3069 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
3071 theAngle = theAngle*math.pi/180.0
3072 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
3073 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
3074 anObj.SetParameters(Parameters)
3077 ## Shortcut to MakeChamferEdge() and MakeChamferFaces()
3079 # @ref swig_MakeChamfer "Example"
3080 def MakeChamfer(self,aShape,d1,d2,aShapeType,ListShape):
3081 # Example: see GEOM_TestOthers.py
3083 if aShapeType == ShapeType["EDGE"]:
3084 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1])
3086 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape)
3092 ## @addtogroup l3_basic_op
3095 ## Perform an Archimde operation on the given shape with given parameters.
3096 # The object presenting the resulting face is returned.
3097 # @param theShape Shape to be put in water.
3098 # @param theWeight Weight og the shape.
3099 # @param theWaterDensity Density of the water.
3100 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
3101 # @return New GEOM_Object, containing a section of \a theShape
3102 # by a plane, corresponding to water level.
3104 # @ref tui_archimede "Example"
3105 def Archimede(self,theShape, theWeight, theWaterDensity, theMeshDeflection):
3106 # Example: see GEOM_TestAll.py
3107 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
3108 theWeight,theWaterDensity,theMeshDeflection)
3109 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
3110 RaiseIfFailed("MakeArchimede", self.LocalOp)
3111 anObj.SetParameters(Parameters)
3114 # end of l3_basic_op
3117 ## @addtogroup l2_measure
3120 ## Get point coordinates
3123 # @ref tui_measurement_tools_page "Example"
3124 def PointCoordinates(self,Point):
3125 # Example: see GEOM_TestMeasures.py
3126 aTuple = self.MeasuOp.PointCoordinates(Point)
3127 RaiseIfFailed("PointCoordinates", self.MeasuOp)
3130 ## Get summarized length of all wires,
3131 # area of surface and volume of the given shape.
3132 # @param theShape Shape to define properties of.
3133 # @return [theLength, theSurfArea, theVolume]
3134 # theLength: Summarized length of all wires of the given shape.
3135 # theSurfArea: Area of surface of the given shape.
3136 # theVolume: Volume of the given shape.
3138 # @ref tui_measurement_tools_page "Example"
3139 def BasicProperties(self,theShape):
3140 # Example: see GEOM_TestMeasures.py
3141 aTuple = self.MeasuOp.GetBasicProperties(theShape)
3142 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
3145 ## Get parameters of bounding box of the given shape
3146 # @param theShape Shape to obtain bounding box of.
3147 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
3148 # Xmin,Xmax: Limits of shape along OX axis.
3149 # Ymin,Ymax: Limits of shape along OY axis.
3150 # Zmin,Zmax: Limits of shape along OZ axis.
3152 # @ref tui_measurement_tools_page "Example"
3153 def BoundingBox(self,theShape):
3154 # Example: see GEOM_TestMeasures.py
3155 aTuple = self.MeasuOp.GetBoundingBox(theShape)
3156 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
3159 ## Get inertia matrix and moments of inertia of theShape.
3160 # @param theShape Shape to calculate inertia of.
3161 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
3162 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
3163 # Ix,Iy,Iz: Moments of inertia of the given shape.
3165 # @ref tui_measurement_tools_page "Example"
3166 def Inertia(self,theShape):
3167 # Example: see GEOM_TestMeasures.py
3168 aTuple = self.MeasuOp.GetInertia(theShape)
3169 RaiseIfFailed("GetInertia", self.MeasuOp)
3172 ## Get minimal distance between the given shapes.
3173 # @param theShape1,theShape2 Shapes to find minimal distance between.
3174 # @return Value of the minimal distance between the given shapes.
3176 # @ref tui_measurement_tools_page "Example"
3177 def MinDistance(self, theShape1, theShape2):
3178 # Example: see GEOM_TestMeasures.py
3179 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
3180 RaiseIfFailed("GetMinDistance", self.MeasuOp)
3183 ## Get minimal distance between the given shapes.
3184 # @param theShape1,theShape2 Shapes to find minimal distance between.
3185 # @return Value of the minimal distance between the given shapes.
3187 # @ref swig_all_measure "Example"
3188 def MinDistanceComponents(self, theShape1, theShape2):
3189 # Example: see GEOM_TestMeasures.py
3190 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
3191 RaiseIfFailed("GetMinDistance", self.MeasuOp)
3192 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
3195 ## Get angle between the given shapes in degrees.
3196 # @param theShape1,theShape2 Lines or linear edges to find angle between.
3197 # @return Value of the angle between the given shapes in degrees.
3199 # @ref tui_measurement_tools_page "Example"
3200 def GetAngle(self, theShape1, theShape2):
3201 # Example: see GEOM_TestMeasures.py
3202 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
3203 RaiseIfFailed("GetAngle", self.MeasuOp)
3205 ## Get angle between the given shapes in radians.
3206 # @param theShape1,theShape2 Lines or linear edges to find angle between.
3207 # @return Value of the angle between the given shapes in radians.
3209 # @ref tui_measurement_tools_page "Example"
3210 def GetAngleRadians(self, theShape1, theShape2):
3211 # Example: see GEOM_TestMeasures.py
3212 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
3213 RaiseIfFailed("GetAngle", self.MeasuOp)
3216 ## @name Curve Curvature Measurement
3217 # Methods for receiving radius of curvature of curves
3218 # in the given point
3221 ## Measure curvature of a curve at a point, set by parameter.
3222 # @ref swig_todo "Example"
3223 def CurveCurvatureByParam(self, theCurve, theParam):
3224 # Example: see GEOM_TestMeasures.py
3225 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
3226 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
3230 # @ref swig_todo "Example"
3231 def CurveCurvatureByPoint(self, theCurve, thePoint):
3232 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
3233 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
3237 ## @name Surface Curvature Measurement
3238 # Methods for receiving max and min radius of curvature of surfaces
3239 # in the given point
3243 ## @ref swig_todo "Example"
3244 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
3245 # Example: see GEOM_TestMeasures.py
3246 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
3247 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
3251 ## @ref swig_todo "Example"
3252 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
3253 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
3254 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
3258 ## @ref swig_todo "Example"
3259 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
3260 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
3261 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
3265 ## @ref swig_todo "Example"
3266 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
3267 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
3268 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
3272 ## Get min and max tolerances of sub-shapes of theShape
3273 # @param theShape Shape, to get tolerances of.
3274 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
3275 # FaceMin,FaceMax: Min and max tolerances of the faces.
3276 # EdgeMin,EdgeMax: Min and max tolerances of the edges.
3277 # VertMin,VertMax: Min and max tolerances of the vertices.
3279 # @ref tui_measurement_tools_page "Example"
3280 def Tolerance(self,theShape):
3281 # Example: see GEOM_TestMeasures.py
3282 aTuple = self.MeasuOp.GetTolerance(theShape)
3283 RaiseIfFailed("GetTolerance", self.MeasuOp)
3286 ## Obtain description of the given shape (number of sub-shapes of each type)
3287 # @param theShape Shape to be described.
3288 # @return Description of the given shape.
3290 # @ref tui_measurement_tools_page "Example"
3291 def WhatIs(self,theShape):
3292 # Example: see GEOM_TestMeasures.py
3293 aDescr = self.MeasuOp.WhatIs(theShape)
3294 RaiseIfFailed("WhatIs", self.MeasuOp)
3297 ## Get a point, situated at the centre of mass of theShape.
3298 # @param theShape Shape to define centre of mass of.
3299 # @return New GEOM_Object, containing the created point.
3301 # @ref tui_measurement_tools_page "Example"
3302 def MakeCDG(self,theShape):
3303 # Example: see GEOM_TestMeasures.py
3304 anObj = self.MeasuOp.GetCentreOfMass(theShape)
3305 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
3308 ## Get a vertex subshape by index depended with orientation.
3309 # @param theShape Shape to find subshape.
3310 # @param theIndex Index to find vertex by this index.
3311 # @return New GEOM_Object, containing the created vertex.
3313 # @ref tui_measurement_tools_page "Example"
3314 def GetVertexByIndex(self,theShape, theIndex):
3315 # Example: see GEOM_TestMeasures.py
3316 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
3317 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
3320 ## Get the first vertex of wire/edge depended orientation.
3321 # @param theShape Shape to find first vertex.
3322 # @return New GEOM_Object, containing the created vertex.
3324 # @ref tui_measurement_tools_page "Example"
3325 def GetFirstVertex(self,theShape):
3326 # Example: see GEOM_TestMeasures.py
3327 anObj = self.GetVertexByIndex(theShape, 0)
3328 RaiseIfFailed("GetFirstVertex", self.MeasuOp)
3331 ## Get the last vertex of wire/edge depended orientation.
3332 # @param theShape Shape to find last vertex.
3333 # @return New GEOM_Object, containing the created vertex.
3335 # @ref tui_measurement_tools_page "Example"
3336 def GetLastVertex(self,theShape):
3337 # Example: see GEOM_TestMeasures.py
3338 nb_vert = self.ShapesOp.NumberOfSubShapes(theShape, ShapeType["VERTEX"])
3339 anObj = self.GetVertexByIndex(theShape, (nb_vert-1))
3340 RaiseIfFailed("GetLastVertex", self.MeasuOp)
3343 ## Get a normale to the given face. If the point is not given,
3344 # the normale is calculated at the center of mass.
3345 # @param theFace Face to define normale of.
3346 # @param theOptionalPoint Point to compute the normale at.
3347 # @return New GEOM_Object, containing the created vector.
3349 # @ref swig_todo "Example"
3350 def GetNormal(self, theFace, theOptionalPoint = None):
3351 # Example: see GEOM_TestMeasures.py
3352 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
3353 RaiseIfFailed("GetNormal", self.MeasuOp)
3356 ## Check a topology of the given shape.
3357 # @param theShape Shape to check validity of.
3358 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked,
3359 # if TRUE, the shape's geometry will be checked also.
3360 # @return TRUE, if the shape "seems to be valid".
3361 # If theShape is invalid, prints a description of problem.
3363 # @ref tui_measurement_tools_page "Example"
3364 def CheckShape(self,theShape, theIsCheckGeom = 0):
3365 # Example: see GEOM_TestMeasures.py
3367 (IsValid, Status) = self.MeasuOp.CheckShapeWithGeometry(theShape)
3368 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
3370 (IsValid, Status) = self.MeasuOp.CheckShape(theShape)
3371 RaiseIfFailed("CheckShape", self.MeasuOp)
3376 ## Get position (LCS) of theShape.
3378 # Origin of the LCS is situated at the shape's center of mass.
3379 # Axes of the LCS are obtained from shape's location or,
3380 # if the shape is a planar face, from position of its plane.
3382 # @param theShape Shape to calculate position of.
3383 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
3384 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
3385 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
3386 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
3388 # @ref swig_todo "Example"
3389 def GetPosition(self,theShape):
3390 # Example: see GEOM_TestMeasures.py
3391 aTuple = self.MeasuOp.GetPosition(theShape)
3392 RaiseIfFailed("GetPosition", self.MeasuOp)
3395 ## Get kind of theShape.
3397 # @param theShape Shape to get a kind of.
3398 # @return Returns a kind of shape in terms of <VAR>GEOM_IKindOfShape.shape_kind</VAR> enumeration
3399 # and a list of parameters, describing the shape.
3400 # @note Concrete meaning of each value, returned via \a theIntegers
3401 # or \a theDoubles list depends on the kind of the shape.
3402 # The full list of possible outputs is:
3404 # - geompy.kind.COMPOUND nb_solids nb_faces nb_edges nb_vertices
3405 # - geompy.kind.COMPSOLID nb_solids nb_faces nb_edges nb_vertices
3407 # - geompy.kind.SHELL geompy.info.CLOSED nb_faces nb_edges nb_vertices
3408 # - geompy.kind.SHELL geompy.info.UNCLOSED nb_faces nb_edges nb_vertices
3410 # - geompy.kind.WIRE geompy.info.CLOSED nb_edges nb_vertices
3411 # - geompy.kind.WIRE geompy.info.UNCLOSED nb_edges nb_vertices
3413 # - geompy.kind.SPHERE xc yc zc R
3414 # - geompy.kind.CYLINDER xb yb zb dx dy dz R H
3415 # - geompy.kind.BOX xc yc zc ax ay az
3416 # - geompy.kind.ROTATED_BOX xc yc zc zx zy zz xx xy xz ax ay az
3417 # - geompy.kind.TORUS xc yc zc dx dy dz R_1 R_2
3418 # - geompy.kind.CONE xb yb zb dx dy dz R_1 R_2 H
3419 # - geompy.kind.POLYHEDRON nb_faces nb_edges nb_vertices
3420 # - geompy.kind.SOLID nb_faces nb_edges nb_vertices
3422 # - geompy.kind.SPHERE2D xc yc zc R
3423 # - geompy.kind.CYLINDER2D xb yb zb dx dy dz R H
3424 # - geompy.kind.TORUS2D xc yc zc dx dy dz R_1 R_2
3425 # - geompy.kind.CONE2D xc yc zc dx dy dz R_1 R_2 H
3426 # - geompy.kind.DISK_CIRCLE xc yc zc dx dy dz R
3427 # - geompy.kind.DISK_ELLIPSE xc yc zc dx dy dz R_1 R_2
3428 # - geompy.kind.POLYGON xo yo zo dx dy dz nb_edges nb_vertices
3429 # - geompy.kind.PLANE xo yo zo dx dy dz
3430 # - geompy.kind.PLANAR xo yo zo dx dy dz nb_edges nb_vertices
3431 # - geompy.kind.FACE nb_edges nb_vertices
3433 # - geompy.kind.CIRCLE xc yc zc dx dy dz R
3434 # - geompy.kind.ARC_CIRCLE xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2
3435 # - geompy.kind.ELLIPSE xc yc zc dx dy dz R_1 R_2
3436 # - geompy.kind.ARC_ELLIPSE xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2
3437 # - geompy.kind.LINE xo yo zo dx dy dz
3438 # - geompy.kind.SEGMENT x1 y1 z1 x2 y2 z2
3439 # - geompy.kind.EDGE nb_vertices
3441 # - geompy.kind.VERTEX x y z
3443 # @ref swig_todo "Example"
3444 def KindOfShape(self,theShape):
3445 # Example: see GEOM_TestMeasures.py
3446 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
3447 RaiseIfFailed("KindOfShape", self.MeasuOp)
3449 aKind = aRoughTuple[0]
3450 anInts = aRoughTuple[1]
3451 aDbls = aRoughTuple[2]
3453 # Now there is no exception from this rule:
3454 aKindTuple = [aKind] + aDbls + anInts
3456 # If they are we will regroup parameters for such kind of shape.
3458 #if aKind == kind.SOME_KIND:
3459 # # SOME_KIND int int double int double double
3460 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
3467 ## @addtogroup l2_import_export
3470 ## Import a shape from the BREP or IGES or STEP file
3471 # (depends on given format) with given name.
3472 # @param theFileName The file, containing the shape.
3473 # @param theFormatName Specify format for the file reading.
3474 # Available formats can be obtained with InsertOp.ImportTranslators() method.
3475 # If format 'IGES_SCALE' is used instead 'IGES' length unit will be
3476 # set to 'meter' and result model will be scaled.
3477 # @return New GEOM_Object, containing the imported shape.
3479 # @ref swig_Import_Export "Example"
3480 def Import(self,theFileName, theFormatName):
3481 # Example: see GEOM_TestOthers.py
3482 anObj = self.InsertOp.Import(theFileName, theFormatName)
3483 RaiseIfFailed("Import", self.InsertOp)
3486 ## Shortcut to Import() for BREP format
3488 # @ref swig_Import_Export "Example"
3489 def ImportBREP(self,theFileName):
3490 # Example: see GEOM_TestOthers.py
3491 return self.Import(theFileName, "BREP")
3493 ## Shortcut to Import() for IGES format
3495 # @ref swig_Import_Export "Example"
3496 def ImportIGES(self,theFileName):
3497 # Example: see GEOM_TestOthers.py
3498 return self.Import(theFileName, "IGES")
3500 ## Return length unit from given IGES file
3502 # @ref swig_Import_Export "Example"
3503 def GetIGESUnit(self,theFileName):
3504 # Example: see GEOM_TestOthers.py
3505 anObj = self.InsertOp.Import(theFileName, "IGES_UNIT")
3506 #RaiseIfFailed("Import", self.InsertOp)
3507 # recieve name using returned vertex
3509 vertices = self.SubShapeAll(anObj,ShapeType["VERTEX"])
3511 p = self.PointCoordinates(vertices[0])
3512 if abs(p[0]-0.01) < 1.e-6:
3514 elif abs(p[0]-0.001) < 1.e-6:
3518 ## Shortcut to Import() for STEP format
3520 # @ref swig_Import_Export "Example"
3521 def ImportSTEP(self,theFileName):
3522 # Example: see GEOM_TestOthers.py
3523 return self.Import(theFileName, "STEP")
3525 ## Export the given shape into a file with given name.
3526 # @param theObject Shape to be stored in the file.
3527 # @param theFileName Name of the file to store the given shape in.
3528 # @param theFormatName Specify format for the shape storage.
3529 # Available formats can be obtained with InsertOp.ImportTranslators() method.
3531 # @ref swig_Import_Export "Example"
3532 def Export(self,theObject, theFileName, theFormatName):
3533 # Example: see GEOM_TestOthers.py
3534 self.InsertOp.Export(theObject, theFileName, theFormatName)
3535 if self.InsertOp.IsDone() == 0:
3536 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
3540 ## Shortcut to Export() for BREP format
3542 # @ref swig_Import_Export "Example"
3543 def ExportBREP(self,theObject, theFileName):
3544 # Example: see GEOM_TestOthers.py
3545 return self.Export(theObject, theFileName, "BREP")
3547 ## Shortcut to Export() for IGES format
3549 # @ref swig_Import_Export "Example"
3550 def ExportIGES(self,theObject, theFileName):
3551 # Example: see GEOM_TestOthers.py
3552 return self.Export(theObject, theFileName, "IGES")
3554 ## Shortcut to Export() for STEP format
3556 # @ref swig_Import_Export "Example"
3557 def ExportSTEP(self,theObject, theFileName):
3558 # Example: see GEOM_TestOthers.py
3559 return self.Export(theObject, theFileName, "STEP")
3561 # end of l2_import_export
3564 ## @addtogroup l3_blocks
3567 ## Create a quadrangle face from four edges. Order of Edges is not
3568 # important. It is not necessary that edges share the same vertex.
3569 # @param E1,E2,E3,E4 Edges for the face bound.
3570 # @return New GEOM_Object, containing the created face.
3572 # @ref tui_building_by_blocks_page "Example"
3573 def MakeQuad(self,E1, E2, E3, E4):
3574 # Example: see GEOM_Spanner.py
3575 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
3576 RaiseIfFailed("MakeQuad", self.BlocksOp)
3579 ## Create a quadrangle face on two edges.
3580 # The missing edges will be built by creating the shortest ones.
3581 # @param E1,E2 Two opposite edges for the face.
3582 # @return New GEOM_Object, containing the created face.
3584 # @ref tui_building_by_blocks_page "Example"
3585 def MakeQuad2Edges(self,E1, E2):
3586 # Example: see GEOM_Spanner.py
3587 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
3588 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
3591 ## Create a quadrangle face with specified corners.
3592 # The missing edges will be built by creating the shortest ones.
3593 # @param V1,V2,V3,V4 Corner vertices for the face.
3594 # @return New GEOM_Object, containing the created face.
3596 # @ref tui_building_by_blocks_page "Example 1"
3597 # \n @ref swig_MakeQuad4Vertices "Example 2"
3598 def MakeQuad4Vertices(self,V1, V2, V3, V4):
3599 # Example: see GEOM_Spanner.py
3600 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
3601 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
3604 ## Create a hexahedral solid, bounded by the six given faces. Order of
3605 # faces is not important. It is not necessary that Faces share the same edge.
3606 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
3607 # @return New GEOM_Object, containing the created solid.
3609 # @ref tui_building_by_blocks_page "Example 1"
3610 # \n @ref swig_MakeHexa "Example 2"
3611 def MakeHexa(self,F1, F2, F3, F4, F5, F6):
3612 # Example: see GEOM_Spanner.py
3613 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
3614 RaiseIfFailed("MakeHexa", self.BlocksOp)
3617 ## Create a hexahedral solid between two given faces.
3618 # The missing faces will be built by creating the smallest ones.
3619 # @param F1,F2 Two opposite faces for the hexahedral solid.
3620 # @return New GEOM_Object, containing the created solid.
3622 # @ref tui_building_by_blocks_page "Example 1"
3623 # \n @ref swig_MakeHexa2Faces "Example 2"
3624 def MakeHexa2Faces(self,F1, F2):
3625 # Example: see GEOM_Spanner.py
3626 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
3627 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
3633 ## @addtogroup l3_blocks_op
3636 ## Get a vertex, found in the given shape by its coordinates.
3637 # @param theShape Block or a compound of blocks.
3638 # @param theX,theY,theZ Coordinates of the sought vertex.
3639 # @param theEpsilon Maximum allowed distance between the resulting
3640 # vertex and point with the given coordinates.
3641 # @return New GEOM_Object, containing the found vertex.
3643 # @ref swig_GetPoint "Example"
3644 def GetPoint(self,theShape, theX, theY, theZ, theEpsilon):
3645 # Example: see GEOM_TestOthers.py
3646 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
3647 RaiseIfFailed("GetPoint", self.BlocksOp)
3650 ## Get an edge, found in the given shape by two given vertices.
3651 # @param theShape Block or a compound of blocks.
3652 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
3653 # @return New GEOM_Object, containing the found edge.
3655 # @ref swig_todo "Example"
3656 def GetEdge(self,theShape, thePoint1, thePoint2):
3657 # Example: see GEOM_Spanner.py
3658 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
3659 RaiseIfFailed("GetEdge", self.BlocksOp)
3662 ## Find an edge of the given shape, which has minimal distance to the given point.
3663 # @param theShape Block or a compound of blocks.
3664 # @param thePoint Point, close to the desired edge.
3665 # @return New GEOM_Object, containing the found edge.
3667 # @ref swig_GetEdgeNearPoint "Example"
3668 def GetEdgeNearPoint(self,theShape, thePoint):
3669 # Example: see GEOM_TestOthers.py
3670 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
3671 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
3674 ## Returns a face, found in the given shape by four given corner vertices.
3675 # @param theShape Block or a compound of blocks.
3676 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
3677 # @return New GEOM_Object, containing the found face.
3679 # @ref swig_todo "Example"
3680 def GetFaceByPoints(self,theShape, thePoint1, thePoint2, thePoint3, thePoint4):
3681 # Example: see GEOM_Spanner.py
3682 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
3683 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
3686 ## Get a face of block, found in the given shape by two given edges.
3687 # @param theShape Block or a compound of blocks.
3688 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
3689 # @return New GEOM_Object, containing the found face.
3691 # @ref swig_todo "Example"
3692 def GetFaceByEdges(self,theShape, theEdge1, theEdge2):
3693 # Example: see GEOM_Spanner.py
3694 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
3695 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
3698 ## Find a face, opposite to the given one in the given block.
3699 # @param theBlock Must be a hexahedral solid.
3700 # @param theFace Face of \a theBlock, opposite to the desired face.
3701 # @return New GEOM_Object, containing the found face.
3703 # @ref swig_GetOppositeFace "Example"
3704 def GetOppositeFace(self,theBlock, theFace):
3705 # Example: see GEOM_Spanner.py
3706 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
3707 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
3710 ## Find a face of the given shape, which has minimal distance to the given point.
3711 # @param theShape Block or a compound of blocks.
3712 # @param thePoint Point, close to the desired face.
3713 # @return New GEOM_Object, containing the found face.
3715 # @ref swig_GetFaceNearPoint "Example"
3716 def GetFaceNearPoint(self,theShape, thePoint):
3717 # Example: see GEOM_Spanner.py
3718 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
3719 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
3722 ## Find a face of block, whose outside normale has minimal angle with the given vector.
3723 # @param theBlock Block or a compound of blocks.
3724 # @param theVector Vector, close to the normale of the desired face.
3725 # @return New GEOM_Object, containing the found face.
3727 # @ref swig_todo "Example"
3728 def GetFaceByNormale(self, theBlock, theVector):
3729 # Example: see GEOM_Spanner.py
3730 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
3731 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
3734 # end of l3_blocks_op
3737 ## @addtogroup l4_blocks_measure
3740 ## Check, if the compound of blocks is given.
3741 # To be considered as a compound of blocks, the
3742 # given shape must satisfy the following conditions:
3743 # - Each element of the compound should be a Block (6 faces and 12 edges).
3744 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
3745 # - The compound should be connexe.
3746 # - The glue between two quadrangle faces should be applied.
3747 # @param theCompound The compound to check.
3748 # @return TRUE, if the given shape is a compound of blocks.
3749 # If theCompound is not valid, prints all discovered errors.
3751 # @ref tui_measurement_tools_page "Example 1"
3752 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
3753 def CheckCompoundOfBlocks(self,theCompound):
3754 # Example: see GEOM_Spanner.py
3755 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
3756 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
3758 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
3762 ## Remove all seam and degenerated edges from \a theShape.
3763 # Unite faces and edges, sharing one surface. It means that
3764 # this faces must have references to one C++ surface object (handle).
3765 # @param theShape The compound or single solid to remove irregular edges from.
3766 # @param doUnionFaces If True, then unite faces. If False (the default value),
3767 # do not unite faces.
3768 # @return Improved shape.
3770 # @ref swig_RemoveExtraEdges "Example"
3771 def RemoveExtraEdges(self, theShape, doUnionFaces=False):
3772 # Example: see GEOM_TestOthers.py
3773 nbFacesOptimum = -1 # -1 means do not unite faces
3774 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
3775 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
3776 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
3779 ## Check, if the given shape is a blocks compound.
3780 # Fix all detected errors.
3781 # \note Single block can be also fixed by this method.
3782 # @param theShape The compound to check and improve.
3783 # @return Improved compound.
3785 # @ref swig_CheckAndImprove "Example"
3786 def CheckAndImprove(self,theShape):
3787 # Example: see GEOM_TestOthers.py
3788 anObj = self.BlocksOp.CheckAndImprove(theShape)
3789 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
3792 # end of l4_blocks_measure
3795 ## @addtogroup l3_blocks_op
3798 ## Get all the blocks, contained in the given compound.
3799 # @param theCompound The compound to explode.
3800 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
3801 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
3802 # \note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
3803 # @return List of GEOM_Objects, containing the retrieved blocks.
3805 # @ref tui_explode_on_blocks "Example 1"
3806 # \n @ref swig_MakeBlockExplode "Example 2"
3807 def MakeBlockExplode(self,theCompound, theMinNbFaces, theMaxNbFaces):
3808 # Example: see GEOM_TestOthers.py
3809 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
3810 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
3811 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
3813 anObj.SetParameters(Parameters)
3817 ## Find block, containing the given point inside its volume or on boundary.
3818 # @param theCompound Compound, to find block in.
3819 # @param thePoint Point, close to the desired block. If the point lays on
3820 # boundary between some blocks, we return block with nearest center.
3821 # @return New GEOM_Object, containing the found block.
3823 # @ref swig_todo "Example"
3824 def GetBlockNearPoint(self,theCompound, thePoint):
3825 # Example: see GEOM_Spanner.py
3826 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
3827 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
3830 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
3831 # @param theCompound Compound, to find block in.
3832 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
3833 # @return New GEOM_Object, containing the found block.
3835 # @ref swig_GetBlockByParts "Example"
3836 def GetBlockByParts(self,theCompound, theParts):
3837 # Example: see GEOM_TestOthers.py
3838 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
3839 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
3842 ## Return all blocks, containing all the elements, passed as the parts.
3843 # @param theCompound Compound, to find blocks in.
3844 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
3845 # @return List of GEOM_Objects, containing the found blocks.
3847 # @ref swig_todo "Example"
3848 def GetBlocksByParts(self,theCompound, theParts):
3849 # Example: see GEOM_Spanner.py
3850 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
3851 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
3854 ## Multi-transformate block and glue the result.
3855 # Transformation is defined so, as to superpose direction faces.
3856 # @param Block Hexahedral solid to be multi-transformed.
3857 # @param DirFace1 ID of First direction face.
3858 # @param DirFace2 ID of Second direction face.
3859 # @param NbTimes Quantity of transformations to be done.
3860 # \note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
3861 # @return New GEOM_Object, containing the result shape.
3863 # @ref tui_multi_transformation "Example"
3864 def MakeMultiTransformation1D(self,Block, DirFace1, DirFace2, NbTimes):
3865 # Example: see GEOM_Spanner.py
3866 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
3867 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
3868 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
3869 anObj.SetParameters(Parameters)
3872 ## Multi-transformate block and glue the result.
3873 # @param Block Hexahedral solid to be multi-transformed.
3874 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
3875 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
3876 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
3877 # @return New GEOM_Object, containing the result shape.
3879 # @ref tui_multi_transformation "Example"
3880 def MakeMultiTransformation2D(self,Block, DirFace1U, DirFace2U, NbTimesU,
3881 DirFace1V, DirFace2V, NbTimesV):
3882 # Example: see GEOM_Spanner.py
3883 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
3884 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
3885 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
3886 DirFace1V, DirFace2V, NbTimesV)
3887 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
3888 anObj.SetParameters(Parameters)
3891 ## Build all possible propagation groups.
3892 # Propagation group is a set of all edges, opposite to one (main)
3893 # edge of this group directly or through other opposite edges.
3894 # Notion of Opposite Edge make sence only on quadrangle face.
3895 # @param theShape Shape to build propagation groups on.
3896 # @return List of GEOM_Objects, each of them is a propagation group.
3898 # @ref swig_Propagate "Example"
3899 def Propagate(self,theShape):
3900 # Example: see GEOM_TestOthers.py
3901 listChains = self.BlocksOp.Propagate(theShape)
3902 RaiseIfFailed("Propagate", self.BlocksOp)
3905 # end of l3_blocks_op
3908 ## @addtogroup l3_groups
3911 ## Creates a new group which will store sub shapes of theMainShape
3912 # @param theMainShape is a GEOM object on which the group is selected
3913 # @param theShapeType defines a shape type of the group
3914 # @return a newly created GEOM group
3916 # @ref tui_working_with_groups_page "Example 1"
3917 # \n @ref swig_CreateGroup "Example 2"
3918 def CreateGroup(self,theMainShape, theShapeType):
3919 # Example: see GEOM_TestOthers.py
3920 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
3921 RaiseIfFailed("CreateGroup", self.GroupOp)
3924 ## Adds a sub object with ID theSubShapeId to the group
3925 # @param theGroup is a GEOM group to which the new sub shape is added
3926 # @param theSubShapeID is a sub shape ID in the main object.
3927 # \note Use method GetSubShapeID() to get an unique ID of the sub shape
3929 # @ref tui_working_with_groups_page "Example"
3930 def AddObject(self,theGroup, theSubShapeID):
3931 # Example: see GEOM_TestOthers.py
3932 self.GroupOp.AddObject(theGroup, theSubShapeID)
3933 RaiseIfFailed("AddObject", self.GroupOp)
3936 ## Removes a sub object with ID \a theSubShapeId from the group
3937 # @param theGroup is a GEOM group from which the new sub shape is removed
3938 # @param theSubShapeID is a sub shape ID in the main object.
3939 # \note Use method GetSubShapeID() to get an unique ID of the sub shape
3941 # @ref tui_working_with_groups_page "Example"
3942 def RemoveObject(self,theGroup, theSubShapeID):
3943 # Example: see GEOM_TestOthers.py
3944 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
3945 RaiseIfFailed("RemoveObject", self.GroupOp)
3948 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
3949 # @param theGroup is a GEOM group to which the new sub shapes are added.
3950 # @param theSubShapes is a list of sub shapes to be added.
3952 # @ref tui_working_with_groups_page "Example"
3953 def UnionList (self,theGroup, theSubShapes):
3954 # Example: see GEOM_TestOthers.py
3955 self.GroupOp.UnionList(theGroup, theSubShapes)
3956 RaiseIfFailed("UnionList", self.GroupOp)
3959 ## Works like the above method, but argument
3960 # theSubShapes here is a list of sub-shapes indices
3962 # @ref swig_UnionIDs "Example"
3963 def UnionIDs(self,theGroup, theSubShapes):
3964 # Example: see GEOM_TestOthers.py
3965 self.GroupOp.UnionIDs(theGroup, theSubShapes)
3966 RaiseIfFailed("UnionIDs", self.GroupOp)
3969 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
3970 # @param theGroup is a GEOM group from which the sub-shapes are removed.
3971 # @param theSubShapes is a list of sub-shapes to be removed.
3973 # @ref tui_working_with_groups_page "Example"
3974 def DifferenceList (self,theGroup, theSubShapes):
3975 # Example: see GEOM_TestOthers.py
3976 self.GroupOp.DifferenceList(theGroup, theSubShapes)
3977 RaiseIfFailed("DifferenceList", self.GroupOp)
3980 ## Works like the above method, but argument
3981 # theSubShapes here is a list of sub-shapes indices
3983 # @ref swig_DifferenceIDs "Example"
3984 def DifferenceIDs(self,theGroup, theSubShapes):
3985 # Example: see GEOM_TestOthers.py
3986 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
3987 RaiseIfFailed("DifferenceIDs", self.GroupOp)
3990 ## Returns a list of sub objects ID stored in the group
3991 # @param theGroup is a GEOM group for which a list of IDs is requested
3993 # @ref swig_GetObjectIDs "Example"
3994 def GetObjectIDs(self,theGroup):
3995 # Example: see GEOM_TestOthers.py
3996 ListIDs = self.GroupOp.GetObjects(theGroup)
3997 RaiseIfFailed("GetObjects", self.GroupOp)
4000 ## Returns a type of sub objects stored in the group
4001 # @param theGroup is a GEOM group which type is returned.
4003 # @ref swig_GetType "Example"
4004 def GetType(self,theGroup):
4005 # Example: see GEOM_TestOthers.py
4006 aType = self.GroupOp.GetType(theGroup)
4007 RaiseIfFailed("GetType", self.GroupOp)
4010 ## Convert a type of geom object from id to string value
4011 # @param theId is a GEOM obect type id.
4013 # @ref swig_GetType "Example"
4014 def ShapeIdToType(self, theId):
4088 return "FREE_BOUNDS"
4096 return "THRUSECTIONS"
4098 return "COMPOUNDFILTER"
4100 return "SHAPES_ON_SHAPE"
4102 return "ELLIPSE_ARC"
4109 return "Shape Id not exist."
4111 ## Returns a main shape associated with the group
4112 # @param theGroup is a GEOM group for which a main shape object is requested
4113 # @return a GEOM object which is a main shape for theGroup
4115 # @ref swig_GetMainShape "Example"
4116 def GetMainShape(self,theGroup):
4117 # Example: see GEOM_TestOthers.py
4118 anObj = self.GroupOp.GetMainShape(theGroup)
4119 RaiseIfFailed("GetMainShape", self.GroupOp)
4122 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
4123 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
4125 # @ref swig_todo "Example"
4126 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1):
4127 edges = self.SubShapeAll(theShape, ShapeType["EDGE"])
4130 Props = self.BasicProperties(edge)
4131 if min_length <= Props[0] and Props[0] <= max_length:
4132 if (not include_min) and (min_length == Props[0]):
4135 if (not include_max) and (Props[0] == max_length):
4138 edges_in_range.append(edge)
4140 if len(edges_in_range) <= 0:
4141 print "No edges found by given criteria"
4144 group_edges = self.CreateGroup(theShape, ShapeType["EDGE"])
4145 self.UnionList(group_edges, edges_in_range)
4149 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
4150 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
4152 # @ref swig_todo "Example"
4153 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
4154 nb_selected = sg.SelectedCount()
4156 print "Select a shape before calling this function, please."
4159 print "Only one shape must be selected"
4162 id_shape = sg.getSelected(0)
4163 shape = IDToObject( id_shape )
4165 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
4169 if include_min: left_str = " <= "
4170 if include_max: right_str = " <= "
4172 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
4173 + left_str + "length" + right_str + `max_length`)
4175 sg.updateObjBrowser(1)
4182 ## @addtogroup l4_advanced
4185 ## Create a T-shape object with specified caracteristics for the main
4186 # and the incident pipes (radius, width, half-length).
4187 # The extremities of the main pipe are located on junctions points P1 and P2.
4188 # The extremity of the incident pipe is located on junction point P3.
4189 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
4190 # the main plane of the T-shape is XOY.
4191 # @param theR1 Internal radius of main pipe
4192 # @param theW1 Width of main pipe
4193 # @param theL1 Half-length of main pipe
4194 # @param theR2 Internal radius of incident pipe (R2 < R1)
4195 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
4196 # @param theL2 Half-length of incident pipe
4197 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
4198 # @param theP1 1st junction point of main pipe
4199 # @param theP2 2nd junction point of main pipe
4200 # @param theP3 Junction point of incident pipe
4201 # @return List of GEOM_Objects, containing the created shape and propagation groups.
4203 # @ref tui_creation_pipetshape "Example"
4204 def MakePipeTShape(self, theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh=True, theP1=None, theP2=None, theP3=None):
4205 theR1, theW1, theL1, theR2, theW2, theL2, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2)
4206 if (theP1 and theP2 and theP3):
4207 anObj = self.AdvOp.MakePipeTShapeWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh, theP1, theP2, theP3)
4209 anObj = self.AdvOp.MakePipeTShape(theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh)
4210 RaiseIfFailed("MakePipeTShape", self.AdvOp)
4211 if Parameters: anObj[0].SetParameters(Parameters)
4214 ## Create a T-shape object with chamfer and with specified caracteristics for the main
4215 # and the incident pipes (radius, width, half-length). The chamfer is
4216 # created on the junction of the pipes.
4217 # The extremities of the main pipe are located on junctions points P1 and P2.
4218 # The extremity of the incident pipe is located on junction point P3.
4219 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
4220 # the main plane of the T-shape is XOY.
4221 # @param theR1 Internal radius of main pipe
4222 # @param theW1 Width of main pipe
4223 # @param theL1 Half-length of main pipe
4224 # @param theR2 Internal radius of incident pipe (R2 < R1)
4225 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
4226 # @param theL2 Half-length of incident pipe
4227 # @param theH Height of the chamfer.
4228 # @param theW Width of the chamfer.
4229 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
4230 # @param theP1 1st junction point of main pipe
4231 # @param theP2 2nd junction point of main pipe
4232 # @param theP3 Junction point of incident pipe
4233 # @return List of GEOM_Objects, containing the created shape and propagation groups.
4235 # @ref tui_creation_pipetshape "Example"
4236 def MakePipeTShapeChamfer(self, theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh=True, theP1=None, theP2=None, theP3=None):
4237 theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW)
4238 if (theP1 and theP2 and theP3):
4239 anObj = self.AdvOp.MakePipeTShapeChamferWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh, theP1, theP2, theP3)
4241 anObj = self.AdvOp.MakePipeTShapeChamfer(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh)
4242 RaiseIfFailed("MakePipeTShapeChamfer", self.AdvOp)
4243 if Parameters: anObj[0].SetParameters(Parameters)
4246 ## Create a T-shape object with fillet and with specified caracteristics for the main
4247 # and the incident pipes (radius, width, half-length). The fillet is
4248 # created on the junction of the pipes.
4249 # The extremities of the main pipe are located on junctions points P1 and P2.
4250 # The extremity of the incident pipe is located on junction point P3.
4251 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
4252 # the main plane of the T-shape is XOY.
4253 # @param theR1 Internal radius of main pipe
4254 # @param theW1 Width of main pipe
4255 # @param theL1 Half-length of main pipe
4256 # @param theR2 Internal radius of incident pipe (R2 < R1)
4257 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
4258 # @param theL2 Half-length of incident pipe
4259 # @param theRF Radius of curvature of fillet.
4260 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
4261 # @param theP1 1st junction point of main pipe
4262 # @param theP2 2nd junction point of main pipe
4263 # @param theP3 Junction point of incident pipe
4264 # @return List of GEOM_Objects, containing the created shape and propagation groups.
4266 # @ref tui_creation_pipetshape "Example"
4267 def MakePipeTShapeFillet(self, theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh=True, theP1=None, theP2=None, theP3=None):
4268 theR1, theW1, theL1, theR2, theW2, theL2, theRF, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theRF)
4269 if (theP1 and theP2 and theP3):
4270 anObj = self.AdvOp.MakePipeTShapeFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh, theP1, theP2, theP3)
4272 anObj = self.AdvOp.MakePipeTShapeFillet(theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh)
4273 RaiseIfFailed("MakePipeTShapeFillet", self.AdvOp)
4274 if Parameters: anObj[0].SetParameters(Parameters)
4277 #@@ insert new functions before this line @@ do not remove this line @@#
4279 # end of l4_advanced
4282 ## Create a copy of the given object
4283 # @ingroup l1_geompy_auxiliary
4285 # @ref swig_all_advanced "Example"
4286 def MakeCopy(self,theOriginal):
4287 # Example: see GEOM_TestAll.py
4288 anObj = self.InsertOp.MakeCopy(theOriginal)
4289 RaiseIfFailed("MakeCopy", self.InsertOp)
4292 ## Add Path to load python scripts from
4293 # @ingroup l1_geompy_auxiliary
4294 def addPath(self,Path):
4295 if (sys.path.count(Path) < 1):
4296 sys.path.append(Path)
4300 ## Load marker texture from the file
4301 # @param Path a path to the texture file
4302 # @return unique texture identifier
4303 # @ingroup l1_geompy_auxiliary
4304 def LoadTexture(self, Path):
4305 # Example: see GEOM_TestAll.py
4306 ID = self.InsertOp.LoadTexture(Path)
4307 RaiseIfFailed("LoadTexture", self.InsertOp)
4310 ## Add marker texture. @a Width and @a Height parameters
4311 # specify width and height of the texture in pixels.
4312 # If @a RowData is @c True, @a Texture parameter should represent texture data
4313 # packed into the byte array. If @a RowData is @c False (default), @a Texture
4314 # parameter should be unpacked string, in which '1' symbols represent opaque
4315 # pixels and '0' represent transparent pixels of the texture bitmap.
4317 # @param Width texture width in pixels
4318 # @param Height texture height in pixels
4319 # @param Texture texture data
4320 # @param RowData if @c True, @a Texture data are packed in the byte stream
4321 # @ingroup l1_geompy_auxiliary
4322 def AddTexture(self, Width, Height, Texture, RowData=False):
4323 # Example: see GEOM_TestAll.py
4324 if not RowData: Texture = PackData(Texture)
4325 ID = self.InsertOp.AddTexture(Width, Height, Texture)
4326 RaiseIfFailed("AddTexture", self.InsertOp)
4330 #Register the new proxy for GEOM_Gen
4331 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geompyDC)