1 # -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
4 # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
5 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
7 # This library is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU Lesser General Public
9 # License as published by the Free Software Foundation; either
10 # version 2.1 of the License.
12 # This library is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # Lesser General Public License for more details.
17 # You should have received a copy of the GNU Lesser General Public
18 # License along with this library; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 # GEOM GEOM_SWIG : binding of C++ omplementaion with Python
25 # Author : Paul RASCLE, EDF
33 ## @defgroup l1_geompy_auxiliary Auxiliary data structures and methods
35 ## @defgroup l1_geompy_purpose All package methods, grouped by their purpose
37 ## @defgroup l2_import_export Importing/exporting geometrical objects
38 ## @defgroup l2_creating Creating geometrical objects
40 ## @defgroup l3_basic_go Creating Basic Geometric Objects
42 ## @defgroup l4_curves Creating Curves
45 ## @defgroup l3_3d_primitives Creating 3D Primitives
46 ## @defgroup l3_complex Creating Complex Objects
47 ## @defgroup l3_groups Working with groups
48 ## @defgroup l3_blocks Building by blocks
50 ## @defgroup l4_blocks_measure Check and Improve
53 ## @defgroup l3_sketcher Sketcher
54 ## @defgroup l3_advanced Creating Advanced Geometrical Objects
56 ## @defgroup l4_decompose Decompose objects
57 ## @defgroup l4_access Access to sub-shapes by their unique IDs inside the main shape
58 ## @defgroup l4_obtain Access to subshapes by a criteria
63 ## @defgroup l2_transforming Transforming geometrical objects
65 ## @defgroup l3_basic_op Basic Operations
66 ## @defgroup l3_boolean Boolean Operations
67 ## @defgroup l3_transform Transformation Operations
68 ## @defgroup l3_local Local Operations (Fillet and Chamfer)
69 ## @defgroup l3_blocks_op Blocks Operations
70 ## @defgroup l3_healing Repairing Operations
71 ## @defgroup l3_restore_ss Restore presentation parameters and a tree of subshapes
74 ## @defgroup l2_measure Using measurement tools
82 from salome_notebook import *
87 ## Enumeration ShapeType as a dictionary
88 # @ingroup l1_geompy_auxiliary
89 ShapeType = {"COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8}
91 ## Raise an Error, containing the Method_name, if Operation is Failed
92 ## @ingroup l1_geompy_auxiliary
93 def RaiseIfFailed (Method_name, Operation):
94 if Operation.IsDone() == 0 and Operation.GetErrorCode() != "NOT_FOUND_ANY":
95 raise RuntimeError, Method_name + " : " + Operation.GetErrorCode()
97 ## Return list of variables value from salome notebook
98 ## @ingroup l1_geompy_auxiliary
99 def ParseParameters(*parameters):
102 for parameter in parameters:
103 if isinstance(parameter,str):
104 if notebook.isVariable(parameter):
105 Result.append(notebook.get(parameter))
107 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
109 Result.append(parameter)
112 StringResult = StringResult + str(parameter)
113 StringResult = StringResult + ":"
115 StringResult = StringResult[:len(StringResult)-1]
116 Result.append(StringResult)
119 ## Return list of variables value from salome notebook
120 ## @ingroup l1_geompy_auxiliary
124 for parameter in list:
125 if isinstance(parameter,str) and notebook.isVariable(parameter):
126 Result.append(str(notebook.get(parameter)))
129 Result.append(str(parameter))
132 StringResult = StringResult + str(parameter)
133 StringResult = StringResult + ":"
135 StringResult = StringResult[:len(StringResult)-1]
136 return Result, StringResult
138 ## Return list of variables value from salome notebook
139 ## @ingroup l1_geompy_auxiliary
140 def ParseSketcherCommand(command):
143 sections = command.split(":")
144 for section in sections:
145 parameters = section.split(" ")
147 for parameter in parameters:
148 if paramIndex > 1 and parameter.find("'") != -1:
149 parameter = parameter.replace("'","")
150 if notebook.isVariable(parameter):
151 Result = Result + str(notebook.get(parameter)) + " "
154 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
158 Result = Result + str(parameter) + " "
161 StringResult = StringResult + parameter
162 StringResult = StringResult + ":"
164 paramIndex = paramIndex + 1
166 Result = Result[:len(Result)-1] + ":"
168 Result = Result[:len(Result)-1]
169 return Result, StringResult
171 ## Helper function which can be used to pack the passed string to the byte data.
172 ## Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
173 ## If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
176 ## val = PackData("10001110") # val = 0xAE
177 ## val = PackData("1") # val = 0x80
179 ## @param data unpacked data - a string containing '1' and '0' symbols
180 ## @return data packed to the byte stream
181 ## @ingroup l1_geompy_auxiliary
184 if len(data)%8: bytes += 1
186 for b in range(bytes):
187 d = data[b*8:(b+1)*8]
192 if d[i] == "1": val += 1
194 raise "Invalid symbol %s" % d[i]
201 ## Read bitmap texture from the text file.
202 ## In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
203 ## A zero symbol ('0') represents transparent pixel of the texture bitmap.
204 ## The function returns width and height of the pixmap in pixels and byte stream representing
205 ## texture bitmap itself.
207 ## This function can be used to read the texture to the byte stream in order to pass it to
208 ## the AddTexture() function of geompy class.
212 ## geompy.init_geom(salome.myStudy)
213 ## texture = geompy.readtexture('mytexture.dat')
214 ## texture = geompy.AddTexture(*texture)
215 ## obj.SetMarkerTexture(texture)
217 ## @param fname texture file name
218 ## @return sequence of tree values: texture's width, height in pixels and its byte stream
219 ## @ingroup l1_geompy_auxiliary
220 def ReadTexture(fname):
223 lines = [ l.strip() for l in f.readlines()]
226 if lines: maxlen = max([len(x) for x in lines])
228 if maxlen%8: lenbytes += 1
232 lenline = (len(line)/8+1)*8
235 lenline = (len(line)/8)*8
237 for i in range(lenline/8):
240 if i*8+j < len(line) and line[i*8+j] != "0": byte += "1"
243 bytedata += PackData(byte)
245 for i in range(lenline/8, lenbytes):
246 bytedata += PackData("0")
248 return lenbytes*8, len(lines), bytedata
253 ## Kinds of shape enumeration
254 # @ingroup l1_geompy_auxiliary
255 kind = GEOM.GEOM_IKindOfShape
257 ## Information about closed/unclosed state of shell or wire
258 # @ingroup l1_geompy_auxiliary
264 class geompyDC(GEOM._objref_GEOM_Gen):
267 GEOM._objref_GEOM_Gen.__init__(self)
268 self.myBuilder = None
286 ## @addtogroup l1_geompy_auxiliary
288 def init_geom(self,theStudy):
289 self.myStudy = theStudy
290 self.myStudyId = self.myStudy._get_StudyId()
291 self.myBuilder = self.myStudy.NewBuilder()
292 self.father = self.myStudy.FindComponent("GEOM")
293 if self.father is None:
294 self.father = self.myBuilder.NewComponent("GEOM")
295 A1 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributeName")
296 FName = A1._narrow(SALOMEDS.AttributeName)
297 FName.SetValue("Geometry")
298 A2 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributePixMap")
299 aPixmap = A2._narrow(SALOMEDS.AttributePixMap)
300 aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry")
301 self.myBuilder.DefineComponentInstance(self.father,self)
303 self.BasicOp = self.GetIBasicOperations (self.myStudyId)
304 self.CurvesOp = self.GetICurvesOperations (self.myStudyId)
305 self.PrimOp = self.GetI3DPrimOperations (self.myStudyId)
306 self.ShapesOp = self.GetIShapesOperations (self.myStudyId)
307 self.HealOp = self.GetIHealingOperations (self.myStudyId)
308 self.InsertOp = self.GetIInsertOperations (self.myStudyId)
309 self.BoolOp = self.GetIBooleanOperations (self.myStudyId)
310 self.TrsfOp = self.GetITransformOperations(self.myStudyId)
311 self.LocalOp = self.GetILocalOperations (self.myStudyId)
312 self.MeasuOp = self.GetIMeasureOperations (self.myStudyId)
313 self.BlocksOp = self.GetIBlocksOperations (self.myStudyId)
314 self.GroupOp = self.GetIGroupOperations (self.myStudyId)
317 ## Get name for sub-shape aSubObj of shape aMainObj
319 # @ref swig_SubShapeAllSorted "Example"
320 def SubShapeName(self,aSubObj, aMainObj):
321 # Example: see GEOM_TestAll.py
323 #aSubId = orb.object_to_string(aSubObj)
324 #aMainId = orb.object_to_string(aMainObj)
325 #index = gg.getIndexTopology(aSubId, aMainId)
326 #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
327 index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
328 name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
331 ## Publish in study aShape with name aName
333 # \param aShape the shape to be published
334 # \param aName the name for the shape
335 # \param doRestoreSubShapes if True, finds and publishes also
336 # sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
337 # and published sub-shapes of arguments
338 # \param theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes for
339 # these arguments description
340 # \return study entry of the published shape in form of string
342 # @ref swig_MakeQuad4Vertices "Example"
343 def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
344 theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
345 # Example: see GEOM_TestAll.py
347 aSObject = self.AddInStudy(self.myStudy, aShape, aName, None)
348 if doRestoreSubShapes:
349 self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs,
350 theFindMethod, theInheritFirstArg)
352 print "addToStudy() failed"
354 return aShape.GetStudyEntry()
356 ## Publish in study aShape with name aName as sub-object of previously published aFather
358 # @ref swig_SubShapeAllSorted "Example"
359 def addToStudyInFather(self, aFather, aShape, aName):
360 # Example: see GEOM_TestAll.py
362 aSObject = self.AddInStudy(self.myStudy, aShape, aName, aFather)
364 print "addToStudyInFather() failed"
366 return aShape.GetStudyEntry()
368 # end of l1_geompy_auxiliary
371 ## @addtogroup l3_restore_ss
374 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
375 # To be used from python scripts out of geompy.addToStudy (non-default usage)
376 # \param theObject published GEOM object, arguments of which will be published
377 # \param theArgs list of GEOM_Object, operation arguments to be published.
378 # If this list is empty, all operation arguments will be published
379 # \param theFindMethod method to search subshapes, corresponding to arguments and
380 # their subshapes. Value from enumeration GEOM::find_shape_method.
381 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
382 # Do not publish subshapes in place of arguments, but only
383 # in place of subshapes of the first argument,
384 # because the whole shape corresponds to the first argument.
385 # Mainly to be used after transformations, but it also can be
386 # usefull after partition with one object shape, and some other
387 # operations, where only the first argument has to be considered.
388 # If theObject has only one argument shape, this flag is automatically
389 # considered as True, not regarding really passed value.
390 # \return list of published sub-shapes
392 # @ref tui_restore_prs_params "Example"
393 def RestoreSubShapes (self, theObject, theArgs=[],
394 theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
395 # Example: see GEOM_TestAll.py
396 return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
397 theFindMethod, theInheritFirstArg)
399 # end of l3_restore_ss
402 ## @addtogroup l3_basic_go
405 ## Create point by three coordinates.
406 # @param theX The X coordinate of the point.
407 # @param theY The Y coordinate of the point.
408 # @param theZ The Z coordinate of the point.
409 # @return New GEOM_Object, containing the created point.
411 # @ref tui_creation_point "Example"
412 def MakeVertex(self,theX, theY, theZ):
413 # Example: see GEOM_TestAll.py
414 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
415 anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
416 RaiseIfFailed("MakePointXYZ", self.BasicOp)
417 anObj.SetParameters(Parameters)
420 ## Create a point, distant from the referenced point
421 # on the given distances along the coordinate axes.
422 # @param theReference The referenced point.
423 # @param theX Displacement from the referenced point along OX axis.
424 # @param theY Displacement from the referenced point along OY axis.
425 # @param theZ Displacement from the referenced point along OZ axis.
426 # @return New GEOM_Object, containing the created point.
428 # @ref tui_creation_point "Example"
429 def MakeVertexWithRef(self,theReference, theX, theY, theZ):
430 # Example: see GEOM_TestAll.py
431 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
432 anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
433 RaiseIfFailed("MakePointWithReference", self.BasicOp)
434 anObj.SetParameters(Parameters)
437 ## Create a point, corresponding to the given parameter on the given curve.
438 # @param theRefCurve The referenced curve.
439 # @param theParameter Value of parameter on the referenced curve.
440 # @return New GEOM_Object, containing the created point.
442 # @ref tui_creation_point "Example"
443 def MakeVertexOnCurve(self,theRefCurve, theParameter):
444 # Example: see GEOM_TestAll.py
445 theParameter, Parameters = ParseParameters(theParameter)
446 anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter)
447 RaiseIfFailed("MakePointOnCurve", self.BasicOp)
448 anObj.SetParameters(Parameters)
451 ## Create a point by projection give coordinates on the given curve
452 # @param theRefCurve The referenced curve.
453 # @param theX X-coordinate in 3D space
454 # @param theY Y-coordinate in 3D space
455 # @param theZ Z-coordinate in 3D space
456 # @return New GEOM_Object, containing the created point.
458 # @ref tui_creation_point "Example"
459 def MakeVertexOnCurveByCoord(self,theRefCurve, theX, theY, theZ):
460 # Example: see GEOM_TestAll.py
461 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
462 anObj = self.BasicOp.MakePointOnCurveByCoord(theRefCurve, theX, theY, theZ)
463 RaiseIfFailed("MakeVertexOnCurveByCoord", self.BasicOp)
464 anObj.SetParameters(Parameters)
467 ## Create a point, corresponding to the given parameters on the
469 # @param theRefSurf The referenced surface.
470 # @param theUParameter Value of U-parameter on the referenced surface.
471 # @param theVParameter Value of V-parameter on the referenced surface.
472 # @return New GEOM_Object, containing the created point.
474 # @ref swig_MakeVertexOnSurface "Example"
475 def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter):
476 theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
477 # Example: see GEOM_TestAll.py
478 anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
479 RaiseIfFailed("MakePointOnSurface", self.BasicOp)
480 anObj.SetParameters(Parameters);
483 ## Create a point by projection give coordinates on the given surface
484 # @param theRefSurf The referenced surface.
485 # @param theX X-coordinate in 3D space
486 # @param theY Y-coordinate in 3D space
487 # @param theZ Z-coordinate in 3D space
488 # @return New GEOM_Object, containing the created point.
490 # @ref swig_MakeVertexOnSurfaceByCoord "Example"
491 def MakeVertexOnSurfaceByCoord(self, theRefSurf, theX, theY, theZ):
492 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
493 # Example: see GEOM_TestAll.py
494 anObj = self.BasicOp.MakePointOnSurfaceByCoord(theRefSurf, theX, theY, theZ)
495 RaiseIfFailed("MakeVertexOnSurfaceByCoord", self.BasicOp)
496 anObj.SetParameters(Parameters);
499 ## Create a point on intersection of two lines.
500 # @param theRefLine1, theRefLine2 The referenced lines.
501 # @return New GEOM_Object, containing the created point.
503 # @ref swig_MakeVertexOnLinesIntersection "Example"
504 def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2):
505 # Example: see GEOM_TestAll.py
506 anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
507 RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
510 ## Create a tangent, corresponding to the given parameter on the given curve.
511 # @param theRefCurve The referenced curve.
512 # @param theParameter Value of parameter on the referenced curve.
513 # @return New GEOM_Object, containing the created tangent.
515 # @ref swig_MakeTangentOnCurve "Example"
516 def MakeTangentOnCurve(self, theRefCurve, theParameter):
517 anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
518 RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
521 ## Create a tangent plane, corresponding to the given parameter on the given face.
522 # @param theFace The face for which tangent plane should be built.
523 # @param theParameterV vertical value of the center point (0.0 - 1.0).
524 # @param theParameterU horisontal value of the center point (0.0 - 1.0).
525 # @param theTrimSize the size of plane.
526 # @return New GEOM_Object, containing the created tangent.
528 # @ref swig_MakeTangentPlaneOnFace "Example"
529 def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize):
530 anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
531 RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
534 ## Create a vector with the given components.
535 # @param theDX X component of the vector.
536 # @param theDY Y component of the vector.
537 # @param theDZ Z component of the vector.
538 # @return New GEOM_Object, containing the created vector.
540 # @ref tui_creation_vector "Example"
541 def MakeVectorDXDYDZ(self,theDX, theDY, theDZ):
542 # Example: see GEOM_TestAll.py
543 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
544 anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
545 RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
546 anObj.SetParameters(Parameters)
549 ## Create a vector between two points.
550 # @param thePnt1 Start point for the vector.
551 # @param thePnt2 End point for the vector.
552 # @return New GEOM_Object, containing the created vector.
554 # @ref tui_creation_vector "Example"
555 def MakeVector(self,thePnt1, thePnt2):
556 # Example: see GEOM_TestAll.py
557 anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
558 RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
561 ## Create a line, passing through the given point
562 # and parrallel to the given direction
563 # @param thePnt Point. The resulting line will pass through it.
564 # @param theDir Direction. The resulting line will be parallel to it.
565 # @return New GEOM_Object, containing the created line.
567 # @ref tui_creation_line "Example"
568 def MakeLine(self,thePnt, theDir):
569 # Example: see GEOM_TestAll.py
570 anObj = self.BasicOp.MakeLine(thePnt, theDir)
571 RaiseIfFailed("MakeLine", self.BasicOp)
574 ## Create a line, passing through the given points
575 # @param thePnt1 First of two points, defining the line.
576 # @param thePnt2 Second of two points, defining the line.
577 # @return New GEOM_Object, containing the created line.
579 # @ref tui_creation_line "Example"
580 def MakeLineTwoPnt(self,thePnt1, thePnt2):
581 # Example: see GEOM_TestAll.py
582 anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
583 RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
586 ## Create a line on two faces intersection.
587 # @param theFace1 First of two faces, defining the line.
588 # @param theFace2 Second of two faces, defining the line.
589 # @return New GEOM_Object, containing the created line.
591 # @ref swig_MakeLineTwoFaces "Example"
592 def MakeLineTwoFaces(self, theFace1, theFace2):
593 # Example: see GEOM_TestAll.py
594 anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
595 RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
598 ## Create a plane, passing through the given point
599 # and normal to the given vector.
600 # @param thePnt Point, the plane has to pass through.
601 # @param theVec Vector, defining the plane normal direction.
602 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
603 # @return New GEOM_Object, containing the created plane.
605 # @ref tui_creation_plane "Example"
606 def MakePlane(self,thePnt, theVec, theTrimSize):
607 # Example: see GEOM_TestAll.py
608 theTrimSize, Parameters = ParseParameters(theTrimSize);
609 anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
610 RaiseIfFailed("MakePlanePntVec", self.BasicOp)
611 anObj.SetParameters(Parameters)
614 ## Create a plane, passing through the three given points
615 # @param thePnt1 First of three points, defining the plane.
616 # @param thePnt2 Second of three points, defining the plane.
617 # @param thePnt3 Fird of three points, defining the plane.
618 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
619 # @return New GEOM_Object, containing the created plane.
621 # @ref tui_creation_plane "Example"
622 def MakePlaneThreePnt(self,thePnt1, thePnt2, thePnt3, theTrimSize):
623 # Example: see GEOM_TestAll.py
624 theTrimSize, Parameters = ParseParameters(theTrimSize);
625 anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
626 RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
627 anObj.SetParameters(Parameters)
630 ## Create a plane, similar to the existing one, but with another size of representing face.
631 # @param theFace Referenced plane or LCS(Marker).
632 # @param theTrimSize New half size of a side of quadrangle face, representing the plane.
633 # @return New GEOM_Object, containing the created plane.
635 # @ref tui_creation_plane "Example"
636 def MakePlaneFace(self,theFace, theTrimSize):
637 # Example: see GEOM_TestAll.py
638 theTrimSize, Parameters = ParseParameters(theTrimSize);
639 anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
640 RaiseIfFailed("MakePlaneFace", self.BasicOp)
641 anObj.SetParameters(Parameters)
644 ## Create a plane, passing through the 2 vectors
645 # with center in a start point of the first vector.
646 # @param theVec1 Vector, defining center point and plane direction.
647 # @param theVec2 Vector, defining the plane normal direction.
648 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
649 # @return New GEOM_Object, containing the created plane.
651 # @ref tui_creation_plane "Example"
652 def MakePlane2Vec(self,theVec1, theVec2, theTrimSize):
653 # Example: see GEOM_TestAll.py
654 theTrimSize, Parameters = ParseParameters(theTrimSize);
655 anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
656 RaiseIfFailed("MakePlane2Vec", self.BasicOp)
657 anObj.SetParameters(Parameters)
660 ## Create a plane, based on a Local coordinate system.
661 # @param theLCS coordinate system, defining plane.
662 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
663 # @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
664 # @return New GEOM_Object, containing the created plane.
666 # @ref tui_creation_plane "Example"
667 def MakePlaneLCS(self,theLCS, theTrimSize, theOrientation):
668 # Example: see GEOM_TestAll.py
669 theTrimSize, Parameters = ParseParameters(theTrimSize);
670 anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
671 RaiseIfFailed("MakePlaneLCS", self.BasicOp)
672 anObj.SetParameters(Parameters)
675 ## Create a local coordinate system.
676 # @param OX,OY,OZ Three coordinates of coordinate system origin.
677 # @param XDX,XDY,XDZ Three components of OX direction
678 # @param YDX,YDY,YDZ Three components of OY direction
679 # @return New GEOM_Object, containing the created coordinate system.
681 # @ref swig_MakeMarker "Example"
682 def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ):
683 # Example: see GEOM_TestAll.py
684 OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
685 anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
686 RaiseIfFailed("MakeMarker", self.BasicOp)
687 anObj.SetParameters(Parameters)
690 ## Create a local coordinate system from shape.
691 # @param theShape The initial shape to detect the coordinate system.
692 # @return New GEOM_Object, containing the created coordinate system.
694 # @ref tui_creation_lcs "Example"
695 def MakeMarkerFromShape(self, theShape):
696 anObj = self.BasicOp.MakeMarkerFromShape(theShape)
697 RaiseIfFailed("MakeMarkerFromShape", self.BasicOp)
700 ## Create a local coordinate system from point and two vectors.
701 # @param theOrigin Point of coordinate system origin.
702 # @param theXVec Vector of X direction
703 # @param theYVec Vector of Y direction
704 # @return New GEOM_Object, containing the created coordinate system.
706 # @ref tui_creation_lcs "Example"
707 def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec):
708 anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec)
709 RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp)
715 ## @addtogroup l4_curves
718 ## Create an arc of circle, passing through three given points.
719 # @param thePnt1 Start point of the arc.
720 # @param thePnt2 Middle point of the arc.
721 # @param thePnt3 End point of the arc.
722 # @return New GEOM_Object, containing the created arc.
724 # @ref swig_MakeArc "Example"
725 def MakeArc(self,thePnt1, thePnt2, thePnt3):
726 # Example: see GEOM_TestAll.py
727 anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
728 RaiseIfFailed("MakeArc", self.CurvesOp)
731 ## Create an arc of circle from a center and 2 points.
732 # @param thePnt1 Center of the arc
733 # @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
734 # @param thePnt3 End point of the arc (Gives also a direction)
735 # @param theSense Orientation of the arc
736 # @return New GEOM_Object, containing the created arc.
738 # @ref swig_MakeArc "Example"
739 def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False):
740 # Example: see GEOM_TestAll.py
741 anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
742 RaiseIfFailed("MakeArcCenter", self.CurvesOp)
745 ## Create an arc of ellipse, of center and two points.
746 # @param theCenter Center of the arc.
747 # @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
748 # @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
749 # @return New GEOM_Object, containing the created arc.
751 # @ref swig_MakeArc "Example"
752 def MakeArcOfEllipse(self,theCenter, thePnt1, thePnt2):
753 # Example: see GEOM_TestAll.py
754 anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
755 RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
758 ## Create a circle with given center, normal vector and radius.
759 # @param thePnt Circle center.
760 # @param theVec Vector, normal to the plane of the circle.
761 # @param theR Circle radius.
762 # @return New GEOM_Object, containing the created circle.
764 # @ref tui_creation_circle "Example"
765 def MakeCircle(self, thePnt, theVec, theR):
766 # Example: see GEOM_TestAll.py
767 theR, Parameters = ParseParameters(theR)
768 anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
769 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
770 anObj.SetParameters(Parameters)
773 ## Create a circle with given radius.
774 # Center of the circle will be in the origin of global
775 # coordinate system and normal vector will be codirected with Z axis
776 # @param theR Circle radius.
777 # @return New GEOM_Object, containing the created circle.
778 def MakeCircleR(self, theR):
779 anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
780 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
783 ## Create a circle, passing through three given points
784 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
785 # @return New GEOM_Object, containing the created circle.
787 # @ref tui_creation_circle "Example"
788 def MakeCircleThreePnt(self,thePnt1, thePnt2, thePnt3):
789 # Example: see GEOM_TestAll.py
790 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
791 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
794 ## Create a circle, with given point1 as center,
795 # passing through the point2 as radius and laying in the plane,
796 # defined by all three given points.
797 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
798 # @return New GEOM_Object, containing the created circle.
800 # @ref swig_MakeCircle "Example"
801 def MakeCircleCenter2Pnt(self,thePnt1, thePnt2, thePnt3):
802 # Example: see GEOM_example6.py
803 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
804 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
807 ## Create an ellipse with given center, normal vector and radiuses.
808 # @param thePnt Ellipse center.
809 # @param theVec Vector, normal to the plane of the ellipse.
810 # @param theRMajor Major ellipse radius.
811 # @param theRMinor Minor ellipse radius.
812 # @param theVecMaj Vector, direction of the ellipse's main axis.
813 # @return New GEOM_Object, containing the created ellipse.
815 # @ref tui_creation_ellipse "Example"
816 def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None):
817 # Example: see GEOM_TestAll.py
818 theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
819 if theVecMaj is not None:
820 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
822 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
824 RaiseIfFailed("MakeEllipse", self.CurvesOp)
825 anObj.SetParameters(Parameters)
828 ## Create an ellipse with given radiuses.
829 # Center of the ellipse will be in the origin of global
830 # coordinate system and normal vector will be codirected with Z axis
831 # @param theRMajor Major ellipse radius.
832 # @param theRMinor Minor ellipse radius.
833 # @return New GEOM_Object, containing the created ellipse.
834 def MakeEllipseRR(self, theRMajor, theRMinor):
835 anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
836 RaiseIfFailed("MakeEllipse", self.CurvesOp)
839 ## Create a polyline on the set of points.
840 # @param thePoints Sequence of points for the polyline.
841 # @return New GEOM_Object, containing the created polyline.
843 # @ref tui_creation_curve "Example"
844 def MakePolyline(self,thePoints):
845 # Example: see GEOM_TestAll.py
846 anObj = self.CurvesOp.MakePolyline(thePoints)
847 RaiseIfFailed("MakePolyline", self.CurvesOp)
850 ## Create bezier curve on the set of points.
851 # @param thePoints Sequence of points for the bezier curve.
852 # @return New GEOM_Object, containing the created bezier curve.
854 # @ref tui_creation_curve "Example"
855 def MakeBezier(self,thePoints):
856 # Example: see GEOM_TestAll.py
857 anObj = self.CurvesOp.MakeSplineBezier(thePoints)
858 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
861 ## Create B-Spline curve on the set of points.
862 # @param thePoints Sequence of points for the B-Spline curve.
863 # @param theIsClosed If True, build a closed curve.
864 # @return New GEOM_Object, containing the created B-Spline curve.
866 # @ref tui_creation_curve "Example"
867 def MakeInterpol(self, thePoints, theIsClosed=False):
868 # Example: see GEOM_TestAll.py
869 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed)
870 RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
876 ## @addtogroup l3_sketcher
879 ## Create a sketcher (wire or face), following the textual description,
880 # passed through <VAR>theCommand</VAR> argument. \n
881 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
882 # Format of the description string have to be the following:
884 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
887 # - x1, y1 are coordinates of the first sketcher point (zero by default),
889 # - "R angle" : Set the direction by angle
890 # - "D dx dy" : Set the direction by DX & DY
893 # - "TT x y" : Create segment by point at X & Y
894 # - "T dx dy" : Create segment by point with DX & DY
895 # - "L length" : Create segment by direction & Length
896 # - "IX x" : Create segment by direction & Intersect. X
897 # - "IY y" : Create segment by direction & Intersect. Y
900 # - "C radius length" : Create arc by direction, radius and length(in degree)
903 # - "WW" : Close Wire (to finish)
904 # - "WF" : Close Wire and build face (to finish)
906 # @param theCommand String, defining the sketcher in local
907 # coordinates of the working plane.
908 # @param theWorkingPlane Nine double values, defining origin,
909 # OZ and OX directions of the working plane.
910 # @return New GEOM_Object, containing the created wire.
912 # @ref tui_sketcher_page "Example"
913 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0]):
914 # Example: see GEOM_TestAll.py
915 theCommand,Parameters = ParseSketcherCommand(theCommand)
916 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
917 RaiseIfFailed("MakeSketcher", self.CurvesOp)
918 anObj.SetParameters(Parameters)
921 ## Create a sketcher (wire or face), following the textual description,
922 # passed through <VAR>theCommand</VAR> argument. \n
923 # For format of the description string see the previous method.\n
924 # @param theCommand String, defining the sketcher in local
925 # coordinates of the working plane.
926 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
927 # @return New GEOM_Object, containing the created wire.
929 # @ref tui_sketcher_page "Example"
930 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane):
931 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
932 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
935 ## Create a sketcher wire, following the numerical description,
936 # passed through <VAR>theCoordinates</VAR> argument. \n
937 # @param theCoordinates double values, defining points to create a wire,
939 # @return New GEOM_Object, containing the created wire.
941 # @ref tui_sketcher_page "Example"
942 def Make3DSketcher(self, theCoordinates):
943 anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
944 RaiseIfFailed("Make3DSketcher", self.CurvesOp)
950 ## @addtogroup l3_3d_primitives
953 ## Create a box by coordinates of two opposite vertices.
955 # @ref tui_creation_box "Example"
956 def MakeBox(self,x1,y1,z1,x2,y2,z2):
957 # Example: see GEOM_TestAll.py
958 pnt1 = self.MakeVertex(x1,y1,z1)
959 pnt2 = self.MakeVertex(x2,y2,z2)
960 return self.MakeBoxTwoPnt(pnt1,pnt2)
962 ## Create a box with specified dimensions along the coordinate axes
963 # and with edges, parallel to the coordinate axes.
964 # Center of the box will be at point (DX/2, DY/2, DZ/2).
965 # @param theDX Length of Box edges, parallel to OX axis.
966 # @param theDY Length of Box edges, parallel to OY axis.
967 # @param theDZ Length of Box edges, parallel to OZ axis.
968 # @return New GEOM_Object, containing the created box.
970 # @ref tui_creation_box "Example"
971 def MakeBoxDXDYDZ(self,theDX, theDY, theDZ):
972 # Example: see GEOM_TestAll.py
973 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
974 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
975 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
976 anObj.SetParameters(Parameters)
979 ## Create a box with two specified opposite vertices,
980 # and with edges, parallel to the coordinate axes
981 # @param thePnt1 First of two opposite vertices.
982 # @param thePnt2 Second of two opposite vertices.
983 # @return New GEOM_Object, containing the created box.
985 # @ref tui_creation_box "Example"
986 def MakeBoxTwoPnt(self,thePnt1, thePnt2):
987 # Example: see GEOM_TestAll.py
988 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
989 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
992 ## Create a face with specified dimensions along OX-OY coordinate axes,
993 # with edges, parallel to this coordinate axes.
994 # @param theH height of Face.
995 # @param theW width of Face.
996 # @param theOrientation orientation belong axis OXY OYZ OZX
997 # @return New GEOM_Object, containing the created face.
999 # @ref tui_creation_face "Example"
1000 def MakeFaceHW(self,theH, theW, theOrientation):
1001 # Example: see GEOM_TestAll.py
1002 theH,theW,Parameters = ParseParameters(theH, theW)
1003 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
1004 RaiseIfFailed("MakeFaceHW", self.PrimOp)
1005 anObj.SetParameters(Parameters)
1008 ## Create a face from another plane and two sizes,
1009 # vertical size and horisontal size.
1010 # @param theObj Normale vector to the creating face or
1012 # @param theH Height (vertical size).
1013 # @param theW Width (horisontal size).
1014 # @return New GEOM_Object, containing the created face.
1016 # @ref tui_creation_face "Example"
1017 def MakeFaceObjHW(self, theObj, theH, theW):
1018 # Example: see GEOM_TestAll.py
1019 theH,theW,Parameters = ParseParameters(theH, theW)
1020 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
1021 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
1022 anObj.SetParameters(Parameters)
1025 ## Create a disk with given center, normal vector and radius.
1026 # @param thePnt Disk center.
1027 # @param theVec Vector, normal to the plane of the disk.
1028 # @param theR Disk radius.
1029 # @return New GEOM_Object, containing the created disk.
1031 # @ref tui_creation_disk "Example"
1032 def MakeDiskPntVecR(self,thePnt, theVec, theR):
1033 # Example: see GEOM_TestAll.py
1034 theR,Parameters = ParseParameters(theR)
1035 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
1036 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
1037 anObj.SetParameters(Parameters)
1040 ## Create a disk, passing through three given points
1041 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
1042 # @return New GEOM_Object, containing the created disk.
1044 # @ref tui_creation_disk "Example"
1045 def MakeDiskThreePnt(self,thePnt1, thePnt2, thePnt3):
1046 # Example: see GEOM_TestAll.py
1047 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
1048 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
1051 ## Create a disk with specified dimensions along OX-OY coordinate axes.
1052 # @param theR Radius of Face.
1053 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
1054 # @return New GEOM_Object, containing the created disk.
1056 # @ref tui_creation_face "Example"
1057 def MakeDiskR(self,theR, theOrientation):
1058 # Example: see GEOM_TestAll.py
1059 theR,Parameters = ParseParameters(theR)
1060 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
1061 RaiseIfFailed("MakeDiskR", self.PrimOp)
1062 anObj.SetParameters(Parameters)
1065 ## Create a cylinder with given base point, axis, radius and height.
1066 # @param thePnt Central point of cylinder base.
1067 # @param theAxis Cylinder axis.
1068 # @param theR Cylinder radius.
1069 # @param theH Cylinder height.
1070 # @return New GEOM_Object, containing the created cylinder.
1072 # @ref tui_creation_cylinder "Example"
1073 def MakeCylinder(self,thePnt, theAxis, theR, theH):
1074 # Example: see GEOM_TestAll.py
1075 theR,theH,Parameters = ParseParameters(theR, theH)
1076 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
1077 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
1078 anObj.SetParameters(Parameters)
1081 ## Create a cylinder with given radius and height at
1082 # the origin of coordinate system. Axis of the cylinder
1083 # will be collinear to the OZ axis of the coordinate system.
1084 # @param theR Cylinder radius.
1085 # @param theH Cylinder height.
1086 # @return New GEOM_Object, containing the created cylinder.
1088 # @ref tui_creation_cylinder "Example"
1089 def MakeCylinderRH(self,theR, theH):
1090 # Example: see GEOM_TestAll.py
1091 theR,theH,Parameters = ParseParameters(theR, theH)
1092 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
1093 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
1094 anObj.SetParameters(Parameters)
1097 ## Create a sphere with given center and radius.
1098 # @param thePnt Sphere center.
1099 # @param theR Sphere radius.
1100 # @return New GEOM_Object, containing the created sphere.
1102 # @ref tui_creation_sphere "Example"
1103 def MakeSpherePntR(self, thePnt, theR):
1104 # Example: see GEOM_TestAll.py
1105 theR,Parameters = ParseParameters(theR)
1106 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
1107 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
1108 anObj.SetParameters(Parameters)
1111 ## Create a sphere with given center and radius.
1112 # @param x,y,z Coordinates of sphere center.
1113 # @param theR Sphere radius.
1114 # @return New GEOM_Object, containing the created sphere.
1116 # @ref tui_creation_sphere "Example"
1117 def MakeSphere(self, x, y, z, theR):
1118 # Example: see GEOM_TestAll.py
1119 point = self.MakeVertex(x, y, z)
1120 anObj = self.MakeSpherePntR(point, theR)
1123 ## Create a sphere with given radius at the origin of coordinate system.
1124 # @param theR Sphere radius.
1125 # @return New GEOM_Object, containing the created sphere.
1127 # @ref tui_creation_sphere "Example"
1128 def MakeSphereR(self, theR):
1129 # Example: see GEOM_TestAll.py
1130 theR,Parameters = ParseParameters(theR)
1131 anObj = self.PrimOp.MakeSphereR(theR)
1132 RaiseIfFailed("MakeSphereR", self.PrimOp)
1133 anObj.SetParameters(Parameters)
1136 ## Create a cone with given base point, axis, height and radiuses.
1137 # @param thePnt Central point of the first cone base.
1138 # @param theAxis Cone axis.
1139 # @param theR1 Radius of the first cone base.
1140 # @param theR2 Radius of the second cone base.
1141 # \note If both radiuses are non-zero, the cone will be truncated.
1142 # \note If the radiuses are equal, a cylinder will be created instead.
1143 # @param theH Cone height.
1144 # @return New GEOM_Object, containing the created cone.
1146 # @ref tui_creation_cone "Example"
1147 def MakeCone(self,thePnt, theAxis, theR1, theR2, theH):
1148 # Example: see GEOM_TestAll.py
1149 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
1150 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
1151 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
1152 anObj.SetParameters(Parameters)
1155 ## Create a cone with given height and radiuses at
1156 # the origin of coordinate system. Axis of the cone will
1157 # be collinear to the OZ axis of the coordinate system.
1158 # @param theR1 Radius of the first cone base.
1159 # @param theR2 Radius of the second cone base.
1160 # \note If both radiuses are non-zero, the cone will be truncated.
1161 # \note If the radiuses are equal, a cylinder will be created instead.
1162 # @param theH Cone height.
1163 # @return New GEOM_Object, containing the created cone.
1165 # @ref tui_creation_cone "Example"
1166 def MakeConeR1R2H(self,theR1, theR2, theH):
1167 # Example: see GEOM_TestAll.py
1168 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
1169 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
1170 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
1171 anObj.SetParameters(Parameters)
1174 ## Create a torus with given center, normal vector and radiuses.
1175 # @param thePnt Torus central point.
1176 # @param theVec Torus axis of symmetry.
1177 # @param theRMajor Torus major radius.
1178 # @param theRMinor Torus minor radius.
1179 # @return New GEOM_Object, containing the created torus.
1181 # @ref tui_creation_torus "Example"
1182 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor):
1183 # Example: see GEOM_TestAll.py
1184 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
1185 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
1186 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
1187 anObj.SetParameters(Parameters)
1190 ## Create a torus with given radiuses at the origin of coordinate system.
1191 # @param theRMajor Torus major radius.
1192 # @param theRMinor Torus minor radius.
1193 # @return New GEOM_Object, containing the created torus.
1195 # @ref tui_creation_torus "Example"
1196 def MakeTorusRR(self, theRMajor, theRMinor):
1197 # Example: see GEOM_TestAll.py
1198 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
1199 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
1200 RaiseIfFailed("MakeTorusRR", self.PrimOp)
1201 anObj.SetParameters(Parameters)
1204 # end of l3_3d_primitives
1207 ## @addtogroup l3_complex
1210 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
1211 # @param theBase Base shape to be extruded.
1212 # @param thePoint1 First end of extrusion vector.
1213 # @param thePoint2 Second end of extrusion vector.
1214 # @return New GEOM_Object, containing the created prism.
1216 # @ref tui_creation_prism "Example"
1217 def MakePrism(self, theBase, thePoint1, thePoint2):
1218 # Example: see GEOM_TestAll.py
1219 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
1220 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
1223 ## Create a shape by extrusion of the base shape along the vector,
1224 # i.e. all the space, transfixed by the base shape during its translation
1225 # along the vector on the given distance.
1226 # @param theBase Base shape to be extruded.
1227 # @param theVec Direction of extrusion.
1228 # @param theH Prism dimension along theVec.
1229 # @return New GEOM_Object, containing the created prism.
1231 # @ref tui_creation_prism "Example"
1232 def MakePrismVecH(self, theBase, theVec, theH):
1233 # Example: see GEOM_TestAll.py
1234 theH,Parameters = ParseParameters(theH)
1235 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
1236 RaiseIfFailed("MakePrismVecH", self.PrimOp)
1237 anObj.SetParameters(Parameters)
1240 ## Create a shape by extrusion of the base shape along the vector,
1241 # i.e. all the space, transfixed by the base shape during its translation
1242 # along the vector on the given distance in 2 Ways (forward/backward) .
1243 # @param theBase Base shape to be extruded.
1244 # @param theVec Direction of extrusion.
1245 # @param theH Prism dimension along theVec in forward direction.
1246 # @return New GEOM_Object, containing the created prism.
1248 # @ref tui_creation_prism "Example"
1249 def MakePrismVecH2Ways(self, theBase, theVec, theH):
1250 # Example: see GEOM_TestAll.py
1251 theH,Parameters = ParseParameters(theH)
1252 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
1253 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
1254 anObj.SetParameters(Parameters)
1257 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
1258 # @param theBase Base shape to be extruded.
1259 # @param theDX, theDY, theDZ Directions of extrusion.
1260 # @return New GEOM_Object, containing the created prism.
1262 # @ref tui_creation_prism "Example"
1263 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ):
1264 # Example: see GEOM_TestAll.py
1265 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1266 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
1267 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
1268 anObj.SetParameters(Parameters)
1271 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
1272 # i.e. all the space, transfixed by the base shape during its translation
1273 # along the vector on the given distance in 2 Ways (forward/backward) .
1274 # @param theBase Base shape to be extruded.
1275 # @param theDX, theDY, theDZ Directions of extrusion.
1276 # @return New GEOM_Object, containing the created prism.
1278 # @ref tui_creation_prism "Example"
1279 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ):
1280 # Example: see GEOM_TestAll.py
1281 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1282 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
1283 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
1284 anObj.SetParameters(Parameters)
1287 ## Create a shape by revolution of the base shape around the axis
1288 # on the given angle, i.e. all the space, transfixed by the base
1289 # shape during its rotation around the axis on the given angle.
1290 # @param theBase Base shape to be rotated.
1291 # @param theAxis Rotation axis.
1292 # @param theAngle Rotation angle in radians.
1293 # @return New GEOM_Object, containing the created revolution.
1295 # @ref tui_creation_revolution "Example"
1296 def MakeRevolution(self, theBase, theAxis, theAngle):
1297 # Example: see GEOM_TestAll.py
1298 theAngle,Parameters = ParseParameters(theAngle)
1299 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
1300 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
1301 anObj.SetParameters(Parameters)
1304 ## The Same Revolution but in both ways forward&backward.
1305 def MakeRevolution2Ways(self, theBase, theAxis, theAngle):
1306 theAngle,Parameters = ParseParameters(theAngle)
1307 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
1308 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
1309 anObj.SetParameters(Parameters)
1312 ## Create a filling from the given compound of contours.
1313 # @param theShape the compound of contours
1314 # @param theMinDeg a minimal degree of BSpline surface to create
1315 # @param theMaxDeg a maximal degree of BSpline surface to create
1316 # @param theTol2D a 2d tolerance to be reached
1317 # @param theTol3D a 3d tolerance to be reached
1318 # @param theNbIter a number of iteration of approximation algorithm
1319 # @param isApprox if True, BSpline curves are generated in the process
1320 # of surface construction. By default it is False, that means
1321 # the surface is created using Besier curves. The usage of
1322 # Approximation makes the algorithm work slower, but allows
1323 # building the surface for rather complex cases
1324 # @return New GEOM_Object, containing the created filling surface.
1326 # @ref tui_creation_filling "Example"
1327 def MakeFilling(self, theShape, theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter, isApprox=0):
1328 # Example: see GEOM_TestAll.py
1329 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg,
1330 theTol2D, theTol3D, theNbIter)
1331 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
1332 theTol2D, theTol3D, theNbIter, isApprox)
1333 RaiseIfFailed("MakeFilling", self.PrimOp)
1334 anObj.SetParameters(Parameters)
1337 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
1338 # @param theSeqSections - set of specified sections.
1339 # @param theModeSolid - mode defining building solid or shell
1340 # @param thePreci - precision 3D used for smoothing by default 1.e-6
1341 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
1342 # @return New GEOM_Object, containing the created shell or solid.
1344 # @ref swig_todo "Example"
1345 def MakeThruSections(self,theSeqSections,theModeSolid,thePreci,theRuled):
1346 # Example: see GEOM_TestAll.py
1347 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
1348 RaiseIfFailed("MakeThruSections", self.PrimOp)
1351 ## Create a shape by extrusion of the base shape along
1352 # the path shape. The path shape can be a wire or an edge.
1353 # @param theBase Base shape to be extruded.
1354 # @param thePath Path shape to extrude the base shape along it.
1355 # @return New GEOM_Object, containing the created pipe.
1357 # @ref tui_creation_pipe "Example"
1358 def MakePipe(self,theBase, thePath):
1359 # Example: see GEOM_TestAll.py
1360 anObj = self.PrimOp.MakePipe(theBase, thePath)
1361 RaiseIfFailed("MakePipe", self.PrimOp)
1364 ## Create a shape by extrusion of the profile shape along
1365 # the path shape. The path shape can be a wire or an edge.
1366 # the several profiles can be specified in the several locations of path.
1367 # @param theSeqBases - list of Bases shape to be extruded.
1368 # @param theLocations - list of locations on the path corresponding
1369 # specified list of the Bases shapes. Number of locations
1370 # should be equal to number of bases or list of locations can be empty.
1371 # @param thePath - Path shape to extrude the base shape along it.
1372 # @param theWithContact - the mode defining that the section is translated to be in
1373 # contact with the spine.
1374 # @param theWithCorrection - defining that the section is rotated to be
1375 # orthogonal to the spine tangent in the correspondent point
1376 # @return New GEOM_Object, containing the created pipe.
1378 # @ref tui_creation_pipe_with_diff_sec "Example"
1379 def MakePipeWithDifferentSections(self, theSeqBases,
1380 theLocations, thePath,
1381 theWithContact, theWithCorrection):
1382 anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
1383 theLocations, thePath,
1384 theWithContact, theWithCorrection)
1385 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
1388 ## Create a shape by extrusion of the profile shape along
1389 # the path shape. The path shape can be a wire or a edge.
1390 # the several profiles can be specified in the several locations of path.
1391 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
1392 # shell or face. If number of faces in neighbour sections
1393 # aren't coincided result solid between such sections will
1394 # be created using external boundaries of this shells.
1395 # @param theSeqSubBases - list of corresponding subshapes of section shapes.
1396 # This list is used for searching correspondences between
1397 # faces in the sections. Size of this list must be equal
1398 # to size of list of base shapes.
1399 # @param theLocations - list of locations on the path corresponding
1400 # specified list of the Bases shapes. Number of locations
1401 # should be equal to number of bases. First and last
1402 # locations must be coincided with first and last vertexes
1403 # of path correspondingly.
1404 # @param thePath - Path shape to extrude the base shape along it.
1405 # @param theWithContact - the mode defining that the section is translated to be in
1406 # contact with the spine.
1407 # @param theWithCorrection - defining that the section is rotated to be
1408 # orthogonal to the spine tangent in the correspondent point
1409 # @return New GEOM_Object, containing the created solids.
1411 # @ref tui_creation_pipe_with_shell_sec "Example"
1412 def MakePipeWithShellSections(self,theSeqBases, theSeqSubBases,
1413 theLocations, thePath,
1414 theWithContact, theWithCorrection):
1415 anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
1416 theLocations, thePath,
1417 theWithContact, theWithCorrection)
1418 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
1421 ## Create a shape by extrusion of the profile shape along
1422 # the path shape. This function is used only for debug pipe
1423 # functionality - it is a version of previous function
1424 # (MakePipeWithShellSections(...)) which give a possibility to
1425 # recieve information about creating pipe between each pair of
1426 # sections step by step.
1427 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
1428 theLocations, thePath,
1429 theWithContact, theWithCorrection):
1431 nbsect = len(theSeqBases)
1432 nbsubsect = len(theSeqSubBases)
1433 #print "nbsect = ",nbsect
1434 for i in range(1,nbsect):
1436 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
1437 tmpLocations = [ theLocations[i-1], theLocations[i] ]
1439 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
1440 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
1441 tmpLocations, thePath,
1442 theWithContact, theWithCorrection)
1443 if self.PrimOp.IsDone() == 0:
1444 print "Problems with pipe creation between ",i," and ",i+1," sections"
1445 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
1448 print "Pipe between ",i," and ",i+1," sections is OK"
1453 resc = self.MakeCompound(res)
1454 #resc = self.MakeSewing(res, 0.001)
1455 #print "resc: ",resc
1458 ## Create solids between given sections
1459 # @param theSeqBases - list of sections (shell or face).
1460 # @param theLocations - list of corresponding vertexes
1461 # @return New GEOM_Object, containing the created solids.
1463 # @ref tui_creation_pipe_without_path "Example"
1464 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations):
1465 anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
1466 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
1469 ## Create a shape by extrusion of the base shape along
1470 # the path shape with constant bi-normal direction along the given vector.
1471 # The path shape can be a wire or an edge.
1472 # @param theBase Base shape to be extruded.
1473 # @param thePath Path shape to extrude the base shape along it.
1474 # @param theVec Vector defines a constant binormal direction to keep the
1475 # same angle beetween the direction and the sections
1476 # along the sweep surface.
1477 # @return New GEOM_Object, containing the created pipe.
1479 # @ref tui_creation_pipe "Example"
1480 def MakePipeBiNormalAlongVector(self,theBase, thePath, theVec):
1481 # Example: see GEOM_TestAll.py
1482 anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
1483 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
1489 ## @addtogroup l3_advanced
1492 ## Create a linear edge with specified ends.
1493 # @param thePnt1 Point for the first end of edge.
1494 # @param thePnt2 Point for the second end of edge.
1495 # @return New GEOM_Object, containing the created edge.
1497 # @ref tui_creation_edge "Example"
1498 def MakeEdge(self,thePnt1, thePnt2):
1499 # Example: see GEOM_TestAll.py
1500 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
1501 RaiseIfFailed("MakeEdge", self.ShapesOp)
1504 ## Create a wire from the set of edges and wires.
1505 # @param theEdgesAndWires List of edges and/or wires.
1506 # @param theTolerance Maximum distance between vertices, that will be merged.
1507 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
1508 # @return New GEOM_Object, containing the created wire.
1510 # @ref tui_creation_wire "Example"
1511 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07):
1512 # Example: see GEOM_TestAll.py
1513 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
1514 RaiseIfFailed("MakeWire", self.ShapesOp)
1517 ## Create a face on the given wire.
1518 # @param theWire closed Wire or Edge to build the face on.
1519 # @param isPlanarWanted If TRUE, only planar face will be built.
1520 # If impossible, NULL object will be returned.
1521 # @return New GEOM_Object, containing the created face.
1523 # @ref tui_creation_face "Example"
1524 def MakeFace(self,theWire, isPlanarWanted):
1525 # Example: see GEOM_TestAll.py
1526 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
1527 RaiseIfFailed("MakeFace", self.ShapesOp)
1530 ## Create a face on the given wires set.
1531 # @param theWires List of closed wires or edges to build the face on.
1532 # @param isPlanarWanted If TRUE, only planar face will be built.
1533 # If impossible, NULL object will be returned.
1534 # @return New GEOM_Object, containing the created face.
1536 # @ref tui_creation_face "Example"
1537 def MakeFaceWires(self,theWires, isPlanarWanted):
1538 # Example: see GEOM_TestAll.py
1539 anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
1540 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
1543 ## Shortcut to MakeFaceWires()
1545 # @ref tui_creation_face "Example 1"
1546 # \n @ref swig_MakeFaces "Example 2"
1547 def MakeFaces(self,theWires, isPlanarWanted):
1548 # Example: see GEOM_TestOthers.py
1549 anObj = self.MakeFaceWires(theWires, isPlanarWanted)
1552 ## Create a shell from the set of faces and shells.
1553 # @param theFacesAndShells List of faces and/or shells.
1554 # @return New GEOM_Object, containing the created shell.
1556 # @ref tui_creation_shell "Example"
1557 def MakeShell(self,theFacesAndShells):
1558 # Example: see GEOM_TestAll.py
1559 anObj = self.ShapesOp.MakeShell(theFacesAndShells)
1560 RaiseIfFailed("MakeShell", self.ShapesOp)
1563 ## Create a solid, bounded by the given shells.
1564 # @param theShells Sequence of bounding shells.
1565 # @return New GEOM_Object, containing the created solid.
1567 # @ref tui_creation_solid "Example"
1568 def MakeSolid(self,theShells):
1569 # Example: see GEOM_TestAll.py
1570 anObj = self.ShapesOp.MakeSolidShells(theShells)
1571 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
1574 ## Create a compound of the given shapes.
1575 # @param theShapes List of shapes to put in compound.
1576 # @return New GEOM_Object, containing the created compound.
1578 # @ref tui_creation_compound "Example"
1579 def MakeCompound(self,theShapes):
1580 # Example: see GEOM_TestAll.py
1581 anObj = self.ShapesOp.MakeCompound(theShapes)
1582 RaiseIfFailed("MakeCompound", self.ShapesOp)
1585 # end of l3_advanced
1588 ## @addtogroup l2_measure
1591 ## Gives quantity of faces in the given shape.
1592 # @param theShape Shape to count faces of.
1593 # @return Quantity of faces.
1595 # @ref swig_NumberOf "Example"
1596 def NumberOfFaces(self, theShape):
1597 # Example: see GEOM_TestOthers.py
1598 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
1599 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
1602 ## Gives quantity of edges in the given shape.
1603 # @param theShape Shape to count edges of.
1604 # @return Quantity of edges.
1606 # @ref swig_NumberOf "Example"
1607 def NumberOfEdges(self, theShape):
1608 # Example: see GEOM_TestOthers.py
1609 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
1610 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
1613 ## Gives quantity of subshapes of type theShapeType in the given shape.
1614 # @param theShape Shape to count subshapes of.
1615 # @param theShapeType Type of subshapes to count.
1616 # @return Quantity of subshapes of given type.
1618 # @ref swig_NumberOf "Example"
1619 def NumberOfSubShapes(self, theShape, theShapeType):
1620 # Example: see GEOM_TestOthers.py
1621 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
1622 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
1625 ## Gives quantity of solids in the given shape.
1626 # @param theShape Shape to count solids in.
1627 # @return Quantity of solids.
1629 # @ref swig_NumberOf "Example"
1630 def NumberOfSolids(self, theShape):
1631 # Example: see GEOM_TestOthers.py
1632 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, ShapeType["SOLID"])
1633 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
1639 ## @addtogroup l3_healing
1642 ## Reverses an orientation the given shape.
1643 # @param theShape Shape to be reversed.
1644 # @return The reversed copy of theShape.
1646 # @ref swig_ChangeOrientation "Example"
1647 def ChangeOrientation(self,theShape):
1648 # Example: see GEOM_TestAll.py
1649 anObj = self.ShapesOp.ChangeOrientation(theShape)
1650 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
1653 ## Shortcut to ChangeOrientation()
1655 # @ref swig_OrientationChange "Example"
1656 def OrientationChange(self,theShape):
1657 # Example: see GEOM_TestOthers.py
1658 anObj = self.ChangeOrientation(theShape)
1664 ## @addtogroup l4_obtain
1667 ## Retrieve all free faces from the given shape.
1668 # Free face is a face, which is not shared between two shells of the shape.
1669 # @param theShape Shape to find free faces in.
1670 # @return List of IDs of all free faces, contained in theShape.
1672 # @ref tui_measurement_tools_page "Example"
1673 def GetFreeFacesIDs(self,theShape):
1674 # Example: see GEOM_TestOthers.py
1675 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
1676 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
1679 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
1680 # @param theShape1 Shape to find sub-shapes in.
1681 # @param theShape2 Shape to find shared sub-shapes with.
1682 # @param theShapeType Type of sub-shapes to be retrieved.
1683 # @return List of sub-shapes of theShape1, shared with theShape2.
1685 # @ref swig_GetSharedShapes "Example"
1686 def GetSharedShapes(self,theShape1, theShape2, theShapeType):
1687 # Example: see GEOM_TestOthers.py
1688 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
1689 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
1692 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
1693 # situated relatively the specified plane by the certain way,
1694 # defined through <VAR>theState</VAR> parameter.
1695 # @param theShape Shape to find sub-shapes of.
1696 # @param theShapeType Type of sub-shapes to be retrieved.
1697 # @param theAx1 Vector (or line, or linear edge), specifying normal
1698 # direction and location of the plane to find shapes on.
1699 # @param theState The state of the subshapes to find. It can be one of
1700 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1701 # @return List of all found sub-shapes.
1703 # @ref swig_GetShapesOnPlane "Example"
1704 def GetShapesOnPlane(self,theShape, theShapeType, theAx1, theState):
1705 # Example: see GEOM_TestOthers.py
1706 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
1707 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
1710 ## Works like the above method, but returns list of sub-shapes indices
1712 # @ref swig_GetShapesOnPlaneIDs "Example"
1713 def GetShapesOnPlaneIDs(self,theShape, theShapeType, theAx1, theState):
1714 # Example: see GEOM_TestOthers.py
1715 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
1716 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
1719 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
1720 # situated relatively the specified plane by the certain way,
1721 # defined through <VAR>theState</VAR> parameter.
1722 # @param theShape Shape to find sub-shapes of.
1723 # @param theShapeType Type of sub-shapes to be retrieved.
1724 # @param theAx1 Vector (or line, or linear edge), specifying normal
1725 # direction of the plane to find shapes on.
1726 # @param thePnt Point specifying location of the plane to find shapes on.
1727 # @param theState The state of the subshapes to find. It can be one of
1728 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1729 # @return List of all found sub-shapes.
1731 # @ref swig_GetShapesOnPlaneWithLocation "Example"
1732 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState):
1733 # Example: see GEOM_TestOthers.py
1734 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
1735 theAx1, thePnt, theState)
1736 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
1739 ## Works like the above method, but returns list of sub-shapes indices
1741 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
1742 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
1743 # Example: see GEOM_TestOthers.py
1744 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
1745 theAx1, thePnt, theState)
1746 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
1749 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1750 # the specified cylinder by the certain way, defined through \a theState parameter.
1751 # @param theShape Shape to find sub-shapes of.
1752 # @param theShapeType Type of sub-shapes to be retrieved.
1753 # @param theAxis Vector (or line, or linear edge), specifying
1754 # axis of the cylinder to find shapes on.
1755 # @param theRadius Radius of the cylinder to find shapes on.
1756 # @param theState The state of the subshapes to find. It can be one of
1757 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1758 # @return List of all found sub-shapes.
1760 # @ref swig_GetShapesOnCylinder "Example"
1761 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState):
1762 # Example: see GEOM_TestOthers.py
1763 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
1764 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
1767 ## Works like the above method, but returns list of sub-shapes indices
1769 # @ref swig_GetShapesOnCylinderIDs "Example"
1770 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
1771 # Example: see GEOM_TestOthers.py
1772 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
1773 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
1776 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1777 # the specified cylinder by the certain way, defined through \a theState parameter.
1778 # @param theShape Shape to find sub-shapes of.
1779 # @param theShapeType Type of sub-shapes to be retrieved.
1780 # @param theAxis Vector (or line, or linear edge), specifying
1781 # axis of the cylinder to find shapes on.
1782 # @param thePnt Point specifying location of the bottom of the cylinder.
1783 # @param theRadius Radius of the cylinder to find shapes on.
1784 # @param theState The state of the subshapes to find. It can be one of
1785 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1786 # @return List of all found sub-shapes.
1788 # @ref swig_GetShapesOnCylinderWithLocation "Example"
1789 def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
1790 # Example: see GEOM_TestOthers.py
1791 aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
1792 RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
1795 ## Works like the above method, but returns list of sub-shapes indices
1797 # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
1798 def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
1799 # Example: see GEOM_TestOthers.py
1800 aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
1801 RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
1804 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1805 # the specified sphere by the certain way, defined through \a theState parameter.
1806 # @param theShape Shape to find sub-shapes of.
1807 # @param theShapeType Type of sub-shapes to be retrieved.
1808 # @param theCenter Point, specifying center of the sphere to find shapes on.
1809 # @param theRadius Radius of the sphere 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_GetShapesOnSphere "Example"
1815 def GetShapesOnSphere(self,theShape, theShapeType, theCenter, theRadius, theState):
1816 # Example: see GEOM_TestOthers.py
1817 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
1818 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
1821 ## Works like the above method, but returns list of sub-shapes indices
1823 # @ref swig_GetShapesOnSphereIDs "Example"
1824 def GetShapesOnSphereIDs(self,theShape, theShapeType, theCenter, theRadius, theState):
1825 # Example: see GEOM_TestOthers.py
1826 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
1827 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
1830 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1831 # the specified quadrangle 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 theTopLeftPoint Point, specifying top left corner of a quadrangle
1835 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
1836 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
1837 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
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_GetShapesOnQuadrangle "Example"
1843 def GetShapesOnQuadrangle(self, theShape, theShapeType,
1844 theTopLeftPoint, theTopRigthPoint,
1845 theBottomLeftPoint, theBottomRigthPoint, theState):
1846 # Example: see GEOM_TestOthers.py
1847 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
1848 theTopLeftPoint, theTopRigthPoint,
1849 theBottomLeftPoint, theBottomRigthPoint, theState)
1850 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
1853 ## Works like the above method, but returns list of sub-shapes indices
1855 # @ref swig_GetShapesOnQuadrangleIDs "Example"
1856 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
1857 theTopLeftPoint, theTopRigthPoint,
1858 theBottomLeftPoint, theBottomRigthPoint, theState):
1859 # Example: see GEOM_TestOthers.py
1860 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
1861 theTopLeftPoint, theTopRigthPoint,
1862 theBottomLeftPoint, theBottomRigthPoint, theState)
1863 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
1866 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1867 # the specified \a theBox by the certain way, defined through \a theState parameter.
1868 # @param theBox Shape for relative comparing.
1869 # @param theShape Shape to find sub-shapes of.
1870 # @param theShapeType Type of sub-shapes to be retrieved.
1871 # @param theState The state of the subshapes to find. It can be one of
1872 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1873 # @return List of all found sub-shapes.
1875 # @ref swig_GetShapesOnBox "Example"
1876 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState):
1877 # Example: see GEOM_TestOthers.py
1878 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
1879 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
1882 ## Works like the above method, but returns list of sub-shapes indices
1884 # @ref swig_GetShapesOnBoxIDs "Example"
1885 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
1886 # Example: see GEOM_TestOthers.py
1887 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
1888 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
1891 ## Find in \a theShape all sub-shapes of type \a theShapeType,
1892 # situated relatively the specified \a theCheckShape by the
1893 # certain way, defined through \a theState parameter.
1894 # @param theCheckShape Shape for relative comparing.
1895 # @param theShape Shape to find sub-shapes of.
1896 # @param theShapeType Type of sub-shapes to be retrieved.
1897 # @param theState The state of the subshapes to find. It can be one of
1898 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1899 # @return List of all found sub-shapes.
1901 # @ref swig_GetShapesOnShape "Example"
1902 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState):
1903 # Example: see GEOM_TestOthers.py
1904 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
1905 theShapeType, theState)
1906 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
1909 ## Works like the above method, but returns result as compound
1911 # @ref swig_GetShapesOnShapeAsCompound "Example"
1912 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState):
1913 # Example: see GEOM_TestOthers.py
1914 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
1915 theShapeType, theState)
1916 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
1919 ## Works like the above method, but returns list of sub-shapes indices
1921 # @ref swig_GetShapesOnShapeIDs "Example"
1922 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
1923 # Example: see GEOM_TestOthers.py
1924 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
1925 theShapeType, theState)
1926 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
1929 ## Get sub-shape(s) of theShapeWhere, which are
1930 # coincident with \a theShapeWhat or could be a part of it.
1931 # @param theShapeWhere Shape to find sub-shapes of.
1932 # @param theShapeWhat Shape, specifying what to find.
1933 # @return Group of all found sub-shapes or a single found sub-shape.
1935 # @ref swig_GetInPlace "Example"
1936 def GetInPlace(self,theShapeWhere, theShapeWhat):
1937 # Example: see GEOM_TestOthers.py
1938 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
1939 RaiseIfFailed("GetInPlace", self.ShapesOp)
1942 ## Get sub-shape(s) of \a theShapeWhere, which are
1943 # coincident with \a theShapeWhat or could be a part of it.
1945 # Implementation of this method is based on a saved history of an operation,
1946 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
1947 # arguments (an argument shape or a sub-shape of an argument shape).
1948 # The operation could be the Partition or one of boolean operations,
1949 # performed on simple shapes (not on compounds).
1951 # @param theShapeWhere Shape to find sub-shapes of.
1952 # @param theShapeWhat Shape, specifying what to find (must be in the
1953 # building history of the ShapeWhere).
1954 # @return Group of all found sub-shapes or a single found sub-shape.
1956 # @ref swig_GetInPlace "Example"
1957 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat):
1958 # Example: see GEOM_TestOthers.py
1959 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
1960 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
1963 ## Get sub-shape of theShapeWhere, which is
1964 # equal to \a theShapeWhat.
1965 # @param theShapeWhere Shape to find sub-shape of.
1966 # @param theShapeWhat Shape, specifying what to find.
1967 # @return New GEOM_Object for found sub-shape.
1969 # @ref swig_GetSame "Example"
1970 def GetSame(self,theShapeWhere, theShapeWhat):
1971 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
1972 RaiseIfFailed("GetSame", self.ShapesOp)
1978 ## @addtogroup l4_access
1981 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
1982 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
1984 # @ref swig_all_decompose "Example"
1985 def GetSubShape(self, aShape, ListOfID):
1986 # Example: see GEOM_TestAll.py
1987 anObj = self.AddSubShape(aShape,ListOfID)
1990 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
1992 # @ref swig_all_decompose "Example"
1993 def GetSubShapeID(self, aShape, aSubShape):
1994 # Example: see GEOM_TestAll.py
1995 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
1996 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
2002 ## @addtogroup l4_decompose
2005 ## Explode a shape on subshapes of a given type.
2006 # @param aShape Shape to be exploded.
2007 # @param aType Type of sub-shapes to be retrieved.
2008 # @return List of sub-shapes of type theShapeType, contained in theShape.
2010 # @ref swig_all_decompose "Example"
2011 def SubShapeAll(self, aShape, aType):
2012 # Example: see GEOM_TestAll.py
2013 ListObj = self.ShapesOp.MakeExplode(aShape,aType,0)
2014 RaiseIfFailed("MakeExplode", self.ShapesOp)
2017 ## Explode a shape on subshapes of a given type.
2018 # @param aShape Shape to be exploded.
2019 # @param aType Type of sub-shapes to be retrieved.
2020 # @return List of IDs of sub-shapes.
2022 # @ref swig_all_decompose "Example"
2023 def SubShapeAllIDs(self, aShape, aType):
2024 ListObj = self.ShapesOp.SubShapeAllIDs(aShape,aType,0)
2025 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
2028 ## Explode a shape on subshapes of a given type.
2029 # Sub-shapes will be sorted by coordinates of their gravity centers.
2030 # @param aShape Shape to be exploded.
2031 # @param aType Type of sub-shapes to be retrieved.
2032 # @return List of sub-shapes of type theShapeType, contained in theShape.
2034 # @ref swig_SubShapeAllSorted "Example"
2035 def SubShapeAllSorted(self, aShape, aType):
2036 # Example: see GEOM_TestAll.py
2037 ListObj = self.ShapesOp.MakeExplode(aShape,aType,1)
2038 RaiseIfFailed("MakeExplode", self.ShapesOp)
2041 ## Explode a shape on subshapes of a given type.
2042 # Sub-shapes will be sorted by coordinates of their gravity centers.
2043 # @param aShape Shape to be exploded.
2044 # @param aType Type of sub-shapes to be retrieved.
2045 # @return List of IDs of sub-shapes.
2047 # @ref swig_all_decompose "Example"
2048 def SubShapeAllSortedIDs(self, aShape, aType):
2049 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape,aType,1)
2050 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
2053 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
2054 # selected by they indices in list of all sub-shapes of type <VAR>aType</VAR>.
2055 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
2057 # @ref swig_all_decompose "Example"
2058 def SubShape(self, aShape, aType, ListOfInd):
2059 # Example: see GEOM_TestAll.py
2061 AllShapeList = self.SubShapeAll(aShape, aType)
2062 for ind in ListOfInd:
2063 ListOfIDs.append(self.GetSubShapeID(aShape, AllShapeList[ind - 1]))
2064 anObj = self.GetSubShape(aShape, ListOfIDs)
2067 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
2068 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
2069 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
2071 # @ref swig_all_decompose "Example"
2072 def SubShapeSorted(self,aShape, aType, ListOfInd):
2073 # Example: see GEOM_TestAll.py
2075 AllShapeList = self.SubShapeAllSorted(aShape, aType)
2076 for ind in ListOfInd:
2077 ListOfIDs.append(self.GetSubShapeID(aShape, AllShapeList[ind - 1]))
2078 anObj = self.GetSubShape(aShape, ListOfIDs)
2081 # end of l4_decompose
2084 ## @addtogroup l3_healing
2087 ## Apply a sequence of Shape Healing operators to the given object.
2088 # @param theShape Shape to be processed.
2089 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
2090 # @param theParameters List of names of parameters
2091 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
2092 # @param theValues List of values of parameters, in the same order
2093 # as parameters are listed in <VAR>theParameters</VAR> list.
2094 # @return New GEOM_Object, containing processed shape.
2096 # @ref tui_shape_processing "Example"
2097 def ProcessShape(self,theShape, theOperators, theParameters, theValues):
2098 # Example: see GEOM_TestHealing.py
2099 theValues,Parameters = ParseList(theValues)
2100 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
2101 RaiseIfFailed("ProcessShape", self.HealOp)
2102 for string in (theOperators + theParameters):
2103 Parameters = ":" + Parameters
2105 anObj.SetParameters(Parameters)
2108 ## Remove faces from the given object (shape).
2109 # @param theObject Shape to be processed.
2110 # @param theFaces Indices of faces to be removed, if EMPTY then the method
2111 # removes ALL faces of the given object.
2112 # @return New GEOM_Object, containing processed shape.
2114 # @ref tui_suppress_faces "Example"
2115 def SuppressFaces(self,theObject, theFaces):
2116 # Example: see GEOM_TestHealing.py
2117 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
2118 RaiseIfFailed("SuppressFaces", self.HealOp)
2121 ## Sewing of some shapes into single shape.
2123 # @ref tui_sewing "Example"
2124 def MakeSewing(self, ListShape, theTolerance):
2125 # Example: see GEOM_TestHealing.py
2126 comp = self.MakeCompound(ListShape)
2127 anObj = self.Sew(comp, theTolerance)
2130 ## Sewing of the given object.
2131 # @param theObject Shape to be processed.
2132 # @param theTolerance Required tolerance value.
2133 # @return New GEOM_Object, containing processed shape.
2134 def Sew(self, theObject, theTolerance):
2135 # Example: see MakeSewing() above
2136 theTolerance,Parameters = ParseParameters(theTolerance)
2137 anObj = self.HealOp.Sew(theObject, theTolerance)
2138 RaiseIfFailed("Sew", self.HealOp)
2139 anObj.SetParameters(Parameters)
2142 ## Remove internal wires and edges from the given object (face).
2143 # @param theObject Shape to be processed.
2144 # @param theWires Indices of wires to be removed, if EMPTY then the method
2145 # removes ALL internal wires of the given object.
2146 # @return New GEOM_Object, containing processed shape.
2148 # @ref tui_suppress_internal_wires "Example"
2149 def SuppressInternalWires(self,theObject, theWires):
2150 # Example: see GEOM_TestHealing.py
2151 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
2152 RaiseIfFailed("RemoveIntWires", self.HealOp)
2155 ## Remove internal closed contours (holes) from the given object.
2156 # @param theObject Shape to be processed.
2157 # @param theWires Indices of wires to be removed, if EMPTY then the method
2158 # removes ALL internal holes of the given object
2159 # @return New GEOM_Object, containing processed shape.
2161 # @ref tui_suppress_holes "Example"
2162 def SuppressHoles(self,theObject, theWires):
2163 # Example: see GEOM_TestHealing.py
2164 anObj = self.HealOp.FillHoles(theObject, theWires)
2165 RaiseIfFailed("FillHoles", self.HealOp)
2168 ## Close an open wire.
2169 # @param theObject Shape to be processed.
2170 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
2171 # if -1, then <VAR>theObject</VAR> itself is a wire.
2172 # @param isCommonVertex If TRUE : closure by creation of a common vertex,
2173 # If FALS : closure by creation of an edge between ends.
2174 # @return New GEOM_Object, containing processed shape.
2176 # @ref tui_close_contour "Example"
2177 def CloseContour(self,theObject, theWires, isCommonVertex):
2178 # Example: see GEOM_TestHealing.py
2179 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
2180 RaiseIfFailed("CloseContour", self.HealOp)
2183 ## Addition of a point to a given edge object.
2184 # @param theObject Shape to be processed.
2185 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
2186 # if -1, then theObject itself is the edge.
2187 # @param theValue Value of parameter on edge or length parameter,
2188 # depending on \a isByParameter.
2189 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1],
2190 # if FALSE : \a theValue is treated as a length parameter [0..1]
2191 # @return New GEOM_Object, containing processed shape.
2193 # @ref tui_add_point_on_edge "Example"
2194 def DivideEdge(self,theObject, theEdgeIndex, theValue, isByParameter):
2195 # Example: see GEOM_TestHealing.py
2196 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
2197 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
2198 RaiseIfFailed("DivideEdge", self.HealOp)
2199 anObj.SetParameters(Parameters)
2202 ## Change orientation of the given object. Updates given shape.
2203 # @param theObject Shape to be processed.
2205 # @ref swig_todo "Example"
2206 def ChangeOrientationShell(self,theObject):
2207 theObject = self.HealOp.ChangeOrientation(theObject)
2208 RaiseIfFailed("ChangeOrientation", self.HealOp)
2211 ## Change orientation of the given object.
2212 # @param theObject Shape to be processed.
2213 # @return New GEOM_Object, containing processed shape.
2215 # @ref swig_todo "Example"
2216 def ChangeOrientationShellCopy(self,theObject):
2217 anObj = self.HealOp.ChangeOrientationCopy(theObject)
2218 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
2221 ## Get a list of wires (wrapped in GEOM_Object-s),
2222 # that constitute a free boundary of the given shape.
2223 # @param theObject Shape to get free boundary of.
2224 # @return [status, theClosedWires, theOpenWires]
2225 # status: FALSE, if an error(s) occured during the method execution.
2226 # theClosedWires: Closed wires on the free boundary of the given shape.
2227 # theOpenWires: Open wires on the free boundary of the given shape.
2229 # @ref tui_measurement_tools_page "Example"
2230 def GetFreeBoundary(self,theObject):
2231 # Example: see GEOM_TestHealing.py
2232 anObj = self.HealOp.GetFreeBoundary(theObject)
2233 RaiseIfFailed("GetFreeBoundary", self.HealOp)
2236 ## Replace coincident faces in theShape by one face.
2237 # @param theShape Initial shape.
2238 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
2239 # @param doKeepNonSolids If FALSE, only solids will present in the result,
2240 # otherwise all initial shapes.
2241 # @return New GEOM_Object, containing a copy of theShape without coincident faces.
2243 # @ref tui_glue_faces "Example"
2244 def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True):
2245 # Example: see GEOM_Spanner.py
2246 theTolerance,Parameters = ParseParameters(theTolerance)
2247 anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
2249 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
2250 anObj.SetParameters(Parameters)
2253 ## Find coincident faces in theShape for possible gluing.
2254 # @param theShape Initial shape.
2255 # @param theTolerance Maximum distance between faces,
2256 # which can be considered as coincident.
2259 # @ref swig_todo "Example"
2260 def GetGlueFaces(self, theShape, theTolerance):
2261 # Example: see GEOM_Spanner.py
2262 anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
2263 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
2266 ## Replace coincident faces in theShape by one face
2267 # in compliance with given list of faces
2268 # @param theShape Initial shape.
2269 # @param theTolerance Maximum distance between faces,
2270 # which can be considered as coincident.
2271 # @param theFaces List of faces for gluing.
2272 # @param doKeepNonSolids If FALSE, only solids will present in the result,
2273 # otherwise all initial shapes.
2274 # @return New GEOM_Object, containing a copy of theShape
2275 # without some faces.
2277 # @ref swig_todo "Example"
2278 def MakeGlueFacesByList(self, theShape, theTolerance, theFaces, doKeepNonSolids=True):
2279 # Example: see GEOM_Spanner.py
2280 anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces, doKeepNonSolids)
2282 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
2288 ## @addtogroup l3_boolean Boolean Operations
2291 # -----------------------------------------------------------------------------
2292 # Boolean (Common, Cut, Fuse, Section)
2293 # -----------------------------------------------------------------------------
2295 ## Perform one of boolean operations on two given shapes.
2296 # @param theShape1 First argument for boolean operation.
2297 # @param theShape2 Second argument for boolean operation.
2298 # @param theOperation Indicates the operation to be done:
2299 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
2300 # @return New GEOM_Object, containing the result shape.
2302 # @ref tui_fuse "Example"
2303 def MakeBoolean(self,theShape1, theShape2, theOperation):
2304 # Example: see GEOM_TestAll.py
2305 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation)
2306 RaiseIfFailed("MakeBoolean", self.BoolOp)
2309 ## Shortcut to MakeBoolean(s1, s2, 1)
2311 # @ref tui_common "Example 1"
2312 # \n @ref swig_MakeCommon "Example 2"
2313 def MakeCommon(self, s1, s2):
2314 # Example: see GEOM_TestOthers.py
2315 return self.MakeBoolean(s1, s2, 1)
2317 ## Shortcut to MakeBoolean(s1, s2, 2)
2319 # @ref tui_cut "Example 1"
2320 # \n @ref swig_MakeCommon "Example 2"
2321 def MakeCut(self, s1, s2):
2322 # Example: see GEOM_TestOthers.py
2323 return self.MakeBoolean(s1, s2, 2)
2325 ## Shortcut to MakeBoolean(s1, s2, 3)
2327 # @ref tui_fuse "Example 1"
2328 # \n @ref swig_MakeCommon "Example 2"
2329 def MakeFuse(self, s1, s2):
2330 # Example: see GEOM_TestOthers.py
2331 return self.MakeBoolean(s1, s2, 3)
2333 ## Shortcut to MakeBoolean(s1, s2, 4)
2335 # @ref tui_section "Example 1"
2336 # \n @ref swig_MakeCommon "Example 2"
2337 def MakeSection(self, s1, s2):
2338 # Example: see GEOM_TestOthers.py
2339 return self.MakeBoolean(s1, s2, 4)
2344 ## @addtogroup l3_basic_op
2347 ## Perform partition operation.
2348 # @param ListShapes Shapes to be intersected.
2349 # @param ListTools Shapes to intersect theShapes.
2350 # !!!NOTE: Each compound from ListShapes and ListTools will be exploded
2351 # in order to avoid possible intersection between shapes from
2353 # @param Limit Type of resulting shapes (corresponding to TopAbs_ShapeEnum).
2354 # @param KeepNonlimitShapes: if this parameter == 0 - only shapes with
2355 # type <= Limit are kept in the result,
2356 # else - shapes with type > Limit are kept
2357 # also (if they exist)
2359 # After implementation new version of PartitionAlgo (October 2006)
2360 # other parameters are ignored by current functionality. They are kept
2361 # in this function only for support old versions.
2362 # Ignored parameters:
2363 # @param ListKeepInside Shapes, outside which the results will be deleted.
2364 # Each shape from theKeepInside must belong to theShapes also.
2365 # @param ListRemoveInside Shapes, inside which the results will be deleted.
2366 # Each shape from theRemoveInside must belong to theShapes also.
2367 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
2368 # @param ListMaterials Material indices for each shape. Make sence,
2369 # only if theRemoveWebs is TRUE.
2371 # @return New GEOM_Object, containing the result shapes.
2373 # @ref tui_partition "Example"
2374 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
2375 Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
2376 KeepNonlimitShapes=0):
2377 # Example: see GEOM_TestAll.py
2378 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
2379 ListKeepInside, ListRemoveInside,
2380 Limit, RemoveWebs, ListMaterials,
2381 KeepNonlimitShapes);
2382 RaiseIfFailed("MakePartition", self.BoolOp)
2385 ## Perform partition operation.
2386 # This method may be useful if it is needed to make a partition for
2387 # compound contains nonintersected shapes. Performance will be better
2388 # since intersection between shapes from compound is not performed.
2390 # Description of all parameters as in previous method MakePartition()
2392 # !!!NOTE: Passed compounds (via ListShapes or via ListTools)
2393 # have to consist of nonintersecting shapes.
2395 # @return New GEOM_Object, containing the result shapes.
2397 # @ref swig_todo "Example"
2398 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
2399 ListKeepInside=[], ListRemoveInside=[],
2400 Limit=ShapeType["SHAPE"], RemoveWebs=0,
2401 ListMaterials=[], KeepNonlimitShapes=0):
2402 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
2403 ListKeepInside, ListRemoveInside,
2404 Limit, RemoveWebs, ListMaterials,
2405 KeepNonlimitShapes);
2406 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
2409 ## Shortcut to MakePartition()
2411 # @ref tui_partition "Example 1"
2412 # \n @ref swig_Partition "Example 2"
2413 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
2414 Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
2415 KeepNonlimitShapes=0):
2416 # Example: see GEOM_TestOthers.py
2417 anObj = self.MakePartition(ListShapes, ListTools,
2418 ListKeepInside, ListRemoveInside,
2419 Limit, RemoveWebs, ListMaterials,
2420 KeepNonlimitShapes);
2423 ## Perform partition of the Shape with the Plane
2424 # @param theShape Shape to be intersected.
2425 # @param thePlane Tool shape, to intersect theShape.
2426 # @return New GEOM_Object, containing the result shape.
2428 # @ref tui_partition "Example"
2429 def MakeHalfPartition(self,theShape, thePlane):
2430 # Example: see GEOM_TestAll.py
2431 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
2432 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
2435 # end of l3_basic_op
2438 ## @addtogroup l3_transform
2441 ## Translate the given object along the vector, specified
2442 # by its end points, creating its copy before the translation.
2443 # @param theObject The object to be translated.
2444 # @param thePoint1 Start point of translation vector.
2445 # @param thePoint2 End point of translation vector.
2446 # @return New GEOM_Object, containing the translated object.
2448 # @ref tui_translation "Example 1"
2449 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
2450 def MakeTranslationTwoPoints(self,theObject, thePoint1, thePoint2):
2451 # Example: see GEOM_TestAll.py
2452 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
2453 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
2456 ## Translate the given object along the vector, specified by its components.
2457 # @param theObject The object to be translated.
2458 # @param theDX,theDY,theDZ Components of translation vector.
2459 # @return Translated GEOM_Object.
2461 # @ref tui_translation "Example"
2462 def TranslateDXDYDZ(self,theObject, theDX, theDY, theDZ):
2463 # Example: see GEOM_TestAll.py
2464 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
2465 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
2466 anObj.SetParameters(Parameters)
2467 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
2470 ## Translate the given object along the vector, specified
2471 # by its components, creating its copy before the translation.
2472 # @param theObject The object to be translated.
2473 # @param theDX,theDY,theDZ Components of translation vector.
2474 # @return New GEOM_Object, containing the translated object.
2476 # @ref tui_translation "Example"
2477 def MakeTranslation(self,theObject, theDX, theDY, theDZ):
2478 # Example: see GEOM_TestAll.py
2479 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
2480 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
2481 anObj.SetParameters(Parameters)
2482 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
2485 ## Translate the given object along the given vector,
2486 # creating its copy before the translation.
2487 # @param theObject The object to be translated.
2488 # @param theVector The translation vector.
2489 # @return New GEOM_Object, containing the translated object.
2491 # @ref tui_translation "Example"
2492 def MakeTranslationVector(self,theObject, theVector):
2493 # Example: see GEOM_TestAll.py
2494 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
2495 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
2498 ## Translate the given object along the given vector on given distance.
2499 # @param theObject The object to be translated.
2500 # @param theVector The translation vector.
2501 # @param theDistance The translation distance.
2502 # @param theCopy Flag used to translate object itself or create a copy.
2503 # @return Translated GEOM_Object.
2505 # @ref tui_translation "Example"
2506 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy):
2507 # Example: see GEOM_TestAll.py
2508 theDistance,Parameters = ParseParameters(theDistance)
2509 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
2510 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
2511 anObj.SetParameters(Parameters)
2514 ## Translate the given object along the given vector on given distance,
2515 # creating its copy before the translation.
2516 # @param theObject The object to be translated.
2517 # @param theVector The translation vector.
2518 # @param theDistance The translation distance.
2519 # @return New GEOM_Object, containing the translated object.
2521 # @ref tui_translation "Example"
2522 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance):
2523 # Example: see GEOM_TestAll.py
2524 theDistance,Parameters = ParseParameters(theDistance)
2525 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
2526 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
2527 anObj.SetParameters(Parameters)
2530 ## Rotate the given object around the given axis on the given angle.
2531 # @param theObject The object to be rotated.
2532 # @param theAxis Rotation axis.
2533 # @param theAngle Rotation angle in radians.
2534 # @return Rotated GEOM_Object.
2536 # @ref tui_rotation "Example"
2537 def Rotate(self,theObject, theAxis, theAngle):
2538 # Example: see GEOM_TestAll.py
2540 if isinstance(theAngle,str):
2542 theAngle, Parameters = ParseParameters(theAngle)
2544 theAngle = theAngle*math.pi/180.0
2545 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
2546 RaiseIfFailed("RotateCopy", self.TrsfOp)
2547 anObj.SetParameters(Parameters)
2550 ## Rotate the given object around the given axis
2551 # on the given angle, creating its copy before the rotatation.
2552 # @param theObject The object to be rotated.
2553 # @param theAxis Rotation axis.
2554 # @param theAngle Rotation angle in radians.
2555 # @return New GEOM_Object, containing the rotated object.
2557 # @ref tui_rotation "Example"
2558 def MakeRotation(self,theObject, theAxis, theAngle):
2559 # Example: see GEOM_TestAll.py
2561 if isinstance(theAngle,str):
2563 theAngle, Parameters = ParseParameters(theAngle)
2565 theAngle = theAngle*math.pi/180.0
2566 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
2567 RaiseIfFailed("RotateCopy", self.TrsfOp)
2568 anObj.SetParameters(Parameters)
2571 ## Rotate given object around vector perpendicular to plane
2572 # containing three points, creating its copy before the rotatation.
2573 # @param theObject The object to be rotated.
2574 # @param theCentPoint central point - the axis is the vector perpendicular to the plane
2575 # containing the three points.
2576 # @param thePoint1,thePoint2 - in a perpendicular plane of the axis.
2577 # @return New GEOM_Object, containing the rotated object.
2579 # @ref tui_rotation "Example"
2580 def MakeRotationThreePoints(self,theObject, theCentPoint, thePoint1, thePoint2):
2581 # Example: see GEOM_TestAll.py
2582 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
2583 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
2586 ## Scale the given object by the factor, creating its copy before the scaling.
2587 # @param theObject The object to be scaled.
2588 # @param thePoint Center point for scaling.
2589 # Passing None for it means scaling relatively the origin of global CS.
2590 # @param theFactor Scaling factor value.
2591 # @return New GEOM_Object, containing the scaled shape.
2593 # @ref tui_scale "Example"
2594 def MakeScaleTransform(self, theObject, thePoint, theFactor):
2595 # Example: see GEOM_TestAll.py
2596 theFactor, Parameters = ParseParameters(theFactor)
2597 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
2598 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
2599 anObj.SetParameters(Parameters)
2602 ## Scale the given object by different factors along coordinate axes,
2603 # creating its copy before the scaling.
2604 # @param theObject The object to be scaled.
2605 # @param thePoint Center point for scaling.
2606 # Passing None for it means scaling relatively the origin of global CS.
2607 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
2608 # @return New GEOM_Object, containing the scaled shape.
2610 # @ref swig_scale "Example"
2611 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ):
2612 # Example: see GEOM_TestAll.py
2613 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
2614 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
2615 theFactorX, theFactorY, theFactorZ)
2616 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
2617 anObj.SetParameters(Parameters)
2620 ## Create an object, symmetrical
2621 # to the given one relatively the given plane.
2622 # @param theObject The object to be mirrored.
2623 # @param thePlane Plane of symmetry.
2624 # @return New GEOM_Object, containing the mirrored shape.
2626 # @ref tui_mirror "Example"
2627 def MakeMirrorByPlane(self,theObject, thePlane):
2628 # Example: see GEOM_TestAll.py
2629 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
2630 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
2633 ## Create an object, symmetrical
2634 # to the given one relatively the given axis.
2635 # @param theObject The object to be mirrored.
2636 # @param theAxis Axis of symmetry.
2637 # @return New GEOM_Object, containing the mirrored shape.
2639 # @ref tui_mirror "Example"
2640 def MakeMirrorByAxis(self,theObject, theAxis):
2641 # Example: see GEOM_TestAll.py
2642 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
2643 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
2646 ## Create an object, symmetrical
2647 # to the given one relatively the given point.
2648 # @param theObject The object to be mirrored.
2649 # @param thePoint Point of symmetry.
2650 # @return New GEOM_Object, containing the mirrored shape.
2652 # @ref tui_mirror "Example"
2653 def MakeMirrorByPoint(self,theObject, thePoint):
2654 # Example: see GEOM_TestAll.py
2655 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
2656 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
2659 ## Modify the Location of the given object by LCS,
2660 # creating its copy before the setting.
2661 # @param theObject The object to be displaced.
2662 # @param theStartLCS Coordinate system to perform displacement from it.
2663 # If \a theStartLCS is NULL, displacement
2664 # will be performed from global CS.
2665 # If \a theObject itself is used as \a theStartLCS,
2666 # its location will be changed to \a theEndLCS.
2667 # @param theEndLCS Coordinate system to perform displacement to it.
2668 # @return New GEOM_Object, containing the displaced shape.
2670 # @ref tui_modify_location "Example"
2671 def MakePosition(self,theObject, theStartLCS, theEndLCS):
2672 # Example: see GEOM_TestAll.py
2673 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
2674 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
2677 ## Modify the Location of the given object by Path,
2678 # @param theObject The object to be displaced.
2679 # @param thePath Wire or Edge along that the object will be translated.
2680 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
2681 # @param theCopy is to create a copy objects if true.
2682 # @param theReverse - 0 for usual direction, 1 to reverse path direction.
2683 # @return New GEOM_Object, containing the displaced shape.
2685 # @ref tui_modify_location "Example"
2686 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
2687 # Example: see GEOM_TestAll.py
2688 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
2689 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
2692 ## Create new object as offset of the given one.
2693 # @param theObject The base object for the offset.
2694 # @param theOffset Offset value.
2695 # @return New GEOM_Object, containing the offset object.
2697 # @ref tui_offset "Example"
2698 def MakeOffset(self,theObject, theOffset):
2699 # Example: see GEOM_TestAll.py
2700 theOffset, Parameters = ParseParameters(theOffset)
2701 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
2702 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
2703 anObj.SetParameters(Parameters)
2706 # -----------------------------------------------------------------------------
2708 # -----------------------------------------------------------------------------
2710 ## Translate the given object along the given vector a given number times
2711 # @param theObject The object to be translated.
2712 # @param theVector Direction of the translation.
2713 # @param theStep Distance to translate on.
2714 # @param theNbTimes Quantity of translations to be done.
2715 # @return New GEOM_Object, containing compound of all
2716 # the shapes, obtained after each translation.
2718 # @ref tui_multi_translation "Example"
2719 def MakeMultiTranslation1D(self,theObject, theVector, theStep, theNbTimes):
2720 # Example: see GEOM_TestAll.py
2721 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
2722 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
2723 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
2724 anObj.SetParameters(Parameters)
2727 ## Conseqently apply two specified translations to theObject specified number of times.
2728 # @param theObject The object to be translated.
2729 # @param theVector1 Direction of the first translation.
2730 # @param theStep1 Step of the first translation.
2731 # @param theNbTimes1 Quantity of translations to be done along theVector1.
2732 # @param theVector2 Direction of the second translation.
2733 # @param theStep2 Step of the second translation.
2734 # @param theNbTimes2 Quantity of translations to be done along theVector2.
2735 # @return New GEOM_Object, containing compound of all
2736 # the shapes, obtained after each translation.
2738 # @ref tui_multi_translation "Example"
2739 def MakeMultiTranslation2D(self,theObject, theVector1, theStep1, theNbTimes1,
2740 theVector2, theStep2, theNbTimes2):
2741 # Example: see GEOM_TestAll.py
2742 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
2743 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
2744 theVector2, theStep2, theNbTimes2)
2745 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
2746 anObj.SetParameters(Parameters)
2749 ## Rotate the given object around the given axis a given number times.
2750 # Rotation angle will be 2*PI/theNbTimes.
2751 # @param theObject The object to be rotated.
2752 # @param theAxis The rotation axis.
2753 # @param theNbTimes Quantity of rotations to be done.
2754 # @return New GEOM_Object, containing compound of all the
2755 # shapes, obtained after each rotation.
2757 # @ref tui_multi_rotation "Example"
2758 def MultiRotate1D(self,theObject, theAxis, theNbTimes):
2759 # Example: see GEOM_TestAll.py
2760 theAxis, theNbTimes, Parameters = ParseParameters(theAxis, theNbTimes)
2761 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
2762 RaiseIfFailed("MultiRotate1D", self.TrsfOp)
2763 anObj.SetParameters(Parameters)
2766 ## Rotate the given object around the
2767 # given axis on the given angle a given number
2768 # times and multi-translate each rotation result.
2769 # Translation direction passes through center of gravity
2770 # of rotated shape and its projection on the rotation axis.
2771 # @param theObject The object to be rotated.
2772 # @param theAxis Rotation axis.
2773 # @param theAngle Rotation angle in graduces.
2774 # @param theNbTimes1 Quantity of rotations to be done.
2775 # @param theStep Translation distance.
2776 # @param theNbTimes2 Quantity of translations to be done.
2777 # @return New GEOM_Object, containing compound of all the
2778 # shapes, obtained after each transformation.
2780 # @ref tui_multi_rotation "Example"
2781 def MultiRotate2D(self,theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2):
2782 # Example: see GEOM_TestAll.py
2783 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
2784 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
2785 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
2786 anObj.SetParameters(Parameters)
2789 ## The same, as MultiRotate1D(), but axis is given by direction and point
2790 # @ref swig_MakeMultiRotation "Example"
2791 def MakeMultiRotation1D(self,aShape,aDir,aPoint,aNbTimes):
2792 # Example: see GEOM_TestOthers.py
2793 aVec = self.MakeLine(aPoint,aDir)
2794 anObj = self.MultiRotate1D(aShape,aVec,aNbTimes)
2797 ## The same, as MultiRotate2D(), but axis is given by direction and point
2798 # @ref swig_MakeMultiRotation "Example"
2799 def MakeMultiRotation2D(self,aShape,aDir,aPoint,anAngle,nbtimes1,aStep,nbtimes2):
2800 # Example: see GEOM_TestOthers.py
2801 aVec = self.MakeLine(aPoint,aDir)
2802 anObj = self.MultiRotate2D(aShape,aVec,anAngle,nbtimes1,aStep,nbtimes2)
2805 # end of l3_transform
2808 ## @addtogroup l3_local
2811 ## Perform a fillet on all edges of the given shape.
2812 # @param theShape Shape, to perform fillet on.
2813 # @param theR Fillet radius.
2814 # @return New GEOM_Object, containing the result shape.
2816 # @ref tui_fillet "Example 1"
2817 # \n @ref swig_MakeFilletAll "Example 2"
2818 def MakeFilletAll(self,theShape, theR):
2819 # Example: see GEOM_TestOthers.py
2820 theR,Parameters = ParseParameters(theR)
2821 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
2822 RaiseIfFailed("MakeFilletAll", self.LocalOp)
2823 anObj.SetParameters(Parameters)
2826 ## Perform a fillet on the specified edges/faces of the given shape
2827 # @param theShape Shape, to perform fillet on.
2828 # @param theR Fillet radius.
2829 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR>.
2830 # @param theListShapes Global indices of edges/faces to perform fillet on.
2831 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2832 # @return New GEOM_Object, containing the result shape.
2834 # @ref tui_fillet "Example"
2835 def MakeFillet(self,theShape, theR, theShapeType, theListShapes):
2836 # Example: see GEOM_TestAll.py
2837 theR,Parameters = ParseParameters(theR)
2839 if theShapeType == ShapeType["EDGE"]:
2840 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
2841 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
2843 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
2844 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
2845 anObj.SetParameters(Parameters)
2848 ## The same that MakeFillet but with two Fillet Radius R1 and R2
2849 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes):
2850 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
2852 if theShapeType == ShapeType["EDGE"]:
2853 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
2854 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
2856 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
2857 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
2858 anObj.SetParameters(Parameters)
2861 ## Perform a fillet on the specified edges of the given shape
2862 # @param theShape - Wire Shape to perform fillet on.
2863 # @param theR - Fillet radius.
2864 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
2865 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2866 # \note The list of vertices could be empty,
2867 # in this case fillet will done done at all vertices in wire
2868 # @return New GEOM_Object, containing the result shape.
2870 # @ref tui_fillet2d "Example"
2871 def MakeFillet1D(self,theShape, theR, theListOfVertexes):
2872 # Example: see GEOM_TestAll.py
2873 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes)
2874 RaiseIfFailed("MakeFillet1D", self.LocalOp)
2877 ## Perform a fillet on the specified edges/faces of the given shape
2878 # @param theShape - Face Shape to perform fillet on.
2879 # @param theR - Fillet radius.
2880 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
2881 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2882 # @return New GEOM_Object, containing the result shape.
2884 # @ref tui_fillet2d "Example"
2885 def MakeFillet2D(self,theShape, theR, theListOfVertexes):
2886 # Example: see GEOM_TestAll.py
2887 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
2888 RaiseIfFailed("MakeFillet2D", self.LocalOp)
2891 ## Perform a symmetric chamfer on all edges of the given shape.
2892 # @param theShape Shape, to perform chamfer on.
2893 # @param theD Chamfer size along each face.
2894 # @return New GEOM_Object, containing the result shape.
2896 # @ref tui_chamfer "Example 1"
2897 # \n @ref swig_MakeChamferAll "Example 2"
2898 def MakeChamferAll(self,theShape, theD):
2899 # Example: see GEOM_TestOthers.py
2900 theD,Parameters = ParseParameters(theD)
2901 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
2902 RaiseIfFailed("MakeChamferAll", self.LocalOp)
2903 anObj.SetParameters(Parameters)
2906 ## Perform a chamfer on edges, common to the specified faces,
2907 # with distance D1 on the Face1
2908 # @param theShape Shape, to perform chamfer on.
2909 # @param theD1 Chamfer size along \a theFace1.
2910 # @param theD2 Chamfer size along \a theFace2.
2911 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
2912 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2913 # @return New GEOM_Object, containing the result shape.
2915 # @ref tui_chamfer "Example"
2916 def MakeChamferEdge(self,theShape, theD1, theD2, theFace1, theFace2):
2917 # Example: see GEOM_TestAll.py
2918 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
2919 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
2920 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
2921 anObj.SetParameters(Parameters)
2924 ## The Same that MakeChamferEdge but with params theD is chamfer length and
2925 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
2926 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2):
2928 if isinstance(theAngle,str):
2930 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
2932 theAngle = theAngle*math.pi/180.0
2933 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
2934 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
2935 anObj.SetParameters(Parameters)
2938 ## Perform a chamfer on all edges of the specified faces,
2939 # with distance D1 on the first specified face (if several for one edge)
2940 # @param theShape Shape, to perform chamfer on.
2941 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
2942 # connected to the edge, are in \a theFaces, \a theD1
2943 # will be get along face, which is nearer to \a theFaces beginning.
2944 # @param theD2 Chamfer size along another of two faces, connected to the edge.
2945 # @param theFaces Sequence of global indices of faces of \a theShape.
2946 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2947 # @return New GEOM_Object, containing the result shape.
2949 # @ref tui_chamfer "Example"
2950 def MakeChamferFaces(self,theShape, theD1, theD2, theFaces):
2951 # Example: see GEOM_TestAll.py
2952 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
2953 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
2954 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
2955 anObj.SetParameters(Parameters)
2958 ## The Same that MakeChamferFaces but with params theD is chamfer lenght and
2959 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
2961 # @ref swig_FilletChamfer "Example"
2962 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces):
2964 if isinstance(theAngle,str):
2966 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
2968 theAngle = theAngle*math.pi/180.0
2969 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
2970 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
2971 anObj.SetParameters(Parameters)
2974 ## Perform a chamfer on edges,
2975 # with distance D1 on the first specified face (if several for one edge)
2976 # @param theShape Shape, to perform chamfer on.
2977 # @param theD1,theD2 Chamfer size
2978 # @param theEdges Sequence of edges of \a theShape.
2979 # @return New GEOM_Object, containing the result shape.
2981 # @ref swig_FilletChamfer "Example"
2982 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges):
2983 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
2984 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
2985 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
2986 anObj.SetParameters(Parameters)
2989 ## The Same that MakeChamferEdges but with params theD is chamfer lenght and
2990 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
2991 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges):
2993 if isinstance(theAngle,str):
2995 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
2997 theAngle = theAngle*math.pi/180.0
2998 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
2999 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
3000 anObj.SetParameters(Parameters)
3003 ## Shortcut to MakeChamferEdge() and MakeChamferFaces()
3005 # @ref swig_MakeChamfer "Example"
3006 def MakeChamfer(self,aShape,d1,d2,aShapeType,ListShape):
3007 # Example: see GEOM_TestOthers.py
3009 if aShapeType == ShapeType["EDGE"]:
3010 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1])
3012 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape)
3018 ## @addtogroup l3_basic_op
3021 ## Perform an Archimde operation on the given shape with given parameters.
3022 # The object presenting the resulting face is returned.
3023 # @param theShape Shape to be put in water.
3024 # @param theWeight Weight og the shape.
3025 # @param theWaterDensity Density of the water.
3026 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
3027 # @return New GEOM_Object, containing a section of \a theShape
3028 # by a plane, corresponding to water level.
3030 # @ref tui_archimede "Example"
3031 def Archimede(self,theShape, theWeight, theWaterDensity, theMeshDeflection):
3032 # Example: see GEOM_TestAll.py
3033 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
3034 theWeight,theWaterDensity,theMeshDeflection)
3035 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
3036 RaiseIfFailed("MakeArchimede", self.LocalOp)
3037 anObj.SetParameters(Parameters)
3040 # end of l3_basic_op
3043 ## @addtogroup l2_measure
3046 ## Get point coordinates
3049 # @ref tui_measurement_tools_page "Example"
3050 def PointCoordinates(self,Point):
3051 # Example: see GEOM_TestMeasures.py
3052 aTuple = self.MeasuOp.PointCoordinates(Point)
3053 RaiseIfFailed("PointCoordinates", self.MeasuOp)
3056 ## Get summarized length of all wires,
3057 # area of surface and volume of the given shape.
3058 # @param theShape Shape to define properties of.
3059 # @return [theLength, theSurfArea, theVolume]
3060 # theLength: Summarized length of all wires of the given shape.
3061 # theSurfArea: Area of surface of the given shape.
3062 # theVolume: Volume of the given shape.
3064 # @ref tui_measurement_tools_page "Example"
3065 def BasicProperties(self,theShape):
3066 # Example: see GEOM_TestMeasures.py
3067 aTuple = self.MeasuOp.GetBasicProperties(theShape)
3068 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
3071 ## Get parameters of bounding box of the given shape
3072 # @param theShape Shape to obtain bounding box of.
3073 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
3074 # Xmin,Xmax: Limits of shape along OX axis.
3075 # Ymin,Ymax: Limits of shape along OY axis.
3076 # Zmin,Zmax: Limits of shape along OZ axis.
3078 # @ref tui_measurement_tools_page "Example"
3079 def BoundingBox(self,theShape):
3080 # Example: see GEOM_TestMeasures.py
3081 aTuple = self.MeasuOp.GetBoundingBox(theShape)
3082 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
3085 ## Get inertia matrix and moments of inertia of theShape.
3086 # @param theShape Shape to calculate inertia of.
3087 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
3088 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
3089 # Ix,Iy,Iz: Moments of inertia of the given shape.
3091 # @ref tui_measurement_tools_page "Example"
3092 def Inertia(self,theShape):
3093 # Example: see GEOM_TestMeasures.py
3094 aTuple = self.MeasuOp.GetInertia(theShape)
3095 RaiseIfFailed("GetInertia", self.MeasuOp)
3098 ## Get minimal distance between the given shapes.
3099 # @param theShape1,theShape2 Shapes to find minimal distance between.
3100 # @return Value of the minimal distance between the given shapes.
3102 # @ref tui_measurement_tools_page "Example"
3103 def MinDistance(self, theShape1, theShape2):
3104 # Example: see GEOM_TestMeasures.py
3105 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
3106 RaiseIfFailed("GetMinDistance", self.MeasuOp)
3109 ## Get minimal distance between the given shapes.
3110 # @param theShape1,theShape2 Shapes to find minimal distance between.
3111 # @return Value of the minimal distance between the given shapes.
3113 # @ref swig_all_measure "Example"
3114 def MinDistanceComponents(self, theShape1, theShape2):
3115 # Example: see GEOM_TestMeasures.py
3116 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
3117 RaiseIfFailed("GetMinDistance", self.MeasuOp)
3118 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
3121 ## Get angle between the given shapes in degrees.
3122 # @param theShape1,theShape2 Lines or linear edges to find angle between.
3123 # @return Value of the angle between the given shapes in degrees.
3125 # @ref tui_measurement_tools_page "Example"
3126 def GetAngle(self, theShape1, theShape2):
3127 # Example: see GEOM_TestMeasures.py
3128 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
3129 RaiseIfFailed("GetAngle", self.MeasuOp)
3131 ## Get angle between the given shapes in radians.
3132 # @param theShape1,theShape2 Lines or linear edges to find angle between.
3133 # @return Value of the angle between the given shapes in radians.
3135 # @ref tui_measurement_tools_page "Example"
3136 def GetAngleRadians(self, theShape1, theShape2):
3137 # Example: see GEOM_TestMeasures.py
3138 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
3139 RaiseIfFailed("GetAngle", self.MeasuOp)
3142 ## @name Curve Curvature Measurement
3143 # Methods for receiving radius of curvature of curves
3144 # in the given point
3147 ## Measure curvature of a curve at a point, set by parameter.
3148 # @ref swig_todo "Example"
3149 def CurveCurvatureByParam(self, theCurve, theParam):
3150 # Example: see GEOM_TestMeasures.py
3151 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
3152 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
3156 # @ref swig_todo "Example"
3157 def CurveCurvatureByPoint(self, theCurve, thePoint):
3158 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
3159 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
3163 ## @name Surface Curvature Measurement
3164 # Methods for receiving max and min radius of curvature of surfaces
3165 # in the given point
3169 ## @ref swig_todo "Example"
3170 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
3171 # Example: see GEOM_TestMeasures.py
3172 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
3173 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
3177 ## @ref swig_todo "Example"
3178 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
3179 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
3180 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
3184 ## @ref swig_todo "Example"
3185 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
3186 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
3187 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
3191 ## @ref swig_todo "Example"
3192 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
3193 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
3194 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
3198 ## Get min and max tolerances of sub-shapes of theShape
3199 # @param theShape Shape, to get tolerances of.
3200 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
3201 # FaceMin,FaceMax: Min and max tolerances of the faces.
3202 # EdgeMin,EdgeMax: Min and max tolerances of the edges.
3203 # VertMin,VertMax: Min and max tolerances of the vertices.
3205 # @ref tui_measurement_tools_page "Example"
3206 def Tolerance(self,theShape):
3207 # Example: see GEOM_TestMeasures.py
3208 aTuple = self.MeasuOp.GetTolerance(theShape)
3209 RaiseIfFailed("GetTolerance", self.MeasuOp)
3212 ## Obtain description of the given shape (number of sub-shapes of each type)
3213 # @param theShape Shape to be described.
3214 # @return Description of the given shape.
3216 # @ref tui_measurement_tools_page "Example"
3217 def WhatIs(self,theShape):
3218 # Example: see GEOM_TestMeasures.py
3219 aDescr = self.MeasuOp.WhatIs(theShape)
3220 RaiseIfFailed("WhatIs", self.MeasuOp)
3223 ## Get a point, situated at the centre of mass of theShape.
3224 # @param theShape Shape to define centre of mass of.
3225 # @return New GEOM_Object, containing the created point.
3227 # @ref tui_measurement_tools_page "Example"
3228 def MakeCDG(self,theShape):
3229 # Example: see GEOM_TestMeasures.py
3230 anObj = self.MeasuOp.GetCentreOfMass(theShape)
3231 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
3234 ## Get a normale to the given face. If the point is not given,
3235 # the normale is calculated at the center of mass.
3236 # @param theFace Face to define normale of.
3237 # @param theOptionalPoint Point to compute the normale at.
3238 # @return New GEOM_Object, containing the created vector.
3240 # @ref swig_todo "Example"
3241 def GetNormal(self, theFace, theOptionalPoint = None):
3242 # Example: see GEOM_TestMeasures.py
3243 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
3244 RaiseIfFailed("GetNormal", self.MeasuOp)
3247 ## Check a topology of the given shape.
3248 # @param theShape Shape to check validity of.
3249 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked,
3250 # if TRUE, the shape's geometry will be checked also.
3251 # @return TRUE, if the shape "seems to be valid".
3252 # If theShape is invalid, prints a description of problem.
3254 # @ref tui_measurement_tools_page "Example"
3255 def CheckShape(self,theShape, theIsCheckGeom = 0):
3256 # Example: see GEOM_TestMeasures.py
3258 (IsValid, Status) = self.MeasuOp.CheckShapeWithGeometry(theShape)
3259 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
3261 (IsValid, Status) = self.MeasuOp.CheckShape(theShape)
3262 RaiseIfFailed("CheckShape", self.MeasuOp)
3267 ## Get position (LCS) of theShape.
3269 # Origin of the LCS is situated at the shape's center of mass.
3270 # Axes of the LCS are obtained from shape's location or,
3271 # if the shape is a planar face, from position of its plane.
3273 # @param theShape Shape to calculate position of.
3274 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
3275 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
3276 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
3277 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
3279 # @ref swig_todo "Example"
3280 def GetPosition(self,theShape):
3281 # Example: see GEOM_TestMeasures.py
3282 aTuple = self.MeasuOp.GetPosition(theShape)
3283 RaiseIfFailed("GetPosition", self.MeasuOp)
3286 ## Get kind of theShape.
3288 # @param theShape Shape to get a kind of.
3289 # @return Returns a kind of shape in terms of <VAR>GEOM_IKindOfShape.shape_kind</VAR> enumeration
3290 # and a list of parameters, describing the shape.
3291 # @note Concrete meaning of each value, returned via \a theIntegers
3292 # or \a theDoubles list depends on the kind of the shape.
3293 # The full list of possible outputs is:
3295 # - geompy.kind.COMPOUND nb_solids nb_faces nb_edges nb_vertices
3296 # - geompy.kind.COMPSOLID nb_solids nb_faces nb_edges nb_vertices
3298 # - geompy.kind.SHELL geompy.info.CLOSED nb_faces nb_edges nb_vertices
3299 # - geompy.kind.SHELL geompy.info.UNCLOSED nb_faces nb_edges nb_vertices
3301 # - geompy.kind.WIRE geompy.info.CLOSED nb_edges nb_vertices
3302 # - geompy.kind.WIRE geompy.info.UNCLOSED nb_edges nb_vertices
3304 # - geompy.kind.SPHERE xc yc zc R
3305 # - geompy.kind.CYLINDER xb yb zb dx dy dz R H
3306 # - geompy.kind.BOX xc yc zc ax ay az
3307 # - geompy.kind.ROTATED_BOX xc yc zc zx zy zz xx xy xz ax ay az
3308 # - geompy.kind.TORUS xc yc zc dx dy dz R_1 R_2
3309 # - geompy.kind.CONE xb yb zb dx dy dz R_1 R_2 H
3310 # - geompy.kind.POLYHEDRON nb_faces nb_edges nb_vertices
3311 # - geompy.kind.SOLID nb_faces nb_edges nb_vertices
3313 # - geompy.kind.SPHERE2D xc yc zc R
3314 # - geompy.kind.CYLINDER2D xb yb zb dx dy dz R H
3315 # - geompy.kind.TORUS2D xc yc zc dx dy dz R_1 R_2
3316 # - geompy.kind.CONE2D xc yc zc dx dy dz R_1 R_2 H
3317 # - geompy.kind.DISK_CIRCLE xc yc zc dx dy dz R
3318 # - geompy.kind.DISK_ELLIPSE xc yc zc dx dy dz R_1 R_2
3319 # - geompy.kind.POLYGON xo yo zo dx dy dz nb_edges nb_vertices
3320 # - geompy.kind.PLANE xo yo zo dx dy dz
3321 # - geompy.kind.PLANAR xo yo zo dx dy dz nb_edges nb_vertices
3322 # - geompy.kind.FACE nb_edges nb_vertices
3324 # - geompy.kind.CIRCLE xc yc zc dx dy dz R
3325 # - geompy.kind.ARC_CIRCLE xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2
3326 # - geompy.kind.ELLIPSE xc yc zc dx dy dz R_1 R_2
3327 # - geompy.kind.ARC_ELLIPSE xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2
3328 # - geompy.kind.LINE xo yo zo dx dy dz
3329 # - geompy.kind.SEGMENT x1 y1 z1 x2 y2 z2
3330 # - geompy.kind.EDGE nb_vertices
3332 # - geompy.kind.VERTEX x y z
3334 # @ref swig_todo "Example"
3335 def KindOfShape(self,theShape):
3336 # Example: see GEOM_TestMeasures.py
3337 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
3338 RaiseIfFailed("KindOfShape", self.MeasuOp)
3340 aKind = aRoughTuple[0]
3341 anInts = aRoughTuple[1]
3342 aDbls = aRoughTuple[2]
3344 # Now there is no exception from this rule:
3345 aKindTuple = [aKind] + aDbls + anInts
3347 # If they are we will regroup parameters for such kind of shape.
3349 #if aKind == kind.SOME_KIND:
3350 # # SOME_KIND int int double int double double
3351 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
3358 ## @addtogroup l2_import_export
3361 ## Import a shape from the BREP or IGES or STEP file
3362 # (depends on given format) with given name.
3363 # @param theFileName The file, containing the shape.
3364 # @param theFormatName Specify format for the file reading.
3365 # Available formats can be obtained with InsertOp.ImportTranslators() method.
3366 # If format 'IGES_SCALE' is used instead 'IGES' length unit will be
3367 # set to 'meter' and result model will be scaled.
3368 # @return New GEOM_Object, containing the imported shape.
3370 # @ref swig_Import_Export "Example"
3371 def Import(self,theFileName, theFormatName):
3372 # Example: see GEOM_TestOthers.py
3373 anObj = self.InsertOp.Import(theFileName, theFormatName)
3374 RaiseIfFailed("Import", self.InsertOp)
3377 ## Shortcut to Import() for BREP format
3379 # @ref swig_Import_Export "Example"
3380 def ImportBREP(self,theFileName):
3381 # Example: see GEOM_TestOthers.py
3382 return self.Import(theFileName, "BREP")
3384 ## Shortcut to Import() for IGES format
3386 # @ref swig_Import_Export "Example"
3387 def ImportIGES(self,theFileName):
3388 # Example: see GEOM_TestOthers.py
3389 return self.Import(theFileName, "IGES")
3391 ## Return length unit from given IGES file
3393 # @ref swig_Import_Export "Example"
3394 def GetIGESUnit(self,theFileName):
3395 # Example: see GEOM_TestOthers.py
3396 anObj = self.InsertOp.Import(theFileName, "IGES_UNIT")
3397 #RaiseIfFailed("Import", self.InsertOp)
3398 # recieve name using returned vertex
3400 vertices = self.SubShapeAll(anObj,ShapeType["VERTEX"])
3402 p = self.PointCoordinates(vertices[0])
3403 if abs(p[0]-0.01) < 1.e-6:
3405 elif abs(p[0]-0.001) < 1.e-6:
3409 ## Shortcut to Import() for STEP format
3411 # @ref swig_Import_Export "Example"
3412 def ImportSTEP(self,theFileName):
3413 # Example: see GEOM_TestOthers.py
3414 return self.Import(theFileName, "STEP")
3416 ## Export the given shape into a file with given name.
3417 # @param theObject Shape to be stored in the file.
3418 # @param theFileName Name of the file to store the given shape in.
3419 # @param theFormatName Specify format for the shape storage.
3420 # Available formats can be obtained with InsertOp.ImportTranslators() method.
3422 # @ref swig_Import_Export "Example"
3423 def Export(self,theObject, theFileName, theFormatName):
3424 # Example: see GEOM_TestOthers.py
3425 self.InsertOp.Export(theObject, theFileName, theFormatName)
3426 if self.InsertOp.IsDone() == 0:
3427 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
3431 ## Shortcut to Export() for BREP format
3433 # @ref swig_Import_Export "Example"
3434 def ExportBREP(self,theObject, theFileName):
3435 # Example: see GEOM_TestOthers.py
3436 return self.Export(theObject, theFileName, "BREP")
3438 ## Shortcut to Export() for IGES format
3440 # @ref swig_Import_Export "Example"
3441 def ExportIGES(self,theObject, theFileName):
3442 # Example: see GEOM_TestOthers.py
3443 return self.Export(theObject, theFileName, "IGES")
3445 ## Shortcut to Export() for STEP format
3447 # @ref swig_Import_Export "Example"
3448 def ExportSTEP(self,theObject, theFileName):
3449 # Example: see GEOM_TestOthers.py
3450 return self.Export(theObject, theFileName, "STEP")
3452 # end of l2_import_export
3455 ## @addtogroup l3_blocks
3458 ## Create a quadrangle face from four edges. Order of Edges is not
3459 # important. It is not necessary that edges share the same vertex.
3460 # @param E1,E2,E3,E4 Edges for the face bound.
3461 # @return New GEOM_Object, containing the created face.
3463 # @ref tui_building_by_blocks_page "Example"
3464 def MakeQuad(self,E1, E2, E3, E4):
3465 # Example: see GEOM_Spanner.py
3466 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
3467 RaiseIfFailed("MakeQuad", self.BlocksOp)
3470 ## Create a quadrangle face on two edges.
3471 # The missing edges will be built by creating the shortest ones.
3472 # @param E1,E2 Two opposite edges for the face.
3473 # @return New GEOM_Object, containing the created face.
3475 # @ref tui_building_by_blocks_page "Example"
3476 def MakeQuad2Edges(self,E1, E2):
3477 # Example: see GEOM_Spanner.py
3478 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
3479 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
3482 ## Create a quadrangle face with specified corners.
3483 # The missing edges will be built by creating the shortest ones.
3484 # @param V1,V2,V3,V4 Corner vertices for the face.
3485 # @return New GEOM_Object, containing the created face.
3487 # @ref tui_building_by_blocks_page "Example 1"
3488 # \n @ref swig_MakeQuad4Vertices "Example 2"
3489 def MakeQuad4Vertices(self,V1, V2, V3, V4):
3490 # Example: see GEOM_Spanner.py
3491 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
3492 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
3495 ## Create a hexahedral solid, bounded by the six given faces. Order of
3496 # faces is not important. It is not necessary that Faces share the same edge.
3497 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
3498 # @return New GEOM_Object, containing the created solid.
3500 # @ref tui_building_by_blocks_page "Example 1"
3501 # \n @ref swig_MakeHexa "Example 2"
3502 def MakeHexa(self,F1, F2, F3, F4, F5, F6):
3503 # Example: see GEOM_Spanner.py
3504 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
3505 RaiseIfFailed("MakeHexa", self.BlocksOp)
3508 ## Create a hexahedral solid between two given faces.
3509 # The missing faces will be built by creating the smallest ones.
3510 # @param F1,F2 Two opposite faces for the hexahedral solid.
3511 # @return New GEOM_Object, containing the created solid.
3513 # @ref tui_building_by_blocks_page "Example 1"
3514 # \n @ref swig_MakeHexa2Faces "Example 2"
3515 def MakeHexa2Faces(self,F1, F2):
3516 # Example: see GEOM_Spanner.py
3517 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
3518 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
3524 ## @addtogroup l3_blocks_op
3527 ## Get a vertex, found in the given shape by its coordinates.
3528 # @param theShape Block or a compound of blocks.
3529 # @param theX,theY,theZ Coordinates of the sought vertex.
3530 # @param theEpsilon Maximum allowed distance between the resulting
3531 # vertex and point with the given coordinates.
3532 # @return New GEOM_Object, containing the found vertex.
3534 # @ref swig_GetPoint "Example"
3535 def GetPoint(self,theShape, theX, theY, theZ, theEpsilon):
3536 # Example: see GEOM_TestOthers.py
3537 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
3538 RaiseIfFailed("GetPoint", self.BlocksOp)
3541 ## Get an edge, found in the given shape by two given vertices.
3542 # @param theShape Block or a compound of blocks.
3543 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
3544 # @return New GEOM_Object, containing the found edge.
3546 # @ref swig_todo "Example"
3547 def GetEdge(self,theShape, thePoint1, thePoint2):
3548 # Example: see GEOM_Spanner.py
3549 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
3550 RaiseIfFailed("GetEdge", self.BlocksOp)
3553 ## Find an edge of the given shape, which has minimal distance to the given point.
3554 # @param theShape Block or a compound of blocks.
3555 # @param thePoint Point, close to the desired edge.
3556 # @return New GEOM_Object, containing the found edge.
3558 # @ref swig_GetEdgeNearPoint "Example"
3559 def GetEdgeNearPoint(self,theShape, thePoint):
3560 # Example: see GEOM_TestOthers.py
3561 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
3562 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
3565 ## Returns a face, found in the given shape by four given corner vertices.
3566 # @param theShape Block or a compound of blocks.
3567 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
3568 # @return New GEOM_Object, containing the found face.
3570 # @ref swig_todo "Example"
3571 def GetFaceByPoints(self,theShape, thePoint1, thePoint2, thePoint3, thePoint4):
3572 # Example: see GEOM_Spanner.py
3573 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
3574 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
3577 ## Get a face of block, found in the given shape by two given edges.
3578 # @param theShape Block or a compound of blocks.
3579 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
3580 # @return New GEOM_Object, containing the found face.
3582 # @ref swig_todo "Example"
3583 def GetFaceByEdges(self,theShape, theEdge1, theEdge2):
3584 # Example: see GEOM_Spanner.py
3585 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
3586 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
3589 ## Find a face, opposite to the given one in the given block.
3590 # @param theBlock Must be a hexahedral solid.
3591 # @param theFace Face of \a theBlock, opposite to the desired face.
3592 # @return New GEOM_Object, containing the found face.
3594 # @ref swig_GetOppositeFace "Example"
3595 def GetOppositeFace(self,theBlock, theFace):
3596 # Example: see GEOM_Spanner.py
3597 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
3598 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
3601 ## Find a face of the given shape, which has minimal distance to the given point.
3602 # @param theShape Block or a compound of blocks.
3603 # @param thePoint Point, close to the desired face.
3604 # @return New GEOM_Object, containing the found face.
3606 # @ref swig_GetFaceNearPoint "Example"
3607 def GetFaceNearPoint(self,theShape, thePoint):
3608 # Example: see GEOM_Spanner.py
3609 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
3610 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
3613 ## Find a face of block, whose outside normale has minimal angle with the given vector.
3614 # @param theBlock Block or a compound of blocks.
3615 # @param theVector Vector, close to the normale of the desired face.
3616 # @return New GEOM_Object, containing the found face.
3618 # @ref swig_todo "Example"
3619 def GetFaceByNormale(self, theBlock, theVector):
3620 # Example: see GEOM_Spanner.py
3621 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
3622 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
3625 # end of l3_blocks_op
3628 ## @addtogroup l4_blocks_measure
3631 ## Check, if the compound of blocks is given.
3632 # To be considered as a compound of blocks, the
3633 # given shape must satisfy the following conditions:
3634 # - Each element of the compound should be a Block (6 faces and 12 edges).
3635 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
3636 # - The compound should be connexe.
3637 # - The glue between two quadrangle faces should be applied.
3638 # @param theCompound The compound to check.
3639 # @return TRUE, if the given shape is a compound of blocks.
3640 # If theCompound is not valid, prints all discovered errors.
3642 # @ref tui_measurement_tools_page "Example 1"
3643 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
3644 def CheckCompoundOfBlocks(self,theCompound):
3645 # Example: see GEOM_Spanner.py
3646 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
3647 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
3649 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
3653 ## Remove all seam and degenerated edges from \a theShape.
3654 # Unite faces and edges, sharing one surface. It means that
3655 # this faces must have references to one C++ surface object (handle).
3656 # @param theShape The compound or single solid to remove irregular edges from.
3657 # @param doUnionFaces If True, then unite faces. If False (the default value),
3658 # do not unite faces.
3659 # @return Improved shape.
3661 # @ref swig_RemoveExtraEdges "Example"
3662 def RemoveExtraEdges(self, theShape, doUnionFaces=False):
3663 # Example: see GEOM_TestOthers.py
3664 nbFacesOptimum = -1 # -1 means do not unite faces
3665 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
3666 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
3667 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
3670 ## Check, if the given shape is a blocks compound.
3671 # Fix all detected errors.
3672 # \note Single block can be also fixed by this method.
3673 # @param theShape The compound to check and improve.
3674 # @return Improved compound.
3676 # @ref swig_CheckAndImprove "Example"
3677 def CheckAndImprove(self,theShape):
3678 # Example: see GEOM_TestOthers.py
3679 anObj = self.BlocksOp.CheckAndImprove(theShape)
3680 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
3683 # end of l4_blocks_measure
3686 ## @addtogroup l3_blocks_op
3689 ## Get all the blocks, contained in the given compound.
3690 # @param theCompound The compound to explode.
3691 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
3692 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
3693 # \note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
3694 # @return List of GEOM_Objects, containing the retrieved blocks.
3696 # @ref tui_explode_on_blocks "Example 1"
3697 # \n @ref swig_MakeBlockExplode "Example 2"
3698 def MakeBlockExplode(self,theCompound, theMinNbFaces, theMaxNbFaces):
3699 # Example: see GEOM_TestOthers.py
3700 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
3701 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
3702 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
3704 anObj.SetParameters(Parameters)
3708 ## Find block, containing the given point inside its volume or on boundary.
3709 # @param theCompound Compound, to find block in.
3710 # @param thePoint Point, close to the desired block. If the point lays on
3711 # boundary between some blocks, we return block with nearest center.
3712 # @return New GEOM_Object, containing the found block.
3714 # @ref swig_todo "Example"
3715 def GetBlockNearPoint(self,theCompound, thePoint):
3716 # Example: see GEOM_Spanner.py
3717 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
3718 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
3721 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
3722 # @param theCompound Compound, to find block in.
3723 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
3724 # @return New GEOM_Object, containing the found block.
3726 # @ref swig_GetBlockByParts "Example"
3727 def GetBlockByParts(self,theCompound, theParts):
3728 # Example: see GEOM_TestOthers.py
3729 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
3730 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
3733 ## Return all blocks, containing all the elements, passed as the parts.
3734 # @param theCompound Compound, to find blocks in.
3735 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
3736 # @return List of GEOM_Objects, containing the found blocks.
3738 # @ref swig_todo "Example"
3739 def GetBlocksByParts(self,theCompound, theParts):
3740 # Example: see GEOM_Spanner.py
3741 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
3742 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
3745 ## Multi-transformate block and glue the result.
3746 # Transformation is defined so, as to superpose direction faces.
3747 # @param Block Hexahedral solid to be multi-transformed.
3748 # @param DirFace1 ID of First direction face.
3749 # @param DirFace2 ID of Second direction face.
3750 # @param NbTimes Quantity of transformations to be done.
3751 # \note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
3752 # @return New GEOM_Object, containing the result shape.
3754 # @ref tui_multi_transformation "Example"
3755 def MakeMultiTransformation1D(self,Block, DirFace1, DirFace2, NbTimes):
3756 # Example: see GEOM_Spanner.py
3757 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
3758 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
3759 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
3760 anObj.SetParameters(Parameters)
3763 ## Multi-transformate block and glue the result.
3764 # @param Block Hexahedral solid to be multi-transformed.
3765 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
3766 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
3767 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
3768 # @return New GEOM_Object, containing the result shape.
3770 # @ref tui_multi_transformation "Example"
3771 def MakeMultiTransformation2D(self,Block, DirFace1U, DirFace2U, NbTimesU,
3772 DirFace1V, DirFace2V, NbTimesV):
3773 # Example: see GEOM_Spanner.py
3774 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
3775 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
3776 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
3777 DirFace1V, DirFace2V, NbTimesV)
3778 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
3779 anObj.SetParameters(Parameters)
3782 ## Build all possible propagation groups.
3783 # Propagation group is a set of all edges, opposite to one (main)
3784 # edge of this group directly or through other opposite edges.
3785 # Notion of Opposite Edge make sence only on quadrangle face.
3786 # @param theShape Shape to build propagation groups on.
3787 # @return List of GEOM_Objects, each of them is a propagation group.
3789 # @ref swig_Propagate "Example"
3790 def Propagate(self,theShape):
3791 # Example: see GEOM_TestOthers.py
3792 listChains = self.BlocksOp.Propagate(theShape)
3793 RaiseIfFailed("Propagate", self.BlocksOp)
3796 # end of l3_blocks_op
3799 ## @addtogroup l3_groups
3802 ## Creates a new group which will store sub shapes of theMainShape
3803 # @param theMainShape is a GEOM object on which the group is selected
3804 # @param theShapeType defines a shape type of the group
3805 # @return a newly created GEOM group
3807 # @ref tui_working_with_groups_page "Example 1"
3808 # \n @ref swig_CreateGroup "Example 2"
3809 def CreateGroup(self,theMainShape, theShapeType):
3810 # Example: see GEOM_TestOthers.py
3811 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
3812 RaiseIfFailed("CreateGroup", self.GroupOp)
3815 ## Adds a sub object with ID theSubShapeId to the group
3816 # @param theGroup is a GEOM group to which the new sub shape is added
3817 # @param theSubShapeID is a sub shape ID in the main object.
3818 # \note Use method GetSubShapeID() to get an unique ID of the sub shape
3820 # @ref tui_working_with_groups_page "Example"
3821 def AddObject(self,theGroup, theSubShapeID):
3822 # Example: see GEOM_TestOthers.py
3823 self.GroupOp.AddObject(theGroup, theSubShapeID)
3824 RaiseIfFailed("AddObject", self.GroupOp)
3827 ## Removes a sub object with ID \a theSubShapeId from the group
3828 # @param theGroup is a GEOM group from which the new sub shape is removed
3829 # @param theSubShapeID is a sub shape ID in the main object.
3830 # \note Use method GetSubShapeID() to get an unique ID of the sub shape
3832 # @ref tui_working_with_groups_page "Example"
3833 def RemoveObject(self,theGroup, theSubShapeID):
3834 # Example: see GEOM_TestOthers.py
3835 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
3836 RaiseIfFailed("RemoveObject", self.GroupOp)
3839 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
3840 # @param theGroup is a GEOM group to which the new sub shapes are added.
3841 # @param theSubShapes is a list of sub shapes to be added.
3843 # @ref tui_working_with_groups_page "Example"
3844 def UnionList (self,theGroup, theSubShapes):
3845 # Example: see GEOM_TestOthers.py
3846 self.GroupOp.UnionList(theGroup, theSubShapes)
3847 RaiseIfFailed("UnionList", self.GroupOp)
3850 ## Works like the above method, but argument
3851 # theSubShapes here is a list of sub-shapes indices
3853 # @ref swig_UnionIDs "Example"
3854 def UnionIDs(self,theGroup, theSubShapes):
3855 # Example: see GEOM_TestOthers.py
3856 self.GroupOp.UnionIDs(theGroup, theSubShapes)
3857 RaiseIfFailed("UnionIDs", self.GroupOp)
3860 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
3861 # @param theGroup is a GEOM group from which the sub-shapes are removed.
3862 # @param theSubShapes is a list of sub-shapes to be removed.
3864 # @ref tui_working_with_groups_page "Example"
3865 def DifferenceList (self,theGroup, theSubShapes):
3866 # Example: see GEOM_TestOthers.py
3867 self.GroupOp.DifferenceList(theGroup, theSubShapes)
3868 RaiseIfFailed("DifferenceList", self.GroupOp)
3871 ## Works like the above method, but argument
3872 # theSubShapes here is a list of sub-shapes indices
3874 # @ref swig_DifferenceIDs "Example"
3875 def DifferenceIDs(self,theGroup, theSubShapes):
3876 # Example: see GEOM_TestOthers.py
3877 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
3878 RaiseIfFailed("DifferenceIDs", self.GroupOp)
3881 ## Returns a list of sub objects ID stored in the group
3882 # @param theGroup is a GEOM group for which a list of IDs is requested
3884 # @ref swig_GetObjectIDs "Example"
3885 def GetObjectIDs(self,theGroup):
3886 # Example: see GEOM_TestOthers.py
3887 ListIDs = self.GroupOp.GetObjects(theGroup)
3888 RaiseIfFailed("GetObjects", self.GroupOp)
3891 ## Returns a type of sub objects stored in the group
3892 # @param theGroup is a GEOM group which type is returned.
3894 # @ref swig_GetType "Example"
3895 def GetType(self,theGroup):
3896 # Example: see GEOM_TestOthers.py
3897 aType = self.GroupOp.GetType(theGroup)
3898 RaiseIfFailed("GetType", self.GroupOp)
3901 ## Convert a type of geom object from id to string value
3902 # @param theId is a GEOM obect type id.
3904 # @ref swig_GetType "Example"
3905 def ShapeIdToType(self, theId):
3979 return "FREE_BOUNDS"
3987 return "THRUSECTIONS"
3989 return "COMPOUNDFILTER"
3991 return "SHAPES_ON_SHAPE"
3993 return "ELLIPSE_ARC"
4000 return "Shape Id not exist."
4002 ## Returns a main shape associated with the group
4003 # @param theGroup is a GEOM group for which a main shape object is requested
4004 # @return a GEOM object which is a main shape for theGroup
4006 # @ref swig_GetMainShape "Example"
4007 def GetMainShape(self,theGroup):
4008 # Example: see GEOM_TestOthers.py
4009 anObj = self.GroupOp.GetMainShape(theGroup)
4010 RaiseIfFailed("GetMainShape", self.GroupOp)
4013 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
4014 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
4016 # @ref swig_todo "Example"
4017 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1):
4018 edges = self.SubShapeAll(theShape, ShapeType["EDGE"])
4021 Props = self.BasicProperties(edge)
4022 if min_length <= Props[0] and Props[0] <= max_length:
4023 if (not include_min) and (min_length == Props[0]):
4026 if (not include_max) and (Props[0] == max_length):
4029 edges_in_range.append(edge)
4031 if len(edges_in_range) <= 0:
4032 print "No edges found by given criteria"
4035 group_edges = self.CreateGroup(theShape, ShapeType["EDGE"])
4036 self.UnionList(group_edges, edges_in_range)
4040 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
4041 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
4043 # @ref swig_todo "Example"
4044 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
4045 nb_selected = sg.SelectedCount()
4047 print "Select a shape before calling this function, please."
4050 print "Only one shape must be selected"
4053 id_shape = sg.getSelected(0)
4054 shape = IDToObject( id_shape )
4056 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
4060 if include_min: left_str = " <= "
4061 if include_max: right_str = " <= "
4063 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
4064 + left_str + "length" + right_str + `max_length`)
4066 sg.updateObjBrowser(1)
4073 ## Create a copy of the given object
4074 # @ingroup l1_geompy_auxiliary
4076 # @ref swig_all_advanced "Example"
4077 def MakeCopy(self,theOriginal):
4078 # Example: see GEOM_TestAll.py
4079 anObj = self.InsertOp.MakeCopy(theOriginal)
4080 RaiseIfFailed("MakeCopy", self.InsertOp)
4083 ## Add Path to load python scripts from
4084 # @ingroup l1_geompy_auxiliary
4085 def addPath(self,Path):
4086 if (sys.path.count(Path) < 1):
4087 sys.path.append(Path)
4091 ## Load marker texture from the file
4092 # @param Path a path to the texture file
4093 # @return unique texture identifier
4094 # @ingroup l1_geompy_auxiliary
4095 def LoadTexture(self, Path):
4096 # Example: see GEOM_TestAll.py
4097 ID = self.InsertOp.LoadTexture(Path)
4098 RaiseIfFailed("LoadTexture", self.InsertOp)
4101 ## Add marker texture. @a Width and @a Height parameters
4102 # specify width and height of the texture in pixels.
4103 # If @a RowData is @c True, @a Texture parameter should represent texture data
4104 # packed into the byte array. If @a RowData is @c False (default), @a Texture
4105 # parameter should be unpacked string, in which '1' symbols represent opaque
4106 # pixels and '0' represent transparent pixels of the texture bitmap.
4108 # @param Width texture width in pixels
4109 # @param Height texture height in pixels
4110 # @param Texture texture data
4111 # @param RowData if @c True, @a Texture data are packed in the byte stream
4112 # @ingroup l1_geompy_auxiliary
4113 def AddTexture(self, Width, Height, Texture, RowData=False):
4114 # Example: see GEOM_TestAll.py
4115 if not RowData: Texture = PackData(Texture)
4116 ID = self.InsertOp.AddTexture(Width, Height, Texture)
4117 RaiseIfFailed("AddTexture", self.InsertOp)
4121 #Register the new proxy for GEOM_Gen
4122 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geompyDC)