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.
691 # @param theOrigin Point of coordinate system origin.
692 # @param theXVec Vector of X direction
693 # @param theYVec Vector of Y direction
694 # @return New GEOM_Object, containing the created coordinate system.
696 # @ref swig_MakeMarker "Example"
697 def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec):
698 O = self.PointCoordinates( theOrigin )
700 for vec in [ theXVec, theYVec ]:
701 v1, v2 = self.SubShapeAll( vec, ShapeType["VERTEX"] )
702 p1 = self.PointCoordinates( v1 )
703 p2 = self.PointCoordinates( v2 )
704 for i in range( 0, 3 ):
705 OXOY.append( p2[i] - p1[i] )
707 anObj = self.BasicOp.MakeMarker( O[0], O[1], O[2],
708 OXOY[0], OXOY[1], OXOY[2],
709 OXOY[3], OXOY[4], OXOY[5], )
710 RaiseIfFailed("MakeMarker", self.BasicOp)
716 ## @addtogroup l4_curves
719 ## Create an arc of circle, passing through three given points.
720 # @param thePnt1 Start point of the arc.
721 # @param thePnt2 Middle point of the arc.
722 # @param thePnt3 End point of the arc.
723 # @return New GEOM_Object, containing the created arc.
725 # @ref swig_MakeArc "Example"
726 def MakeArc(self,thePnt1, thePnt2, thePnt3):
727 # Example: see GEOM_TestAll.py
728 anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
729 RaiseIfFailed("MakeArc", self.CurvesOp)
732 ## Create an arc of circle from a center and 2 points.
733 # @param thePnt1 Center of the arc
734 # @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
735 # @param thePnt3 End point of the arc (Gives also a direction)
736 # @param theSense Orientation of the arc
737 # @return New GEOM_Object, containing the created arc.
739 # @ref swig_MakeArc "Example"
740 def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False):
741 # Example: see GEOM_TestAll.py
742 anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
743 RaiseIfFailed("MakeArcCenter", self.CurvesOp)
746 ## Create an arc of ellipse, of center and two points.
747 # @param theCenter Center of the arc.
748 # @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
749 # @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
750 # @return New GEOM_Object, containing the created arc.
752 # @ref swig_MakeArc "Example"
753 def MakeArcOfEllipse(self,theCenter, thePnt1, thePnt2):
754 # Example: see GEOM_TestAll.py
755 anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
756 RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
759 ## Create a circle with given center, normal vector and radius.
760 # @param thePnt Circle center.
761 # @param theVec Vector, normal to the plane of the circle.
762 # @param theR Circle radius.
763 # @return New GEOM_Object, containing the created circle.
765 # @ref tui_creation_circle "Example"
766 def MakeCircle(self, thePnt, theVec, theR):
767 # Example: see GEOM_TestAll.py
768 theR, Parameters = ParseParameters(theR)
769 anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
770 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
771 anObj.SetParameters(Parameters)
774 ## Create a circle with given radius.
775 # Center of the circle will be in the origin of global
776 # coordinate system and normal vector will be codirected with Z axis
777 # @param theR Circle radius.
778 # @return New GEOM_Object, containing the created circle.
779 def MakeCircleR(self, theR):
780 anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
781 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
784 ## Create a circle, passing through three given points
785 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
786 # @return New GEOM_Object, containing the created circle.
788 # @ref tui_creation_circle "Example"
789 def MakeCircleThreePnt(self,thePnt1, thePnt2, thePnt3):
790 # Example: see GEOM_TestAll.py
791 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
792 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
795 ## Create a circle, with given point1 as center,
796 # passing through the point2 as radius and laying in the plane,
797 # defined by all three given points.
798 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
799 # @return New GEOM_Object, containing the created circle.
801 # @ref swig_MakeCircle "Example"
802 def MakeCircleCenter2Pnt(self,thePnt1, thePnt2, thePnt3):
803 # Example: see GEOM_example6.py
804 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
805 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
808 ## Create an ellipse with given center, normal vector and radiuses.
809 # @param thePnt Ellipse center.
810 # @param theVec Vector, normal to the plane of the ellipse.
811 # @param theRMajor Major ellipse radius.
812 # @param theRMinor Minor ellipse radius.
813 # @param theVecMaj Vector, direction of the ellipse's main axis.
814 # @return New GEOM_Object, containing the created ellipse.
816 # @ref tui_creation_ellipse "Example"
817 def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None):
818 # Example: see GEOM_TestAll.py
819 theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
820 if theVecMaj is not None:
821 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
823 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
825 RaiseIfFailed("MakeEllipse", self.CurvesOp)
826 anObj.SetParameters(Parameters)
829 ## Create an ellipse with given radiuses.
830 # Center of the ellipse will be in the origin of global
831 # coordinate system and normal vector will be codirected with Z axis
832 # @param theRMajor Major ellipse radius.
833 # @param theRMinor Minor ellipse radius.
834 # @return New GEOM_Object, containing the created ellipse.
835 def MakeEllipseRR(self, theRMajor, theRMinor):
836 anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
837 RaiseIfFailed("MakeEllipse", self.CurvesOp)
840 ## Create a polyline on the set of points.
841 # @param thePoints Sequence of points for the polyline.
842 # @return New GEOM_Object, containing the created polyline.
844 # @ref tui_creation_curve "Example"
845 def MakePolyline(self,thePoints):
846 # Example: see GEOM_TestAll.py
847 anObj = self.CurvesOp.MakePolyline(thePoints)
848 RaiseIfFailed("MakePolyline", self.CurvesOp)
851 ## Create bezier curve on the set of points.
852 # @param thePoints Sequence of points for the bezier curve.
853 # @return New GEOM_Object, containing the created bezier curve.
855 # @ref tui_creation_curve "Example"
856 def MakeBezier(self,thePoints):
857 # Example: see GEOM_TestAll.py
858 anObj = self.CurvesOp.MakeSplineBezier(thePoints)
859 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
862 ## Create B-Spline curve on the set of points.
863 # @param thePoints Sequence of points for the B-Spline curve.
864 # @param theIsClosed If True, build a closed curve.
865 # @return New GEOM_Object, containing the created B-Spline curve.
867 # @ref tui_creation_curve "Example"
868 def MakeInterpol(self, thePoints, theIsClosed=False):
869 # Example: see GEOM_TestAll.py
870 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed)
871 RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
877 ## @addtogroup l3_sketcher
880 ## Create a sketcher (wire or face), following the textual description,
881 # passed through <VAR>theCommand</VAR> argument. \n
882 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
883 # Format of the description string have to be the following:
885 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
888 # - x1, y1 are coordinates of the first sketcher point (zero by default),
890 # - "R angle" : Set the direction by angle
891 # - "D dx dy" : Set the direction by DX & DY
894 # - "TT x y" : Create segment by point at X & Y
895 # - "T dx dy" : Create segment by point with DX & DY
896 # - "L length" : Create segment by direction & Length
897 # - "IX x" : Create segment by direction & Intersect. X
898 # - "IY y" : Create segment by direction & Intersect. Y
901 # - "C radius length" : Create arc by direction, radius and length(in degree)
904 # - "WW" : Close Wire (to finish)
905 # - "WF" : Close Wire and build face (to finish)
907 # @param theCommand String, defining the sketcher in local
908 # coordinates of the working plane.
909 # @param theWorkingPlane Nine double values, defining origin,
910 # OZ and OX directions of the working plane.
911 # @return New GEOM_Object, containing the created wire.
913 # @ref tui_sketcher_page "Example"
914 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0]):
915 # Example: see GEOM_TestAll.py
916 theCommand,Parameters = ParseSketcherCommand(theCommand)
917 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
918 RaiseIfFailed("MakeSketcher", self.CurvesOp)
919 anObj.SetParameters(Parameters)
922 ## Create a sketcher (wire or face), following the textual description,
923 # passed through <VAR>theCommand</VAR> argument. \n
924 # For format of the description string see the previous method.\n
925 # @param theCommand String, defining the sketcher in local
926 # coordinates of the working plane.
927 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
928 # @return New GEOM_Object, containing the created wire.
930 # @ref tui_sketcher_page "Example"
931 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane):
932 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
933 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
936 ## Create a sketcher wire, following the numerical description,
937 # passed through <VAR>theCoordinates</VAR> argument. \n
938 # @param theCoordinates double values, defining points to create a wire,
940 # @return New GEOM_Object, containing the created wire.
942 # @ref tui_sketcher_page "Example"
943 def Make3DSketcher(self, theCoordinates):
944 anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
945 RaiseIfFailed("Make3DSketcher", self.CurvesOp)
951 ## @addtogroup l3_3d_primitives
954 ## Create a box by coordinates of two opposite vertices.
956 # @ref tui_creation_box "Example"
957 def MakeBox(self,x1,y1,z1,x2,y2,z2):
958 # Example: see GEOM_TestAll.py
959 pnt1 = self.MakeVertex(x1,y1,z1)
960 pnt2 = self.MakeVertex(x2,y2,z2)
961 return self.MakeBoxTwoPnt(pnt1,pnt2)
963 ## Create a box with specified dimensions along the coordinate axes
964 # and with edges, parallel to the coordinate axes.
965 # Center of the box will be at point (DX/2, DY/2, DZ/2).
966 # @param theDX Length of Box edges, parallel to OX axis.
967 # @param theDY Length of Box edges, parallel to OY axis.
968 # @param theDZ Length of Box edges, parallel to OZ axis.
969 # @return New GEOM_Object, containing the created box.
971 # @ref tui_creation_box "Example"
972 def MakeBoxDXDYDZ(self,theDX, theDY, theDZ):
973 # Example: see GEOM_TestAll.py
974 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
975 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
976 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
977 anObj.SetParameters(Parameters)
980 ## Create a box with two specified opposite vertices,
981 # and with edges, parallel to the coordinate axes
982 # @param thePnt1 First of two opposite vertices.
983 # @param thePnt2 Second of two opposite vertices.
984 # @return New GEOM_Object, containing the created box.
986 # @ref tui_creation_box "Example"
987 def MakeBoxTwoPnt(self,thePnt1, thePnt2):
988 # Example: see GEOM_TestAll.py
989 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
990 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
993 ## Create a face with specified dimensions along OX-OY coordinate axes,
994 # with edges, parallel to this coordinate axes.
995 # @param theH height of Face.
996 # @param theW width of Face.
997 # @param theOrientation orientation belong axis OXY OYZ OZX
998 # @return New GEOM_Object, containing the created face.
1000 # @ref tui_creation_face "Example"
1001 def MakeFaceHW(self,theH, theW, theOrientation):
1002 # Example: see GEOM_TestAll.py
1003 theH,theW,Parameters = ParseParameters(theH, theW)
1004 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
1005 RaiseIfFailed("MakeFaceHW", self.PrimOp)
1006 anObj.SetParameters(Parameters)
1009 ## Create a face from another plane and two sizes,
1010 # vertical size and horisontal size.
1011 # @param theObj Normale vector to the creating face or
1013 # @param theH Height (vertical size).
1014 # @param theW Width (horisontal size).
1015 # @return New GEOM_Object, containing the created face.
1017 # @ref tui_creation_face "Example"
1018 def MakeFaceObjHW(self, theObj, theH, theW):
1019 # Example: see GEOM_TestAll.py
1020 theH,theW,Parameters = ParseParameters(theH, theW)
1021 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
1022 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
1023 anObj.SetParameters(Parameters)
1026 ## Create a disk with given center, normal vector and radius.
1027 # @param thePnt Disk center.
1028 # @param theVec Vector, normal to the plane of the disk.
1029 # @param theR Disk radius.
1030 # @return New GEOM_Object, containing the created disk.
1032 # @ref tui_creation_disk "Example"
1033 def MakeDiskPntVecR(self,thePnt, theVec, theR):
1034 # Example: see GEOM_TestAll.py
1035 theR,Parameters = ParseParameters(theR)
1036 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
1037 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
1038 anObj.SetParameters(Parameters)
1041 ## Create a disk, passing through three given points
1042 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
1043 # @return New GEOM_Object, containing the created disk.
1045 # @ref tui_creation_disk "Example"
1046 def MakeDiskThreePnt(self,thePnt1, thePnt2, thePnt3):
1047 # Example: see GEOM_TestAll.py
1048 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
1049 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
1052 ## Create a disk with specified dimensions along OX-OY coordinate axes.
1053 # @param theR Radius of Face.
1054 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
1055 # @return New GEOM_Object, containing the created disk.
1057 # @ref tui_creation_face "Example"
1058 def MakeDiskR(self,theR, theOrientation):
1059 # Example: see GEOM_TestAll.py
1060 theR,Parameters = ParseParameters(theR)
1061 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
1062 RaiseIfFailed("MakeDiskR", self.PrimOp)
1063 anObj.SetParameters(Parameters)
1066 ## Create a cylinder with given base point, axis, radius and height.
1067 # @param thePnt Central point of cylinder base.
1068 # @param theAxis Cylinder axis.
1069 # @param theR Cylinder radius.
1070 # @param theH Cylinder height.
1071 # @return New GEOM_Object, containing the created cylinder.
1073 # @ref tui_creation_cylinder "Example"
1074 def MakeCylinder(self,thePnt, theAxis, theR, theH):
1075 # Example: see GEOM_TestAll.py
1076 theR,theH,Parameters = ParseParameters(theR, theH)
1077 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
1078 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
1079 anObj.SetParameters(Parameters)
1082 ## Create a cylinder with given radius and height at
1083 # the origin of coordinate system. Axis of the cylinder
1084 # will be collinear to the OZ axis of the coordinate system.
1085 # @param theR Cylinder radius.
1086 # @param theH Cylinder height.
1087 # @return New GEOM_Object, containing the created cylinder.
1089 # @ref tui_creation_cylinder "Example"
1090 def MakeCylinderRH(self,theR, theH):
1091 # Example: see GEOM_TestAll.py
1092 theR,theH,Parameters = ParseParameters(theR, theH)
1093 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
1094 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
1095 anObj.SetParameters(Parameters)
1098 ## Create a sphere with given center and radius.
1099 # @param thePnt Sphere center.
1100 # @param theR Sphere radius.
1101 # @return New GEOM_Object, containing the created sphere.
1103 # @ref tui_creation_sphere "Example"
1104 def MakeSpherePntR(self, thePnt, theR):
1105 # Example: see GEOM_TestAll.py
1106 theR,Parameters = ParseParameters(theR)
1107 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
1108 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
1109 anObj.SetParameters(Parameters)
1112 ## Create a sphere with given center and radius.
1113 # @param x,y,z Coordinates of sphere center.
1114 # @param theR Sphere radius.
1115 # @return New GEOM_Object, containing the created sphere.
1117 # @ref tui_creation_sphere "Example"
1118 def MakeSphere(self, x, y, z, theR):
1119 # Example: see GEOM_TestAll.py
1120 point = self.MakeVertex(x, y, z)
1121 anObj = self.MakeSpherePntR(point, theR)
1124 ## Create a sphere with given radius at the origin of coordinate system.
1125 # @param theR Sphere radius.
1126 # @return New GEOM_Object, containing the created sphere.
1128 # @ref tui_creation_sphere "Example"
1129 def MakeSphereR(self, theR):
1130 # Example: see GEOM_TestAll.py
1131 theR,Parameters = ParseParameters(theR)
1132 anObj = self.PrimOp.MakeSphereR(theR)
1133 RaiseIfFailed("MakeSphereR", self.PrimOp)
1134 anObj.SetParameters(Parameters)
1137 ## Create a cone with given base point, axis, height and radiuses.
1138 # @param thePnt Central point of the first cone base.
1139 # @param theAxis Cone axis.
1140 # @param theR1 Radius of the first cone base.
1141 # @param theR2 Radius of the second cone base.
1142 # \note If both radiuses are non-zero, the cone will be truncated.
1143 # \note If the radiuses are equal, a cylinder will be created instead.
1144 # @param theH Cone height.
1145 # @return New GEOM_Object, containing the created cone.
1147 # @ref tui_creation_cone "Example"
1148 def MakeCone(self,thePnt, theAxis, theR1, theR2, theH):
1149 # Example: see GEOM_TestAll.py
1150 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
1151 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
1152 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
1153 anObj.SetParameters(Parameters)
1156 ## Create a cone with given height and radiuses at
1157 # the origin of coordinate system. Axis of the cone will
1158 # be collinear to the OZ axis of the coordinate system.
1159 # @param theR1 Radius of the first cone base.
1160 # @param theR2 Radius of the second cone base.
1161 # \note If both radiuses are non-zero, the cone will be truncated.
1162 # \note If the radiuses are equal, a cylinder will be created instead.
1163 # @param theH Cone height.
1164 # @return New GEOM_Object, containing the created cone.
1166 # @ref tui_creation_cone "Example"
1167 def MakeConeR1R2H(self,theR1, theR2, theH):
1168 # Example: see GEOM_TestAll.py
1169 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
1170 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
1171 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
1172 anObj.SetParameters(Parameters)
1175 ## Create a torus with given center, normal vector and radiuses.
1176 # @param thePnt Torus central point.
1177 # @param theVec Torus axis of symmetry.
1178 # @param theRMajor Torus major radius.
1179 # @param theRMinor Torus minor radius.
1180 # @return New GEOM_Object, containing the created torus.
1182 # @ref tui_creation_torus "Example"
1183 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor):
1184 # Example: see GEOM_TestAll.py
1185 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
1186 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
1187 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
1188 anObj.SetParameters(Parameters)
1191 ## Create a torus with given radiuses at the origin of coordinate system.
1192 # @param theRMajor Torus major radius.
1193 # @param theRMinor Torus minor radius.
1194 # @return New GEOM_Object, containing the created torus.
1196 # @ref tui_creation_torus "Example"
1197 def MakeTorusRR(self, theRMajor, theRMinor):
1198 # Example: see GEOM_TestAll.py
1199 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
1200 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
1201 RaiseIfFailed("MakeTorusRR", self.PrimOp)
1202 anObj.SetParameters(Parameters)
1205 # end of l3_3d_primitives
1208 ## @addtogroup l3_complex
1211 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
1212 # @param theBase Base shape to be extruded.
1213 # @param thePoint1 First end of extrusion vector.
1214 # @param thePoint2 Second end of extrusion vector.
1215 # @return New GEOM_Object, containing the created prism.
1217 # @ref tui_creation_prism "Example"
1218 def MakePrism(self, theBase, thePoint1, thePoint2):
1219 # Example: see GEOM_TestAll.py
1220 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
1221 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
1224 ## Create a shape by extrusion of the base shape along the vector,
1225 # i.e. all the space, transfixed by the base shape during its translation
1226 # along the vector on the given distance.
1227 # @param theBase Base shape to be extruded.
1228 # @param theVec Direction of extrusion.
1229 # @param theH Prism dimension along theVec.
1230 # @return New GEOM_Object, containing the created prism.
1232 # @ref tui_creation_prism "Example"
1233 def MakePrismVecH(self, theBase, theVec, theH):
1234 # Example: see GEOM_TestAll.py
1235 theH,Parameters = ParseParameters(theH)
1236 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
1237 RaiseIfFailed("MakePrismVecH", self.PrimOp)
1238 anObj.SetParameters(Parameters)
1241 ## Create a shape by extrusion of the base shape along the vector,
1242 # i.e. all the space, transfixed by the base shape during its translation
1243 # along the vector on the given distance in 2 Ways (forward/backward) .
1244 # @param theBase Base shape to be extruded.
1245 # @param theVec Direction of extrusion.
1246 # @param theH Prism dimension along theVec in forward direction.
1247 # @return New GEOM_Object, containing the created prism.
1249 # @ref tui_creation_prism "Example"
1250 def MakePrismVecH2Ways(self, theBase, theVec, theH):
1251 # Example: see GEOM_TestAll.py
1252 theH,Parameters = ParseParameters(theH)
1253 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
1254 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
1255 anObj.SetParameters(Parameters)
1258 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
1259 # @param theBase Base shape to be extruded.
1260 # @param theDX, theDY, theDZ Directions of extrusion.
1261 # @return New GEOM_Object, containing the created prism.
1263 # @ref tui_creation_prism "Example"
1264 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ):
1265 # Example: see GEOM_TestAll.py
1266 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1267 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
1268 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
1269 anObj.SetParameters(Parameters)
1272 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
1273 # i.e. all the space, transfixed by the base shape during its translation
1274 # along the vector on the given distance in 2 Ways (forward/backward) .
1275 # @param theBase Base shape to be extruded.
1276 # @param theDX, theDY, theDZ Directions of extrusion.
1277 # @return New GEOM_Object, containing the created prism.
1279 # @ref tui_creation_prism "Example"
1280 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ):
1281 # Example: see GEOM_TestAll.py
1282 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1283 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
1284 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
1285 anObj.SetParameters(Parameters)
1288 ## Create a shape by revolution of the base shape around the axis
1289 # on the given angle, i.e. all the space, transfixed by the base
1290 # shape during its rotation around the axis on the given angle.
1291 # @param theBase Base shape to be rotated.
1292 # @param theAxis Rotation axis.
1293 # @param theAngle Rotation angle in radians.
1294 # @return New GEOM_Object, containing the created revolution.
1296 # @ref tui_creation_revolution "Example"
1297 def MakeRevolution(self, theBase, theAxis, theAngle):
1298 # Example: see GEOM_TestAll.py
1299 theAngle,Parameters = ParseParameters(theAngle)
1300 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
1301 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
1302 anObj.SetParameters(Parameters)
1305 ## The Same Revolution but in both ways forward&backward.
1306 def MakeRevolution2Ways(self, theBase, theAxis, theAngle):
1307 theAngle,Parameters = ParseParameters(theAngle)
1308 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
1309 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
1310 anObj.SetParameters(Parameters)
1313 ## Create a filling from the given compound of contours.
1314 # @param theShape the compound of contours
1315 # @param theMinDeg a minimal degree of BSpline surface to create
1316 # @param theMaxDeg a maximal degree of BSpline surface to create
1317 # @param theTol2D a 2d tolerance to be reached
1318 # @param theTol3D a 3d tolerance to be reached
1319 # @param theNbIter a number of iteration of approximation algorithm
1320 # @param isApprox if True, BSpline curves are generated in the process
1321 # of surface construction. By default it is False, that means
1322 # the surface is created using Besier curves. The usage of
1323 # Approximation makes the algorithm work slower, but allows
1324 # building the surface for rather complex cases
1325 # @return New GEOM_Object, containing the created filling surface.
1327 # @ref tui_creation_filling "Example"
1328 def MakeFilling(self, theShape, theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter, isApprox=0):
1329 # Example: see GEOM_TestAll.py
1330 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg,
1331 theTol2D, theTol3D, theNbIter)
1332 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
1333 theTol2D, theTol3D, theNbIter, isApprox)
1334 RaiseIfFailed("MakeFilling", self.PrimOp)
1335 anObj.SetParameters(Parameters)
1338 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
1339 # @param theSeqSections - set of specified sections.
1340 # @param theModeSolid - mode defining building solid or shell
1341 # @param thePreci - precision 3D used for smoothing by default 1.e-6
1342 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
1343 # @return New GEOM_Object, containing the created shell or solid.
1345 # @ref swig_todo "Example"
1346 def MakeThruSections(self,theSeqSections,theModeSolid,thePreci,theRuled):
1347 # Example: see GEOM_TestAll.py
1348 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
1349 RaiseIfFailed("MakeThruSections", self.PrimOp)
1352 ## Create a shape by extrusion of the base shape along
1353 # the path shape. The path shape can be a wire or an edge.
1354 # @param theBase Base shape to be extruded.
1355 # @param thePath Path shape to extrude the base shape along it.
1356 # @return New GEOM_Object, containing the created pipe.
1358 # @ref tui_creation_pipe "Example"
1359 def MakePipe(self,theBase, thePath):
1360 # Example: see GEOM_TestAll.py
1361 anObj = self.PrimOp.MakePipe(theBase, thePath)
1362 RaiseIfFailed("MakePipe", self.PrimOp)
1365 ## Create a shape by extrusion of the profile shape along
1366 # the path shape. The path shape can be a wire or an edge.
1367 # the several profiles can be specified in the several locations of path.
1368 # @param theSeqBases - list of Bases shape to be extruded.
1369 # @param theLocations - list of locations on the path corresponding
1370 # specified list of the Bases shapes. Number of locations
1371 # should be equal to number of bases or list of locations can be empty.
1372 # @param thePath - Path shape to extrude the base shape along it.
1373 # @param theWithContact - the mode defining that the section is translated to be in
1374 # contact with the spine.
1375 # @param theWithCorrection - defining that the section is rotated to be
1376 # orthogonal to the spine tangent in the correspondent point
1377 # @return New GEOM_Object, containing the created pipe.
1379 # @ref tui_creation_pipe_with_diff_sec "Example"
1380 def MakePipeWithDifferentSections(self, theSeqBases,
1381 theLocations, thePath,
1382 theWithContact, theWithCorrection):
1383 anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
1384 theLocations, thePath,
1385 theWithContact, theWithCorrection)
1386 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
1389 ## Create a shape by extrusion of the profile shape along
1390 # the path shape. The path shape can be a wire or a edge.
1391 # the several profiles can be specified in the several locations of path.
1392 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
1393 # shell or face. If number of faces in neighbour sections
1394 # aren't coincided result solid between such sections will
1395 # be created using external boundaries of this shells.
1396 # @param theSeqSubBases - list of corresponding subshapes of section shapes.
1397 # This list is used for searching correspondences between
1398 # faces in the sections. Size of this list must be equal
1399 # to size of list of base shapes.
1400 # @param theLocations - list of locations on the path corresponding
1401 # specified list of the Bases shapes. Number of locations
1402 # should be equal to number of bases. First and last
1403 # locations must be coincided with first and last vertexes
1404 # of path correspondingly.
1405 # @param thePath - Path shape to extrude the base shape along it.
1406 # @param theWithContact - the mode defining that the section is translated to be in
1407 # contact with the spine.
1408 # @param theWithCorrection - defining that the section is rotated to be
1409 # orthogonal to the spine tangent in the correspondent point
1410 # @return New GEOM_Object, containing the created solids.
1412 # @ref tui_creation_pipe_with_shell_sec "Example"
1413 def MakePipeWithShellSections(self,theSeqBases, theSeqSubBases,
1414 theLocations, thePath,
1415 theWithContact, theWithCorrection):
1416 anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
1417 theLocations, thePath,
1418 theWithContact, theWithCorrection)
1419 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
1422 ## Create a shape by extrusion of the profile shape along
1423 # the path shape. This function is used only for debug pipe
1424 # functionality - it is a version of previous function
1425 # (MakePipeWithShellSections(...)) which give a possibility to
1426 # recieve information about creating pipe between each pair of
1427 # sections step by step.
1428 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
1429 theLocations, thePath,
1430 theWithContact, theWithCorrection):
1432 nbsect = len(theSeqBases)
1433 nbsubsect = len(theSeqSubBases)
1434 #print "nbsect = ",nbsect
1435 for i in range(1,nbsect):
1437 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
1438 tmpLocations = [ theLocations[i-1], theLocations[i] ]
1440 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
1441 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
1442 tmpLocations, thePath,
1443 theWithContact, theWithCorrection)
1444 if self.PrimOp.IsDone() == 0:
1445 print "Problems with pipe creation between ",i," and ",i+1," sections"
1446 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
1449 print "Pipe between ",i," and ",i+1," sections is OK"
1454 resc = self.MakeCompound(res)
1455 #resc = self.MakeSewing(res, 0.001)
1456 #print "resc: ",resc
1459 ## Create solids between given sections
1460 # @param theSeqBases - list of sections (shell or face).
1461 # @param theLocations - list of corresponding vertexes
1462 # @return New GEOM_Object, containing the created solids.
1464 # @ref tui_creation_pipe_without_path "Example"
1465 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations):
1466 anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
1467 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
1470 ## Create a shape by extrusion of the base shape along
1471 # the path shape with constant bi-normal direction along the given vector.
1472 # The path shape can be a wire or an edge.
1473 # @param theBase Base shape to be extruded.
1474 # @param thePath Path shape to extrude the base shape along it.
1475 # @param theVec Vector defines a constant binormal direction to keep the
1476 # same angle beetween the direction and the sections
1477 # along the sweep surface.
1478 # @return New GEOM_Object, containing the created pipe.
1480 # @ref tui_creation_pipe "Example"
1481 def MakePipeBiNormalAlongVector(self,theBase, thePath, theVec):
1482 # Example: see GEOM_TestAll.py
1483 anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
1484 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
1490 ## @addtogroup l3_advanced
1493 ## Create a linear edge with specified ends.
1494 # @param thePnt1 Point for the first end of edge.
1495 # @param thePnt2 Point for the second end of edge.
1496 # @return New GEOM_Object, containing the created edge.
1498 # @ref tui_creation_edge "Example"
1499 def MakeEdge(self,thePnt1, thePnt2):
1500 # Example: see GEOM_TestAll.py
1501 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
1502 RaiseIfFailed("MakeEdge", self.ShapesOp)
1505 ## Create a wire from the set of edges and wires.
1506 # @param theEdgesAndWires List of edges and/or wires.
1507 # @param theTolerance Maximum distance between vertices, that will be merged.
1508 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
1509 # @return New GEOM_Object, containing the created wire.
1511 # @ref tui_creation_wire "Example"
1512 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07):
1513 # Example: see GEOM_TestAll.py
1514 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
1515 RaiseIfFailed("MakeWire", self.ShapesOp)
1518 ## Create a face on the given wire.
1519 # @param theWire closed Wire or Edge to build the face on.
1520 # @param isPlanarWanted If TRUE, only planar face will be built.
1521 # If impossible, NULL object will be returned.
1522 # @return New GEOM_Object, containing the created face.
1524 # @ref tui_creation_face "Example"
1525 def MakeFace(self,theWire, isPlanarWanted):
1526 # Example: see GEOM_TestAll.py
1527 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
1528 RaiseIfFailed("MakeFace", self.ShapesOp)
1531 ## Create a face on the given wires set.
1532 # @param theWires List of closed wires or edges to build the face on.
1533 # @param isPlanarWanted If TRUE, only planar face will be built.
1534 # If impossible, NULL object will be returned.
1535 # @return New GEOM_Object, containing the created face.
1537 # @ref tui_creation_face "Example"
1538 def MakeFaceWires(self,theWires, isPlanarWanted):
1539 # Example: see GEOM_TestAll.py
1540 anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
1541 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
1544 ## Shortcut to MakeFaceWires()
1546 # @ref tui_creation_face "Example 1"
1547 # \n @ref swig_MakeFaces "Example 2"
1548 def MakeFaces(self,theWires, isPlanarWanted):
1549 # Example: see GEOM_TestOthers.py
1550 anObj = self.MakeFaceWires(theWires, isPlanarWanted)
1553 ## Create a shell from the set of faces and shells.
1554 # @param theFacesAndShells List of faces and/or shells.
1555 # @return New GEOM_Object, containing the created shell.
1557 # @ref tui_creation_shell "Example"
1558 def MakeShell(self,theFacesAndShells):
1559 # Example: see GEOM_TestAll.py
1560 anObj = self.ShapesOp.MakeShell(theFacesAndShells)
1561 RaiseIfFailed("MakeShell", self.ShapesOp)
1564 ## Create a solid, bounded by the given shells.
1565 # @param theShells Sequence of bounding shells.
1566 # @return New GEOM_Object, containing the created solid.
1568 # @ref tui_creation_solid "Example"
1569 def MakeSolid(self,theShells):
1570 # Example: see GEOM_TestAll.py
1571 anObj = self.ShapesOp.MakeSolidShells(theShells)
1572 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
1575 ## Create a compound of the given shapes.
1576 # @param theShapes List of shapes to put in compound.
1577 # @return New GEOM_Object, containing the created compound.
1579 # @ref tui_creation_compound "Example"
1580 def MakeCompound(self,theShapes):
1581 # Example: see GEOM_TestAll.py
1582 anObj = self.ShapesOp.MakeCompound(theShapes)
1583 RaiseIfFailed("MakeCompound", self.ShapesOp)
1586 # end of l3_advanced
1589 ## @addtogroup l2_measure
1592 ## Gives quantity of faces in the given shape.
1593 # @param theShape Shape to count faces of.
1594 # @return Quantity of faces.
1596 # @ref swig_NumberOf "Example"
1597 def NumberOfFaces(self, theShape):
1598 # Example: see GEOM_TestOthers.py
1599 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
1600 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
1603 ## Gives quantity of edges in the given shape.
1604 # @param theShape Shape to count edges of.
1605 # @return Quantity of edges.
1607 # @ref swig_NumberOf "Example"
1608 def NumberOfEdges(self, theShape):
1609 # Example: see GEOM_TestOthers.py
1610 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
1611 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
1614 ## Gives quantity of subshapes of type theShapeType in the given shape.
1615 # @param theShape Shape to count subshapes of.
1616 # @param theShapeType Type of subshapes to count.
1617 # @return Quantity of subshapes of given type.
1619 # @ref swig_NumberOf "Example"
1620 def NumberOfSubShapes(self, theShape, theShapeType):
1621 # Example: see GEOM_TestOthers.py
1622 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
1623 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
1626 ## Gives quantity of solids in the given shape.
1627 # @param theShape Shape to count solids in.
1628 # @return Quantity of solids.
1630 # @ref swig_NumberOf "Example"
1631 def NumberOfSolids(self, theShape):
1632 # Example: see GEOM_TestOthers.py
1633 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, ShapeType["SOLID"])
1634 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
1640 ## @addtogroup l3_healing
1643 ## Reverses an orientation the given shape.
1644 # @param theShape Shape to be reversed.
1645 # @return The reversed copy of theShape.
1647 # @ref swig_ChangeOrientation "Example"
1648 def ChangeOrientation(self,theShape):
1649 # Example: see GEOM_TestAll.py
1650 anObj = self.ShapesOp.ChangeOrientation(theShape)
1651 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
1654 ## Shortcut to ChangeOrientation()
1656 # @ref swig_OrientationChange "Example"
1657 def OrientationChange(self,theShape):
1658 # Example: see GEOM_TestOthers.py
1659 anObj = self.ChangeOrientation(theShape)
1665 ## @addtogroup l4_obtain
1668 ## Retrieve all free faces from the given shape.
1669 # Free face is a face, which is not shared between two shells of the shape.
1670 # @param theShape Shape to find free faces in.
1671 # @return List of IDs of all free faces, contained in theShape.
1673 # @ref tui_measurement_tools_page "Example"
1674 def GetFreeFacesIDs(self,theShape):
1675 # Example: see GEOM_TestOthers.py
1676 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
1677 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
1680 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
1681 # @param theShape1 Shape to find sub-shapes in.
1682 # @param theShape2 Shape to find shared sub-shapes with.
1683 # @param theShapeType Type of sub-shapes to be retrieved.
1684 # @return List of sub-shapes of theShape1, shared with theShape2.
1686 # @ref swig_GetSharedShapes "Example"
1687 def GetSharedShapes(self,theShape1, theShape2, theShapeType):
1688 # Example: see GEOM_TestOthers.py
1689 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
1690 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
1693 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
1694 # situated relatively the specified plane by the certain way,
1695 # defined through <VAR>theState</VAR> parameter.
1696 # @param theShape Shape to find sub-shapes of.
1697 # @param theShapeType Type of sub-shapes to be retrieved.
1698 # @param theAx1 Vector (or line, or linear edge), specifying normal
1699 # direction and location of the plane to find shapes on.
1700 # @param theState The state of the subshapes to find. It can be one of
1701 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1702 # @return List of all found sub-shapes.
1704 # @ref swig_GetShapesOnPlane "Example"
1705 def GetShapesOnPlane(self,theShape, theShapeType, theAx1, theState):
1706 # Example: see GEOM_TestOthers.py
1707 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
1708 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
1711 ## Works like the above method, but returns list of sub-shapes indices
1713 # @ref swig_GetShapesOnPlaneIDs "Example"
1714 def GetShapesOnPlaneIDs(self,theShape, theShapeType, theAx1, theState):
1715 # Example: see GEOM_TestOthers.py
1716 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
1717 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
1720 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
1721 # situated relatively the specified plane by the certain way,
1722 # defined through <VAR>theState</VAR> parameter.
1723 # @param theShape Shape to find sub-shapes of.
1724 # @param theShapeType Type of sub-shapes to be retrieved.
1725 # @param theAx1 Vector (or line, or linear edge), specifying normal
1726 # direction of the plane to find shapes on.
1727 # @param thePnt Point specifying location of the plane to find shapes on.
1728 # @param theState The state of the subshapes to find. It can be one of
1729 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1730 # @return List of all found sub-shapes.
1732 # @ref swig_GetShapesOnPlaneWithLocation "Example"
1733 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState):
1734 # Example: see GEOM_TestOthers.py
1735 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
1736 theAx1, thePnt, theState)
1737 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
1740 ## Works like the above method, but returns list of sub-shapes indices
1742 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
1743 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
1744 # Example: see GEOM_TestOthers.py
1745 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
1746 theAx1, thePnt, theState)
1747 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
1750 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1751 # the specified cylinder by the certain way, defined through \a theState parameter.
1752 # @param theShape Shape to find sub-shapes of.
1753 # @param theShapeType Type of sub-shapes to be retrieved.
1754 # @param theAxis Vector (or line, or linear edge), specifying
1755 # axis of the cylinder to find shapes on.
1756 # @param theRadius Radius of the cylinder to find shapes on.
1757 # @param theState The state of the subshapes to find. It can be one of
1758 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1759 # @return List of all found sub-shapes.
1761 # @ref swig_GetShapesOnCylinder "Example"
1762 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState):
1763 # Example: see GEOM_TestOthers.py
1764 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
1765 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
1768 ## Works like the above method, but returns list of sub-shapes indices
1770 # @ref swig_GetShapesOnCylinderIDs "Example"
1771 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
1772 # Example: see GEOM_TestOthers.py
1773 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
1774 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
1777 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1778 # the specified cylinder by the certain way, defined through \a theState parameter.
1779 # @param theShape Shape to find sub-shapes of.
1780 # @param theShapeType Type of sub-shapes to be retrieved.
1781 # @param theAxis Vector (or line, or linear edge), specifying
1782 # axis of the cylinder to find shapes on.
1783 # @param thePnt Point specifying location of the bottom of the cylinder.
1784 # @param theRadius Radius of the cylinder to find shapes on.
1785 # @param theState The state of the subshapes to find. It can be one of
1786 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1787 # @return List of all found sub-shapes.
1789 # @ref swig_GetShapesOnCylinderWithLocation "Example"
1790 def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
1791 # Example: see GEOM_TestOthers.py
1792 aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
1793 RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
1796 ## Works like the above method, but returns list of sub-shapes indices
1798 # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
1799 def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
1800 # Example: see GEOM_TestOthers.py
1801 aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
1802 RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
1805 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1806 # the specified sphere by the certain way, defined through \a theState parameter.
1807 # @param theShape Shape to find sub-shapes of.
1808 # @param theShapeType Type of sub-shapes to be retrieved.
1809 # @param theCenter Point, specifying center of the sphere to find shapes on.
1810 # @param theRadius Radius of the sphere to find shapes on.
1811 # @param theState The state of the subshapes to find. It can be one of
1812 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1813 # @return List of all found sub-shapes.
1815 # @ref swig_GetShapesOnSphere "Example"
1816 def GetShapesOnSphere(self,theShape, theShapeType, theCenter, theRadius, theState):
1817 # Example: see GEOM_TestOthers.py
1818 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
1819 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
1822 ## Works like the above method, but returns list of sub-shapes indices
1824 # @ref swig_GetShapesOnSphereIDs "Example"
1825 def GetShapesOnSphereIDs(self,theShape, theShapeType, theCenter, theRadius, theState):
1826 # Example: see GEOM_TestOthers.py
1827 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
1828 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
1831 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1832 # the specified quadrangle by the certain way, defined through \a theState parameter.
1833 # @param theShape Shape to find sub-shapes of.
1834 # @param theShapeType Type of sub-shapes to be retrieved.
1835 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
1836 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
1837 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
1838 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
1839 # @param theState The state of the subshapes to find. It can be one of
1840 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1841 # @return List of all found sub-shapes.
1843 # @ref swig_GetShapesOnQuadrangle "Example"
1844 def GetShapesOnQuadrangle(self, theShape, theShapeType,
1845 theTopLeftPoint, theTopRigthPoint,
1846 theBottomLeftPoint, theBottomRigthPoint, theState):
1847 # Example: see GEOM_TestOthers.py
1848 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
1849 theTopLeftPoint, theTopRigthPoint,
1850 theBottomLeftPoint, theBottomRigthPoint, theState)
1851 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
1854 ## Works like the above method, but returns list of sub-shapes indices
1856 # @ref swig_GetShapesOnQuadrangleIDs "Example"
1857 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
1858 theTopLeftPoint, theTopRigthPoint,
1859 theBottomLeftPoint, theBottomRigthPoint, theState):
1860 # Example: see GEOM_TestOthers.py
1861 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
1862 theTopLeftPoint, theTopRigthPoint,
1863 theBottomLeftPoint, theBottomRigthPoint, theState)
1864 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
1867 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1868 # the specified \a theBox by the certain way, defined through \a theState parameter.
1869 # @param theBox Shape for relative comparing.
1870 # @param theShape Shape to find sub-shapes of.
1871 # @param theShapeType Type of sub-shapes to be retrieved.
1872 # @param theState The state of the subshapes to find. It can be one of
1873 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1874 # @return List of all found sub-shapes.
1876 # @ref swig_GetShapesOnBox "Example"
1877 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState):
1878 # Example: see GEOM_TestOthers.py
1879 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
1880 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
1883 ## Works like the above method, but returns list of sub-shapes indices
1885 # @ref swig_GetShapesOnBoxIDs "Example"
1886 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
1887 # Example: see GEOM_TestOthers.py
1888 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
1889 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
1892 ## Find in \a theShape all sub-shapes of type \a theShapeType,
1893 # situated relatively the specified \a theCheckShape by the
1894 # certain way, defined through \a theState parameter.
1895 # @param theCheckShape Shape for relative comparing.
1896 # @param theShape Shape to find sub-shapes of.
1897 # @param theShapeType Type of sub-shapes to be retrieved.
1898 # @param theState The state of the subshapes to find. It can be one of
1899 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1900 # @return List of all found sub-shapes.
1902 # @ref swig_GetShapesOnShape "Example"
1903 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState):
1904 # Example: see GEOM_TestOthers.py
1905 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
1906 theShapeType, theState)
1907 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
1910 ## Works like the above method, but returns result as compound
1912 # @ref swig_GetShapesOnShapeAsCompound "Example"
1913 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState):
1914 # Example: see GEOM_TestOthers.py
1915 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
1916 theShapeType, theState)
1917 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
1920 ## Works like the above method, but returns list of sub-shapes indices
1922 # @ref swig_GetShapesOnShapeIDs "Example"
1923 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
1924 # Example: see GEOM_TestOthers.py
1925 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
1926 theShapeType, theState)
1927 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
1930 ## Get sub-shape(s) of theShapeWhere, which are
1931 # coincident with \a theShapeWhat or could be a part of it.
1932 # @param theShapeWhere Shape to find sub-shapes of.
1933 # @param theShapeWhat Shape, specifying what to find.
1934 # @return Group of all found sub-shapes or a single found sub-shape.
1936 # @ref swig_GetInPlace "Example"
1937 def GetInPlace(self,theShapeWhere, theShapeWhat):
1938 # Example: see GEOM_TestOthers.py
1939 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
1940 RaiseIfFailed("GetInPlace", self.ShapesOp)
1943 ## Get sub-shape(s) of \a theShapeWhere, which are
1944 # coincident with \a theShapeWhat or could be a part of it.
1946 # Implementation of this method is based on a saved history of an operation,
1947 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
1948 # arguments (an argument shape or a sub-shape of an argument shape).
1949 # The operation could be the Partition or one of boolean operations,
1950 # performed on simple shapes (not on compounds).
1952 # @param theShapeWhere Shape to find sub-shapes of.
1953 # @param theShapeWhat Shape, specifying what to find (must be in the
1954 # building history of the ShapeWhere).
1955 # @return Group of all found sub-shapes or a single found sub-shape.
1957 # @ref swig_GetInPlace "Example"
1958 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat):
1959 # Example: see GEOM_TestOthers.py
1960 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
1961 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
1964 ## Get sub-shape of theShapeWhere, which is
1965 # equal to \a theShapeWhat.
1966 # @param theShapeWhere Shape to find sub-shape of.
1967 # @param theShapeWhat Shape, specifying what to find.
1968 # @return New GEOM_Object for found sub-shape.
1970 # @ref swig_GetSame "Example"
1971 def GetSame(self,theShapeWhere, theShapeWhat):
1972 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
1973 RaiseIfFailed("GetSame", self.ShapesOp)
1979 ## @addtogroup l4_access
1982 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
1983 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
1985 # @ref swig_all_decompose "Example"
1986 def GetSubShape(self, aShape, ListOfID):
1987 # Example: see GEOM_TestAll.py
1988 anObj = self.AddSubShape(aShape,ListOfID)
1991 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
1993 # @ref swig_all_decompose "Example"
1994 def GetSubShapeID(self, aShape, aSubShape):
1995 # Example: see GEOM_TestAll.py
1996 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
1997 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
2003 ## @addtogroup l4_decompose
2006 ## Explode a shape on subshapes of a given type.
2007 # @param aShape Shape to be exploded.
2008 # @param aType Type of sub-shapes to be retrieved.
2009 # @return List of sub-shapes of type theShapeType, contained in theShape.
2011 # @ref swig_all_decompose "Example"
2012 def SubShapeAll(self, aShape, aType):
2013 # Example: see GEOM_TestAll.py
2014 ListObj = self.ShapesOp.MakeExplode(aShape,aType,0)
2015 RaiseIfFailed("MakeExplode", self.ShapesOp)
2018 ## Explode a shape on subshapes of a given type.
2019 # @param aShape Shape to be exploded.
2020 # @param aType Type of sub-shapes to be retrieved.
2021 # @return List of IDs of sub-shapes.
2023 # @ref swig_all_decompose "Example"
2024 def SubShapeAllIDs(self, aShape, aType):
2025 ListObj = self.ShapesOp.SubShapeAllIDs(aShape,aType,0)
2026 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
2029 ## Explode a shape on subshapes of a given type.
2030 # Sub-shapes will be sorted by coordinates of their gravity centers.
2031 # @param aShape Shape to be exploded.
2032 # @param aType Type of sub-shapes to be retrieved.
2033 # @return List of sub-shapes of type theShapeType, contained in theShape.
2035 # @ref swig_SubShapeAllSorted "Example"
2036 def SubShapeAllSorted(self, aShape, aType):
2037 # Example: see GEOM_TestAll.py
2038 ListObj = self.ShapesOp.MakeExplode(aShape,aType,1)
2039 RaiseIfFailed("MakeExplode", self.ShapesOp)
2042 ## Explode a shape on subshapes of a given type.
2043 # Sub-shapes will be sorted by coordinates of their gravity centers.
2044 # @param aShape Shape to be exploded.
2045 # @param aType Type of sub-shapes to be retrieved.
2046 # @return List of IDs of sub-shapes.
2048 # @ref swig_all_decompose "Example"
2049 def SubShapeAllSortedIDs(self, aShape, aType):
2050 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape,aType,1)
2051 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
2054 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
2055 # selected by they indices in list of all sub-shapes of type <VAR>aType</VAR>.
2056 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
2058 # @ref swig_all_decompose "Example"
2059 def SubShape(self, aShape, aType, ListOfInd):
2060 # Example: see GEOM_TestAll.py
2062 AllShapeList = self.SubShapeAll(aShape, aType)
2063 for ind in ListOfInd:
2064 ListOfIDs.append(self.GetSubShapeID(aShape, AllShapeList[ind - 1]))
2065 anObj = self.GetSubShape(aShape, ListOfIDs)
2068 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
2069 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
2070 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
2072 # @ref swig_all_decompose "Example"
2073 def SubShapeSorted(self,aShape, aType, ListOfInd):
2074 # Example: see GEOM_TestAll.py
2076 AllShapeList = self.SubShapeAllSorted(aShape, aType)
2077 for ind in ListOfInd:
2078 ListOfIDs.append(self.GetSubShapeID(aShape, AllShapeList[ind - 1]))
2079 anObj = self.GetSubShape(aShape, ListOfIDs)
2082 # end of l4_decompose
2085 ## @addtogroup l3_healing
2088 ## Apply a sequence of Shape Healing operators to the given object.
2089 # @param theShape Shape to be processed.
2090 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
2091 # @param theParameters List of names of parameters
2092 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
2093 # @param theValues List of values of parameters, in the same order
2094 # as parameters are listed in <VAR>theParameters</VAR> list.
2095 # @return New GEOM_Object, containing processed shape.
2097 # @ref tui_shape_processing "Example"
2098 def ProcessShape(self,theShape, theOperators, theParameters, theValues):
2099 # Example: see GEOM_TestHealing.py
2100 theValues,Parameters = ParseList(theValues)
2101 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
2102 RaiseIfFailed("ProcessShape", self.HealOp)
2103 for string in (theOperators + theParameters):
2104 Parameters = ":" + Parameters
2106 anObj.SetParameters(Parameters)
2109 ## Remove faces from the given object (shape).
2110 # @param theObject Shape to be processed.
2111 # @param theFaces Indices of faces to be removed, if EMPTY then the method
2112 # removes ALL faces of the given object.
2113 # @return New GEOM_Object, containing processed shape.
2115 # @ref tui_suppress_faces "Example"
2116 def SuppressFaces(self,theObject, theFaces):
2117 # Example: see GEOM_TestHealing.py
2118 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
2119 RaiseIfFailed("SuppressFaces", self.HealOp)
2122 ## Sewing of some shapes into single shape.
2124 # @ref tui_sewing "Example"
2125 def MakeSewing(self, ListShape, theTolerance):
2126 # Example: see GEOM_TestHealing.py
2127 comp = self.MakeCompound(ListShape)
2128 anObj = self.Sew(comp, theTolerance)
2131 ## Sewing of the given object.
2132 # @param theObject Shape to be processed.
2133 # @param theTolerance Required tolerance value.
2134 # @return New GEOM_Object, containing processed shape.
2135 def Sew(self, theObject, theTolerance):
2136 # Example: see MakeSewing() above
2137 theTolerance,Parameters = ParseParameters(theTolerance)
2138 anObj = self.HealOp.Sew(theObject, theTolerance)
2139 RaiseIfFailed("Sew", self.HealOp)
2140 anObj.SetParameters(Parameters)
2143 ## Remove internal wires and edges from the given object (face).
2144 # @param theObject Shape to be processed.
2145 # @param theWires Indices of wires to be removed, if EMPTY then the method
2146 # removes ALL internal wires of the given object.
2147 # @return New GEOM_Object, containing processed shape.
2149 # @ref tui_suppress_internal_wires "Example"
2150 def SuppressInternalWires(self,theObject, theWires):
2151 # Example: see GEOM_TestHealing.py
2152 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
2153 RaiseIfFailed("RemoveIntWires", self.HealOp)
2156 ## Remove internal closed contours (holes) from the given object.
2157 # @param theObject Shape to be processed.
2158 # @param theWires Indices of wires to be removed, if EMPTY then the method
2159 # removes ALL internal holes of the given object
2160 # @return New GEOM_Object, containing processed shape.
2162 # @ref tui_suppress_holes "Example"
2163 def SuppressHoles(self,theObject, theWires):
2164 # Example: see GEOM_TestHealing.py
2165 anObj = self.HealOp.FillHoles(theObject, theWires)
2166 RaiseIfFailed("FillHoles", self.HealOp)
2169 ## Close an open wire.
2170 # @param theObject Shape to be processed.
2171 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
2172 # if -1, then <VAR>theObject</VAR> itself is a wire.
2173 # @param isCommonVertex If TRUE : closure by creation of a common vertex,
2174 # If FALS : closure by creation of an edge between ends.
2175 # @return New GEOM_Object, containing processed shape.
2177 # @ref tui_close_contour "Example"
2178 def CloseContour(self,theObject, theWires, isCommonVertex):
2179 # Example: see GEOM_TestHealing.py
2180 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
2181 RaiseIfFailed("CloseContour", self.HealOp)
2184 ## Addition of a point to a given edge object.
2185 # @param theObject Shape to be processed.
2186 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
2187 # if -1, then theObject itself is the edge.
2188 # @param theValue Value of parameter on edge or length parameter,
2189 # depending on \a isByParameter.
2190 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1],
2191 # if FALSE : \a theValue is treated as a length parameter [0..1]
2192 # @return New GEOM_Object, containing processed shape.
2194 # @ref tui_add_point_on_edge "Example"
2195 def DivideEdge(self,theObject, theEdgeIndex, theValue, isByParameter):
2196 # Example: see GEOM_TestHealing.py
2197 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
2198 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
2199 RaiseIfFailed("DivideEdge", self.HealOp)
2200 anObj.SetParameters(Parameters)
2203 ## Change orientation of the given object. Updates given shape.
2204 # @param theObject Shape to be processed.
2206 # @ref swig_todo "Example"
2207 def ChangeOrientationShell(self,theObject):
2208 theObject = self.HealOp.ChangeOrientation(theObject)
2209 RaiseIfFailed("ChangeOrientation", self.HealOp)
2212 ## Change orientation of the given object.
2213 # @param theObject Shape to be processed.
2214 # @return New GEOM_Object, containing processed shape.
2216 # @ref swig_todo "Example"
2217 def ChangeOrientationShellCopy(self,theObject):
2218 anObj = self.HealOp.ChangeOrientationCopy(theObject)
2219 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
2222 ## Get a list of wires (wrapped in GEOM_Object-s),
2223 # that constitute a free boundary of the given shape.
2224 # @param theObject Shape to get free boundary of.
2225 # @return [status, theClosedWires, theOpenWires]
2226 # status: FALSE, if an error(s) occured during the method execution.
2227 # theClosedWires: Closed wires on the free boundary of the given shape.
2228 # theOpenWires: Open wires on the free boundary of the given shape.
2230 # @ref tui_measurement_tools_page "Example"
2231 def GetFreeBoundary(self,theObject):
2232 # Example: see GEOM_TestHealing.py
2233 anObj = self.HealOp.GetFreeBoundary(theObject)
2234 RaiseIfFailed("GetFreeBoundary", self.HealOp)
2237 ## Replace coincident faces in theShape by one face.
2238 # @param theShape Initial shape.
2239 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
2240 # @param doKeepNonSolids If FALSE, only solids will present in the result,
2241 # otherwise all initial shapes.
2242 # @return New GEOM_Object, containing a copy of theShape without coincident faces.
2244 # @ref tui_glue_faces "Example"
2245 def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True):
2246 # Example: see GEOM_Spanner.py
2247 theTolerance,Parameters = ParseParameters(theTolerance)
2248 anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
2250 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
2251 anObj.SetParameters(Parameters)
2254 ## Find coincident faces in theShape for possible gluing.
2255 # @param theShape Initial shape.
2256 # @param theTolerance Maximum distance between faces,
2257 # which can be considered as coincident.
2260 # @ref swig_todo "Example"
2261 def GetGlueFaces(self, theShape, theTolerance):
2262 # Example: see GEOM_Spanner.py
2263 anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
2264 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
2267 ## Replace coincident faces in theShape by one face
2268 # in compliance with given list of faces
2269 # @param theShape Initial shape.
2270 # @param theTolerance Maximum distance between faces,
2271 # which can be considered as coincident.
2272 # @param theFaces List of faces for gluing.
2273 # @param doKeepNonSolids If FALSE, only solids will present in the result,
2274 # otherwise all initial shapes.
2275 # @return New GEOM_Object, containing a copy of theShape
2276 # without some faces.
2278 # @ref swig_todo "Example"
2279 def MakeGlueFacesByList(self, theShape, theTolerance, theFaces, doKeepNonSolids=True):
2280 # Example: see GEOM_Spanner.py
2281 anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces, doKeepNonSolids)
2283 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
2289 ## @addtogroup l3_boolean Boolean Operations
2292 # -----------------------------------------------------------------------------
2293 # Boolean (Common, Cut, Fuse, Section)
2294 # -----------------------------------------------------------------------------
2296 ## Perform one of boolean operations on two given shapes.
2297 # @param theShape1 First argument for boolean operation.
2298 # @param theShape2 Second argument for boolean operation.
2299 # @param theOperation Indicates the operation to be done:
2300 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
2301 # @return New GEOM_Object, containing the result shape.
2303 # @ref tui_fuse "Example"
2304 def MakeBoolean(self,theShape1, theShape2, theOperation):
2305 # Example: see GEOM_TestAll.py
2306 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation)
2307 RaiseIfFailed("MakeBoolean", self.BoolOp)
2310 ## Shortcut to MakeBoolean(s1, s2, 1)
2312 # @ref tui_common "Example 1"
2313 # \n @ref swig_MakeCommon "Example 2"
2314 def MakeCommon(self, s1, s2):
2315 # Example: see GEOM_TestOthers.py
2316 return self.MakeBoolean(s1, s2, 1)
2318 ## Shortcut to MakeBoolean(s1, s2, 2)
2320 # @ref tui_cut "Example 1"
2321 # \n @ref swig_MakeCommon "Example 2"
2322 def MakeCut(self, s1, s2):
2323 # Example: see GEOM_TestOthers.py
2324 return self.MakeBoolean(s1, s2, 2)
2326 ## Shortcut to MakeBoolean(s1, s2, 3)
2328 # @ref tui_fuse "Example 1"
2329 # \n @ref swig_MakeCommon "Example 2"
2330 def MakeFuse(self, s1, s2):
2331 # Example: see GEOM_TestOthers.py
2332 return self.MakeBoolean(s1, s2, 3)
2334 ## Shortcut to MakeBoolean(s1, s2, 4)
2336 # @ref tui_section "Example 1"
2337 # \n @ref swig_MakeCommon "Example 2"
2338 def MakeSection(self, s1, s2):
2339 # Example: see GEOM_TestOthers.py
2340 return self.MakeBoolean(s1, s2, 4)
2345 ## @addtogroup l3_basic_op
2348 ## Perform partition operation.
2349 # @param ListShapes Shapes to be intersected.
2350 # @param ListTools Shapes to intersect theShapes.
2351 # !!!NOTE: Each compound from ListShapes and ListTools will be exploded
2352 # in order to avoid possible intersection between shapes from
2354 # @param Limit Type of resulting shapes (corresponding to TopAbs_ShapeEnum).
2355 # @param KeepNonlimitShapes: if this parameter == 0 - only shapes with
2356 # type <= Limit are kept in the result,
2357 # else - shapes with type > Limit are kept
2358 # also (if they exist)
2360 # After implementation new version of PartitionAlgo (October 2006)
2361 # other parameters are ignored by current functionality. They are kept
2362 # in this function only for support old versions.
2363 # Ignored parameters:
2364 # @param ListKeepInside Shapes, outside which the results will be deleted.
2365 # Each shape from theKeepInside must belong to theShapes also.
2366 # @param ListRemoveInside Shapes, inside which the results will be deleted.
2367 # Each shape from theRemoveInside must belong to theShapes also.
2368 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
2369 # @param ListMaterials Material indices for each shape. Make sence,
2370 # only if theRemoveWebs is TRUE.
2372 # @return New GEOM_Object, containing the result shapes.
2374 # @ref tui_partition "Example"
2375 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
2376 Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
2377 KeepNonlimitShapes=0):
2378 # Example: see GEOM_TestAll.py
2379 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
2380 ListKeepInside, ListRemoveInside,
2381 Limit, RemoveWebs, ListMaterials,
2382 KeepNonlimitShapes);
2383 RaiseIfFailed("MakePartition", self.BoolOp)
2386 ## Perform partition operation.
2387 # This method may be useful if it is needed to make a partition for
2388 # compound contains nonintersected shapes. Performance will be better
2389 # since intersection between shapes from compound is not performed.
2391 # Description of all parameters as in previous method MakePartition()
2393 # !!!NOTE: Passed compounds (via ListShapes or via ListTools)
2394 # have to consist of nonintersecting shapes.
2396 # @return New GEOM_Object, containing the result shapes.
2398 # @ref swig_todo "Example"
2399 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
2400 ListKeepInside=[], ListRemoveInside=[],
2401 Limit=ShapeType["SHAPE"], RemoveWebs=0,
2402 ListMaterials=[], KeepNonlimitShapes=0):
2403 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
2404 ListKeepInside, ListRemoveInside,
2405 Limit, RemoveWebs, ListMaterials,
2406 KeepNonlimitShapes);
2407 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
2410 ## Shortcut to MakePartition()
2412 # @ref tui_partition "Example 1"
2413 # \n @ref swig_Partition "Example 2"
2414 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
2415 Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
2416 KeepNonlimitShapes=0):
2417 # Example: see GEOM_TestOthers.py
2418 anObj = self.MakePartition(ListShapes, ListTools,
2419 ListKeepInside, ListRemoveInside,
2420 Limit, RemoveWebs, ListMaterials,
2421 KeepNonlimitShapes);
2424 ## Perform partition of the Shape with the Plane
2425 # @param theShape Shape to be intersected.
2426 # @param thePlane Tool shape, to intersect theShape.
2427 # @return New GEOM_Object, containing the result shape.
2429 # @ref tui_partition "Example"
2430 def MakeHalfPartition(self,theShape, thePlane):
2431 # Example: see GEOM_TestAll.py
2432 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
2433 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
2436 # end of l3_basic_op
2439 ## @addtogroup l3_transform
2442 ## Translate the given object along the vector, specified
2443 # by its end points, creating its copy before the translation.
2444 # @param theObject The object to be translated.
2445 # @param thePoint1 Start point of translation vector.
2446 # @param thePoint2 End point of translation vector.
2447 # @return New GEOM_Object, containing the translated object.
2449 # @ref tui_translation "Example 1"
2450 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
2451 def MakeTranslationTwoPoints(self,theObject, thePoint1, thePoint2):
2452 # Example: see GEOM_TestAll.py
2453 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
2454 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
2457 ## Translate the given object along the vector, specified by its components.
2458 # @param theObject The object to be translated.
2459 # @param theDX,theDY,theDZ Components of translation vector.
2460 # @return Translated GEOM_Object.
2462 # @ref tui_translation "Example"
2463 def TranslateDXDYDZ(self,theObject, theDX, theDY, theDZ):
2464 # Example: see GEOM_TestAll.py
2465 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
2466 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
2467 anObj.SetParameters(Parameters)
2468 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
2471 ## Translate the given object along the vector, specified
2472 # by its components, creating its copy before the translation.
2473 # @param theObject The object to be translated.
2474 # @param theDX,theDY,theDZ Components of translation vector.
2475 # @return New GEOM_Object, containing the translated object.
2477 # @ref tui_translation "Example"
2478 def MakeTranslation(self,theObject, theDX, theDY, theDZ):
2479 # Example: see GEOM_TestAll.py
2480 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
2481 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
2482 anObj.SetParameters(Parameters)
2483 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
2486 ## Translate the given object along the given vector,
2487 # creating its copy before the translation.
2488 # @param theObject The object to be translated.
2489 # @param theVector The translation vector.
2490 # @return New GEOM_Object, containing the translated object.
2492 # @ref tui_translation "Example"
2493 def MakeTranslationVector(self,theObject, theVector):
2494 # Example: see GEOM_TestAll.py
2495 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
2496 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
2499 ## Translate the given object along the given vector on given distance.
2500 # @param theObject The object to be translated.
2501 # @param theVector The translation vector.
2502 # @param theDistance The translation distance.
2503 # @param theCopy Flag used to translate object itself or create a copy.
2504 # @return Translated GEOM_Object.
2506 # @ref tui_translation "Example"
2507 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy):
2508 # Example: see GEOM_TestAll.py
2509 theDistance,Parameters = ParseParameters(theDistance)
2510 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
2511 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
2512 anObj.SetParameters(Parameters)
2515 ## Translate the given object along the given vector on given distance,
2516 # creating its copy before the translation.
2517 # @param theObject The object to be translated.
2518 # @param theVector The translation vector.
2519 # @param theDistance The translation distance.
2520 # @return New GEOM_Object, containing the translated object.
2522 # @ref tui_translation "Example"
2523 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance):
2524 # Example: see GEOM_TestAll.py
2525 theDistance,Parameters = ParseParameters(theDistance)
2526 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
2527 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
2528 anObj.SetParameters(Parameters)
2531 ## Rotate the given object around the given axis on the given angle.
2532 # @param theObject The object to be rotated.
2533 # @param theAxis Rotation axis.
2534 # @param theAngle Rotation angle in radians.
2535 # @return Rotated GEOM_Object.
2537 # @ref tui_rotation "Example"
2538 def Rotate(self,theObject, theAxis, theAngle):
2539 # Example: see GEOM_TestAll.py
2541 if isinstance(theAngle,str):
2543 theAngle, Parameters = ParseParameters(theAngle)
2545 theAngle = theAngle*math.pi/180.0
2546 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
2547 RaiseIfFailed("RotateCopy", self.TrsfOp)
2548 anObj.SetParameters(Parameters)
2551 ## Rotate the given object around the given axis
2552 # on the given angle, creating its copy before the rotatation.
2553 # @param theObject The object to be rotated.
2554 # @param theAxis Rotation axis.
2555 # @param theAngle Rotation angle in radians.
2556 # @return New GEOM_Object, containing the rotated object.
2558 # @ref tui_rotation "Example"
2559 def MakeRotation(self,theObject, theAxis, theAngle):
2560 # Example: see GEOM_TestAll.py
2562 if isinstance(theAngle,str):
2564 theAngle, Parameters = ParseParameters(theAngle)
2566 theAngle = theAngle*math.pi/180.0
2567 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
2568 RaiseIfFailed("RotateCopy", self.TrsfOp)
2569 anObj.SetParameters(Parameters)
2572 ## Rotate given object around vector perpendicular to plane
2573 # containing three points, creating its copy before the rotatation.
2574 # @param theObject The object to be rotated.
2575 # @param theCentPoint central point - the axis is the vector perpendicular to the plane
2576 # containing the three points.
2577 # @param thePoint1,thePoint2 - in a perpendicular plane of the axis.
2578 # @return New GEOM_Object, containing the rotated object.
2580 # @ref tui_rotation "Example"
2581 def MakeRotationThreePoints(self,theObject, theCentPoint, thePoint1, thePoint2):
2582 # Example: see GEOM_TestAll.py
2583 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
2584 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
2587 ## Scale the given object by the factor, creating its copy before the scaling.
2588 # @param theObject The object to be scaled.
2589 # @param thePoint Center point for scaling.
2590 # Passing None for it means scaling relatively the origin of global CS.
2591 # @param theFactor Scaling factor value.
2592 # @return New GEOM_Object, containing the scaled shape.
2594 # @ref tui_scale "Example"
2595 def MakeScaleTransform(self, theObject, thePoint, theFactor):
2596 # Example: see GEOM_TestAll.py
2597 theFactor, Parameters = ParseParameters(theFactor)
2598 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
2599 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
2600 anObj.SetParameters(Parameters)
2603 ## Scale the given object by different factors along coordinate axes,
2604 # creating its copy before the scaling.
2605 # @param theObject The object to be scaled.
2606 # @param thePoint Center point for scaling.
2607 # Passing None for it means scaling relatively the origin of global CS.
2608 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
2609 # @return New GEOM_Object, containing the scaled shape.
2611 # @ref swig_scale "Example"
2612 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ):
2613 # Example: see GEOM_TestAll.py
2614 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
2615 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
2616 theFactorX, theFactorY, theFactorZ)
2617 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
2618 anObj.SetParameters(Parameters)
2621 ## Create an object, symmetrical
2622 # to the given one relatively the given plane.
2623 # @param theObject The object to be mirrored.
2624 # @param thePlane Plane of symmetry.
2625 # @return New GEOM_Object, containing the mirrored shape.
2627 # @ref tui_mirror "Example"
2628 def MakeMirrorByPlane(self,theObject, thePlane):
2629 # Example: see GEOM_TestAll.py
2630 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
2631 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
2634 ## Create an object, symmetrical
2635 # to the given one relatively the given axis.
2636 # @param theObject The object to be mirrored.
2637 # @param theAxis Axis of symmetry.
2638 # @return New GEOM_Object, containing the mirrored shape.
2640 # @ref tui_mirror "Example"
2641 def MakeMirrorByAxis(self,theObject, theAxis):
2642 # Example: see GEOM_TestAll.py
2643 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
2644 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
2647 ## Create an object, symmetrical
2648 # to the given one relatively the given point.
2649 # @param theObject The object to be mirrored.
2650 # @param thePoint Point of symmetry.
2651 # @return New GEOM_Object, containing the mirrored shape.
2653 # @ref tui_mirror "Example"
2654 def MakeMirrorByPoint(self,theObject, thePoint):
2655 # Example: see GEOM_TestAll.py
2656 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
2657 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
2660 ## Modify the Location of the given object by LCS,
2661 # creating its copy before the setting.
2662 # @param theObject The object to be displaced.
2663 # @param theStartLCS Coordinate system to perform displacement from it.
2664 # If \a theStartLCS is NULL, displacement
2665 # will be performed from global CS.
2666 # If \a theObject itself is used as \a theStartLCS,
2667 # its location will be changed to \a theEndLCS.
2668 # @param theEndLCS Coordinate system to perform displacement to it.
2669 # @return New GEOM_Object, containing the displaced shape.
2671 # @ref tui_modify_location "Example"
2672 def MakePosition(self,theObject, theStartLCS, theEndLCS):
2673 # Example: see GEOM_TestAll.py
2674 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
2675 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
2678 ## Modify the Location of the given object by Path,
2679 # @param theObject The object to be displaced.
2680 # @param thePath Wire or Edge along that the object will be translated.
2681 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
2682 # @param theCopy is to create a copy objects if true.
2683 # @param theReverse - 0 for usual direction, 1 to reverse path direction.
2684 # @return New GEOM_Object, containing the displaced shape.
2686 # @ref tui_modify_location "Example"
2687 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
2688 # Example: see GEOM_TestAll.py
2689 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
2690 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
2693 ## Create new object as offset of the given one.
2694 # @param theObject The base object for the offset.
2695 # @param theOffset Offset value.
2696 # @return New GEOM_Object, containing the offset object.
2698 # @ref tui_offset "Example"
2699 def MakeOffset(self,theObject, theOffset):
2700 # Example: see GEOM_TestAll.py
2701 theOffset, Parameters = ParseParameters(theOffset)
2702 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
2703 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
2704 anObj.SetParameters(Parameters)
2707 # -----------------------------------------------------------------------------
2709 # -----------------------------------------------------------------------------
2711 ## Translate the given object along the given vector a given number times
2712 # @param theObject The object to be translated.
2713 # @param theVector Direction of the translation.
2714 # @param theStep Distance to translate on.
2715 # @param theNbTimes Quantity of translations to be done.
2716 # @return New GEOM_Object, containing compound of all
2717 # the shapes, obtained after each translation.
2719 # @ref tui_multi_translation "Example"
2720 def MakeMultiTranslation1D(self,theObject, theVector, theStep, theNbTimes):
2721 # Example: see GEOM_TestAll.py
2722 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
2723 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
2724 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
2725 anObj.SetParameters(Parameters)
2728 ## Conseqently apply two specified translations to theObject specified number of times.
2729 # @param theObject The object to be translated.
2730 # @param theVector1 Direction of the first translation.
2731 # @param theStep1 Step of the first translation.
2732 # @param theNbTimes1 Quantity of translations to be done along theVector1.
2733 # @param theVector2 Direction of the second translation.
2734 # @param theStep2 Step of the second translation.
2735 # @param theNbTimes2 Quantity of translations to be done along theVector2.
2736 # @return New GEOM_Object, containing compound of all
2737 # the shapes, obtained after each translation.
2739 # @ref tui_multi_translation "Example"
2740 def MakeMultiTranslation2D(self,theObject, theVector1, theStep1, theNbTimes1,
2741 theVector2, theStep2, theNbTimes2):
2742 # Example: see GEOM_TestAll.py
2743 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
2744 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
2745 theVector2, theStep2, theNbTimes2)
2746 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
2747 anObj.SetParameters(Parameters)
2750 ## Rotate the given object around the given axis a given number times.
2751 # Rotation angle will be 2*PI/theNbTimes.
2752 # @param theObject The object to be rotated.
2753 # @param theAxis The rotation axis.
2754 # @param theNbTimes Quantity of rotations to be done.
2755 # @return New GEOM_Object, containing compound of all the
2756 # shapes, obtained after each rotation.
2758 # @ref tui_multi_rotation "Example"
2759 def MultiRotate1D(self,theObject, theAxis, theNbTimes):
2760 # Example: see GEOM_TestAll.py
2761 theAxis, theNbTimes, Parameters = ParseParameters(theAxis, theNbTimes)
2762 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
2763 RaiseIfFailed("MultiRotate1D", self.TrsfOp)
2764 anObj.SetParameters(Parameters)
2767 ## Rotate the given object around the
2768 # given axis on the given angle a given number
2769 # times and multi-translate each rotation result.
2770 # Translation direction passes through center of gravity
2771 # of rotated shape and its projection on the rotation axis.
2772 # @param theObject The object to be rotated.
2773 # @param theAxis Rotation axis.
2774 # @param theAngle Rotation angle in graduces.
2775 # @param theNbTimes1 Quantity of rotations to be done.
2776 # @param theStep Translation distance.
2777 # @param theNbTimes2 Quantity of translations to be done.
2778 # @return New GEOM_Object, containing compound of all the
2779 # shapes, obtained after each transformation.
2781 # @ref tui_multi_rotation "Example"
2782 def MultiRotate2D(self,theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2):
2783 # Example: see GEOM_TestAll.py
2784 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
2785 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
2786 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
2787 anObj.SetParameters(Parameters)
2790 ## The same, as MultiRotate1D(), but axis is given by direction and point
2791 # @ref swig_MakeMultiRotation "Example"
2792 def MakeMultiRotation1D(self,aShape,aDir,aPoint,aNbTimes):
2793 # Example: see GEOM_TestOthers.py
2794 aVec = self.MakeLine(aPoint,aDir)
2795 anObj = self.MultiRotate1D(aShape,aVec,aNbTimes)
2798 ## The same, as MultiRotate2D(), but axis is given by direction and point
2799 # @ref swig_MakeMultiRotation "Example"
2800 def MakeMultiRotation2D(self,aShape,aDir,aPoint,anAngle,nbtimes1,aStep,nbtimes2):
2801 # Example: see GEOM_TestOthers.py
2802 aVec = self.MakeLine(aPoint,aDir)
2803 anObj = self.MultiRotate2D(aShape,aVec,anAngle,nbtimes1,aStep,nbtimes2)
2806 # end of l3_transform
2809 ## @addtogroup l3_local
2812 ## Perform a fillet on all edges of the given shape.
2813 # @param theShape Shape, to perform fillet on.
2814 # @param theR Fillet radius.
2815 # @return New GEOM_Object, containing the result shape.
2817 # @ref tui_fillet "Example 1"
2818 # \n @ref swig_MakeFilletAll "Example 2"
2819 def MakeFilletAll(self,theShape, theR):
2820 # Example: see GEOM_TestOthers.py
2821 theR,Parameters = ParseParameters(theR)
2822 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
2823 RaiseIfFailed("MakeFilletAll", self.LocalOp)
2824 anObj.SetParameters(Parameters)
2827 ## Perform a fillet on the specified edges/faces of the given shape
2828 # @param theShape Shape, to perform fillet on.
2829 # @param theR Fillet radius.
2830 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR>.
2831 # @param theListShapes Global indices of edges/faces to perform fillet on.
2832 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2833 # @return New GEOM_Object, containing the result shape.
2835 # @ref tui_fillet "Example"
2836 def MakeFillet(self,theShape, theR, theShapeType, theListShapes):
2837 # Example: see GEOM_TestAll.py
2838 theR,Parameters = ParseParameters(theR)
2840 if theShapeType == ShapeType["EDGE"]:
2841 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
2842 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
2844 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
2845 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
2846 anObj.SetParameters(Parameters)
2849 ## The same that MakeFillet but with two Fillet Radius R1 and R2
2850 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes):
2851 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
2853 if theShapeType == ShapeType["EDGE"]:
2854 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
2855 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
2857 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
2858 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
2859 anObj.SetParameters(Parameters)
2862 ## Perform a fillet on the specified edges of the given shape
2863 # @param theShape - Wire Shape to perform fillet on.
2864 # @param theR - Fillet radius.
2865 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
2866 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2867 # \note The list of vertices could be empty,
2868 # in this case fillet will done done at all vertices in wire
2869 # @return New GEOM_Object, containing the result shape.
2871 # @ref tui_fillet2d "Example"
2872 def MakeFillet1D(self,theShape, theR, theListOfVertexes):
2873 # Example: see GEOM_TestAll.py
2874 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes)
2875 RaiseIfFailed("MakeFillet1D", self.LocalOp)
2878 ## Perform a fillet on the specified edges/faces of the given shape
2879 # @param theShape - Face Shape to perform fillet on.
2880 # @param theR - Fillet radius.
2881 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
2882 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2883 # @return New GEOM_Object, containing the result shape.
2885 # @ref tui_fillet2d "Example"
2886 def MakeFillet2D(self,theShape, theR, theListOfVertexes):
2887 # Example: see GEOM_TestAll.py
2888 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
2889 RaiseIfFailed("MakeFillet2D", self.LocalOp)
2892 ## Perform a symmetric chamfer on all edges of the given shape.
2893 # @param theShape Shape, to perform chamfer on.
2894 # @param theD Chamfer size along each face.
2895 # @return New GEOM_Object, containing the result shape.
2897 # @ref tui_chamfer "Example 1"
2898 # \n @ref swig_MakeChamferAll "Example 2"
2899 def MakeChamferAll(self,theShape, theD):
2900 # Example: see GEOM_TestOthers.py
2901 theD,Parameters = ParseParameters(theD)
2902 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
2903 RaiseIfFailed("MakeChamferAll", self.LocalOp)
2904 anObj.SetParameters(Parameters)
2907 ## Perform a chamfer on edges, common to the specified faces,
2908 # with distance D1 on the Face1
2909 # @param theShape Shape, to perform chamfer on.
2910 # @param theD1 Chamfer size along \a theFace1.
2911 # @param theD2 Chamfer size along \a theFace2.
2912 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
2913 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2914 # @return New GEOM_Object, containing the result shape.
2916 # @ref tui_chamfer "Example"
2917 def MakeChamferEdge(self,theShape, theD1, theD2, theFace1, theFace2):
2918 # Example: see GEOM_TestAll.py
2919 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
2920 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
2921 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
2922 anObj.SetParameters(Parameters)
2925 ## The Same that MakeChamferEdge but with params theD is chamfer length and
2926 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
2927 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2):
2929 if isinstance(theAngle,str):
2931 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
2933 theAngle = theAngle*math.pi/180.0
2934 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
2935 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
2936 anObj.SetParameters(Parameters)
2939 ## Perform a chamfer on all edges of the specified faces,
2940 # with distance D1 on the first specified face (if several for one edge)
2941 # @param theShape Shape, to perform chamfer on.
2942 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
2943 # connected to the edge, are in \a theFaces, \a theD1
2944 # will be get along face, which is nearer to \a theFaces beginning.
2945 # @param theD2 Chamfer size along another of two faces, connected to the edge.
2946 # @param theFaces Sequence of global indices of faces of \a theShape.
2947 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2948 # @return New GEOM_Object, containing the result shape.
2950 # @ref tui_chamfer "Example"
2951 def MakeChamferFaces(self,theShape, theD1, theD2, theFaces):
2952 # Example: see GEOM_TestAll.py
2953 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
2954 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
2955 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
2956 anObj.SetParameters(Parameters)
2959 ## The Same that MakeChamferFaces but with params theD is chamfer lenght and
2960 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
2962 # @ref swig_FilletChamfer "Example"
2963 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces):
2965 if isinstance(theAngle,str):
2967 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
2969 theAngle = theAngle*math.pi/180.0
2970 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
2971 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
2972 anObj.SetParameters(Parameters)
2975 ## Perform a chamfer on edges,
2976 # with distance D1 on the first specified face (if several for one edge)
2977 # @param theShape Shape, to perform chamfer on.
2978 # @param theD1,theD2 Chamfer size
2979 # @param theEdges Sequence of edges of \a theShape.
2980 # @return New GEOM_Object, containing the result shape.
2982 # @ref swig_FilletChamfer "Example"
2983 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges):
2984 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
2985 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
2986 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
2987 anObj.SetParameters(Parameters)
2990 ## The Same that MakeChamferEdges but with params theD is chamfer lenght and
2991 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
2992 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges):
2994 if isinstance(theAngle,str):
2996 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
2998 theAngle = theAngle*math.pi/180.0
2999 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
3000 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
3001 anObj.SetParameters(Parameters)
3004 ## Shortcut to MakeChamferEdge() and MakeChamferFaces()
3006 # @ref swig_MakeChamfer "Example"
3007 def MakeChamfer(self,aShape,d1,d2,aShapeType,ListShape):
3008 # Example: see GEOM_TestOthers.py
3010 if aShapeType == ShapeType["EDGE"]:
3011 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1])
3013 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape)
3019 ## @addtogroup l3_basic_op
3022 ## Perform an Archimde operation on the given shape with given parameters.
3023 # The object presenting the resulting face is returned.
3024 # @param theShape Shape to be put in water.
3025 # @param theWeight Weight og the shape.
3026 # @param theWaterDensity Density of the water.
3027 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
3028 # @return New GEOM_Object, containing a section of \a theShape
3029 # by a plane, corresponding to water level.
3031 # @ref tui_archimede "Example"
3032 def Archimede(self,theShape, theWeight, theWaterDensity, theMeshDeflection):
3033 # Example: see GEOM_TestAll.py
3034 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
3035 theWeight,theWaterDensity,theMeshDeflection)
3036 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
3037 RaiseIfFailed("MakeArchimede", self.LocalOp)
3038 anObj.SetParameters(Parameters)
3041 # end of l3_basic_op
3044 ## @addtogroup l2_measure
3047 ## Get point coordinates
3050 # @ref tui_measurement_tools_page "Example"
3051 def PointCoordinates(self,Point):
3052 # Example: see GEOM_TestMeasures.py
3053 aTuple = self.MeasuOp.PointCoordinates(Point)
3054 RaiseIfFailed("PointCoordinates", self.MeasuOp)
3057 ## Get summarized length of all wires,
3058 # area of surface and volume of the given shape.
3059 # @param theShape Shape to define properties of.
3060 # @return [theLength, theSurfArea, theVolume]
3061 # theLength: Summarized length of all wires of the given shape.
3062 # theSurfArea: Area of surface of the given shape.
3063 # theVolume: Volume of the given shape.
3065 # @ref tui_measurement_tools_page "Example"
3066 def BasicProperties(self,theShape):
3067 # Example: see GEOM_TestMeasures.py
3068 aTuple = self.MeasuOp.GetBasicProperties(theShape)
3069 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
3072 ## Get parameters of bounding box of the given shape
3073 # @param theShape Shape to obtain bounding box of.
3074 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
3075 # Xmin,Xmax: Limits of shape along OX axis.
3076 # Ymin,Ymax: Limits of shape along OY axis.
3077 # Zmin,Zmax: Limits of shape along OZ axis.
3079 # @ref tui_measurement_tools_page "Example"
3080 def BoundingBox(self,theShape):
3081 # Example: see GEOM_TestMeasures.py
3082 aTuple = self.MeasuOp.GetBoundingBox(theShape)
3083 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
3086 ## Get inertia matrix and moments of inertia of theShape.
3087 # @param theShape Shape to calculate inertia of.
3088 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
3089 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
3090 # Ix,Iy,Iz: Moments of inertia of the given shape.
3092 # @ref tui_measurement_tools_page "Example"
3093 def Inertia(self,theShape):
3094 # Example: see GEOM_TestMeasures.py
3095 aTuple = self.MeasuOp.GetInertia(theShape)
3096 RaiseIfFailed("GetInertia", self.MeasuOp)
3099 ## Get minimal distance between the given shapes.
3100 # @param theShape1,theShape2 Shapes to find minimal distance between.
3101 # @return Value of the minimal distance between the given shapes.
3103 # @ref tui_measurement_tools_page "Example"
3104 def MinDistance(self, theShape1, theShape2):
3105 # Example: see GEOM_TestMeasures.py
3106 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
3107 RaiseIfFailed("GetMinDistance", self.MeasuOp)
3110 ## Get minimal distance between the given shapes.
3111 # @param theShape1,theShape2 Shapes to find minimal distance between.
3112 # @return Value of the minimal distance between the given shapes.
3114 # @ref swig_all_measure "Example"
3115 def MinDistanceComponents(self, theShape1, theShape2):
3116 # Example: see GEOM_TestMeasures.py
3117 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
3118 RaiseIfFailed("GetMinDistance", self.MeasuOp)
3119 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
3122 ## Get angle between the given shapes in degrees.
3123 # @param theShape1,theShape2 Lines or linear edges to find angle between.
3124 # @return Value of the angle between the given shapes in degrees.
3126 # @ref tui_measurement_tools_page "Example"
3127 def GetAngle(self, theShape1, theShape2):
3128 # Example: see GEOM_TestMeasures.py
3129 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
3130 RaiseIfFailed("GetAngle", self.MeasuOp)
3132 ## Get angle between the given shapes in radians.
3133 # @param theShape1,theShape2 Lines or linear edges to find angle between.
3134 # @return Value of the angle between the given shapes in radians.
3136 # @ref tui_measurement_tools_page "Example"
3137 def GetAngleRadians(self, theShape1, theShape2):
3138 # Example: see GEOM_TestMeasures.py
3139 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
3140 RaiseIfFailed("GetAngle", self.MeasuOp)
3143 ## @name Curve Curvature Measurement
3144 # Methods for receiving radius of curvature of curves
3145 # in the given point
3148 ## Measure curvature of a curve at a point, set by parameter.
3149 # @ref swig_todo "Example"
3150 def CurveCurvatureByParam(self, theCurve, theParam):
3151 # Example: see GEOM_TestMeasures.py
3152 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
3153 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
3157 # @ref swig_todo "Example"
3158 def CurveCurvatureByPoint(self, theCurve, thePoint):
3159 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
3160 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
3164 ## @name Surface Curvature Measurement
3165 # Methods for receiving max and min radius of curvature of surfaces
3166 # in the given point
3170 ## @ref swig_todo "Example"
3171 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
3172 # Example: see GEOM_TestMeasures.py
3173 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
3174 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
3178 ## @ref swig_todo "Example"
3179 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
3180 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
3181 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
3185 ## @ref swig_todo "Example"
3186 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
3187 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
3188 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
3192 ## @ref swig_todo "Example"
3193 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
3194 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
3195 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
3199 ## Get min and max tolerances of sub-shapes of theShape
3200 # @param theShape Shape, to get tolerances of.
3201 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
3202 # FaceMin,FaceMax: Min and max tolerances of the faces.
3203 # EdgeMin,EdgeMax: Min and max tolerances of the edges.
3204 # VertMin,VertMax: Min and max tolerances of the vertices.
3206 # @ref tui_measurement_tools_page "Example"
3207 def Tolerance(self,theShape):
3208 # Example: see GEOM_TestMeasures.py
3209 aTuple = self.MeasuOp.GetTolerance(theShape)
3210 RaiseIfFailed("GetTolerance", self.MeasuOp)
3213 ## Obtain description of the given shape (number of sub-shapes of each type)
3214 # @param theShape Shape to be described.
3215 # @return Description of the given shape.
3217 # @ref tui_measurement_tools_page "Example"
3218 def WhatIs(self,theShape):
3219 # Example: see GEOM_TestMeasures.py
3220 aDescr = self.MeasuOp.WhatIs(theShape)
3221 RaiseIfFailed("WhatIs", self.MeasuOp)
3224 ## Get a point, situated at the centre of mass of theShape.
3225 # @param theShape Shape to define centre of mass of.
3226 # @return New GEOM_Object, containing the created point.
3228 # @ref tui_measurement_tools_page "Example"
3229 def MakeCDG(self,theShape):
3230 # Example: see GEOM_TestMeasures.py
3231 anObj = self.MeasuOp.GetCentreOfMass(theShape)
3232 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
3235 ## Get a normale to the given face. If the point is not given,
3236 # the normale is calculated at the center of mass.
3237 # @param theFace Face to define normale of.
3238 # @param theOptionalPoint Point to compute the normale at.
3239 # @return New GEOM_Object, containing the created vector.
3241 # @ref swig_todo "Example"
3242 def GetNormal(self, theFace, theOptionalPoint = None):
3243 # Example: see GEOM_TestMeasures.py
3244 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
3245 RaiseIfFailed("GetNormal", self.MeasuOp)
3248 ## Check a topology of the given shape.
3249 # @param theShape Shape to check validity of.
3250 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked,
3251 # if TRUE, the shape's geometry will be checked also.
3252 # @return TRUE, if the shape "seems to be valid".
3253 # If theShape is invalid, prints a description of problem.
3255 # @ref tui_measurement_tools_page "Example"
3256 def CheckShape(self,theShape, theIsCheckGeom = 0):
3257 # Example: see GEOM_TestMeasures.py
3259 (IsValid, Status) = self.MeasuOp.CheckShapeWithGeometry(theShape)
3260 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
3262 (IsValid, Status) = self.MeasuOp.CheckShape(theShape)
3263 RaiseIfFailed("CheckShape", self.MeasuOp)
3268 ## Get position (LCS) of theShape.
3270 # Origin of the LCS is situated at the shape's center of mass.
3271 # Axes of the LCS are obtained from shape's location or,
3272 # if the shape is a planar face, from position of its plane.
3274 # @param theShape Shape to calculate position of.
3275 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
3276 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
3277 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
3278 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
3280 # @ref swig_todo "Example"
3281 def GetPosition(self,theShape):
3282 # Example: see GEOM_TestMeasures.py
3283 aTuple = self.MeasuOp.GetPosition(theShape)
3284 RaiseIfFailed("GetPosition", self.MeasuOp)
3287 ## Get kind of theShape.
3289 # @param theShape Shape to get a kind of.
3290 # @return Returns a kind of shape in terms of <VAR>GEOM_IKindOfShape.shape_kind</VAR> enumeration
3291 # and a list of parameters, describing the shape.
3292 # @note Concrete meaning of each value, returned via \a theIntegers
3293 # or \a theDoubles list depends on the kind of the shape.
3294 # The full list of possible outputs is:
3296 # - geompy.kind.COMPOUND nb_solids nb_faces nb_edges nb_vertices
3297 # - geompy.kind.COMPSOLID nb_solids nb_faces nb_edges nb_vertices
3299 # - geompy.kind.SHELL geompy.info.CLOSED nb_faces nb_edges nb_vertices
3300 # - geompy.kind.SHELL geompy.info.UNCLOSED nb_faces nb_edges nb_vertices
3302 # - geompy.kind.WIRE geompy.info.CLOSED nb_edges nb_vertices
3303 # - geompy.kind.WIRE geompy.info.UNCLOSED nb_edges nb_vertices
3305 # - geompy.kind.SPHERE xc yc zc R
3306 # - geompy.kind.CYLINDER xb yb zb dx dy dz R H
3307 # - geompy.kind.BOX xc yc zc ax ay az
3308 # - geompy.kind.ROTATED_BOX xc yc zc zx zy zz xx xy xz ax ay az
3309 # - geompy.kind.TORUS xc yc zc dx dy dz R_1 R_2
3310 # - geompy.kind.CONE xb yb zb dx dy dz R_1 R_2 H
3311 # - geompy.kind.POLYHEDRON nb_faces nb_edges nb_vertices
3312 # - geompy.kind.SOLID nb_faces nb_edges nb_vertices
3314 # - geompy.kind.SPHERE2D xc yc zc R
3315 # - geompy.kind.CYLINDER2D xb yb zb dx dy dz R H
3316 # - geompy.kind.TORUS2D xc yc zc dx dy dz R_1 R_2
3317 # - geompy.kind.CONE2D xc yc zc dx dy dz R_1 R_2 H
3318 # - geompy.kind.DISK_CIRCLE xc yc zc dx dy dz R
3319 # - geompy.kind.DISK_ELLIPSE xc yc zc dx dy dz R_1 R_2
3320 # - geompy.kind.POLYGON xo yo zo dx dy dz nb_edges nb_vertices
3321 # - geompy.kind.PLANE xo yo zo dx dy dz
3322 # - geompy.kind.PLANAR xo yo zo dx dy dz nb_edges nb_vertices
3323 # - geompy.kind.FACE nb_edges nb_vertices
3325 # - geompy.kind.CIRCLE xc yc zc dx dy dz R
3326 # - geompy.kind.ARC_CIRCLE xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2
3327 # - geompy.kind.ELLIPSE xc yc zc dx dy dz R_1 R_2
3328 # - geompy.kind.ARC_ELLIPSE xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2
3329 # - geompy.kind.LINE xo yo zo dx dy dz
3330 # - geompy.kind.SEGMENT x1 y1 z1 x2 y2 z2
3331 # - geompy.kind.EDGE nb_vertices
3333 # - geompy.kind.VERTEX x y z
3335 # @ref swig_todo "Example"
3336 def KindOfShape(self,theShape):
3337 # Example: see GEOM_TestMeasures.py
3338 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
3339 RaiseIfFailed("KindOfShape", self.MeasuOp)
3341 aKind = aRoughTuple[0]
3342 anInts = aRoughTuple[1]
3343 aDbls = aRoughTuple[2]
3345 # Now there is no exception from this rule:
3346 aKindTuple = [aKind] + aDbls + anInts
3348 # If they are we will regroup parameters for such kind of shape.
3350 #if aKind == kind.SOME_KIND:
3351 # # SOME_KIND int int double int double double
3352 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
3359 ## @addtogroup l2_import_export
3362 ## Import a shape from the BREP or IGES or STEP file
3363 # (depends on given format) with given name.
3364 # @param theFileName The file, containing the shape.
3365 # @param theFormatName Specify format for the file reading.
3366 # Available formats can be obtained with InsertOp.ImportTranslators() method.
3367 # If format 'IGES_SCALE' is used instead 'IGES' length unit will be
3368 # set to 'meter' and result model will be scaled.
3369 # @return New GEOM_Object, containing the imported shape.
3371 # @ref swig_Import_Export "Example"
3372 def Import(self,theFileName, theFormatName):
3373 # Example: see GEOM_TestOthers.py
3374 anObj = self.InsertOp.Import(theFileName, theFormatName)
3375 RaiseIfFailed("Import", self.InsertOp)
3378 ## Shortcut to Import() for BREP format
3380 # @ref swig_Import_Export "Example"
3381 def ImportBREP(self,theFileName):
3382 # Example: see GEOM_TestOthers.py
3383 return self.Import(theFileName, "BREP")
3385 ## Shortcut to Import() for IGES format
3387 # @ref swig_Import_Export "Example"
3388 def ImportIGES(self,theFileName):
3389 # Example: see GEOM_TestOthers.py
3390 return self.Import(theFileName, "IGES")
3392 ## Return length unit from given IGES file
3394 # @ref swig_Import_Export "Example"
3395 def GetIGESUnit(self,theFileName):
3396 # Example: see GEOM_TestOthers.py
3397 anObj = self.InsertOp.Import(theFileName, "IGES_UNIT")
3398 #RaiseIfFailed("Import", self.InsertOp)
3399 # recieve name using returned vertex
3401 vertices = self.SubShapeAll(anObj,ShapeType["VERTEX"])
3403 p = self.PointCoordinates(vertices[0])
3404 if abs(p[0]-0.01) < 1.e-6:
3406 elif abs(p[0]-0.001) < 1.e-6:
3410 ## Shortcut to Import() for STEP format
3412 # @ref swig_Import_Export "Example"
3413 def ImportSTEP(self,theFileName):
3414 # Example: see GEOM_TestOthers.py
3415 return self.Import(theFileName, "STEP")
3417 ## Export the given shape into a file with given name.
3418 # @param theObject Shape to be stored in the file.
3419 # @param theFileName Name of the file to store the given shape in.
3420 # @param theFormatName Specify format for the shape storage.
3421 # Available formats can be obtained with InsertOp.ImportTranslators() method.
3423 # @ref swig_Import_Export "Example"
3424 def Export(self,theObject, theFileName, theFormatName):
3425 # Example: see GEOM_TestOthers.py
3426 self.InsertOp.Export(theObject, theFileName, theFormatName)
3427 if self.InsertOp.IsDone() == 0:
3428 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
3432 ## Shortcut to Export() for BREP format
3434 # @ref swig_Import_Export "Example"
3435 def ExportBREP(self,theObject, theFileName):
3436 # Example: see GEOM_TestOthers.py
3437 return self.Export(theObject, theFileName, "BREP")
3439 ## Shortcut to Export() for IGES format
3441 # @ref swig_Import_Export "Example"
3442 def ExportIGES(self,theObject, theFileName):
3443 # Example: see GEOM_TestOthers.py
3444 return self.Export(theObject, theFileName, "IGES")
3446 ## Shortcut to Export() for STEP format
3448 # @ref swig_Import_Export "Example"
3449 def ExportSTEP(self,theObject, theFileName):
3450 # Example: see GEOM_TestOthers.py
3451 return self.Export(theObject, theFileName, "STEP")
3453 # end of l2_import_export
3456 ## @addtogroup l3_blocks
3459 ## Create a quadrangle face from four edges. Order of Edges is not
3460 # important. It is not necessary that edges share the same vertex.
3461 # @param E1,E2,E3,E4 Edges for the face bound.
3462 # @return New GEOM_Object, containing the created face.
3464 # @ref tui_building_by_blocks_page "Example"
3465 def MakeQuad(self,E1, E2, E3, E4):
3466 # Example: see GEOM_Spanner.py
3467 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
3468 RaiseIfFailed("MakeQuad", self.BlocksOp)
3471 ## Create a quadrangle face on two edges.
3472 # The missing edges will be built by creating the shortest ones.
3473 # @param E1,E2 Two opposite edges for the face.
3474 # @return New GEOM_Object, containing the created face.
3476 # @ref tui_building_by_blocks_page "Example"
3477 def MakeQuad2Edges(self,E1, E2):
3478 # Example: see GEOM_Spanner.py
3479 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
3480 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
3483 ## Create a quadrangle face with specified corners.
3484 # The missing edges will be built by creating the shortest ones.
3485 # @param V1,V2,V3,V4 Corner vertices for the face.
3486 # @return New GEOM_Object, containing the created face.
3488 # @ref tui_building_by_blocks_page "Example 1"
3489 # \n @ref swig_MakeQuad4Vertices "Example 2"
3490 def MakeQuad4Vertices(self,V1, V2, V3, V4):
3491 # Example: see GEOM_Spanner.py
3492 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
3493 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
3496 ## Create a hexahedral solid, bounded by the six given faces. Order of
3497 # faces is not important. It is not necessary that Faces share the same edge.
3498 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
3499 # @return New GEOM_Object, containing the created solid.
3501 # @ref tui_building_by_blocks_page "Example 1"
3502 # \n @ref swig_MakeHexa "Example 2"
3503 def MakeHexa(self,F1, F2, F3, F4, F5, F6):
3504 # Example: see GEOM_Spanner.py
3505 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
3506 RaiseIfFailed("MakeHexa", self.BlocksOp)
3509 ## Create a hexahedral solid between two given faces.
3510 # The missing faces will be built by creating the smallest ones.
3511 # @param F1,F2 Two opposite faces for the hexahedral solid.
3512 # @return New GEOM_Object, containing the created solid.
3514 # @ref tui_building_by_blocks_page "Example 1"
3515 # \n @ref swig_MakeHexa2Faces "Example 2"
3516 def MakeHexa2Faces(self,F1, F2):
3517 # Example: see GEOM_Spanner.py
3518 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
3519 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
3525 ## @addtogroup l3_blocks_op
3528 ## Get a vertex, found in the given shape by its coordinates.
3529 # @param theShape Block or a compound of blocks.
3530 # @param theX,theY,theZ Coordinates of the sought vertex.
3531 # @param theEpsilon Maximum allowed distance between the resulting
3532 # vertex and point with the given coordinates.
3533 # @return New GEOM_Object, containing the found vertex.
3535 # @ref swig_GetPoint "Example"
3536 def GetPoint(self,theShape, theX, theY, theZ, theEpsilon):
3537 # Example: see GEOM_TestOthers.py
3538 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
3539 RaiseIfFailed("GetPoint", self.BlocksOp)
3542 ## Get an edge, found in the given shape by two given vertices.
3543 # @param theShape Block or a compound of blocks.
3544 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
3545 # @return New GEOM_Object, containing the found edge.
3547 # @ref swig_todo "Example"
3548 def GetEdge(self,theShape, thePoint1, thePoint2):
3549 # Example: see GEOM_Spanner.py
3550 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
3551 RaiseIfFailed("GetEdge", self.BlocksOp)
3554 ## Find an edge of the given shape, which has minimal distance to the given point.
3555 # @param theShape Block or a compound of blocks.
3556 # @param thePoint Point, close to the desired edge.
3557 # @return New GEOM_Object, containing the found edge.
3559 # @ref swig_GetEdgeNearPoint "Example"
3560 def GetEdgeNearPoint(self,theShape, thePoint):
3561 # Example: see GEOM_TestOthers.py
3562 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
3563 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
3566 ## Returns a face, found in the given shape by four given corner vertices.
3567 # @param theShape Block or a compound of blocks.
3568 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
3569 # @return New GEOM_Object, containing the found face.
3571 # @ref swig_todo "Example"
3572 def GetFaceByPoints(self,theShape, thePoint1, thePoint2, thePoint3, thePoint4):
3573 # Example: see GEOM_Spanner.py
3574 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
3575 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
3578 ## Get a face of block, found in the given shape by two given edges.
3579 # @param theShape Block or a compound of blocks.
3580 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
3581 # @return New GEOM_Object, containing the found face.
3583 # @ref swig_todo "Example"
3584 def GetFaceByEdges(self,theShape, theEdge1, theEdge2):
3585 # Example: see GEOM_Spanner.py
3586 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
3587 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
3590 ## Find a face, opposite to the given one in the given block.
3591 # @param theBlock Must be a hexahedral solid.
3592 # @param theFace Face of \a theBlock, opposite to the desired face.
3593 # @return New GEOM_Object, containing the found face.
3595 # @ref swig_GetOppositeFace "Example"
3596 def GetOppositeFace(self,theBlock, theFace):
3597 # Example: see GEOM_Spanner.py
3598 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
3599 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
3602 ## Find a face of the given shape, which has minimal distance to the given point.
3603 # @param theShape Block or a compound of blocks.
3604 # @param thePoint Point, close to the desired face.
3605 # @return New GEOM_Object, containing the found face.
3607 # @ref swig_GetFaceNearPoint "Example"
3608 def GetFaceNearPoint(self,theShape, thePoint):
3609 # Example: see GEOM_Spanner.py
3610 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
3611 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
3614 ## Find a face of block, whose outside normale has minimal angle with the given vector.
3615 # @param theBlock Block or a compound of blocks.
3616 # @param theVector Vector, close to the normale of the desired face.
3617 # @return New GEOM_Object, containing the found face.
3619 # @ref swig_todo "Example"
3620 def GetFaceByNormale(self, theBlock, theVector):
3621 # Example: see GEOM_Spanner.py
3622 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
3623 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
3626 # end of l3_blocks_op
3629 ## @addtogroup l4_blocks_measure
3632 ## Check, if the compound of blocks is given.
3633 # To be considered as a compound of blocks, the
3634 # given shape must satisfy the following conditions:
3635 # - Each element of the compound should be a Block (6 faces and 12 edges).
3636 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
3637 # - The compound should be connexe.
3638 # - The glue between two quadrangle faces should be applied.
3639 # @param theCompound The compound to check.
3640 # @return TRUE, if the given shape is a compound of blocks.
3641 # If theCompound is not valid, prints all discovered errors.
3643 # @ref tui_measurement_tools_page "Example 1"
3644 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
3645 def CheckCompoundOfBlocks(self,theCompound):
3646 # Example: see GEOM_Spanner.py
3647 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
3648 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
3650 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
3654 ## Remove all seam and degenerated edges from \a theShape.
3655 # Unite faces and edges, sharing one surface. It means that
3656 # this faces must have references to one C++ surface object (handle).
3657 # @param theShape The compound or single solid to remove irregular edges from.
3658 # @param doUnionFaces If True, then unite faces. If False (the default value),
3659 # do not unite faces.
3660 # @return Improved shape.
3662 # @ref swig_RemoveExtraEdges "Example"
3663 def RemoveExtraEdges(self, theShape, doUnionFaces=False):
3664 # Example: see GEOM_TestOthers.py
3665 nbFacesOptimum = -1 # -1 means do not unite faces
3666 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
3667 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
3668 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
3671 ## Check, if the given shape is a blocks compound.
3672 # Fix all detected errors.
3673 # \note Single block can be also fixed by this method.
3674 # @param theShape The compound to check and improve.
3675 # @return Improved compound.
3677 # @ref swig_CheckAndImprove "Example"
3678 def CheckAndImprove(self,theShape):
3679 # Example: see GEOM_TestOthers.py
3680 anObj = self.BlocksOp.CheckAndImprove(theShape)
3681 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
3684 # end of l4_blocks_measure
3687 ## @addtogroup l3_blocks_op
3690 ## Get all the blocks, contained in the given compound.
3691 # @param theCompound The compound to explode.
3692 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
3693 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
3694 # \note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
3695 # @return List of GEOM_Objects, containing the retrieved blocks.
3697 # @ref tui_explode_on_blocks "Example 1"
3698 # \n @ref swig_MakeBlockExplode "Example 2"
3699 def MakeBlockExplode(self,theCompound, theMinNbFaces, theMaxNbFaces):
3700 # Example: see GEOM_TestOthers.py
3701 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
3702 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
3703 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
3705 anObj.SetParameters(Parameters)
3709 ## Find block, containing the given point inside its volume or on boundary.
3710 # @param theCompound Compound, to find block in.
3711 # @param thePoint Point, close to the desired block. If the point lays on
3712 # boundary between some blocks, we return block with nearest center.
3713 # @return New GEOM_Object, containing the found block.
3715 # @ref swig_todo "Example"
3716 def GetBlockNearPoint(self,theCompound, thePoint):
3717 # Example: see GEOM_Spanner.py
3718 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
3719 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
3722 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
3723 # @param theCompound Compound, to find block in.
3724 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
3725 # @return New GEOM_Object, containing the found block.
3727 # @ref swig_GetBlockByParts "Example"
3728 def GetBlockByParts(self,theCompound, theParts):
3729 # Example: see GEOM_TestOthers.py
3730 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
3731 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
3734 ## Return all blocks, containing all the elements, passed as the parts.
3735 # @param theCompound Compound, to find blocks in.
3736 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
3737 # @return List of GEOM_Objects, containing the found blocks.
3739 # @ref swig_todo "Example"
3740 def GetBlocksByParts(self,theCompound, theParts):
3741 # Example: see GEOM_Spanner.py
3742 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
3743 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
3746 ## Multi-transformate block and glue the result.
3747 # Transformation is defined so, as to superpose direction faces.
3748 # @param Block Hexahedral solid to be multi-transformed.
3749 # @param DirFace1 ID of First direction face.
3750 # @param DirFace2 ID of Second direction face.
3751 # @param NbTimes Quantity of transformations to be done.
3752 # \note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
3753 # @return New GEOM_Object, containing the result shape.
3755 # @ref tui_multi_transformation "Example"
3756 def MakeMultiTransformation1D(self,Block, DirFace1, DirFace2, NbTimes):
3757 # Example: see GEOM_Spanner.py
3758 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
3759 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
3760 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
3761 anObj.SetParameters(Parameters)
3764 ## Multi-transformate block and glue the result.
3765 # @param Block Hexahedral solid to be multi-transformed.
3766 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
3767 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
3768 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
3769 # @return New GEOM_Object, containing the result shape.
3771 # @ref tui_multi_transformation "Example"
3772 def MakeMultiTransformation2D(self,Block, DirFace1U, DirFace2U, NbTimesU,
3773 DirFace1V, DirFace2V, NbTimesV):
3774 # Example: see GEOM_Spanner.py
3775 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
3776 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
3777 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
3778 DirFace1V, DirFace2V, NbTimesV)
3779 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
3780 anObj.SetParameters(Parameters)
3783 ## Build all possible propagation groups.
3784 # Propagation group is a set of all edges, opposite to one (main)
3785 # edge of this group directly or through other opposite edges.
3786 # Notion of Opposite Edge make sence only on quadrangle face.
3787 # @param theShape Shape to build propagation groups on.
3788 # @return List of GEOM_Objects, each of them is a propagation group.
3790 # @ref swig_Propagate "Example"
3791 def Propagate(self,theShape):
3792 # Example: see GEOM_TestOthers.py
3793 listChains = self.BlocksOp.Propagate(theShape)
3794 RaiseIfFailed("Propagate", self.BlocksOp)
3797 # end of l3_blocks_op
3800 ## @addtogroup l3_groups
3803 ## Creates a new group which will store sub shapes of theMainShape
3804 # @param theMainShape is a GEOM object on which the group is selected
3805 # @param theShapeType defines a shape type of the group
3806 # @return a newly created GEOM group
3808 # @ref tui_working_with_groups_page "Example 1"
3809 # \n @ref swig_CreateGroup "Example 2"
3810 def CreateGroup(self,theMainShape, theShapeType):
3811 # Example: see GEOM_TestOthers.py
3812 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
3813 RaiseIfFailed("CreateGroup", self.GroupOp)
3816 ## Adds a sub object with ID theSubShapeId to the group
3817 # @param theGroup is a GEOM group to which the new sub shape is added
3818 # @param theSubShapeID is a sub shape ID in the main object.
3819 # \note Use method GetSubShapeID() to get an unique ID of the sub shape
3821 # @ref tui_working_with_groups_page "Example"
3822 def AddObject(self,theGroup, theSubShapeID):
3823 # Example: see GEOM_TestOthers.py
3824 self.GroupOp.AddObject(theGroup, theSubShapeID)
3825 RaiseIfFailed("AddObject", self.GroupOp)
3828 ## Removes a sub object with ID \a theSubShapeId from the group
3829 # @param theGroup is a GEOM group from which the new sub shape is removed
3830 # @param theSubShapeID is a sub shape ID in the main object.
3831 # \note Use method GetSubShapeID() to get an unique ID of the sub shape
3833 # @ref tui_working_with_groups_page "Example"
3834 def RemoveObject(self,theGroup, theSubShapeID):
3835 # Example: see GEOM_TestOthers.py
3836 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
3837 RaiseIfFailed("RemoveObject", self.GroupOp)
3840 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
3841 # @param theGroup is a GEOM group to which the new sub shapes are added.
3842 # @param theSubShapes is a list of sub shapes to be added.
3844 # @ref tui_working_with_groups_page "Example"
3845 def UnionList (self,theGroup, theSubShapes):
3846 # Example: see GEOM_TestOthers.py
3847 self.GroupOp.UnionList(theGroup, theSubShapes)
3848 RaiseIfFailed("UnionList", self.GroupOp)
3851 ## Works like the above method, but argument
3852 # theSubShapes here is a list of sub-shapes indices
3854 # @ref swig_UnionIDs "Example"
3855 def UnionIDs(self,theGroup, theSubShapes):
3856 # Example: see GEOM_TestOthers.py
3857 self.GroupOp.UnionIDs(theGroup, theSubShapes)
3858 RaiseIfFailed("UnionIDs", self.GroupOp)
3861 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
3862 # @param theGroup is a GEOM group from which the sub-shapes are removed.
3863 # @param theSubShapes is a list of sub-shapes to be removed.
3865 # @ref tui_working_with_groups_page "Example"
3866 def DifferenceList (self,theGroup, theSubShapes):
3867 # Example: see GEOM_TestOthers.py
3868 self.GroupOp.DifferenceList(theGroup, theSubShapes)
3869 RaiseIfFailed("DifferenceList", self.GroupOp)
3872 ## Works like the above method, but argument
3873 # theSubShapes here is a list of sub-shapes indices
3875 # @ref swig_DifferenceIDs "Example"
3876 def DifferenceIDs(self,theGroup, theSubShapes):
3877 # Example: see GEOM_TestOthers.py
3878 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
3879 RaiseIfFailed("DifferenceIDs", self.GroupOp)
3882 ## Returns a list of sub objects ID stored in the group
3883 # @param theGroup is a GEOM group for which a list of IDs is requested
3885 # @ref swig_GetObjectIDs "Example"
3886 def GetObjectIDs(self,theGroup):
3887 # Example: see GEOM_TestOthers.py
3888 ListIDs = self.GroupOp.GetObjects(theGroup)
3889 RaiseIfFailed("GetObjects", self.GroupOp)
3892 ## Returns a type of sub objects stored in the group
3893 # @param theGroup is a GEOM group which type is returned.
3895 # @ref swig_GetType "Example"
3896 def GetType(self,theGroup):
3897 # Example: see GEOM_TestOthers.py
3898 aType = self.GroupOp.GetType(theGroup)
3899 RaiseIfFailed("GetType", self.GroupOp)
3902 ## Returns a main shape associated with the group
3903 # @param theGroup is a GEOM group for which a main shape object is requested
3904 # @return a GEOM object which is a main shape for theGroup
3906 # @ref swig_GetMainShape "Example"
3907 def GetMainShape(self,theGroup):
3908 # Example: see GEOM_TestOthers.py
3909 anObj = self.GroupOp.GetMainShape(theGroup)
3910 RaiseIfFailed("GetMainShape", self.GroupOp)
3913 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
3914 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
3916 # @ref swig_todo "Example"
3917 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1):
3918 edges = self.SubShapeAll(theShape, ShapeType["EDGE"])
3921 Props = self.BasicProperties(edge)
3922 if min_length <= Props[0] and Props[0] <= max_length:
3923 if (not include_min) and (min_length == Props[0]):
3926 if (not include_max) and (Props[0] == max_length):
3929 edges_in_range.append(edge)
3931 if len(edges_in_range) <= 0:
3932 print "No edges found by given criteria"
3935 group_edges = self.CreateGroup(theShape, ShapeType["EDGE"])
3936 self.UnionList(group_edges, edges_in_range)
3940 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
3941 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
3943 # @ref swig_todo "Example"
3944 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
3945 nb_selected = sg.SelectedCount()
3947 print "Select a shape before calling this function, please."
3950 print "Only one shape must be selected"
3953 id_shape = sg.getSelected(0)
3954 shape = IDToObject( id_shape )
3956 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
3960 if include_min: left_str = " <= "
3961 if include_max: right_str = " <= "
3963 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
3964 + left_str + "length" + right_str + `max_length`)
3966 sg.updateObjBrowser(1)
3973 ## Create a copy of the given object
3974 # @ingroup l1_geompy_auxiliary
3976 # @ref swig_all_advanced "Example"
3977 def MakeCopy(self,theOriginal):
3978 # Example: see GEOM_TestAll.py
3979 anObj = self.InsertOp.MakeCopy(theOriginal)
3980 RaiseIfFailed("MakeCopy", self.InsertOp)
3983 ## Add Path to load python scripts from
3984 # @ingroup l1_geompy_auxiliary
3985 def addPath(self,Path):
3986 if (sys.path.count(Path) < 1):
3987 sys.path.append(Path)
3991 ## Load marker texture from the file
3992 # @param Path a path to the texture file
3993 # @return unique texture identifier
3994 # @ingroup l1_geompy_auxiliary
3995 def LoadTexture(self, Path):
3996 # Example: see GEOM_TestAll.py
3997 ID = self.InsertOp.LoadTexture(Path)
3998 RaiseIfFailed("LoadTexture", self.InsertOp)
4001 ## Add marker texture. @a Width and @a Height parameters
4002 # specify width and height of the texture in pixels.
4003 # If @a RowData is @c True, @a Texture parameter should represent texture data
4004 # packed into the byte array. If @a RowData is @c False (default), @a Texture
4005 # parameter should be unpacked string, in which '1' symbols represent opaque
4006 # pixels and '0' represent transparent pixels of the texture bitmap.
4008 # @param Width texture width in pixels
4009 # @param Height texture height in pixels
4010 # @param Texture texture data
4011 # @param RowData if @c True, @a Texture data are packed in the byte stream
4012 # @ingroup l1_geompy_auxiliary
4013 def AddTexture(self, Width, Height, Texture, RowData=False):
4014 # Example: see GEOM_TestAll.py
4015 if not RowData: Texture = PackData(Texture)
4016 ID = self.InsertOp.AddTexture(Width, Height, Texture)
4017 RaiseIfFailed("AddTexture", self.InsertOp)
4021 #Register the new proxy for GEOM_Gen
4022 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geompyDC)