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
916 # - "A dx dy" : Create arc by point with DX & DY
917 # - "UU x y radius flag1": Create arc by point at X & Y with given radiUs
918 # - "U dx dy radius flag1" : Create arc by point with DX & DY with given radiUs
919 # - "EE x y xc yc flag1 flag2": Create arc by point at X & Y with given cEnter coordinates
920 # - "E dx dy dxc dyc radius flag1 flag2" : Create arc by point with DX & DY with given cEnter coordinates
923 # - "WW" : Close Wire (to finish)
924 # - "WF" : Close Wire and build face (to finish)
927 # - Flag1 (= reverse) is 0 or 2 ...
928 # - if 0 the drawn arc is the one of lower angle (< Pi)
929 # - if 2 the drawn arc ius the one of greater angle (> Pi)
932 # - Flag2 (= control tolerance) is 0 or 1 ...
933 # - if 0 the specified end point can be at a distance of the arc greater than the tolerance (10^-7)
934 # - if 1 the wire is built only if the end point is on the arc
935 # with a tolerance of 10^-7 on the distance else the creation fails
937 # @param theCommand String, defining the sketcher in local
938 # coordinates of the working plane.
939 # @param theWorkingPlane Nine double values, defining origin,
940 # OZ and OX directions of the working plane.
941 # @return New GEOM_Object, containing the created wire.
943 # @ref tui_sketcher_page "Example"
944 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0]):
945 # Example: see GEOM_TestAll.py
946 theCommand,Parameters = ParseSketcherCommand(theCommand)
947 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
948 RaiseIfFailed("MakeSketcher", self.CurvesOp)
949 anObj.SetParameters(Parameters)
952 ## Create a sketcher (wire or face), following the textual description,
953 # passed through <VAR>theCommand</VAR> argument. \n
954 # For format of the description string see the previous method.\n
955 # @param theCommand String, defining the sketcher in local
956 # coordinates of the working plane.
957 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
958 # @return New GEOM_Object, containing the created wire.
960 # @ref tui_sketcher_page "Example"
961 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane):
962 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
963 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
966 ## Create a sketcher wire, following the numerical description,
967 # passed through <VAR>theCoordinates</VAR> argument. \n
968 # @param theCoordinates double values, defining points to create a wire,
970 # @return New GEOM_Object, containing the created wire.
972 # @ref tui_sketcher_page "Example"
973 def Make3DSketcher(self, theCoordinates):
974 theCoordinates,Parameters = ParseParameters(theCoordinates)
975 anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
976 RaiseIfFailed("Make3DSketcher", self.CurvesOp)
977 anObj.SetParameters(Parameters)
983 ## @addtogroup l3_3d_primitives
986 ## Create a box by coordinates of two opposite vertices.
988 # @ref tui_creation_box "Example"
989 def MakeBox(self,x1,y1,z1,x2,y2,z2):
990 # Example: see GEOM_TestAll.py
991 pnt1 = self.MakeVertex(x1,y1,z1)
992 pnt2 = self.MakeVertex(x2,y2,z2)
993 return self.MakeBoxTwoPnt(pnt1,pnt2)
995 ## Create a box with specified dimensions along the coordinate axes
996 # and with edges, parallel to the coordinate axes.
997 # Center of the box will be at point (DX/2, DY/2, DZ/2).
998 # @param theDX Length of Box edges, parallel to OX axis.
999 # @param theDY Length of Box edges, parallel to OY axis.
1000 # @param theDZ Length of Box edges, parallel to OZ axis.
1001 # @return New GEOM_Object, containing the created box.
1003 # @ref tui_creation_box "Example"
1004 def MakeBoxDXDYDZ(self,theDX, theDY, theDZ):
1005 # Example: see GEOM_TestAll.py
1006 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1007 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
1008 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
1009 anObj.SetParameters(Parameters)
1012 ## Create a box with two specified opposite vertices,
1013 # and with edges, parallel to the coordinate axes
1014 # @param thePnt1 First of two opposite vertices.
1015 # @param thePnt2 Second of two opposite vertices.
1016 # @return New GEOM_Object, containing the created box.
1018 # @ref tui_creation_box "Example"
1019 def MakeBoxTwoPnt(self,thePnt1, thePnt2):
1020 # Example: see GEOM_TestAll.py
1021 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
1022 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
1025 ## Create a face with specified dimensions along OX-OY coordinate axes,
1026 # with edges, parallel to this coordinate axes.
1027 # @param theH height of Face.
1028 # @param theW width of Face.
1029 # @param theOrientation orientation belong axis OXY OYZ OZX
1030 # @return New GEOM_Object, containing the created face.
1032 # @ref tui_creation_face "Example"
1033 def MakeFaceHW(self,theH, theW, theOrientation):
1034 # Example: see GEOM_TestAll.py
1035 theH,theW,Parameters = ParseParameters(theH, theW)
1036 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
1037 RaiseIfFailed("MakeFaceHW", self.PrimOp)
1038 anObj.SetParameters(Parameters)
1041 ## Create a face from another plane and two sizes,
1042 # vertical size and horisontal size.
1043 # @param theObj Normale vector to the creating face or
1045 # @param theH Height (vertical size).
1046 # @param theW Width (horisontal size).
1047 # @return New GEOM_Object, containing the created face.
1049 # @ref tui_creation_face "Example"
1050 def MakeFaceObjHW(self, theObj, theH, theW):
1051 # Example: see GEOM_TestAll.py
1052 theH,theW,Parameters = ParseParameters(theH, theW)
1053 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
1054 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
1055 anObj.SetParameters(Parameters)
1058 ## Create a disk with given center, normal vector and radius.
1059 # @param thePnt Disk center.
1060 # @param theVec Vector, normal to the plane of the disk.
1061 # @param theR Disk radius.
1062 # @return New GEOM_Object, containing the created disk.
1064 # @ref tui_creation_disk "Example"
1065 def MakeDiskPntVecR(self,thePnt, theVec, theR):
1066 # Example: see GEOM_TestAll.py
1067 theR,Parameters = ParseParameters(theR)
1068 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
1069 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
1070 anObj.SetParameters(Parameters)
1073 ## Create a disk, passing through three given points
1074 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
1075 # @return New GEOM_Object, containing the created disk.
1077 # @ref tui_creation_disk "Example"
1078 def MakeDiskThreePnt(self,thePnt1, thePnt2, thePnt3):
1079 # Example: see GEOM_TestAll.py
1080 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
1081 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
1084 ## Create a disk with specified dimensions along OX-OY coordinate axes.
1085 # @param theR Radius of Face.
1086 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
1087 # @return New GEOM_Object, containing the created disk.
1089 # @ref tui_creation_face "Example"
1090 def MakeDiskR(self,theR, theOrientation):
1091 # Example: see GEOM_TestAll.py
1092 theR,Parameters = ParseParameters(theR)
1093 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
1094 RaiseIfFailed("MakeDiskR", self.PrimOp)
1095 anObj.SetParameters(Parameters)
1098 ## Create a cylinder with given base point, axis, radius and height.
1099 # @param thePnt Central point of cylinder base.
1100 # @param theAxis Cylinder axis.
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 MakeCylinder(self,thePnt, theAxis, theR, theH):
1107 # Example: see GEOM_TestAll.py
1108 theR,theH,Parameters = ParseParameters(theR, theH)
1109 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
1110 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
1111 anObj.SetParameters(Parameters)
1114 ## Create a cylinder with given radius and height at
1115 # the origin of coordinate system. Axis of the cylinder
1116 # will be collinear to the OZ axis of the coordinate system.
1117 # @param theR Cylinder radius.
1118 # @param theH Cylinder height.
1119 # @return New GEOM_Object, containing the created cylinder.
1121 # @ref tui_creation_cylinder "Example"
1122 def MakeCylinderRH(self,theR, theH):
1123 # Example: see GEOM_TestAll.py
1124 theR,theH,Parameters = ParseParameters(theR, theH)
1125 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
1126 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
1127 anObj.SetParameters(Parameters)
1130 ## Create a sphere with given center and radius.
1131 # @param thePnt Sphere center.
1132 # @param theR Sphere radius.
1133 # @return New GEOM_Object, containing the created sphere.
1135 # @ref tui_creation_sphere "Example"
1136 def MakeSpherePntR(self, thePnt, theR):
1137 # Example: see GEOM_TestAll.py
1138 theR,Parameters = ParseParameters(theR)
1139 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
1140 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
1141 anObj.SetParameters(Parameters)
1144 ## Create a sphere with given center and radius.
1145 # @param x,y,z Coordinates of sphere center.
1146 # @param theR Sphere radius.
1147 # @return New GEOM_Object, containing the created sphere.
1149 # @ref tui_creation_sphere "Example"
1150 def MakeSphere(self, x, y, z, theR):
1151 # Example: see GEOM_TestAll.py
1152 point = self.MakeVertex(x, y, z)
1153 anObj = self.MakeSpherePntR(point, theR)
1156 ## Create a sphere with given radius at the origin of coordinate system.
1157 # @param theR Sphere radius.
1158 # @return New GEOM_Object, containing the created sphere.
1160 # @ref tui_creation_sphere "Example"
1161 def MakeSphereR(self, theR):
1162 # Example: see GEOM_TestAll.py
1163 theR,Parameters = ParseParameters(theR)
1164 anObj = self.PrimOp.MakeSphereR(theR)
1165 RaiseIfFailed("MakeSphereR", self.PrimOp)
1166 anObj.SetParameters(Parameters)
1169 ## Create a cone with given base point, axis, height and radiuses.
1170 # @param thePnt Central point of the first cone base.
1171 # @param theAxis Cone axis.
1172 # @param theR1 Radius of the first cone base.
1173 # @param theR2 Radius of the second cone base.
1174 # \note If both radiuses are non-zero, the cone will be truncated.
1175 # \note If the radiuses are equal, a cylinder will be created instead.
1176 # @param theH Cone height.
1177 # @return New GEOM_Object, containing the created cone.
1179 # @ref tui_creation_cone "Example"
1180 def MakeCone(self,thePnt, theAxis, theR1, theR2, theH):
1181 # Example: see GEOM_TestAll.py
1182 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
1183 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
1184 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
1185 anObj.SetParameters(Parameters)
1188 ## Create a cone with given height and radiuses at
1189 # the origin of coordinate system. Axis of the cone will
1190 # be collinear to the OZ axis of the coordinate system.
1191 # @param theR1 Radius of the first cone base.
1192 # @param theR2 Radius of the second cone base.
1193 # \note If both radiuses are non-zero, the cone will be truncated.
1194 # \note If the radiuses are equal, a cylinder will be created instead.
1195 # @param theH Cone height.
1196 # @return New GEOM_Object, containing the created cone.
1198 # @ref tui_creation_cone "Example"
1199 def MakeConeR1R2H(self,theR1, theR2, theH):
1200 # Example: see GEOM_TestAll.py
1201 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
1202 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
1203 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
1204 anObj.SetParameters(Parameters)
1207 ## Create a torus with given center, normal vector and radiuses.
1208 # @param thePnt Torus central point.
1209 # @param theVec Torus axis of symmetry.
1210 # @param theRMajor Torus major radius.
1211 # @param theRMinor Torus minor radius.
1212 # @return New GEOM_Object, containing the created torus.
1214 # @ref tui_creation_torus "Example"
1215 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor):
1216 # Example: see GEOM_TestAll.py
1217 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
1218 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
1219 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
1220 anObj.SetParameters(Parameters)
1223 ## Create a torus with given radiuses at the origin of coordinate system.
1224 # @param theRMajor Torus major radius.
1225 # @param theRMinor Torus minor radius.
1226 # @return New GEOM_Object, containing the created torus.
1228 # @ref tui_creation_torus "Example"
1229 def MakeTorusRR(self, theRMajor, theRMinor):
1230 # Example: see GEOM_TestAll.py
1231 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
1232 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
1233 RaiseIfFailed("MakeTorusRR", self.PrimOp)
1234 anObj.SetParameters(Parameters)
1237 # end of l3_3d_primitives
1240 ## @addtogroup l3_complex
1243 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
1244 # @param theBase Base shape to be extruded.
1245 # @param thePoint1 First end of extrusion vector.
1246 # @param thePoint2 Second end of extrusion vector.
1247 # @return New GEOM_Object, containing the created prism.
1249 # @ref tui_creation_prism "Example"
1250 def MakePrism(self, theBase, thePoint1, thePoint2):
1251 # Example: see GEOM_TestAll.py
1252 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
1253 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
1256 ## Create a shape by extrusion of the base shape along the vector,
1257 # i.e. all the space, transfixed by the base shape during its translation
1258 # along the vector on the given distance.
1259 # @param theBase Base shape to be extruded.
1260 # @param theVec Direction of extrusion.
1261 # @param theH Prism dimension along theVec.
1262 # @return New GEOM_Object, containing the created prism.
1264 # @ref tui_creation_prism "Example"
1265 def MakePrismVecH(self, theBase, theVec, theH):
1266 # Example: see GEOM_TestAll.py
1267 theH,Parameters = ParseParameters(theH)
1268 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
1269 RaiseIfFailed("MakePrismVecH", self.PrimOp)
1270 anObj.SetParameters(Parameters)
1273 ## Create a shape by extrusion of the base shape along the vector,
1274 # i.e. all the space, transfixed by the base shape during its translation
1275 # along the vector on the given distance in 2 Ways (forward/backward) .
1276 # @param theBase Base shape to be extruded.
1277 # @param theVec Direction of extrusion.
1278 # @param theH Prism dimension along theVec in forward direction.
1279 # @return New GEOM_Object, containing the created prism.
1281 # @ref tui_creation_prism "Example"
1282 def MakePrismVecH2Ways(self, theBase, theVec, theH):
1283 # Example: see GEOM_TestAll.py
1284 theH,Parameters = ParseParameters(theH)
1285 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
1286 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
1287 anObj.SetParameters(Parameters)
1290 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
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 MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ):
1297 # Example: see GEOM_TestAll.py
1298 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1299 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
1300 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
1301 anObj.SetParameters(Parameters)
1304 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
1305 # i.e. all the space, transfixed by the base shape during its translation
1306 # along the vector on the given distance in 2 Ways (forward/backward) .
1307 # @param theBase Base shape to be extruded.
1308 # @param theDX, theDY, theDZ Directions of extrusion.
1309 # @return New GEOM_Object, containing the created prism.
1311 # @ref tui_creation_prism "Example"
1312 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ):
1313 # Example: see GEOM_TestAll.py
1314 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1315 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
1316 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
1317 anObj.SetParameters(Parameters)
1320 ## Create a shape by revolution of the base shape around the axis
1321 # on the given angle, i.e. all the space, transfixed by the base
1322 # shape during its rotation around the axis on the given angle.
1323 # @param theBase Base shape to be rotated.
1324 # @param theAxis Rotation axis.
1325 # @param theAngle Rotation angle in radians.
1326 # @return New GEOM_Object, containing the created revolution.
1328 # @ref tui_creation_revolution "Example"
1329 def MakeRevolution(self, theBase, theAxis, theAngle):
1330 # Example: see GEOM_TestAll.py
1331 theAngle,Parameters = ParseParameters(theAngle)
1332 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
1333 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
1334 anObj.SetParameters(Parameters)
1337 ## The Same Revolution but in both ways forward&backward.
1338 def MakeRevolution2Ways(self, theBase, theAxis, theAngle):
1339 theAngle,Parameters = ParseParameters(theAngle)
1340 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
1341 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
1342 anObj.SetParameters(Parameters)
1345 ## Create a filling from the given compound of contours.
1346 # @param theShape the compound of contours
1347 # @param theMinDeg a minimal degree of BSpline surface to create
1348 # @param theMaxDeg a maximal degree of BSpline surface to create
1349 # @param theTol2D a 2d tolerance to be reached
1350 # @param theTol3D a 3d tolerance to be reached
1351 # @param theNbIter a number of iteration of approximation algorithm
1352 # @param theMethod Kind of method to perform filling operation:
1353 # 0 - Default - standard behaviour
1354 # 1 - Use edges orientation - orientation of edges are
1355 # used: if edge is reversed curve from this edge
1356 # is reversed before using in filling algorithm.
1357 # 2 - Auto-correct orientation - change orientation
1358 # of curves using minimization of sum of distances
1359 # between ends points of edges.
1360 # @param isApprox if True, BSpline curves are generated in the process
1361 # of surface construction. By default it is False, that means
1362 # the surface is created using Besier curves. The usage of
1363 # Approximation makes the algorithm work slower, but allows
1364 # building the surface for rather complex cases
1365 # @return New GEOM_Object, containing the created filling surface.
1367 # @ref tui_creation_filling "Example"
1368 def MakeFilling(self, theShape, theMinDeg, theMaxDeg, theTol2D,
1369 theTol3D, theNbIter, theMethod=GEOM.FOM_Default, isApprox=0):
1370 # Example: see GEOM_TestAll.py
1371 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
1372 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
1373 theTol2D, theTol3D, theNbIter,
1374 theMethod, isApprox)
1375 RaiseIfFailed("MakeFilling", self.PrimOp)
1376 anObj.SetParameters(Parameters)
1379 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
1380 # @param theSeqSections - set of specified sections.
1381 # @param theModeSolid - mode defining building solid or shell
1382 # @param thePreci - precision 3D used for smoothing by default 1.e-6
1383 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
1384 # @return New GEOM_Object, containing the created shell or solid.
1386 # @ref swig_todo "Example"
1387 def MakeThruSections(self,theSeqSections,theModeSolid,thePreci,theRuled):
1388 # Example: see GEOM_TestAll.py
1389 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
1390 RaiseIfFailed("MakeThruSections", self.PrimOp)
1393 ## Create a shape by extrusion of the base shape along
1394 # the path shape. The path shape can be a wire or an edge.
1395 # @param theBase Base shape to be extruded.
1396 # @param thePath Path shape to extrude the base shape along it.
1397 # @return New GEOM_Object, containing the created pipe.
1399 # @ref tui_creation_pipe "Example"
1400 def MakePipe(self,theBase, thePath):
1401 # Example: see GEOM_TestAll.py
1402 anObj = self.PrimOp.MakePipe(theBase, thePath)
1403 RaiseIfFailed("MakePipe", self.PrimOp)
1406 ## Create a shape by extrusion of the profile shape along
1407 # the path shape. The path shape can be a wire or an edge.
1408 # the several profiles can be specified in the several locations of path.
1409 # @param theSeqBases - list of Bases shape to be extruded.
1410 # @param theLocations - list of locations on the path corresponding
1411 # specified list of the Bases shapes. Number of locations
1412 # should be equal to number of bases or list of locations can be empty.
1413 # @param thePath - Path shape to extrude the base shape along it.
1414 # @param theWithContact - the mode defining that the section is translated to be in
1415 # contact with the spine.
1416 # @param theWithCorrection - defining that the section is rotated to be
1417 # orthogonal to the spine tangent in the correspondent point
1418 # @return New GEOM_Object, containing the created pipe.
1420 # @ref tui_creation_pipe_with_diff_sec "Example"
1421 def MakePipeWithDifferentSections(self, theSeqBases,
1422 theLocations, thePath,
1423 theWithContact, theWithCorrection):
1424 anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
1425 theLocations, thePath,
1426 theWithContact, theWithCorrection)
1427 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
1430 ## Create a shape by extrusion of the profile shape along
1431 # the path shape. The path shape can be a wire or a edge.
1432 # the several profiles can be specified in the several locations of path.
1433 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
1434 # shell or face. If number of faces in neighbour sections
1435 # aren't coincided result solid between such sections will
1436 # be created using external boundaries of this shells.
1437 # @param theSeqSubBases - list of corresponding subshapes of section shapes.
1438 # This list is used for searching correspondences between
1439 # faces in the sections. Size of this list must be equal
1440 # to size of list of base shapes.
1441 # @param theLocations - list of locations on the path corresponding
1442 # specified list of the Bases shapes. Number of locations
1443 # should be equal to number of bases. First and last
1444 # locations must be coincided with first and last vertexes
1445 # of path correspondingly.
1446 # @param thePath - Path shape to extrude the base shape along it.
1447 # @param theWithContact - the mode defining that the section is translated to be in
1448 # contact with the spine.
1449 # @param theWithCorrection - defining that the section is rotated to be
1450 # orthogonal to the spine tangent in the correspondent point
1451 # @return New GEOM_Object, containing the created solids.
1453 # @ref tui_creation_pipe_with_shell_sec "Example"
1454 def MakePipeWithShellSections(self,theSeqBases, theSeqSubBases,
1455 theLocations, thePath,
1456 theWithContact, theWithCorrection):
1457 anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
1458 theLocations, thePath,
1459 theWithContact, theWithCorrection)
1460 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
1463 ## Create a shape by extrusion of the profile shape along
1464 # the path shape. This function is used only for debug pipe
1465 # functionality - it is a version of previous function
1466 # (MakePipeWithShellSections(...)) which give a possibility to
1467 # recieve information about creating pipe between each pair of
1468 # sections step by step.
1469 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
1470 theLocations, thePath,
1471 theWithContact, theWithCorrection):
1473 nbsect = len(theSeqBases)
1474 nbsubsect = len(theSeqSubBases)
1475 #print "nbsect = ",nbsect
1476 for i in range(1,nbsect):
1478 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
1479 tmpLocations = [ theLocations[i-1], theLocations[i] ]
1481 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
1482 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
1483 tmpLocations, thePath,
1484 theWithContact, theWithCorrection)
1485 if self.PrimOp.IsDone() == 0:
1486 print "Problems with pipe creation between ",i," and ",i+1," sections"
1487 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
1490 print "Pipe between ",i," and ",i+1," sections is OK"
1495 resc = self.MakeCompound(res)
1496 #resc = self.MakeSewing(res, 0.001)
1497 #print "resc: ",resc
1500 ## Create solids between given sections
1501 # @param theSeqBases - list of sections (shell or face).
1502 # @param theLocations - list of corresponding vertexes
1503 # @return New GEOM_Object, containing the created solids.
1505 # @ref tui_creation_pipe_without_path "Example"
1506 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations):
1507 anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
1508 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
1511 ## Create a shape by extrusion of the base shape along
1512 # the path shape with constant bi-normal direction along the given vector.
1513 # The path shape can be a wire or an edge.
1514 # @param theBase Base shape to be extruded.
1515 # @param thePath Path shape to extrude the base shape along it.
1516 # @param theVec Vector defines a constant binormal direction to keep the
1517 # same angle beetween the direction and the sections
1518 # along the sweep surface.
1519 # @return New GEOM_Object, containing the created pipe.
1521 # @ref tui_creation_pipe "Example"
1522 def MakePipeBiNormalAlongVector(self,theBase, thePath, theVec):
1523 # Example: see GEOM_TestAll.py
1524 anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
1525 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
1531 ## @addtogroup l3_advanced
1534 ## Create a linear edge with specified ends.
1535 # @param thePnt1 Point for the first end of edge.
1536 # @param thePnt2 Point for the second end of edge.
1537 # @return New GEOM_Object, containing the created edge.
1539 # @ref tui_creation_edge "Example"
1540 def MakeEdge(self,thePnt1, thePnt2):
1541 # Example: see GEOM_TestAll.py
1542 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
1543 RaiseIfFailed("MakeEdge", self.ShapesOp)
1546 ## Create a wire from the set of edges and wires.
1547 # @param theEdgesAndWires List of edges and/or wires.
1548 # @param theTolerance Maximum distance between vertices, that will be merged.
1549 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
1550 # @return New GEOM_Object, containing the created wire.
1552 # @ref tui_creation_wire "Example"
1553 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07):
1554 # Example: see GEOM_TestAll.py
1555 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
1556 RaiseIfFailed("MakeWire", self.ShapesOp)
1559 ## Create a face on the given wire.
1560 # @param theWire closed Wire or Edge to build the face on.
1561 # @param isPlanarWanted If TRUE, only planar face will be built.
1562 # If impossible, NULL object will be returned.
1563 # @return New GEOM_Object, containing the created face.
1565 # @ref tui_creation_face "Example"
1566 def MakeFace(self,theWire, isPlanarWanted):
1567 # Example: see GEOM_TestAll.py
1568 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
1569 RaiseIfFailed("MakeFace", self.ShapesOp)
1572 ## Create a face on the given wires set.
1573 # @param theWires List of closed wires or edges to build the face on.
1574 # @param isPlanarWanted If TRUE, only planar face will be built.
1575 # If impossible, NULL object will be returned.
1576 # @return New GEOM_Object, containing the created face.
1578 # @ref tui_creation_face "Example"
1579 def MakeFaceWires(self,theWires, isPlanarWanted):
1580 # Example: see GEOM_TestAll.py
1581 anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
1582 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
1585 ## Shortcut to MakeFaceWires()
1587 # @ref tui_creation_face "Example 1"
1588 # \n @ref swig_MakeFaces "Example 2"
1589 def MakeFaces(self,theWires, isPlanarWanted):
1590 # Example: see GEOM_TestOthers.py
1591 anObj = self.MakeFaceWires(theWires, isPlanarWanted)
1594 ## Create a shell from the set of faces and shells.
1595 # @param theFacesAndShells List of faces and/or shells.
1596 # @return New GEOM_Object, containing the created shell.
1598 # @ref tui_creation_shell "Example"
1599 def MakeShell(self,theFacesAndShells):
1600 # Example: see GEOM_TestAll.py
1601 anObj = self.ShapesOp.MakeShell(theFacesAndShells)
1602 RaiseIfFailed("MakeShell", self.ShapesOp)
1605 ## Create a solid, bounded by the given shells.
1606 # @param theShells Sequence of bounding shells.
1607 # @return New GEOM_Object, containing the created solid.
1609 # @ref tui_creation_solid "Example"
1610 def MakeSolid(self,theShells):
1611 # Example: see GEOM_TestAll.py
1612 anObj = self.ShapesOp.MakeSolidShells(theShells)
1613 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
1616 ## Create a compound of the given shapes.
1617 # @param theShapes List of shapes to put in compound.
1618 # @return New GEOM_Object, containing the created compound.
1620 # @ref tui_creation_compound "Example"
1621 def MakeCompound(self,theShapes):
1622 # Example: see GEOM_TestAll.py
1623 anObj = self.ShapesOp.MakeCompound(theShapes)
1624 RaiseIfFailed("MakeCompound", self.ShapesOp)
1627 # end of l3_advanced
1630 ## @addtogroup l2_measure
1633 ## Gives quantity of faces in the given shape.
1634 # @param theShape Shape to count faces of.
1635 # @return Quantity of faces.
1637 # @ref swig_NumberOf "Example"
1638 def NumberOfFaces(self, theShape):
1639 # Example: see GEOM_TestOthers.py
1640 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
1641 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
1644 ## Gives quantity of edges in the given shape.
1645 # @param theShape Shape to count edges of.
1646 # @return Quantity of edges.
1648 # @ref swig_NumberOf "Example"
1649 def NumberOfEdges(self, theShape):
1650 # Example: see GEOM_TestOthers.py
1651 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
1652 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
1655 ## Gives quantity of subshapes of type theShapeType in the given shape.
1656 # @param theShape Shape to count subshapes of.
1657 # @param theShapeType Type of subshapes to count.
1658 # @return Quantity of subshapes of given type.
1660 # @ref swig_NumberOf "Example"
1661 def NumberOfSubShapes(self, theShape, theShapeType):
1662 # Example: see GEOM_TestOthers.py
1663 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
1664 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
1667 ## Gives quantity of solids in the given shape.
1668 # @param theShape Shape to count solids in.
1669 # @return Quantity of solids.
1671 # @ref swig_NumberOf "Example"
1672 def NumberOfSolids(self, theShape):
1673 # Example: see GEOM_TestOthers.py
1674 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, ShapeType["SOLID"])
1675 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
1681 ## @addtogroup l3_healing
1684 ## Reverses an orientation the given shape.
1685 # @param theShape Shape to be reversed.
1686 # @return The reversed copy of theShape.
1688 # @ref swig_ChangeOrientation "Example"
1689 def ChangeOrientation(self,theShape):
1690 # Example: see GEOM_TestAll.py
1691 anObj = self.ShapesOp.ChangeOrientation(theShape)
1692 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
1695 ## Shortcut to ChangeOrientation()
1697 # @ref swig_OrientationChange "Example"
1698 def OrientationChange(self,theShape):
1699 # Example: see GEOM_TestOthers.py
1700 anObj = self.ChangeOrientation(theShape)
1706 ## @addtogroup l4_obtain
1709 ## Retrieve all free faces from the given shape.
1710 # Free face is a face, which is not shared between two shells of the shape.
1711 # @param theShape Shape to find free faces in.
1712 # @return List of IDs of all free faces, contained in theShape.
1714 # @ref tui_measurement_tools_page "Example"
1715 def GetFreeFacesIDs(self,theShape):
1716 # Example: see GEOM_TestOthers.py
1717 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
1718 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
1721 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
1722 # @param theShape1 Shape to find sub-shapes in.
1723 # @param theShape2 Shape to find shared sub-shapes with.
1724 # @param theShapeType Type of sub-shapes to be retrieved.
1725 # @return List of sub-shapes of theShape1, shared with theShape2.
1727 # @ref swig_GetSharedShapes "Example"
1728 def GetSharedShapes(self,theShape1, theShape2, theShapeType):
1729 # Example: see GEOM_TestOthers.py
1730 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
1731 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
1734 ## Get all sub-shapes, shared by all shapes in the list <VAR>theShapes</VAR>.
1735 # @param theShapes Shapes to find common sub-shapes of.
1736 # @param theShapeType Type of sub-shapes to be retrieved.
1737 # @return List of objects, that are sub-shapes of all given shapes.
1739 # @ref swig_GetSharedShapes "Example"
1740 def GetSharedShapesMulti(self, theShapes, theShapeType):
1741 # Example: see GEOM_TestOthers.py
1742 aList = self.ShapesOp.GetSharedShapesMulti(theShapes, theShapeType)
1743 RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
1746 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
1747 # situated relatively the specified plane by the certain way,
1748 # defined through <VAR>theState</VAR> parameter.
1749 # @param theShape Shape to find sub-shapes of.
1750 # @param theShapeType Type of sub-shapes to be retrieved.
1751 # @param theAx1 Vector (or line, or linear edge), specifying normal
1752 # direction and location of the plane to find shapes on.
1753 # @param theState The state of the subshapes to find. It can be one of
1754 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1755 # @return List of all found sub-shapes.
1757 # @ref swig_GetShapesOnPlane "Example"
1758 def GetShapesOnPlane(self,theShape, theShapeType, theAx1, theState):
1759 # Example: see GEOM_TestOthers.py
1760 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
1761 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
1764 ## Works like the above method, but returns list of sub-shapes indices
1766 # @ref swig_GetShapesOnPlaneIDs "Example"
1767 def GetShapesOnPlaneIDs(self,theShape, theShapeType, theAx1, theState):
1768 # Example: see GEOM_TestOthers.py
1769 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
1770 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
1773 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
1774 # situated relatively the specified plane by the certain way,
1775 # defined through <VAR>theState</VAR> parameter.
1776 # @param theShape Shape to find sub-shapes of.
1777 # @param theShapeType Type of sub-shapes to be retrieved.
1778 # @param theAx1 Vector (or line, or linear edge), specifying normal
1779 # direction of the plane to find shapes on.
1780 # @param thePnt Point specifying location of the plane to find shapes on.
1781 # @param theState The state of the subshapes to find. It can be one of
1782 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1783 # @return List of all found sub-shapes.
1785 # @ref swig_GetShapesOnPlaneWithLocation "Example"
1786 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState):
1787 # Example: see GEOM_TestOthers.py
1788 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
1789 theAx1, thePnt, theState)
1790 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
1793 ## Works like the above method, but returns list of sub-shapes indices
1795 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
1796 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
1797 # Example: see GEOM_TestOthers.py
1798 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
1799 theAx1, thePnt, theState)
1800 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
1803 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1804 # the specified cylinder by the certain way, defined through \a theState parameter.
1805 # @param theShape Shape to find sub-shapes of.
1806 # @param theShapeType Type of sub-shapes to be retrieved.
1807 # @param theAxis Vector (or line, or linear edge), specifying
1808 # axis of the cylinder to find shapes on.
1809 # @param theRadius Radius of the cylinder to find shapes on.
1810 # @param theState The state of the subshapes to find. It can be one of
1811 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1812 # @return List of all found sub-shapes.
1814 # @ref swig_GetShapesOnCylinder "Example"
1815 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState):
1816 # Example: see GEOM_TestOthers.py
1817 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
1818 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
1821 ## Works like the above method, but returns list of sub-shapes indices
1823 # @ref swig_GetShapesOnCylinderIDs "Example"
1824 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
1825 # Example: see GEOM_TestOthers.py
1826 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
1827 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
1830 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1831 # the specified cylinder by the certain way, defined through \a theState parameter.
1832 # @param theShape Shape to find sub-shapes of.
1833 # @param theShapeType Type of sub-shapes to be retrieved.
1834 # @param theAxis Vector (or line, or linear edge), specifying
1835 # axis of the cylinder to find shapes on.
1836 # @param thePnt Point specifying location of the bottom of the cylinder.
1837 # @param theRadius Radius of the cylinder to find shapes on.
1838 # @param theState The state of the subshapes to find. It can be one of
1839 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1840 # @return List of all found sub-shapes.
1842 # @ref swig_GetShapesOnCylinderWithLocation "Example"
1843 def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
1844 # Example: see GEOM_TestOthers.py
1845 aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
1846 RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
1849 ## Works like the above method, but returns list of sub-shapes indices
1851 # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
1852 def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
1853 # Example: see GEOM_TestOthers.py
1854 aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
1855 RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
1858 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1859 # the specified sphere by the certain way, defined through \a theState parameter.
1860 # @param theShape Shape to find sub-shapes of.
1861 # @param theShapeType Type of sub-shapes to be retrieved.
1862 # @param theCenter Point, specifying center of the sphere to find shapes on.
1863 # @param theRadius Radius of the sphere to find shapes on.
1864 # @param theState The state of the subshapes to find. It can be one of
1865 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1866 # @return List of all found sub-shapes.
1868 # @ref swig_GetShapesOnSphere "Example"
1869 def GetShapesOnSphere(self,theShape, theShapeType, theCenter, theRadius, theState):
1870 # Example: see GEOM_TestOthers.py
1871 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
1872 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
1875 ## Works like the above method, but returns list of sub-shapes indices
1877 # @ref swig_GetShapesOnSphereIDs "Example"
1878 def GetShapesOnSphereIDs(self,theShape, theShapeType, theCenter, theRadius, theState):
1879 # Example: see GEOM_TestOthers.py
1880 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
1881 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
1884 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1885 # the specified quadrangle by the certain way, defined through \a theState parameter.
1886 # @param theShape Shape to find sub-shapes of.
1887 # @param theShapeType Type of sub-shapes to be retrieved.
1888 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
1889 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
1890 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
1891 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
1892 # @param theState The state of the subshapes to find. It can be one of
1893 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1894 # @return List of all found sub-shapes.
1896 # @ref swig_GetShapesOnQuadrangle "Example"
1897 def GetShapesOnQuadrangle(self, theShape, theShapeType,
1898 theTopLeftPoint, theTopRigthPoint,
1899 theBottomLeftPoint, theBottomRigthPoint, theState):
1900 # Example: see GEOM_TestOthers.py
1901 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
1902 theTopLeftPoint, theTopRigthPoint,
1903 theBottomLeftPoint, theBottomRigthPoint, theState)
1904 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
1907 ## Works like the above method, but returns list of sub-shapes indices
1909 # @ref swig_GetShapesOnQuadrangleIDs "Example"
1910 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
1911 theTopLeftPoint, theTopRigthPoint,
1912 theBottomLeftPoint, theBottomRigthPoint, theState):
1913 # Example: see GEOM_TestOthers.py
1914 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
1915 theTopLeftPoint, theTopRigthPoint,
1916 theBottomLeftPoint, theBottomRigthPoint, theState)
1917 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
1920 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1921 # the specified \a theBox by the certain way, defined through \a theState parameter.
1922 # @param theBox Shape for relative comparing.
1923 # @param theShape Shape to find sub-shapes of.
1924 # @param theShapeType Type of sub-shapes to be retrieved.
1925 # @param theState The state of the subshapes to find. It can be one of
1926 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1927 # @return List of all found sub-shapes.
1929 # @ref swig_GetShapesOnBox "Example"
1930 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState):
1931 # Example: see GEOM_TestOthers.py
1932 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
1933 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
1936 ## Works like the above method, but returns list of sub-shapes indices
1938 # @ref swig_GetShapesOnBoxIDs "Example"
1939 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
1940 # Example: see GEOM_TestOthers.py
1941 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
1942 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
1945 ## Find in \a theShape all sub-shapes of type \a theShapeType,
1946 # situated relatively the specified \a theCheckShape by the
1947 # certain way, defined through \a theState parameter.
1948 # @param theCheckShape Shape for relative comparing. It must be a solid.
1949 # @param theShape Shape to find sub-shapes of.
1950 # @param theShapeType Type of sub-shapes to be retrieved.
1951 # @param theState The state of the subshapes to find. It can be one of
1952 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1953 # @return List of all found sub-shapes.
1955 # @ref swig_GetShapesOnShape "Example"
1956 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState):
1957 # Example: see GEOM_TestOthers.py
1958 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
1959 theShapeType, theState)
1960 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
1963 ## Works like the above method, but returns result as compound
1965 # @ref swig_GetShapesOnShapeAsCompound "Example"
1966 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState):
1967 # Example: see GEOM_TestOthers.py
1968 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
1969 theShapeType, theState)
1970 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
1973 ## Works like the above method, but returns list of sub-shapes indices
1975 # @ref swig_GetShapesOnShapeIDs "Example"
1976 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
1977 # Example: see GEOM_TestOthers.py
1978 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
1979 theShapeType, theState)
1980 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
1983 ## Get sub-shape(s) of theShapeWhere, which are
1984 # coincident with \a theShapeWhat or could be a part of it.
1985 # @param theShapeWhere Shape to find sub-shapes of.
1986 # @param theShapeWhat Shape, specifying what to find.
1987 # @return Group of all found sub-shapes or a single found sub-shape.
1989 # @ref swig_GetInPlace "Example"
1990 def GetInPlace(self,theShapeWhere, theShapeWhat):
1991 # Example: see GEOM_TestOthers.py
1992 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
1993 RaiseIfFailed("GetInPlace", self.ShapesOp)
1996 ## Get sub-shape(s) of \a theShapeWhere, which are
1997 # coincident with \a theShapeWhat or could be a part of it.
1999 # Implementation of this method is based on a saved history of an operation,
2000 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
2001 # arguments (an argument shape or a sub-shape of an argument shape).
2002 # The operation could be the Partition or one of boolean operations,
2003 # performed on simple shapes (not on compounds).
2005 # @param theShapeWhere Shape to find sub-shapes of.
2006 # @param theShapeWhat Shape, specifying what to find (must be in the
2007 # building history of the ShapeWhere).
2008 # @return Group of all found sub-shapes or a single found sub-shape.
2010 # @ref swig_GetInPlace "Example"
2011 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat):
2012 # Example: see GEOM_TestOthers.py
2013 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
2014 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
2017 ## Get sub-shape of theShapeWhere, which is
2018 # equal to \a theShapeWhat.
2019 # @param theShapeWhere Shape to find sub-shape of.
2020 # @param theShapeWhat Shape, specifying what to find.
2021 # @return New GEOM_Object for found sub-shape.
2023 # @ref swig_GetSame "Example"
2024 def GetSame(self,theShapeWhere, theShapeWhat):
2025 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
2026 RaiseIfFailed("GetSame", self.ShapesOp)
2032 ## @addtogroup l4_access
2035 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
2036 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
2038 # @ref swig_all_decompose "Example"
2039 def GetSubShape(self, aShape, ListOfID):
2040 # Example: see GEOM_TestAll.py
2041 anObj = self.AddSubShape(aShape,ListOfID)
2044 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
2046 # @ref swig_all_decompose "Example"
2047 def GetSubShapeID(self, aShape, aSubShape):
2048 # Example: see GEOM_TestAll.py
2049 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
2050 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
2056 ## @addtogroup l4_decompose
2059 ## Explode a shape on subshapes of a given type.
2060 # @param aShape Shape to be exploded.
2061 # @param aType Type of sub-shapes to be retrieved.
2062 # @return List of sub-shapes of type theShapeType, contained in theShape.
2064 # @ref swig_all_decompose "Example"
2065 def SubShapeAll(self, aShape, aType):
2066 # Example: see GEOM_TestAll.py
2067 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, aType, False)
2068 RaiseIfFailed("SubShapeAll", self.ShapesOp)
2071 ## Explode a shape on subshapes of a given type.
2072 # @param aShape Shape to be exploded.
2073 # @param aType Type of sub-shapes to be retrieved.
2074 # @return List of IDs of sub-shapes.
2076 # @ref swig_all_decompose "Example"
2077 def SubShapeAllIDs(self, aShape, aType):
2078 ListObj = self.ShapesOp.GetAllSubShapesIDs(aShape, aType, False)
2079 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
2082 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
2083 # selected by they indices in list of all sub-shapes of type <VAR>aType</VAR>.
2084 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
2086 # @ref swig_all_decompose "Example"
2087 def SubShape(self, aShape, aType, ListOfInd):
2088 # Example: see GEOM_TestAll.py
2090 AllShapeIDsList = self.SubShapeAllIDs(aShape, aType)
2091 for ind in ListOfInd:
2092 ListOfIDs.append(AllShapeIDsList[ind - 1])
2093 anObj = self.GetSubShape(aShape, ListOfIDs)
2096 ## Explode a shape on subshapes of a given type.
2097 # Sub-shapes will be sorted by coordinates of their gravity centers.
2098 # @param aShape Shape to be exploded.
2099 # @param aType Type of sub-shapes to be retrieved.
2100 # @return List of sub-shapes of type theShapeType, contained in theShape.
2102 # @ref swig_SubShapeAllSorted "Example"
2103 def SubShapeAllSortedCentres(self, aShape, aType):
2104 # Example: see GEOM_TestAll.py
2105 ListObj = self.ShapesOp.MakeAllSubShapes(aShape, aType, True)
2106 RaiseIfFailed("SubShapeAllSortedCentres", self.ShapesOp)
2109 ## Explode a shape on subshapes of a given type.
2110 # Sub-shapes will be sorted by coordinates of their gravity centers.
2111 # @param aShape Shape to be exploded.
2112 # @param aType Type of sub-shapes to be retrieved.
2113 # @return List of IDs of sub-shapes.
2115 # @ref swig_all_decompose "Example"
2116 def SubShapeAllSortedCentresIDs(self, aShape, aType):
2117 ListIDs = self.ShapesOp.GetAllSubShapesIDs(aShape, aType, True)
2118 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
2121 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
2122 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
2123 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
2125 # @ref swig_all_decompose "Example"
2126 def SubShapeSortedCentres(self, aShape, aType, ListOfInd):
2127 # Example: see GEOM_TestAll.py
2129 AllShapeIDsList = self.SubShapeAllSortedCentresIDs(aShape, aType)
2130 for ind in ListOfInd:
2131 ListOfIDs.append(AllShapeIDsList[ind - 1])
2132 anObj = self.GetSubShape(aShape, ListOfIDs)
2135 # end of l4_decompose
2138 ## @addtogroup l4_decompose_d
2141 ## Deprecated method
2142 # It works like SubShapeAllSortedCentres, but wrongly
2143 # defines centres of faces, shells and solids.
2144 def SubShapeAllSorted(self, aShape, aType):
2145 ListObj = self.ShapesOp.MakeExplode(aShape, aType, True)
2146 RaiseIfFailed("MakeExplode", self.ShapesOp)
2149 ## Deprecated method
2150 # It works like SubShapeAllSortedCentresIDs, but wrongly
2151 # defines centres of faces, shells and solids.
2152 def SubShapeAllSortedIDs(self, aShape, aType):
2153 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape, aType, True)
2154 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
2157 ## Deprecated method
2158 # It works like SubShapeSortedCentres, but has a bug
2159 # (wrongly defines centres of faces, shells and solids).
2160 def SubShapeSorted(self, aShape, aType, ListOfInd):
2162 AllShapeIDsList = self.SubShapeAllSortedIDs(aShape, aType)
2163 for ind in ListOfInd:
2164 ListOfIDs.append(AllShapeIDsList[ind - 1])
2165 anObj = self.GetSubShape(aShape, ListOfIDs)
2168 # end of l4_decompose_d
2171 ## @addtogroup l3_healing
2174 ## Apply a sequence of Shape Healing operators to the given object.
2175 # @param theShape Shape to be processed.
2176 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
2177 # @param theParameters List of names of parameters
2178 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
2179 # @param theValues List of values of parameters, in the same order
2180 # as parameters are listed in <VAR>theParameters</VAR> list.
2181 # @return New GEOM_Object, containing processed shape.
2183 # @ref tui_shape_processing "Example"
2184 def ProcessShape(self, theShape, theOperators, theParameters, theValues):
2185 # Example: see GEOM_TestHealing.py
2186 theValues,Parameters = ParseList(theValues)
2187 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
2188 # To avoid script failure in case of good argument shape
2189 if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
2191 RaiseIfFailed("ProcessShape", self.HealOp)
2192 for string in (theOperators + theParameters):
2193 Parameters = ":" + Parameters
2195 anObj.SetParameters(Parameters)
2198 ## Remove faces from the given object (shape).
2199 # @param theObject Shape to be processed.
2200 # @param theFaces Indices of faces to be removed, if EMPTY then the method
2201 # removes ALL faces of the given object.
2202 # @return New GEOM_Object, containing processed shape.
2204 # @ref tui_suppress_faces "Example"
2205 def SuppressFaces(self,theObject, theFaces):
2206 # Example: see GEOM_TestHealing.py
2207 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
2208 RaiseIfFailed("SuppressFaces", self.HealOp)
2211 ## Sewing of some shapes into single shape.
2213 # @ref tui_sewing "Example"
2214 def MakeSewing(self, ListShape, theTolerance):
2215 # Example: see GEOM_TestHealing.py
2216 comp = self.MakeCompound(ListShape)
2217 anObj = self.Sew(comp, theTolerance)
2220 ## Sewing of the given object.
2221 # @param theObject Shape to be processed.
2222 # @param theTolerance Required tolerance value.
2223 # @return New GEOM_Object, containing processed shape.
2224 def Sew(self, theObject, theTolerance):
2225 # Example: see MakeSewing() above
2226 theTolerance,Parameters = ParseParameters(theTolerance)
2227 anObj = self.HealOp.Sew(theObject, theTolerance)
2228 RaiseIfFailed("Sew", self.HealOp)
2229 anObj.SetParameters(Parameters)
2232 ## Remove internal wires and edges from the given object (face).
2233 # @param theObject Shape to be processed.
2234 # @param theWires Indices of wires to be removed, if EMPTY then the method
2235 # removes ALL internal wires of the given object.
2236 # @return New GEOM_Object, containing processed shape.
2238 # @ref tui_suppress_internal_wires "Example"
2239 def SuppressInternalWires(self,theObject, theWires):
2240 # Example: see GEOM_TestHealing.py
2241 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
2242 RaiseIfFailed("RemoveIntWires", self.HealOp)
2245 ## Remove internal closed contours (holes) from the given object.
2246 # @param theObject Shape to be processed.
2247 # @param theWires Indices of wires to be removed, if EMPTY then the method
2248 # removes ALL internal holes of the given object
2249 # @return New GEOM_Object, containing processed shape.
2251 # @ref tui_suppress_holes "Example"
2252 def SuppressHoles(self,theObject, theWires):
2253 # Example: see GEOM_TestHealing.py
2254 anObj = self.HealOp.FillHoles(theObject, theWires)
2255 RaiseIfFailed("FillHoles", self.HealOp)
2258 ## Close an open wire.
2259 # @param theObject Shape to be processed.
2260 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
2261 # if -1, then <VAR>theObject</VAR> itself is a wire.
2262 # @param isCommonVertex If TRUE : closure by creation of a common vertex,
2263 # If FALS : closure by creation of an edge between ends.
2264 # @return New GEOM_Object, containing processed shape.
2266 # @ref tui_close_contour "Example"
2267 def CloseContour(self,theObject, theWires, isCommonVertex):
2268 # Example: see GEOM_TestHealing.py
2269 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
2270 RaiseIfFailed("CloseContour", self.HealOp)
2273 ## Addition of a point to a given edge object.
2274 # @param theObject Shape to be processed.
2275 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
2276 # if -1, then theObject itself is the edge.
2277 # @param theValue Value of parameter on edge or length parameter,
2278 # depending on \a isByParameter.
2279 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1],
2280 # if FALSE : \a theValue is treated as a length parameter [0..1]
2281 # @return New GEOM_Object, containing processed shape.
2283 # @ref tui_add_point_on_edge "Example"
2284 def DivideEdge(self,theObject, theEdgeIndex, theValue, isByParameter):
2285 # Example: see GEOM_TestHealing.py
2286 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
2287 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
2288 RaiseIfFailed("DivideEdge", self.HealOp)
2289 anObj.SetParameters(Parameters)
2292 ## Change orientation of the given object. Updates given shape.
2293 # @param theObject Shape to be processed.
2295 # @ref swig_todo "Example"
2296 def ChangeOrientationShell(self,theObject):
2297 theObject = self.HealOp.ChangeOrientation(theObject)
2298 RaiseIfFailed("ChangeOrientation", self.HealOp)
2301 ## Change orientation of the given object.
2302 # @param theObject Shape to be processed.
2303 # @return New GEOM_Object, containing processed shape.
2305 # @ref swig_todo "Example"
2306 def ChangeOrientationShellCopy(self,theObject):
2307 anObj = self.HealOp.ChangeOrientationCopy(theObject)
2308 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
2311 ## Get a list of wires (wrapped in GEOM_Object-s),
2312 # that constitute a free boundary of the given shape.
2313 # @param theObject Shape to get free boundary of.
2314 # @return [status, theClosedWires, theOpenWires]
2315 # status: FALSE, if an error(s) occured during the method execution.
2316 # theClosedWires: Closed wires on the free boundary of the given shape.
2317 # theOpenWires: Open wires on the free boundary of the given shape.
2319 # @ref tui_measurement_tools_page "Example"
2320 def GetFreeBoundary(self,theObject):
2321 # Example: see GEOM_TestHealing.py
2322 anObj = self.HealOp.GetFreeBoundary(theObject)
2323 RaiseIfFailed("GetFreeBoundary", self.HealOp)
2326 ## Replace coincident faces in theShape by one face.
2327 # @param theShape Initial shape.
2328 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
2329 # @param doKeepNonSolids If FALSE, only solids will present in the result,
2330 # otherwise all initial shapes.
2331 # @return New GEOM_Object, containing a copy of theShape without coincident faces.
2333 # @ref tui_glue_faces "Example"
2334 def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True):
2335 # Example: see GEOM_Spanner.py
2336 theTolerance,Parameters = ParseParameters(theTolerance)
2337 anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
2339 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
2340 anObj.SetParameters(Parameters)
2343 ## Find coincident faces in theShape for possible gluing.
2344 # @param theShape Initial shape.
2345 # @param theTolerance Maximum distance between faces,
2346 # which can be considered as coincident.
2349 # @ref swig_todo "Example"
2350 def GetGlueFaces(self, theShape, theTolerance):
2351 # Example: see GEOM_Spanner.py
2352 anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
2353 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
2356 ## Replace coincident faces in theShape by one face
2357 # in compliance with given list of faces
2358 # @param theShape Initial shape.
2359 # @param theTolerance Maximum distance between faces,
2360 # which can be considered as coincident.
2361 # @param theFaces List of faces for gluing.
2362 # @param doKeepNonSolids If FALSE, only solids will present in the result,
2363 # otherwise all initial shapes.
2364 # @return New GEOM_Object, containing a copy of theShape
2365 # without some faces.
2367 # @ref swig_todo "Example"
2368 def MakeGlueFacesByList(self, theShape, theTolerance, theFaces, doKeepNonSolids=True):
2369 # Example: see GEOM_Spanner.py
2370 anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces, doKeepNonSolids)
2372 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
2378 ## @addtogroup l3_boolean Boolean Operations
2381 # -----------------------------------------------------------------------------
2382 # Boolean (Common, Cut, Fuse, Section)
2383 # -----------------------------------------------------------------------------
2385 ## Perform one of boolean operations on two given shapes.
2386 # @param theShape1 First argument for boolean operation.
2387 # @param theShape2 Second argument for boolean operation.
2388 # @param theOperation Indicates the operation to be done:
2389 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
2390 # @return New GEOM_Object, containing the result shape.
2392 # @ref tui_fuse "Example"
2393 def MakeBoolean(self,theShape1, theShape2, theOperation):
2394 # Example: see GEOM_TestAll.py
2395 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation)
2396 RaiseIfFailed("MakeBoolean", self.BoolOp)
2399 ## Shortcut to MakeBoolean(s1, s2, 1)
2401 # @ref tui_common "Example 1"
2402 # \n @ref swig_MakeCommon "Example 2"
2403 def MakeCommon(self, s1, s2):
2404 # Example: see GEOM_TestOthers.py
2405 return self.MakeBoolean(s1, s2, 1)
2407 ## Shortcut to MakeBoolean(s1, s2, 2)
2409 # @ref tui_cut "Example 1"
2410 # \n @ref swig_MakeCommon "Example 2"
2411 def MakeCut(self, s1, s2):
2412 # Example: see GEOM_TestOthers.py
2413 return self.MakeBoolean(s1, s2, 2)
2415 ## Shortcut to MakeBoolean(s1, s2, 3)
2417 # @ref tui_fuse "Example 1"
2418 # \n @ref swig_MakeCommon "Example 2"
2419 def MakeFuse(self, s1, s2):
2420 # Example: see GEOM_TestOthers.py
2421 return self.MakeBoolean(s1, s2, 3)
2423 ## Shortcut to MakeBoolean(s1, s2, 4)
2425 # @ref tui_section "Example 1"
2426 # \n @ref swig_MakeCommon "Example 2"
2427 def MakeSection(self, s1, s2):
2428 # Example: see GEOM_TestOthers.py
2429 return self.MakeBoolean(s1, s2, 4)
2434 ## @addtogroup l3_basic_op
2437 ## Perform partition operation.
2438 # @param ListShapes Shapes to be intersected.
2439 # @param ListTools Shapes to intersect theShapes.
2440 # !!!NOTE: Each compound from ListShapes and ListTools will be exploded
2441 # in order to avoid possible intersection between shapes from
2443 # @param Limit Type of resulting shapes (corresponding to TopAbs_ShapeEnum).
2444 # @param KeepNonlimitShapes: if this parameter == 0, then only shapes of
2445 # target type (equal to Limit) are kept in the result,
2446 # else standalone shapes of lower dimension
2447 # are kept also (if they exist).
2449 # After implementation new version of PartitionAlgo (October 2006)
2450 # other parameters are ignored by current functionality. They are kept
2451 # in this function only for support old versions.
2452 # Ignored parameters:
2453 # @param ListKeepInside Shapes, outside which the results will be deleted.
2454 # Each shape from theKeepInside must belong to theShapes also.
2455 # @param ListRemoveInside Shapes, inside which the results will be deleted.
2456 # Each shape from theRemoveInside must belong to theShapes also.
2457 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
2458 # @param ListMaterials Material indices for each shape. Make sence,
2459 # only if theRemoveWebs is TRUE.
2461 # @return New GEOM_Object, containing the result shapes.
2463 # @ref tui_partition "Example"
2464 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
2465 Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
2466 KeepNonlimitShapes=0):
2467 # Example: see GEOM_TestAll.py
2468 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
2469 ListKeepInside, ListRemoveInside,
2470 Limit, RemoveWebs, ListMaterials,
2471 KeepNonlimitShapes);
2472 RaiseIfFailed("MakePartition", self.BoolOp)
2475 ## Perform partition operation.
2476 # This method may be useful if it is needed to make a partition for
2477 # compound contains nonintersected shapes. Performance will be better
2478 # since intersection between shapes from compound is not performed.
2480 # Description of all parameters as in previous method MakePartition()
2482 # !!!NOTE: Passed compounds (via ListShapes or via ListTools)
2483 # have to consist of nonintersecting shapes.
2485 # @return New GEOM_Object, containing the result shapes.
2487 # @ref swig_todo "Example"
2488 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
2489 ListKeepInside=[], ListRemoveInside=[],
2490 Limit=ShapeType["SHAPE"], RemoveWebs=0,
2491 ListMaterials=[], KeepNonlimitShapes=0):
2492 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
2493 ListKeepInside, ListRemoveInside,
2494 Limit, RemoveWebs, ListMaterials,
2495 KeepNonlimitShapes);
2496 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
2499 ## Shortcut to MakePartition()
2501 # @ref tui_partition "Example 1"
2502 # \n @ref swig_Partition "Example 2"
2503 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
2504 Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
2505 KeepNonlimitShapes=0):
2506 # Example: see GEOM_TestOthers.py
2507 anObj = self.MakePartition(ListShapes, ListTools,
2508 ListKeepInside, ListRemoveInside,
2509 Limit, RemoveWebs, ListMaterials,
2510 KeepNonlimitShapes);
2513 ## Perform partition of the Shape with the Plane
2514 # @param theShape Shape to be intersected.
2515 # @param thePlane Tool shape, to intersect theShape.
2516 # @return New GEOM_Object, containing the result shape.
2518 # @ref tui_partition "Example"
2519 def MakeHalfPartition(self,theShape, thePlane):
2520 # Example: see GEOM_TestAll.py
2521 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
2522 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
2525 # end of l3_basic_op
2528 ## @addtogroup l3_transform
2531 ## Translate the given object along the vector, specified
2532 # by its end points, creating its copy before the translation.
2533 # @param theObject The object to be translated.
2534 # @param thePoint1 Start point of translation vector.
2535 # @param thePoint2 End point of translation vector.
2536 # @return New GEOM_Object, containing the translated object.
2538 # @ref tui_translation "Example 1"
2539 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
2540 def MakeTranslationTwoPoints(self,theObject, thePoint1, thePoint2):
2541 # Example: see GEOM_TestAll.py
2542 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
2543 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
2546 ## Translate the given object along the vector, specified by its components.
2547 # @param theObject The object to be translated.
2548 # @param theDX,theDY,theDZ Components of translation vector.
2549 # @return Translated GEOM_Object.
2551 # @ref tui_translation "Example"
2552 def TranslateDXDYDZ(self,theObject, theDX, theDY, theDZ):
2553 # Example: see GEOM_TestAll.py
2554 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
2555 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
2556 anObj.SetParameters(Parameters)
2557 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
2560 ## Translate the given object along the vector, specified
2561 # by its components, creating its copy before the translation.
2562 # @param theObject The object to be translated.
2563 # @param theDX,theDY,theDZ Components of translation vector.
2564 # @return New GEOM_Object, containing the translated object.
2566 # @ref tui_translation "Example"
2567 def MakeTranslation(self,theObject, theDX, theDY, theDZ):
2568 # Example: see GEOM_TestAll.py
2569 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
2570 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
2571 anObj.SetParameters(Parameters)
2572 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
2575 ## Translate the given object along the given vector,
2576 # creating its copy before the translation.
2577 # @param theObject The object to be translated.
2578 # @param theVector The translation vector.
2579 # @return New GEOM_Object, containing the translated object.
2581 # @ref tui_translation "Example"
2582 def MakeTranslationVector(self,theObject, theVector):
2583 # Example: see GEOM_TestAll.py
2584 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
2585 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
2588 ## Translate the given object along the given vector on given distance.
2589 # @param theObject The object to be translated.
2590 # @param theVector The translation vector.
2591 # @param theDistance The translation distance.
2592 # @param theCopy Flag used to translate object itself or create a copy.
2593 # @return Translated GEOM_Object.
2595 # @ref tui_translation "Example"
2596 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy):
2597 # Example: see GEOM_TestAll.py
2598 theDistance,Parameters = ParseParameters(theDistance)
2599 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
2600 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
2601 anObj.SetParameters(Parameters)
2604 ## Translate the given object along the given vector on given distance,
2605 # creating its copy before the translation.
2606 # @param theObject The object to be translated.
2607 # @param theVector The translation vector.
2608 # @param theDistance The translation distance.
2609 # @return New GEOM_Object, containing the translated object.
2611 # @ref tui_translation "Example"
2612 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance):
2613 # Example: see GEOM_TestAll.py
2614 theDistance,Parameters = ParseParameters(theDistance)
2615 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
2616 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
2617 anObj.SetParameters(Parameters)
2620 ## Rotate the given object around the given axis on the given angle.
2621 # @param theObject The object to be rotated.
2622 # @param theAxis Rotation axis.
2623 # @param theAngle Rotation angle in radians.
2624 # @return Rotated GEOM_Object.
2626 # @ref tui_rotation "Example"
2627 def Rotate(self,theObject, theAxis, theAngle):
2628 # Example: see GEOM_TestAll.py
2630 if isinstance(theAngle,str):
2632 theAngle, Parameters = ParseParameters(theAngle)
2634 theAngle = theAngle*math.pi/180.0
2635 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
2636 RaiseIfFailed("RotateCopy", self.TrsfOp)
2637 anObj.SetParameters(Parameters)
2640 ## Rotate the given object around the given axis
2641 # on the given angle, creating its copy before the rotatation.
2642 # @param theObject The object to be rotated.
2643 # @param theAxis Rotation axis.
2644 # @param theAngle Rotation angle in radians.
2645 # @return New GEOM_Object, containing the rotated object.
2647 # @ref tui_rotation "Example"
2648 def MakeRotation(self,theObject, theAxis, theAngle):
2649 # Example: see GEOM_TestAll.py
2651 if isinstance(theAngle,str):
2653 theAngle, Parameters = ParseParameters(theAngle)
2655 theAngle = theAngle*math.pi/180.0
2656 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
2657 RaiseIfFailed("RotateCopy", self.TrsfOp)
2658 anObj.SetParameters(Parameters)
2661 ## Rotate given object around vector perpendicular to plane
2662 # containing three points, creating its copy before the rotatation.
2663 # @param theObject The object to be rotated.
2664 # @param theCentPoint central point - the axis is the vector perpendicular to the plane
2665 # containing the three points.
2666 # @param thePoint1,thePoint2 - in a perpendicular plane of the axis.
2667 # @return New GEOM_Object, containing the rotated object.
2669 # @ref tui_rotation "Example"
2670 def MakeRotationThreePoints(self,theObject, theCentPoint, thePoint1, thePoint2):
2671 # Example: see GEOM_TestAll.py
2672 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
2673 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
2676 ## Scale the given object by the factor, creating its copy before the scaling.
2677 # @param theObject The object to be scaled.
2678 # @param thePoint Center point for scaling.
2679 # Passing None for it means scaling relatively the origin of global CS.
2680 # @param theFactor Scaling factor value.
2681 # @return New GEOM_Object, containing the scaled shape.
2683 # @ref tui_scale "Example"
2684 def MakeScaleTransform(self, theObject, thePoint, theFactor):
2685 # Example: see GEOM_TestAll.py
2686 theFactor, Parameters = ParseParameters(theFactor)
2687 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
2688 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
2689 anObj.SetParameters(Parameters)
2692 ## Scale the given object by different factors along coordinate axes,
2693 # creating its copy before the scaling.
2694 # @param theObject The object to be scaled.
2695 # @param thePoint Center point for scaling.
2696 # Passing None for it means scaling relatively the origin of global CS.
2697 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
2698 # @return New GEOM_Object, containing the scaled shape.
2700 # @ref swig_scale "Example"
2701 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ):
2702 # Example: see GEOM_TestAll.py
2703 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
2704 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
2705 theFactorX, theFactorY, theFactorZ)
2706 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
2707 anObj.SetParameters(Parameters)
2710 ## Create an object, symmetrical
2711 # to the given one relatively the given plane.
2712 # @param theObject The object to be mirrored.
2713 # @param thePlane Plane of symmetry.
2714 # @return New GEOM_Object, containing the mirrored shape.
2716 # @ref tui_mirror "Example"
2717 def MakeMirrorByPlane(self,theObject, thePlane):
2718 # Example: see GEOM_TestAll.py
2719 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
2720 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
2723 ## Create an object, symmetrical
2724 # to the given one relatively the given axis.
2725 # @param theObject The object to be mirrored.
2726 # @param theAxis Axis of symmetry.
2727 # @return New GEOM_Object, containing the mirrored shape.
2729 # @ref tui_mirror "Example"
2730 def MakeMirrorByAxis(self,theObject, theAxis):
2731 # Example: see GEOM_TestAll.py
2732 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
2733 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
2736 ## Create an object, symmetrical
2737 # to the given one relatively the given point.
2738 # @param theObject The object to be mirrored.
2739 # @param thePoint Point of symmetry.
2740 # @return New GEOM_Object, containing the mirrored shape.
2742 # @ref tui_mirror "Example"
2743 def MakeMirrorByPoint(self,theObject, thePoint):
2744 # Example: see GEOM_TestAll.py
2745 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
2746 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
2749 ## Modify the Location of the given object by LCS,
2750 # creating its copy before the setting.
2751 # @param theObject The object to be displaced.
2752 # @param theStartLCS Coordinate system to perform displacement from it.
2753 # If \a theStartLCS is NULL, displacement
2754 # will be performed from global CS.
2755 # If \a theObject itself is used as \a theStartLCS,
2756 # its location will be changed to \a theEndLCS.
2757 # @param theEndLCS Coordinate system to perform displacement to it.
2758 # @return New GEOM_Object, containing the displaced shape.
2760 # @ref tui_modify_location "Example"
2761 def MakePosition(self,theObject, theStartLCS, theEndLCS):
2762 # Example: see GEOM_TestAll.py
2763 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
2764 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
2767 ## Modify the Location of the given object by Path,
2768 # @param theObject The object to be displaced.
2769 # @param thePath Wire or Edge along that the object will be translated.
2770 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
2771 # @param theCopy is to create a copy objects if true.
2772 # @param theReverse - 0 for usual direction, 1 to reverse path direction.
2773 # @return New GEOM_Object, containing the displaced shape.
2775 # @ref tui_modify_location "Example"
2776 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
2777 # Example: see GEOM_TestAll.py
2778 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
2779 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
2782 ## Create new object as offset of the given one.
2783 # @param theObject The base object for the offset.
2784 # @param theOffset Offset value.
2785 # @return New GEOM_Object, containing the offset object.
2787 # @ref tui_offset "Example"
2788 def MakeOffset(self,theObject, theOffset):
2789 # Example: see GEOM_TestAll.py
2790 theOffset, Parameters = ParseParameters(theOffset)
2791 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
2792 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
2793 anObj.SetParameters(Parameters)
2796 # -----------------------------------------------------------------------------
2798 # -----------------------------------------------------------------------------
2800 ## Translate the given object along the given vector a given number times
2801 # @param theObject The object to be translated.
2802 # @param theVector Direction of the translation.
2803 # @param theStep Distance to translate on.
2804 # @param theNbTimes Quantity of translations to be done.
2805 # @return New GEOM_Object, containing compound of all
2806 # the shapes, obtained after each translation.
2808 # @ref tui_multi_translation "Example"
2809 def MakeMultiTranslation1D(self,theObject, theVector, theStep, theNbTimes):
2810 # Example: see GEOM_TestAll.py
2811 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
2812 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
2813 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
2814 anObj.SetParameters(Parameters)
2817 ## Conseqently apply two specified translations to theObject specified number of times.
2818 # @param theObject The object to be translated.
2819 # @param theVector1 Direction of the first translation.
2820 # @param theStep1 Step of the first translation.
2821 # @param theNbTimes1 Quantity of translations to be done along theVector1.
2822 # @param theVector2 Direction of the second translation.
2823 # @param theStep2 Step of the second translation.
2824 # @param theNbTimes2 Quantity of translations to be done along theVector2.
2825 # @return New GEOM_Object, containing compound of all
2826 # the shapes, obtained after each translation.
2828 # @ref tui_multi_translation "Example"
2829 def MakeMultiTranslation2D(self,theObject, theVector1, theStep1, theNbTimes1,
2830 theVector2, theStep2, theNbTimes2):
2831 # Example: see GEOM_TestAll.py
2832 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
2833 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
2834 theVector2, theStep2, theNbTimes2)
2835 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
2836 anObj.SetParameters(Parameters)
2839 ## Rotate the given object around the given axis a given number times.
2840 # Rotation angle will be 2*PI/theNbTimes.
2841 # @param theObject The object to be rotated.
2842 # @param theAxis The rotation axis.
2843 # @param theNbTimes Quantity of rotations to be done.
2844 # @return New GEOM_Object, containing compound of all the
2845 # shapes, obtained after each rotation.
2847 # @ref tui_multi_rotation "Example"
2848 def MultiRotate1D(self,theObject, theAxis, theNbTimes):
2849 # Example: see GEOM_TestAll.py
2850 theAxis, theNbTimes, Parameters = ParseParameters(theAxis, theNbTimes)
2851 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
2852 RaiseIfFailed("MultiRotate1D", self.TrsfOp)
2853 anObj.SetParameters(Parameters)
2856 ## Rotate the given object around the
2857 # given axis on the given angle a given number
2858 # times and multi-translate each rotation result.
2859 # Translation direction passes through center of gravity
2860 # of rotated shape and its projection on the rotation axis.
2861 # @param theObject The object to be rotated.
2862 # @param theAxis Rotation axis.
2863 # @param theAngle Rotation angle in graduces.
2864 # @param theNbTimes1 Quantity of rotations to be done.
2865 # @param theStep Translation distance.
2866 # @param theNbTimes2 Quantity of translations to be done.
2867 # @return New GEOM_Object, containing compound of all the
2868 # shapes, obtained after each transformation.
2870 # @ref tui_multi_rotation "Example"
2871 def MultiRotate2D(self,theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2):
2872 # Example: see GEOM_TestAll.py
2873 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
2874 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
2875 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
2876 anObj.SetParameters(Parameters)
2879 ## The same, as MultiRotate1D(), but axis is given by direction and point
2880 # @ref swig_MakeMultiRotation "Example"
2881 def MakeMultiRotation1D(self,aShape,aDir,aPoint,aNbTimes):
2882 # Example: see GEOM_TestOthers.py
2883 aVec = self.MakeLine(aPoint,aDir)
2884 anObj = self.MultiRotate1D(aShape,aVec,aNbTimes)
2887 ## The same, as MultiRotate2D(), but axis is given by direction and point
2888 # @ref swig_MakeMultiRotation "Example"
2889 def MakeMultiRotation2D(self,aShape,aDir,aPoint,anAngle,nbtimes1,aStep,nbtimes2):
2890 # Example: see GEOM_TestOthers.py
2891 aVec = self.MakeLine(aPoint,aDir)
2892 anObj = self.MultiRotate2D(aShape,aVec,anAngle,nbtimes1,aStep,nbtimes2)
2895 # end of l3_transform
2898 ## @addtogroup l3_local
2901 ## Perform a fillet on all edges of the given shape.
2902 # @param theShape Shape, to perform fillet on.
2903 # @param theR Fillet radius.
2904 # @return New GEOM_Object, containing the result shape.
2906 # @ref tui_fillet "Example 1"
2907 # \n @ref swig_MakeFilletAll "Example 2"
2908 def MakeFilletAll(self,theShape, theR):
2909 # Example: see GEOM_TestOthers.py
2910 theR,Parameters = ParseParameters(theR)
2911 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
2912 RaiseIfFailed("MakeFilletAll", self.LocalOp)
2913 anObj.SetParameters(Parameters)
2916 ## Perform a fillet on the specified edges/faces of the given shape
2917 # @param theShape Shape, to perform fillet on.
2918 # @param theR Fillet radius.
2919 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR>.
2920 # @param theListShapes Global indices of edges/faces to perform fillet on.
2921 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2922 # @return New GEOM_Object, containing the result shape.
2924 # @ref tui_fillet "Example"
2925 def MakeFillet(self,theShape, theR, theShapeType, theListShapes):
2926 # Example: see GEOM_TestAll.py
2927 theR,Parameters = ParseParameters(theR)
2929 if theShapeType == ShapeType["EDGE"]:
2930 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
2931 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
2933 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
2934 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
2935 anObj.SetParameters(Parameters)
2938 ## The same that MakeFillet but with two Fillet Radius R1 and R2
2939 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes):
2940 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
2942 if theShapeType == ShapeType["EDGE"]:
2943 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
2944 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
2946 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
2947 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
2948 anObj.SetParameters(Parameters)
2951 ## Perform a fillet on the specified edges of the given shape
2952 # @param theShape - Wire 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 # \note The list of vertices could be empty,
2957 # in this case fillet will done done at all vertices in wire
2958 # @return New GEOM_Object, containing the result shape.
2960 # @ref tui_fillet2d "Example"
2961 def MakeFillet1D(self,theShape, theR, theListOfVertexes):
2962 # Example: see GEOM_TestAll.py
2963 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes)
2964 RaiseIfFailed("MakeFillet1D", self.LocalOp)
2967 ## Perform a fillet on the specified edges/faces of the given shape
2968 # @param theShape - Face Shape to perform fillet on.
2969 # @param theR - Fillet radius.
2970 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
2971 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2972 # @return New GEOM_Object, containing the result shape.
2974 # @ref tui_fillet2d "Example"
2975 def MakeFillet2D(self,theShape, theR, theListOfVertexes):
2976 # Example: see GEOM_TestAll.py
2977 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
2978 RaiseIfFailed("MakeFillet2D", self.LocalOp)
2981 ## Perform a symmetric chamfer on all edges of the given shape.
2982 # @param theShape Shape, to perform chamfer on.
2983 # @param theD Chamfer size along each face.
2984 # @return New GEOM_Object, containing the result shape.
2986 # @ref tui_chamfer "Example 1"
2987 # \n @ref swig_MakeChamferAll "Example 2"
2988 def MakeChamferAll(self,theShape, theD):
2989 # Example: see GEOM_TestOthers.py
2990 theD,Parameters = ParseParameters(theD)
2991 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
2992 RaiseIfFailed("MakeChamferAll", self.LocalOp)
2993 anObj.SetParameters(Parameters)
2996 ## Perform a chamfer on edges, common to the specified faces,
2997 # with distance D1 on the Face1
2998 # @param theShape Shape, to perform chamfer on.
2999 # @param theD1 Chamfer size along \a theFace1.
3000 # @param theD2 Chamfer size along \a theFace2.
3001 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
3002 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
3003 # @return New GEOM_Object, containing the result shape.
3005 # @ref tui_chamfer "Example"
3006 def MakeChamferEdge(self,theShape, theD1, theD2, theFace1, theFace2):
3007 # Example: see GEOM_TestAll.py
3008 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
3009 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
3010 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
3011 anObj.SetParameters(Parameters)
3014 ## The Same that MakeChamferEdge but with params theD is chamfer length and
3015 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
3016 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2):
3018 if isinstance(theAngle,str):
3020 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
3022 theAngle = theAngle*math.pi/180.0
3023 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
3024 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
3025 anObj.SetParameters(Parameters)
3028 ## Perform a chamfer on all edges of the specified faces,
3029 # with distance D1 on the first specified face (if several for one edge)
3030 # @param theShape Shape, to perform chamfer on.
3031 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
3032 # connected to the edge, are in \a theFaces, \a theD1
3033 # will be get along face, which is nearer to \a theFaces beginning.
3034 # @param theD2 Chamfer size along another of two faces, connected to the edge.
3035 # @param theFaces Sequence of global indices of faces of \a theShape.
3036 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
3037 # @return New GEOM_Object, containing the result shape.
3039 # @ref tui_chamfer "Example"
3040 def MakeChamferFaces(self,theShape, theD1, theD2, theFaces):
3041 # Example: see GEOM_TestAll.py
3042 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
3043 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
3044 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
3045 anObj.SetParameters(Parameters)
3048 ## The Same that MakeChamferFaces but with params theD is chamfer lenght and
3049 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
3051 # @ref swig_FilletChamfer "Example"
3052 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces):
3054 if isinstance(theAngle,str):
3056 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
3058 theAngle = theAngle*math.pi/180.0
3059 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
3060 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
3061 anObj.SetParameters(Parameters)
3064 ## Perform a chamfer on edges,
3065 # with distance D1 on the first specified face (if several for one edge)
3066 # @param theShape Shape, to perform chamfer on.
3067 # @param theD1,theD2 Chamfer size
3068 # @param theEdges Sequence of edges of \a theShape.
3069 # @return New GEOM_Object, containing the result shape.
3071 # @ref swig_FilletChamfer "Example"
3072 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges):
3073 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
3074 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
3075 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
3076 anObj.SetParameters(Parameters)
3079 ## The Same that MakeChamferEdges but with params theD is chamfer lenght and
3080 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
3081 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges):
3083 if isinstance(theAngle,str):
3085 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
3087 theAngle = theAngle*math.pi/180.0
3088 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
3089 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
3090 anObj.SetParameters(Parameters)
3093 ## Shortcut to MakeChamferEdge() and MakeChamferFaces()
3095 # @ref swig_MakeChamfer "Example"
3096 def MakeChamfer(self,aShape,d1,d2,aShapeType,ListShape):
3097 # Example: see GEOM_TestOthers.py
3099 if aShapeType == ShapeType["EDGE"]:
3100 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1])
3102 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape)
3108 ## @addtogroup l3_basic_op
3111 ## Perform an Archimde operation on the given shape with given parameters.
3112 # The object presenting the resulting face is returned.
3113 # @param theShape Shape to be put in water.
3114 # @param theWeight Weight og the shape.
3115 # @param theWaterDensity Density of the water.
3116 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
3117 # @return New GEOM_Object, containing a section of \a theShape
3118 # by a plane, corresponding to water level.
3120 # @ref tui_archimede "Example"
3121 def Archimede(self,theShape, theWeight, theWaterDensity, theMeshDeflection):
3122 # Example: see GEOM_TestAll.py
3123 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
3124 theWeight,theWaterDensity,theMeshDeflection)
3125 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
3126 RaiseIfFailed("MakeArchimede", self.LocalOp)
3127 anObj.SetParameters(Parameters)
3130 # end of l3_basic_op
3133 ## @addtogroup l2_measure
3136 ## Get point coordinates
3139 # @ref tui_measurement_tools_page "Example"
3140 def PointCoordinates(self,Point):
3141 # Example: see GEOM_TestMeasures.py
3142 aTuple = self.MeasuOp.PointCoordinates(Point)
3143 RaiseIfFailed("PointCoordinates", self.MeasuOp)
3146 ## Get summarized length of all wires,
3147 # area of surface and volume of the given shape.
3148 # @param theShape Shape to define properties of.
3149 # @return [theLength, theSurfArea, theVolume]
3150 # theLength: Summarized length of all wires of the given shape.
3151 # theSurfArea: Area of surface of the given shape.
3152 # theVolume: Volume of the given shape.
3154 # @ref tui_measurement_tools_page "Example"
3155 def BasicProperties(self,theShape):
3156 # Example: see GEOM_TestMeasures.py
3157 aTuple = self.MeasuOp.GetBasicProperties(theShape)
3158 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
3161 ## Get parameters of bounding box of the given shape
3162 # @param theShape Shape to obtain bounding box of.
3163 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
3164 # Xmin,Xmax: Limits of shape along OX axis.
3165 # Ymin,Ymax: Limits of shape along OY axis.
3166 # Zmin,Zmax: Limits of shape along OZ axis.
3168 # @ref tui_measurement_tools_page "Example"
3169 def BoundingBox(self,theShape):
3170 # Example: see GEOM_TestMeasures.py
3171 aTuple = self.MeasuOp.GetBoundingBox(theShape)
3172 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
3175 ## Get inertia matrix and moments of inertia of theShape.
3176 # @param theShape Shape to calculate inertia of.
3177 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
3178 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
3179 # Ix,Iy,Iz: Moments of inertia of the given shape.
3181 # @ref tui_measurement_tools_page "Example"
3182 def Inertia(self,theShape):
3183 # Example: see GEOM_TestMeasures.py
3184 aTuple = self.MeasuOp.GetInertia(theShape)
3185 RaiseIfFailed("GetInertia", self.MeasuOp)
3188 ## Get minimal distance between the given shapes.
3189 # @param theShape1,theShape2 Shapes to find minimal distance between.
3190 # @return Value of the minimal distance between the given shapes.
3192 # @ref tui_measurement_tools_page "Example"
3193 def MinDistance(self, theShape1, theShape2):
3194 # Example: see GEOM_TestMeasures.py
3195 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
3196 RaiseIfFailed("GetMinDistance", self.MeasuOp)
3199 ## Get minimal distance between the given shapes.
3200 # @param theShape1,theShape2 Shapes to find minimal distance between.
3201 # @return Value of the minimal distance between the given shapes.
3203 # @ref swig_all_measure "Example"
3204 def MinDistanceComponents(self, theShape1, theShape2):
3205 # Example: see GEOM_TestMeasures.py
3206 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
3207 RaiseIfFailed("GetMinDistance", self.MeasuOp)
3208 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
3211 ## Get angle between the given shapes in degrees.
3212 # @param theShape1,theShape2 Lines or linear edges to find angle between.
3213 # @return Value of the angle between the given shapes in degrees.
3215 # @ref tui_measurement_tools_page "Example"
3216 def GetAngle(self, theShape1, theShape2):
3217 # Example: see GEOM_TestMeasures.py
3218 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
3219 RaiseIfFailed("GetAngle", self.MeasuOp)
3221 ## Get angle between the given shapes in radians.
3222 # @param theShape1,theShape2 Lines or linear edges to find angle between.
3223 # @return Value of the angle between the given shapes in radians.
3225 # @ref tui_measurement_tools_page "Example"
3226 def GetAngleRadians(self, theShape1, theShape2):
3227 # Example: see GEOM_TestMeasures.py
3228 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
3229 RaiseIfFailed("GetAngle", self.MeasuOp)
3232 ## @name Curve Curvature Measurement
3233 # Methods for receiving radius of curvature of curves
3234 # in the given point
3237 ## Measure curvature of a curve at a point, set by parameter.
3238 # @ref swig_todo "Example"
3239 def CurveCurvatureByParam(self, theCurve, theParam):
3240 # Example: see GEOM_TestMeasures.py
3241 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
3242 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
3246 # @ref swig_todo "Example"
3247 def CurveCurvatureByPoint(self, theCurve, thePoint):
3248 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
3249 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
3253 ## @name Surface Curvature Measurement
3254 # Methods for receiving max and min radius of curvature of surfaces
3255 # in the given point
3259 ## @ref swig_todo "Example"
3260 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
3261 # Example: see GEOM_TestMeasures.py
3262 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
3263 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
3267 ## @ref swig_todo "Example"
3268 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
3269 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
3270 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
3274 ## @ref swig_todo "Example"
3275 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
3276 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
3277 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
3281 ## @ref swig_todo "Example"
3282 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
3283 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
3284 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
3288 ## Get min and max tolerances of sub-shapes of theShape
3289 # @param theShape Shape, to get tolerances of.
3290 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
3291 # FaceMin,FaceMax: Min and max tolerances of the faces.
3292 # EdgeMin,EdgeMax: Min and max tolerances of the edges.
3293 # VertMin,VertMax: Min and max tolerances of the vertices.
3295 # @ref tui_measurement_tools_page "Example"
3296 def Tolerance(self,theShape):
3297 # Example: see GEOM_TestMeasures.py
3298 aTuple = self.MeasuOp.GetTolerance(theShape)
3299 RaiseIfFailed("GetTolerance", self.MeasuOp)
3302 ## Obtain description of the given shape (number of sub-shapes of each type)
3303 # @param theShape Shape to be described.
3304 # @return Description of the given shape.
3306 # @ref tui_measurement_tools_page "Example"
3307 def WhatIs(self,theShape):
3308 # Example: see GEOM_TestMeasures.py
3309 aDescr = self.MeasuOp.WhatIs(theShape)
3310 RaiseIfFailed("WhatIs", self.MeasuOp)
3313 ## Get a point, situated at the centre of mass of theShape.
3314 # @param theShape Shape to define centre of mass of.
3315 # @return New GEOM_Object, containing the created point.
3317 # @ref tui_measurement_tools_page "Example"
3318 def MakeCDG(self,theShape):
3319 # Example: see GEOM_TestMeasures.py
3320 anObj = self.MeasuOp.GetCentreOfMass(theShape)
3321 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
3324 ## Get a vertex subshape by index depended with orientation.
3325 # @param theShape Shape to find subshape.
3326 # @param theIndex Index to find vertex by this index.
3327 # @return New GEOM_Object, containing the created vertex.
3329 # @ref tui_measurement_tools_page "Example"
3330 def GetVertexByIndex(self,theShape, theIndex):
3331 # Example: see GEOM_TestMeasures.py
3332 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
3333 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
3336 ## Get the first vertex of wire/edge depended orientation.
3337 # @param theShape Shape to find first vertex.
3338 # @return New GEOM_Object, containing the created vertex.
3340 # @ref tui_measurement_tools_page "Example"
3341 def GetFirstVertex(self,theShape):
3342 # Example: see GEOM_TestMeasures.py
3343 anObj = self.GetVertexByIndex(theShape, 0)
3344 RaiseIfFailed("GetFirstVertex", self.MeasuOp)
3347 ## Get the last vertex of wire/edge depended orientation.
3348 # @param theShape Shape to find last vertex.
3349 # @return New GEOM_Object, containing the created vertex.
3351 # @ref tui_measurement_tools_page "Example"
3352 def GetLastVertex(self,theShape):
3353 # Example: see GEOM_TestMeasures.py
3354 nb_vert = self.ShapesOp.NumberOfSubShapes(theShape, ShapeType["VERTEX"])
3355 anObj = self.GetVertexByIndex(theShape, (nb_vert-1))
3356 RaiseIfFailed("GetLastVertex", self.MeasuOp)
3359 ## Get a normale to the given face. If the point is not given,
3360 # the normale is calculated at the center of mass.
3361 # @param theFace Face to define normale of.
3362 # @param theOptionalPoint Point to compute the normale at.
3363 # @return New GEOM_Object, containing the created vector.
3365 # @ref swig_todo "Example"
3366 def GetNormal(self, theFace, theOptionalPoint = None):
3367 # Example: see GEOM_TestMeasures.py
3368 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
3369 RaiseIfFailed("GetNormal", self.MeasuOp)
3372 ## Check a topology of the given shape.
3373 # @param theShape Shape to check validity of.
3374 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked,
3375 # if TRUE, the shape's geometry will be checked also.
3376 # @return TRUE, if the shape "seems to be valid".
3377 # If theShape is invalid, prints a description of problem.
3379 # @ref tui_measurement_tools_page "Example"
3380 def CheckShape(self,theShape, theIsCheckGeom = 0):
3381 # Example: see GEOM_TestMeasures.py
3383 (IsValid, Status) = self.MeasuOp.CheckShapeWithGeometry(theShape)
3384 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
3386 (IsValid, Status) = self.MeasuOp.CheckShape(theShape)
3387 RaiseIfFailed("CheckShape", self.MeasuOp)
3392 ## Get position (LCS) of theShape.
3394 # Origin of the LCS is situated at the shape's center of mass.
3395 # Axes of the LCS are obtained from shape's location or,
3396 # if the shape is a planar face, from position of its plane.
3398 # @param theShape Shape to calculate position of.
3399 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
3400 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
3401 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
3402 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
3404 # @ref swig_todo "Example"
3405 def GetPosition(self,theShape):
3406 # Example: see GEOM_TestMeasures.py
3407 aTuple = self.MeasuOp.GetPosition(theShape)
3408 RaiseIfFailed("GetPosition", self.MeasuOp)
3411 ## Get kind of theShape.
3413 # @param theShape Shape to get a kind of.
3414 # @return Returns a kind of shape in terms of <VAR>GEOM_IKindOfShape.shape_kind</VAR> enumeration
3415 # and a list of parameters, describing the shape.
3416 # @note Concrete meaning of each value, returned via \a theIntegers
3417 # or \a theDoubles list depends on the kind of the shape.
3418 # The full list of possible outputs is:
3420 # - geompy.kind.COMPOUND nb_solids nb_faces nb_edges nb_vertices
3421 # - geompy.kind.COMPSOLID nb_solids nb_faces nb_edges nb_vertices
3423 # - geompy.kind.SHELL geompy.info.CLOSED nb_faces nb_edges nb_vertices
3424 # - geompy.kind.SHELL geompy.info.UNCLOSED nb_faces nb_edges nb_vertices
3426 # - geompy.kind.WIRE geompy.info.CLOSED nb_edges nb_vertices
3427 # - geompy.kind.WIRE geompy.info.UNCLOSED nb_edges nb_vertices
3429 # - geompy.kind.SPHERE xc yc zc R
3430 # - geompy.kind.CYLINDER xb yb zb dx dy dz R H
3431 # - geompy.kind.BOX xc yc zc ax ay az
3432 # - geompy.kind.ROTATED_BOX xc yc zc zx zy zz xx xy xz ax ay az
3433 # - geompy.kind.TORUS xc yc zc dx dy dz R_1 R_2
3434 # - geompy.kind.CONE xb yb zb dx dy dz R_1 R_2 H
3435 # - geompy.kind.POLYHEDRON nb_faces nb_edges nb_vertices
3436 # - geompy.kind.SOLID nb_faces nb_edges nb_vertices
3438 # - geompy.kind.SPHERE2D xc yc zc R
3439 # - geompy.kind.CYLINDER2D xb yb zb dx dy dz R H
3440 # - geompy.kind.TORUS2D xc yc zc dx dy dz R_1 R_2
3441 # - geompy.kind.CONE2D xc yc zc dx dy dz R_1 R_2 H
3442 # - geompy.kind.DISK_CIRCLE xc yc zc dx dy dz R
3443 # - geompy.kind.DISK_ELLIPSE xc yc zc dx dy dz R_1 R_2
3444 # - geompy.kind.POLYGON xo yo zo dx dy dz nb_edges nb_vertices
3445 # - geompy.kind.PLANE xo yo zo dx dy dz
3446 # - geompy.kind.PLANAR xo yo zo dx dy dz nb_edges nb_vertices
3447 # - geompy.kind.FACE nb_edges nb_vertices
3449 # - geompy.kind.CIRCLE xc yc zc dx dy dz R
3450 # - geompy.kind.ARC_CIRCLE xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2
3451 # - geompy.kind.ELLIPSE xc yc zc dx dy dz R_1 R_2
3452 # - geompy.kind.ARC_ELLIPSE xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2
3453 # - geompy.kind.LINE xo yo zo dx dy dz
3454 # - geompy.kind.SEGMENT x1 y1 z1 x2 y2 z2
3455 # - geompy.kind.EDGE nb_vertices
3457 # - geompy.kind.VERTEX x y z
3459 # @ref swig_todo "Example"
3460 def KindOfShape(self,theShape):
3461 # Example: see GEOM_TestMeasures.py
3462 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
3463 RaiseIfFailed("KindOfShape", self.MeasuOp)
3465 aKind = aRoughTuple[0]
3466 anInts = aRoughTuple[1]
3467 aDbls = aRoughTuple[2]
3469 # Now there is no exception from this rule:
3470 aKindTuple = [aKind] + aDbls + anInts
3472 # If they are we will regroup parameters for such kind of shape.
3474 #if aKind == kind.SOME_KIND:
3475 # # SOME_KIND int int double int double double
3476 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
3483 ## @addtogroup l2_import_export
3486 ## Import a shape from the BREP or IGES or STEP file
3487 # (depends on given format) with given name.
3488 # @param theFileName The file, containing the shape.
3489 # @param theFormatName Specify format for the file reading.
3490 # Available formats can be obtained with InsertOp.ImportTranslators() method.
3491 # If format 'IGES_SCALE' is used instead 'IGES' length unit will be
3492 # set to 'meter' and result model will be scaled.
3493 # @return New GEOM_Object, containing the imported shape.
3495 # @ref swig_Import_Export "Example"
3496 def Import(self,theFileName, theFormatName):
3497 # Example: see GEOM_TestOthers.py
3498 anObj = self.InsertOp.Import(theFileName, theFormatName)
3499 RaiseIfFailed("Import", self.InsertOp)
3502 ## Shortcut to Import() for BREP format
3504 # @ref swig_Import_Export "Example"
3505 def ImportBREP(self,theFileName):
3506 # Example: see GEOM_TestOthers.py
3507 return self.Import(theFileName, "BREP")
3509 ## Shortcut to Import() for IGES format
3511 # @ref swig_Import_Export "Example"
3512 def ImportIGES(self,theFileName):
3513 # Example: see GEOM_TestOthers.py
3514 return self.Import(theFileName, "IGES")
3516 ## Return length unit from given IGES file
3518 # @ref swig_Import_Export "Example"
3519 def GetIGESUnit(self,theFileName):
3520 # Example: see GEOM_TestOthers.py
3521 anObj = self.InsertOp.Import(theFileName, "IGES_UNIT")
3522 #RaiseIfFailed("Import", self.InsertOp)
3523 # recieve name using returned vertex
3525 vertices = self.SubShapeAll(anObj,ShapeType["VERTEX"])
3527 p = self.PointCoordinates(vertices[0])
3528 if abs(p[0]-0.01) < 1.e-6:
3530 elif abs(p[0]-0.001) < 1.e-6:
3534 ## Shortcut to Import() for STEP format
3536 # @ref swig_Import_Export "Example"
3537 def ImportSTEP(self,theFileName):
3538 # Example: see GEOM_TestOthers.py
3539 return self.Import(theFileName, "STEP")
3541 ## Export the given shape into a file with given name.
3542 # @param theObject Shape to be stored in the file.
3543 # @param theFileName Name of the file to store the given shape in.
3544 # @param theFormatName Specify format for the shape storage.
3545 # Available formats can be obtained with InsertOp.ImportTranslators() method.
3547 # @ref swig_Import_Export "Example"
3548 def Export(self,theObject, theFileName, theFormatName):
3549 # Example: see GEOM_TestOthers.py
3550 self.InsertOp.Export(theObject, theFileName, theFormatName)
3551 if self.InsertOp.IsDone() == 0:
3552 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
3556 ## Shortcut to Export() for BREP format
3558 # @ref swig_Import_Export "Example"
3559 def ExportBREP(self,theObject, theFileName):
3560 # Example: see GEOM_TestOthers.py
3561 return self.Export(theObject, theFileName, "BREP")
3563 ## Shortcut to Export() for IGES format
3565 # @ref swig_Import_Export "Example"
3566 def ExportIGES(self,theObject, theFileName):
3567 # Example: see GEOM_TestOthers.py
3568 return self.Export(theObject, theFileName, "IGES")
3570 ## Shortcut to Export() for STEP format
3572 # @ref swig_Import_Export "Example"
3573 def ExportSTEP(self,theObject, theFileName):
3574 # Example: see GEOM_TestOthers.py
3575 return self.Export(theObject, theFileName, "STEP")
3577 # end of l2_import_export
3580 ## @addtogroup l3_blocks
3583 ## Create a quadrangle face from four edges. Order of Edges is not
3584 # important. It is not necessary that edges share the same vertex.
3585 # @param E1,E2,E3,E4 Edges for the face bound.
3586 # @return New GEOM_Object, containing the created face.
3588 # @ref tui_building_by_blocks_page "Example"
3589 def MakeQuad(self,E1, E2, E3, E4):
3590 # Example: see GEOM_Spanner.py
3591 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
3592 RaiseIfFailed("MakeQuad", self.BlocksOp)
3595 ## Create a quadrangle face on two edges.
3596 # The missing edges will be built by creating the shortest ones.
3597 # @param E1,E2 Two opposite edges for the face.
3598 # @return New GEOM_Object, containing the created face.
3600 # @ref tui_building_by_blocks_page "Example"
3601 def MakeQuad2Edges(self,E1, E2):
3602 # Example: see GEOM_Spanner.py
3603 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
3604 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
3607 ## Create a quadrangle face with specified corners.
3608 # The missing edges will be built by creating the shortest ones.
3609 # @param V1,V2,V3,V4 Corner vertices for the face.
3610 # @return New GEOM_Object, containing the created face.
3612 # @ref tui_building_by_blocks_page "Example 1"
3613 # \n @ref swig_MakeQuad4Vertices "Example 2"
3614 def MakeQuad4Vertices(self,V1, V2, V3, V4):
3615 # Example: see GEOM_Spanner.py
3616 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
3617 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
3620 ## Create a hexahedral solid, bounded by the six given faces. Order of
3621 # faces is not important. It is not necessary that Faces share the same edge.
3622 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
3623 # @return New GEOM_Object, containing the created solid.
3625 # @ref tui_building_by_blocks_page "Example 1"
3626 # \n @ref swig_MakeHexa "Example 2"
3627 def MakeHexa(self,F1, F2, F3, F4, F5, F6):
3628 # Example: see GEOM_Spanner.py
3629 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
3630 RaiseIfFailed("MakeHexa", self.BlocksOp)
3633 ## Create a hexahedral solid between two given faces.
3634 # The missing faces will be built by creating the smallest ones.
3635 # @param F1,F2 Two opposite faces for the hexahedral solid.
3636 # @return New GEOM_Object, containing the created solid.
3638 # @ref tui_building_by_blocks_page "Example 1"
3639 # \n @ref swig_MakeHexa2Faces "Example 2"
3640 def MakeHexa2Faces(self,F1, F2):
3641 # Example: see GEOM_Spanner.py
3642 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
3643 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
3649 ## @addtogroup l3_blocks_op
3652 ## Get a vertex, found in the given shape by its coordinates.
3653 # @param theShape Block or a compound of blocks.
3654 # @param theX,theY,theZ Coordinates of the sought vertex.
3655 # @param theEpsilon Maximum allowed distance between the resulting
3656 # vertex and point with the given coordinates.
3657 # @return New GEOM_Object, containing the found vertex.
3659 # @ref swig_GetPoint "Example"
3660 def GetPoint(self,theShape, theX, theY, theZ, theEpsilon):
3661 # Example: see GEOM_TestOthers.py
3662 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
3663 RaiseIfFailed("GetPoint", self.BlocksOp)
3666 ## Get an edge, found in the given shape by two given vertices.
3667 # @param theShape Block or a compound of blocks.
3668 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
3669 # @return New GEOM_Object, containing the found edge.
3671 # @ref swig_todo "Example"
3672 def GetEdge(self,theShape, thePoint1, thePoint2):
3673 # Example: see GEOM_Spanner.py
3674 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
3675 RaiseIfFailed("GetEdge", self.BlocksOp)
3678 ## Find an edge of the given shape, which has minimal distance to the given point.
3679 # @param theShape Block or a compound of blocks.
3680 # @param thePoint Point, close to the desired edge.
3681 # @return New GEOM_Object, containing the found edge.
3683 # @ref swig_GetEdgeNearPoint "Example"
3684 def GetEdgeNearPoint(self,theShape, thePoint):
3685 # Example: see GEOM_TestOthers.py
3686 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
3687 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
3690 ## Returns a face, found in the given shape by four given corner vertices.
3691 # @param theShape Block or a compound of blocks.
3692 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
3693 # @return New GEOM_Object, containing the found face.
3695 # @ref swig_todo "Example"
3696 def GetFaceByPoints(self,theShape, thePoint1, thePoint2, thePoint3, thePoint4):
3697 # Example: see GEOM_Spanner.py
3698 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
3699 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
3702 ## Get a face of block, found in the given shape by two given edges.
3703 # @param theShape Block or a compound of blocks.
3704 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
3705 # @return New GEOM_Object, containing the found face.
3707 # @ref swig_todo "Example"
3708 def GetFaceByEdges(self,theShape, theEdge1, theEdge2):
3709 # Example: see GEOM_Spanner.py
3710 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
3711 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
3714 ## Find a face, opposite to the given one in the given block.
3715 # @param theBlock Must be a hexahedral solid.
3716 # @param theFace Face of \a theBlock, opposite to the desired face.
3717 # @return New GEOM_Object, containing the found face.
3719 # @ref swig_GetOppositeFace "Example"
3720 def GetOppositeFace(self,theBlock, theFace):
3721 # Example: see GEOM_Spanner.py
3722 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
3723 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
3726 ## Find a face of the given shape, which has minimal distance to the given point.
3727 # @param theShape Block or a compound of blocks.
3728 # @param thePoint Point, close to the desired face.
3729 # @return New GEOM_Object, containing the found face.
3731 # @ref swig_GetFaceNearPoint "Example"
3732 def GetFaceNearPoint(self,theShape, thePoint):
3733 # Example: see GEOM_Spanner.py
3734 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
3735 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
3738 ## Find a face of block, whose outside normale has minimal angle with the given vector.
3739 # @param theBlock Block or a compound of blocks.
3740 # @param theVector Vector, close to the normale of the desired face.
3741 # @return New GEOM_Object, containing the found face.
3743 # @ref swig_todo "Example"
3744 def GetFaceByNormale(self, theBlock, theVector):
3745 # Example: see GEOM_Spanner.py
3746 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
3747 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
3750 # end of l3_blocks_op
3753 ## @addtogroup l4_blocks_measure
3756 ## Check, if the compound of blocks is given.
3757 # To be considered as a compound of blocks, the
3758 # given shape must satisfy the following conditions:
3759 # - Each element of the compound should be a Block (6 faces and 12 edges).
3760 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
3761 # - The compound should be connexe.
3762 # - The glue between two quadrangle faces should be applied.
3763 # @param theCompound The compound to check.
3764 # @return TRUE, if the given shape is a compound of blocks.
3765 # If theCompound is not valid, prints all discovered errors.
3767 # @ref tui_measurement_tools_page "Example 1"
3768 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
3769 def CheckCompoundOfBlocks(self,theCompound):
3770 # Example: see GEOM_Spanner.py
3771 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
3772 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
3774 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
3778 ## Remove all seam and degenerated edges from \a theShape.
3779 # Unite faces and edges, sharing one surface. It means that
3780 # this faces must have references to one C++ surface object (handle).
3781 # @param theShape The compound or single solid to remove irregular edges from.
3782 # @param doUnionFaces If True, then unite faces. If False (the default value),
3783 # do not unite faces.
3784 # @return Improved shape.
3786 # @ref swig_RemoveExtraEdges "Example"
3787 def RemoveExtraEdges(self, theShape, doUnionFaces=False):
3788 # Example: see GEOM_TestOthers.py
3789 nbFacesOptimum = -1 # -1 means do not unite faces
3790 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
3791 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
3792 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
3795 ## Check, if the given shape is a blocks compound.
3796 # Fix all detected errors.
3797 # \note Single block can be also fixed by this method.
3798 # @param theShape The compound to check and improve.
3799 # @return Improved compound.
3801 # @ref swig_CheckAndImprove "Example"
3802 def CheckAndImprove(self,theShape):
3803 # Example: see GEOM_TestOthers.py
3804 anObj = self.BlocksOp.CheckAndImprove(theShape)
3805 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
3808 # end of l4_blocks_measure
3811 ## @addtogroup l3_blocks_op
3814 ## Get all the blocks, contained in the given compound.
3815 # @param theCompound The compound to explode.
3816 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
3817 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
3818 # \note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
3819 # @return List of GEOM_Objects, containing the retrieved blocks.
3821 # @ref tui_explode_on_blocks "Example 1"
3822 # \n @ref swig_MakeBlockExplode "Example 2"
3823 def MakeBlockExplode(self,theCompound, theMinNbFaces, theMaxNbFaces):
3824 # Example: see GEOM_TestOthers.py
3825 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
3826 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
3827 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
3829 anObj.SetParameters(Parameters)
3833 ## Find block, containing the given point inside its volume or on boundary.
3834 # @param theCompound Compound, to find block in.
3835 # @param thePoint Point, close to the desired block. If the point lays on
3836 # boundary between some blocks, we return block with nearest center.
3837 # @return New GEOM_Object, containing the found block.
3839 # @ref swig_todo "Example"
3840 def GetBlockNearPoint(self,theCompound, thePoint):
3841 # Example: see GEOM_Spanner.py
3842 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
3843 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
3846 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
3847 # @param theCompound Compound, to find block in.
3848 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
3849 # @return New GEOM_Object, containing the found block.
3851 # @ref swig_GetBlockByParts "Example"
3852 def GetBlockByParts(self,theCompound, theParts):
3853 # Example: see GEOM_TestOthers.py
3854 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
3855 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
3858 ## Return all blocks, containing all the elements, passed as the parts.
3859 # @param theCompound Compound, to find blocks in.
3860 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
3861 # @return List of GEOM_Objects, containing the found blocks.
3863 # @ref swig_todo "Example"
3864 def GetBlocksByParts(self,theCompound, theParts):
3865 # Example: see GEOM_Spanner.py
3866 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
3867 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
3870 ## Multi-transformate block and glue the result.
3871 # Transformation is defined so, as to superpose direction faces.
3872 # @param Block Hexahedral solid to be multi-transformed.
3873 # @param DirFace1 ID of First direction face.
3874 # @param DirFace2 ID of Second direction face.
3875 # @param NbTimes Quantity of transformations to be done.
3876 # \note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
3877 # @return New GEOM_Object, containing the result shape.
3879 # @ref tui_multi_transformation "Example"
3880 def MakeMultiTransformation1D(self,Block, DirFace1, DirFace2, NbTimes):
3881 # Example: see GEOM_Spanner.py
3882 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
3883 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
3884 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
3885 anObj.SetParameters(Parameters)
3888 ## Multi-transformate block and glue the result.
3889 # @param Block Hexahedral solid to be multi-transformed.
3890 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
3891 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
3892 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
3893 # @return New GEOM_Object, containing the result shape.
3895 # @ref tui_multi_transformation "Example"
3896 def MakeMultiTransformation2D(self,Block, DirFace1U, DirFace2U, NbTimesU,
3897 DirFace1V, DirFace2V, NbTimesV):
3898 # Example: see GEOM_Spanner.py
3899 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
3900 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
3901 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
3902 DirFace1V, DirFace2V, NbTimesV)
3903 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
3904 anObj.SetParameters(Parameters)
3907 ## Build all possible propagation groups.
3908 # Propagation group is a set of all edges, opposite to one (main)
3909 # edge of this group directly or through other opposite edges.
3910 # Notion of Opposite Edge make sence only on quadrangle face.
3911 # @param theShape Shape to build propagation groups on.
3912 # @return List of GEOM_Objects, each of them is a propagation group.
3914 # @ref swig_Propagate "Example"
3915 def Propagate(self,theShape):
3916 # Example: see GEOM_TestOthers.py
3917 listChains = self.BlocksOp.Propagate(theShape)
3918 RaiseIfFailed("Propagate", self.BlocksOp)
3921 # end of l3_blocks_op
3924 ## @addtogroup l3_groups
3927 ## Creates a new group which will store sub shapes of theMainShape
3928 # @param theMainShape is a GEOM object on which the group is selected
3929 # @param theShapeType defines a shape type of the group
3930 # @return a newly created GEOM group
3932 # @ref tui_working_with_groups_page "Example 1"
3933 # \n @ref swig_CreateGroup "Example 2"
3934 def CreateGroup(self,theMainShape, theShapeType):
3935 # Example: see GEOM_TestOthers.py
3936 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
3937 RaiseIfFailed("CreateGroup", self.GroupOp)
3940 ## Adds a sub object with ID theSubShapeId to the group
3941 # @param theGroup is a GEOM group to which the new sub shape is added
3942 # @param theSubShapeID is a sub shape ID in the main object.
3943 # \note Use method GetSubShapeID() to get an unique ID of the sub shape
3945 # @ref tui_working_with_groups_page "Example"
3946 def AddObject(self,theGroup, theSubShapeID):
3947 # Example: see GEOM_TestOthers.py
3948 self.GroupOp.AddObject(theGroup, theSubShapeID)
3949 RaiseIfFailed("AddObject", self.GroupOp)
3952 ## Removes a sub object with ID \a theSubShapeId from the group
3953 # @param theGroup is a GEOM group from which the new sub shape is removed
3954 # @param theSubShapeID is a sub shape ID in the main object.
3955 # \note Use method GetSubShapeID() to get an unique ID of the sub shape
3957 # @ref tui_working_with_groups_page "Example"
3958 def RemoveObject(self,theGroup, theSubShapeID):
3959 # Example: see GEOM_TestOthers.py
3960 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
3961 RaiseIfFailed("RemoveObject", self.GroupOp)
3964 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
3965 # @param theGroup is a GEOM group to which the new sub shapes are added.
3966 # @param theSubShapes is a list of sub shapes to be added.
3968 # @ref tui_working_with_groups_page "Example"
3969 def UnionList (self,theGroup, theSubShapes):
3970 # Example: see GEOM_TestOthers.py
3971 self.GroupOp.UnionList(theGroup, theSubShapes)
3972 RaiseIfFailed("UnionList", self.GroupOp)
3975 ## Works like the above method, but argument
3976 # theSubShapes here is a list of sub-shapes indices
3978 # @ref swig_UnionIDs "Example"
3979 def UnionIDs(self,theGroup, theSubShapes):
3980 # Example: see GEOM_TestOthers.py
3981 self.GroupOp.UnionIDs(theGroup, theSubShapes)
3982 RaiseIfFailed("UnionIDs", self.GroupOp)
3985 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
3986 # @param theGroup is a GEOM group from which the sub-shapes are removed.
3987 # @param theSubShapes is a list of sub-shapes to be removed.
3989 # @ref tui_working_with_groups_page "Example"
3990 def DifferenceList (self,theGroup, theSubShapes):
3991 # Example: see GEOM_TestOthers.py
3992 self.GroupOp.DifferenceList(theGroup, theSubShapes)
3993 RaiseIfFailed("DifferenceList", self.GroupOp)
3996 ## Works like the above method, but argument
3997 # theSubShapes here is a list of sub-shapes indices
3999 # @ref swig_DifferenceIDs "Example"
4000 def DifferenceIDs(self,theGroup, theSubShapes):
4001 # Example: see GEOM_TestOthers.py
4002 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
4003 RaiseIfFailed("DifferenceIDs", self.GroupOp)
4006 ## Returns a list of sub objects ID stored in the group
4007 # @param theGroup is a GEOM group for which a list of IDs is requested
4009 # @ref swig_GetObjectIDs "Example"
4010 def GetObjectIDs(self,theGroup):
4011 # Example: see GEOM_TestOthers.py
4012 ListIDs = self.GroupOp.GetObjects(theGroup)
4013 RaiseIfFailed("GetObjects", self.GroupOp)
4016 ## Returns a type of sub objects stored in the group
4017 # @param theGroup is a GEOM group which type is returned.
4019 # @ref swig_GetType "Example"
4020 def GetType(self,theGroup):
4021 # Example: see GEOM_TestOthers.py
4022 aType = self.GroupOp.GetType(theGroup)
4023 RaiseIfFailed("GetType", self.GroupOp)
4026 ## Convert a type of geom object from id to string value
4027 # @param theId is a GEOM obect type id.
4029 # @ref swig_GetType "Example"
4030 def ShapeIdToType(self, theId):
4104 return "FREE_BOUNDS"
4112 return "THRUSECTIONS"
4114 return "COMPOUNDFILTER"
4116 return "SHAPES_ON_SHAPE"
4118 return "ELLIPSE_ARC"
4125 return "Shape Id not exist."
4127 ## Returns a main shape associated with the group
4128 # @param theGroup is a GEOM group for which a main shape object is requested
4129 # @return a GEOM object which is a main shape for theGroup
4131 # @ref swig_GetMainShape "Example"
4132 def GetMainShape(self,theGroup):
4133 # Example: see GEOM_TestOthers.py
4134 anObj = self.GroupOp.GetMainShape(theGroup)
4135 RaiseIfFailed("GetMainShape", self.GroupOp)
4138 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
4139 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
4141 # @ref swig_todo "Example"
4142 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1):
4143 edges = self.SubShapeAll(theShape, ShapeType["EDGE"])
4146 Props = self.BasicProperties(edge)
4147 if min_length <= Props[0] and Props[0] <= max_length:
4148 if (not include_min) and (min_length == Props[0]):
4151 if (not include_max) and (Props[0] == max_length):
4154 edges_in_range.append(edge)
4156 if len(edges_in_range) <= 0:
4157 print "No edges found by given criteria"
4160 group_edges = self.CreateGroup(theShape, ShapeType["EDGE"])
4161 self.UnionList(group_edges, edges_in_range)
4165 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
4166 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
4168 # @ref swig_todo "Example"
4169 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
4170 nb_selected = sg.SelectedCount()
4172 print "Select a shape before calling this function, please."
4175 print "Only one shape must be selected"
4178 id_shape = sg.getSelected(0)
4179 shape = IDToObject( id_shape )
4181 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
4185 if include_min: left_str = " <= "
4186 if include_max: right_str = " <= "
4188 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
4189 + left_str + "length" + right_str + `max_length`)
4191 sg.updateObjBrowser(1)
4198 ## @addtogroup l4_advanced
4201 ## Create a T-shape object with specified caracteristics for the main
4202 # and the incident pipes (radius, width, half-length).
4203 # The extremities of the main pipe are located on junctions points P1 and P2.
4204 # The extremity of the incident pipe is located on junction point P3.
4205 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
4206 # the main plane of the T-shape is XOY.
4207 # @param theR1 Internal radius of main pipe
4208 # @param theW1 Width of main pipe
4209 # @param theL1 Half-length of main pipe
4210 # @param theR2 Internal radius of incident pipe (R2 < R1)
4211 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
4212 # @param theL2 Half-length of incident pipe
4213 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
4214 # @param theP1 1st junction point of main pipe
4215 # @param theP2 2nd junction point of main pipe
4216 # @param theP3 Junction point of incident pipe
4217 # @return List of GEOM_Objects, containing the created shape and propagation groups.
4219 # @ref tui_creation_pipetshape "Example"
4220 def MakePipeTShape(self, theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh=True, theP1=None, theP2=None, theP3=None):
4221 theR1, theW1, theL1, theR2, theW2, theL2, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2)
4222 if (theP1 and theP2 and theP3):
4223 anObj = self.AdvOp.MakePipeTShapeWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh, theP1, theP2, theP3)
4225 anObj = self.AdvOp.MakePipeTShape(theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh)
4226 RaiseIfFailed("MakePipeTShape", self.AdvOp)
4227 if Parameters: anObj[0].SetParameters(Parameters)
4230 ## Create a T-shape object with chamfer and with specified caracteristics for the main
4231 # and the incident pipes (radius, width, half-length). The chamfer is
4232 # created on the junction of the pipes.
4233 # The extremities of the main pipe are located on junctions points P1 and P2.
4234 # The extremity of the incident pipe is located on junction point P3.
4235 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
4236 # the main plane of the T-shape is XOY.
4237 # @param theR1 Internal radius of main pipe
4238 # @param theW1 Width of main pipe
4239 # @param theL1 Half-length of main pipe
4240 # @param theR2 Internal radius of incident pipe (R2 < R1)
4241 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
4242 # @param theL2 Half-length of incident pipe
4243 # @param theH Height of the chamfer.
4244 # @param theW Width of the chamfer.
4245 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
4246 # @param theP1 1st junction point of main pipe
4247 # @param theP2 2nd junction point of main pipe
4248 # @param theP3 Junction point of incident pipe
4249 # @return List of GEOM_Objects, containing the created shape and propagation groups.
4251 # @ref tui_creation_pipetshape "Example"
4252 def MakePipeTShapeChamfer(self, theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh=True, theP1=None, theP2=None, theP3=None):
4253 theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW)
4254 if (theP1 and theP2 and theP3):
4255 anObj = self.AdvOp.MakePipeTShapeChamferWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh, theP1, theP2, theP3)
4257 anObj = self.AdvOp.MakePipeTShapeChamfer(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh)
4258 RaiseIfFailed("MakePipeTShapeChamfer", self.AdvOp)
4259 if Parameters: anObj[0].SetParameters(Parameters)
4262 ## Create a T-shape object with fillet and with specified caracteristics for the main
4263 # and the incident pipes (radius, width, half-length). The fillet is
4264 # created on the junction of the pipes.
4265 # The extremities of the main pipe are located on junctions points P1 and P2.
4266 # The extremity of the incident pipe is located on junction point P3.
4267 # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
4268 # the main plane of the T-shape is XOY.
4269 # @param theR1 Internal radius of main pipe
4270 # @param theW1 Width of main pipe
4271 # @param theL1 Half-length of main pipe
4272 # @param theR2 Internal radius of incident pipe (R2 < R1)
4273 # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
4274 # @param theL2 Half-length of incident pipe
4275 # @param theRF Radius of curvature of fillet.
4276 # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
4277 # @param theP1 1st junction point of main pipe
4278 # @param theP2 2nd junction point of main pipe
4279 # @param theP3 Junction point of incident pipe
4280 # @return List of GEOM_Objects, containing the created shape and propagation groups.
4282 # @ref tui_creation_pipetshape "Example"
4283 def MakePipeTShapeFillet(self, theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh=True, theP1=None, theP2=None, theP3=None):
4284 theR1, theW1, theL1, theR2, theW2, theL2, theRF, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theRF)
4285 if (theP1 and theP2 and theP3):
4286 anObj = self.AdvOp.MakePipeTShapeFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh, theP1, theP2, theP3)
4288 anObj = self.AdvOp.MakePipeTShapeFillet(theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh)
4289 RaiseIfFailed("MakePipeTShapeFillet", self.AdvOp)
4290 if Parameters: anObj[0].SetParameters(Parameters)
4293 #@@ insert new functions before this line @@ do not remove this line @@#
4295 # end of l4_advanced
4298 ## Create a copy of the given object
4299 # @ingroup l1_geompy_auxiliary
4301 # @ref swig_all_advanced "Example"
4302 def MakeCopy(self,theOriginal):
4303 # Example: see GEOM_TestAll.py
4304 anObj = self.InsertOp.MakeCopy(theOriginal)
4305 RaiseIfFailed("MakeCopy", self.InsertOp)
4308 ## Add Path to load python scripts from
4309 # @ingroup l1_geompy_auxiliary
4310 def addPath(self,Path):
4311 if (sys.path.count(Path) < 1):
4312 sys.path.append(Path)
4316 ## Load marker texture from the file
4317 # @param Path a path to the texture file
4318 # @return unique texture identifier
4319 # @ingroup l1_geompy_auxiliary
4320 def LoadTexture(self, Path):
4321 # Example: see GEOM_TestAll.py
4322 ID = self.InsertOp.LoadTexture(Path)
4323 RaiseIfFailed("LoadTexture", self.InsertOp)
4326 ## Add marker texture. @a Width and @a Height parameters
4327 # specify width and height of the texture in pixels.
4328 # If @a RowData is @c True, @a Texture parameter should represent texture data
4329 # packed into the byte array. If @a RowData is @c False (default), @a Texture
4330 # parameter should be unpacked string, in which '1' symbols represent opaque
4331 # pixels and '0' represent transparent pixels of the texture bitmap.
4333 # @param Width texture width in pixels
4334 # @param Height texture height in pixels
4335 # @param Texture texture data
4336 # @param RowData if @c True, @a Texture data are packed in the byte stream
4337 # @ingroup l1_geompy_auxiliary
4338 def AddTexture(self, Width, Height, Texture, RowData=False):
4339 # Example: see GEOM_TestAll.py
4340 if not RowData: Texture = PackData(Texture)
4341 ID = self.InsertOp.AddTexture(Width, Height, Texture)
4342 RaiseIfFailed("AddTexture", self.InsertOp)
4346 #Register the new proxy for GEOM_Gen
4347 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geompyDC)