1 # -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
4 # Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
5 # CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
7 # This library is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU Lesser General Public
9 # License as published by the Free Software Foundation; either
10 # version 2.1 of the License.
12 # This library is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # Lesser General Public License for more details.
17 # You should have received a copy of the GNU Lesser General Public
18 # License along with this library; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 # GEOM GEOM_SWIG : binding of C++ omplementaion with Python
25 # Author : Paul RASCLE, EDF
33 ## @defgroup l1_geompy_auxiliary Auxiliary data structures and methods
35 ## @defgroup l1_geompy_purpose All package methods, grouped by their purpose
37 ## @defgroup l2_import_export Importing/exporting geometrical objects
38 ## @defgroup l2_creating Creating geometrical objects
40 ## @defgroup l3_basic_go Creating Basic Geometric Objects
42 ## @defgroup l4_curves Creating Curves
45 ## @defgroup l3_3d_primitives Creating 3D Primitives
46 ## @defgroup l3_complex Creating Complex Objects
47 ## @defgroup l3_groups Working with groups
48 ## @defgroup l3_blocks Building by blocks
50 ## @defgroup l4_blocks_measure Check and Improve
53 ## @defgroup l3_sketcher Sketcher
54 ## @defgroup l3_advanced Creating Advanced Geometrical Objects
56 ## @defgroup l4_decompose Decompose objects
57 ## @defgroup l4_access Access to sub-shapes by their unique IDs inside the main shape
58 ## @defgroup l4_obtain Access to subshapes by a criteria
63 ## @defgroup l2_transforming Transforming geometrical objects
65 ## @defgroup l3_basic_op Basic Operations
66 ## @defgroup l3_boolean Boolean Operations
67 ## @defgroup l3_transform Transformation Operations
68 ## @defgroup l3_local Local Operations (Fillet and Chamfer)
69 ## @defgroup l3_blocks_op Blocks Operations
70 ## @defgroup l3_healing Repairing Operations
71 ## @defgroup l3_restore_ss Restore presentation parameters and a tree of subshapes
74 ## @defgroup l2_measure Using measurement tools
82 from salome_notebook import *
87 ## Enumeration ShapeType as a dictionary
88 # @ingroup l1_geompy_auxiliary
89 ShapeType = {"COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8}
91 ## Raise an Error, containing the Method_name, if Operation is Failed
92 ## @ingroup l1_geompy_auxiliary
93 def RaiseIfFailed (Method_name, Operation):
94 if Operation.IsDone() == 0 and Operation.GetErrorCode() != "NOT_FOUND_ANY":
95 raise RuntimeError, Method_name + " : " + Operation.GetErrorCode()
97 ## Return list of variables value from salome notebook
98 ## @ingroup l1_geompy_auxiliary
99 def ParseParameters(*parameters):
102 for parameter in parameters:
103 if isinstance(parameter,str):
104 if notebook.isVariable(parameter):
105 Result.append(notebook.get(parameter))
107 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
109 Result.append(parameter)
112 StringResult = StringResult + str(parameter)
113 StringResult = StringResult + ":"
115 StringResult = StringResult[:len(StringResult)-1]
116 Result.append(StringResult)
119 ## Return list of variables value from salome notebook
120 ## @ingroup l1_geompy_auxiliary
124 for parameter in list:
125 if isinstance(parameter,str) and notebook.isVariable(parameter):
126 Result.append(str(notebook.get(parameter)))
129 Result.append(str(parameter))
132 StringResult = StringResult + str(parameter)
133 StringResult = StringResult + ":"
135 StringResult = StringResult[:len(StringResult)-1]
136 return Result, StringResult
138 ## Return list of variables value from salome notebook
139 ## @ingroup l1_geompy_auxiliary
140 def ParseSketcherCommand(command):
143 sections = command.split(":")
144 for section in sections:
145 parameters = section.split(" ")
147 for parameter in parameters:
148 if paramIndex > 1 and parameter.find("'") != -1:
149 parameter = parameter.replace("'","")
150 if notebook.isVariable(parameter):
151 Result = Result + str(notebook.get(parameter)) + " "
154 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
158 Result = Result + str(parameter) + " "
161 StringResult = StringResult + parameter
162 StringResult = StringResult + ":"
164 paramIndex = paramIndex + 1
166 Result = Result[:len(Result)-1] + ":"
168 Result = Result[:len(Result)-1]
169 return Result, StringResult
171 ## Helper function which can be used to pack the passed string to the byte data.
172 ## Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
173 ## If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
176 ## val = PackData("10001110") # val = 0xAE
177 ## val = PackData("1") # val = 0x80
179 ## @param data unpacked data - a string containing '1' and '0' symbols
180 ## @return data packed to the byte stream
181 ## @ingroup l1_geompy_auxiliary
184 if len(data)%8: bytes += 1
186 for b in range(bytes):
187 d = data[b*8:(b+1)*8]
192 if d[i] == "1": val += 1
194 raise "Invalid symbol %s" % d[i]
201 ## Read bitmap texture from the text file.
202 ## In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
203 ## A zero symbol ('0') represents transparent pixel of the texture bitmap.
204 ## The function returns width and height of the pixmap in pixels and byte stream representing
205 ## texture bitmap itself.
207 ## This function can be used to read the texture to the byte stream in order to pass it to
208 ## the AddTexture() function of geompy class.
212 ## geompy.init_geom(salome.myStudy)
213 ## texture = geompy.readtexture('mytexture.dat')
214 ## texture = geompy.AddTexture(*texture)
215 ## obj.SetMarkerTexture(texture)
217 ## @param fname texture file name
218 ## @return sequence of tree values: texture's width, height in pixels and its byte stream
219 ## @ingroup l1_geompy_auxiliary
220 def ReadTexture(fname):
223 lines = [ l.strip() for l in f.readlines()]
226 if lines: maxlen = max([len(x) for x in lines])
228 if maxlen%8: lenbytes += 1
232 lenline = (len(line)/8+1)*8
235 lenline = (len(line)/8)*8
237 for i in range(lenline/8):
240 if i*8+j < len(line) and line[i*8+j] != "0": byte += "1"
243 bytedata += PackData(byte)
245 for i in range(lenline/8, lenbytes):
246 bytedata += PackData("0")
248 return lenbytes*8, len(lines), bytedata
253 ## Kinds of shape enumeration
254 # @ingroup l1_geompy_auxiliary
255 kind = GEOM.GEOM_IKindOfShape
257 ## Information about closed/unclosed state of shell or wire
258 # @ingroup l1_geompy_auxiliary
264 class geompyDC(GEOM._objref_GEOM_Gen):
267 GEOM._objref_GEOM_Gen.__init__(self)
268 self.myBuilder = None
286 ## @addtogroup l1_geompy_auxiliary
288 def init_geom(self,theStudy):
289 self.myStudy = theStudy
290 self.myStudyId = self.myStudy._get_StudyId()
291 self.myBuilder = self.myStudy.NewBuilder()
292 self.father = self.myStudy.FindComponent("GEOM")
293 if self.father is None:
294 self.father = self.myBuilder.NewComponent("GEOM")
295 A1 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributeName")
296 FName = A1._narrow(SALOMEDS.AttributeName)
297 FName.SetValue("Geometry")
298 A2 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributePixMap")
299 aPixmap = A2._narrow(SALOMEDS.AttributePixMap)
300 aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry")
301 self.myBuilder.DefineComponentInstance(self.father,self)
303 self.BasicOp = self.GetIBasicOperations (self.myStudyId)
304 self.CurvesOp = self.GetICurvesOperations (self.myStudyId)
305 self.PrimOp = self.GetI3DPrimOperations (self.myStudyId)
306 self.ShapesOp = self.GetIShapesOperations (self.myStudyId)
307 self.HealOp = self.GetIHealingOperations (self.myStudyId)
308 self.InsertOp = self.GetIInsertOperations (self.myStudyId)
309 self.BoolOp = self.GetIBooleanOperations (self.myStudyId)
310 self.TrsfOp = self.GetITransformOperations(self.myStudyId)
311 self.LocalOp = self.GetILocalOperations (self.myStudyId)
312 self.MeasuOp = self.GetIMeasureOperations (self.myStudyId)
313 self.BlocksOp = self.GetIBlocksOperations (self.myStudyId)
314 self.GroupOp = self.GetIGroupOperations (self.myStudyId)
317 ## Get name for sub-shape aSubObj of shape aMainObj
319 # @ref swig_SubShapeAllSorted "Example"
320 def SubShapeName(self,aSubObj, aMainObj):
321 # Example: see GEOM_TestAll.py
323 #aSubId = orb.object_to_string(aSubObj)
324 #aMainId = orb.object_to_string(aMainObj)
325 #index = gg.getIndexTopology(aSubId, aMainId)
326 #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
327 index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
328 name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
331 ## Publish in study aShape with name aName
333 # \param aShape the shape to be published
334 # \param aName the name for the shape
335 # \param doRestoreSubShapes if True, finds and publishes also
336 # sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
337 # and published sub-shapes of arguments
338 # \param theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes for
339 # these arguments description
340 # \return study entry of the published shape in form of string
342 # @ref swig_MakeQuad4Vertices "Example"
343 def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
344 theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
345 # Example: see GEOM_TestAll.py
347 aSObject = self.AddInStudy(self.myStudy, aShape, aName, None)
348 if doRestoreSubShapes:
349 self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs,
350 theFindMethod, theInheritFirstArg)
352 print "addToStudy() failed"
354 return aShape.GetStudyEntry()
356 ## Publish in study aShape with name aName as sub-object of previously published aFather
358 # @ref swig_SubShapeAllSorted "Example"
359 def addToStudyInFather(self, aFather, aShape, aName):
360 # Example: see GEOM_TestAll.py
362 aSObject = self.AddInStudy(self.myStudy, aShape, aName, aFather)
364 print "addToStudyInFather() failed"
366 return aShape.GetStudyEntry()
368 # end of l1_geompy_auxiliary
371 ## @addtogroup l3_restore_ss
374 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
375 # To be used from python scripts out of geompy.addToStudy (non-default usage)
376 # \param theObject published GEOM object, arguments of which will be published
377 # \param theArgs list of GEOM_Object, operation arguments to be published.
378 # If this list is empty, all operation arguments will be published
379 # \param theFindMethod method to search subshapes, corresponding to arguments and
380 # their subshapes. Value from enumeration GEOM::find_shape_method.
381 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
382 # Do not publish subshapes in place of arguments, but only
383 # in place of subshapes of the first argument,
384 # because the whole shape corresponds to the first argument.
385 # Mainly to be used after transformations, but it also can be
386 # usefull after partition with one object shape, and some other
387 # operations, where only the first argument has to be considered.
388 # If theObject has only one argument shape, this flag is automatically
389 # considered as True, not regarding really passed value.
390 # \return list of published sub-shapes
392 # @ref tui_restore_prs_params "Example"
393 def RestoreSubShapes (self, theObject, theArgs=[],
394 theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
395 # Example: see GEOM_TestAll.py
396 return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
397 theFindMethod, theInheritFirstArg)
399 # end of l3_restore_ss
402 ## @addtogroup l3_basic_go
405 ## Create point by three coordinates.
406 # @param theX The X coordinate of the point.
407 # @param theY The Y coordinate of the point.
408 # @param theZ The Z coordinate of the point.
409 # @return New GEOM_Object, containing the created point.
411 # @ref tui_creation_point "Example"
412 def MakeVertex(self,theX, theY, theZ):
413 # Example: see GEOM_TestAll.py
414 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
415 anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
416 RaiseIfFailed("MakePointXYZ", self.BasicOp)
417 anObj.SetParameters(Parameters)
420 ## Create a point, distant from the referenced point
421 # on the given distances along the coordinate axes.
422 # @param theReference The referenced point.
423 # @param theX Displacement from the referenced point along OX axis.
424 # @param theY Displacement from the referenced point along OY axis.
425 # @param theZ Displacement from the referenced point along OZ axis.
426 # @return New GEOM_Object, containing the created point.
428 # @ref tui_creation_point "Example"
429 def MakeVertexWithRef(self,theReference, theX, theY, theZ):
430 # Example: see GEOM_TestAll.py
431 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
432 anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
433 RaiseIfFailed("MakePointWithReference", self.BasicOp)
434 anObj.SetParameters(Parameters)
437 ## Create a point, corresponding to the given parameter on the given curve.
438 # @param theRefCurve The referenced curve.
439 # @param theParameter Value of parameter on the referenced curve.
440 # @return New GEOM_Object, containing the created point.
442 # @ref tui_creation_point "Example"
443 def MakeVertexOnCurve(self,theRefCurve, theParameter):
444 # Example: see GEOM_TestAll.py
445 theParameter, Parameters = ParseParameters(theParameter)
446 anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter)
447 RaiseIfFailed("MakePointOnCurve", self.BasicOp)
448 anObj.SetParameters(Parameters)
451 ## Create a point by projection give coordinates on the given curve
452 # @param theRefCurve The referenced curve.
453 # @param theX X-coordinate in 3D space
454 # @param theY Y-coordinate in 3D space
455 # @param theZ Z-coordinate in 3D space
456 # @return New GEOM_Object, containing the created point.
458 # @ref tui_creation_point "Example"
459 def MakeVertexOnCurveByCoord(self,theRefCurve, theX, theY, theZ):
460 # Example: see GEOM_TestAll.py
461 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
462 anObj = self.BasicOp.MakePointOnCurveByCoord(theRefCurve, theX, theY, theZ)
463 RaiseIfFailed("MakeVertexOnCurveByCoord", self.BasicOp)
464 anObj.SetParameters(Parameters)
467 ## Create a point, corresponding to the given parameters on the
469 # @param theRefSurf The referenced surface.
470 # @param theUParameter Value of U-parameter on the referenced surface.
471 # @param theVParameter Value of V-parameter on the referenced surface.
472 # @return New GEOM_Object, containing the created point.
474 # @ref swig_MakeVertexOnSurface "Example"
475 def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter):
476 theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
477 # Example: see GEOM_TestAll.py
478 anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
479 RaiseIfFailed("MakePointOnSurface", self.BasicOp)
480 anObj.SetParameters(Parameters);
483 ## Create a point by projection give coordinates on the given surface
484 # @param theRefSurf The referenced surface.
485 # @param theX X-coordinate in 3D space
486 # @param theY Y-coordinate in 3D space
487 # @param theZ Z-coordinate in 3D space
488 # @return New GEOM_Object, containing the created point.
490 # @ref swig_MakeVertexOnSurfaceByCoord "Example"
491 def MakeVertexOnSurfaceByCoord(self, theRefSurf, theX, theY, theZ):
492 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
493 # Example: see GEOM_TestAll.py
494 anObj = self.BasicOp.MakePointOnSurfaceByCoord(theRefSurf, theX, theY, theZ)
495 RaiseIfFailed("MakeVertexOnSurfaceByCoord", self.BasicOp)
496 anObj.SetParameters(Parameters);
499 ## Create a point on intersection of two lines.
500 # @param theRefLine1, theRefLine2 The referenced lines.
501 # @return New GEOM_Object, containing the created point.
503 # @ref swig_MakeVertexOnLinesIntersection "Example"
504 def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2):
505 # Example: see GEOM_TestAll.py
506 anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
507 RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
510 ## Create a tangent, corresponding to the given parameter on the given curve.
511 # @param theRefCurve The referenced curve.
512 # @param theParameter Value of parameter on the referenced curve.
513 # @return New GEOM_Object, containing the created tangent.
515 # @ref swig_MakeTangentOnCurve "Example"
516 def MakeTangentOnCurve(self, theRefCurve, theParameter):
517 anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
518 RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
521 ## Create a tangent plane, corresponding to the given parameter on the given face.
522 # @param theFace The face for which tangent plane should be built.
523 # @param theParameterV vertical value of the center point (0.0 - 1.0).
524 # @param theParameterU horisontal value of the center point (0.0 - 1.0).
525 # @param theTrimSize the size of plane.
526 # @return New GEOM_Object, containing the created tangent.
528 # @ref swig_MakeTangentPlaneOnFace "Example"
529 def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize):
530 anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
531 RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
534 ## Create a vector with the given components.
535 # @param theDX X component of the vector.
536 # @param theDY Y component of the vector.
537 # @param theDZ Z component of the vector.
538 # @return New GEOM_Object, containing the created vector.
540 # @ref tui_creation_vector "Example"
541 def MakeVectorDXDYDZ(self,theDX, theDY, theDZ):
542 # Example: see GEOM_TestAll.py
543 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
544 anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
545 RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
546 anObj.SetParameters(Parameters)
549 ## Create a vector between two points.
550 # @param thePnt1 Start point for the vector.
551 # @param thePnt2 End point for the vector.
552 # @return New GEOM_Object, containing the created vector.
554 # @ref tui_creation_vector "Example"
555 def MakeVector(self,thePnt1, thePnt2):
556 # Example: see GEOM_TestAll.py
557 anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
558 RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
561 ## Create a line, passing through the given point
562 # and parrallel to the given direction
563 # @param thePnt Point. The resulting line will pass through it.
564 # @param theDir Direction. The resulting line will be parallel to it.
565 # @return New GEOM_Object, containing the created line.
567 # @ref tui_creation_line "Example"
568 def MakeLine(self,thePnt, theDir):
569 # Example: see GEOM_TestAll.py
570 anObj = self.BasicOp.MakeLine(thePnt, theDir)
571 RaiseIfFailed("MakeLine", self.BasicOp)
574 ## Create a line, passing through the given points
575 # @param thePnt1 First of two points, defining the line.
576 # @param thePnt2 Second of two points, defining the line.
577 # @return New GEOM_Object, containing the created line.
579 # @ref tui_creation_line "Example"
580 def MakeLineTwoPnt(self,thePnt1, thePnt2):
581 # Example: see GEOM_TestAll.py
582 anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
583 RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
586 ## Create a line on two faces intersection.
587 # @param theFace1 First of two faces, defining the line.
588 # @param theFace2 Second of two faces, defining the line.
589 # @return New GEOM_Object, containing the created line.
591 # @ref swig_MakeLineTwoFaces "Example"
592 def MakeLineTwoFaces(self, theFace1, theFace2):
593 # Example: see GEOM_TestAll.py
594 anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
595 RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
598 ## Create a plane, passing through the given point
599 # and normal to the given vector.
600 # @param thePnt Point, the plane has to pass through.
601 # @param theVec Vector, defining the plane normal direction.
602 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
603 # @return New GEOM_Object, containing the created plane.
605 # @ref tui_creation_plane "Example"
606 def MakePlane(self,thePnt, theVec, theTrimSize):
607 # Example: see GEOM_TestAll.py
608 theTrimSize, Parameters = ParseParameters(theTrimSize);
609 anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
610 RaiseIfFailed("MakePlanePntVec", self.BasicOp)
611 anObj.SetParameters(Parameters)
614 ## Create a plane, passing through the three given points
615 # @param thePnt1 First of three points, defining the plane.
616 # @param thePnt2 Second of three points, defining the plane.
617 # @param thePnt3 Fird of three points, defining the plane.
618 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
619 # @return New GEOM_Object, containing the created plane.
621 # @ref tui_creation_plane "Example"
622 def MakePlaneThreePnt(self,thePnt1, thePnt2, thePnt3, theTrimSize):
623 # Example: see GEOM_TestAll.py
624 theTrimSize, Parameters = ParseParameters(theTrimSize);
625 anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
626 RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
627 anObj.SetParameters(Parameters)
630 ## Create a plane, similar to the existing one, but with another size of representing face.
631 # @param theFace Referenced plane or LCS(Marker).
632 # @param theTrimSize New half size of a side of quadrangle face, representing the plane.
633 # @return New GEOM_Object, containing the created plane.
635 # @ref tui_creation_plane "Example"
636 def MakePlaneFace(self,theFace, theTrimSize):
637 # Example: see GEOM_TestAll.py
638 theTrimSize, Parameters = ParseParameters(theTrimSize);
639 anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
640 RaiseIfFailed("MakePlaneFace", self.BasicOp)
641 anObj.SetParameters(Parameters)
644 ## Create a plane, passing through the 2 vectors
645 # with center in a start point of the first vector.
646 # @param theVec1 Vector, defining center point and plane direction.
647 # @param theVec2 Vector, defining the plane normal direction.
648 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
649 # @return New GEOM_Object, containing the created plane.
651 # @ref tui_creation_plane "Example"
652 def MakePlane2Vec(self,theVec1, theVec2, theTrimSize):
653 # Example: see GEOM_TestAll.py
654 theTrimSize, Parameters = ParseParameters(theTrimSize);
655 anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
656 RaiseIfFailed("MakePlane2Vec", self.BasicOp)
657 anObj.SetParameters(Parameters)
660 ## Create a plane, based on a Local coordinate system.
661 # @param theLCS coordinate system, defining plane.
662 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
663 # @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
664 # @return New GEOM_Object, containing the created plane.
666 # @ref tui_creation_plane "Example"
667 def MakePlaneLCS(self,theLCS, theTrimSize, theOrientation):
668 # Example: see GEOM_TestAll.py
669 theTrimSize, Parameters = ParseParameters(theTrimSize);
670 anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
671 RaiseIfFailed("MakePlaneLCS", self.BasicOp)
672 anObj.SetParameters(Parameters)
675 ## Create a local coordinate system.
676 # @param OX,OY,OZ Three coordinates of coordinate system origin.
677 # @param XDX,XDY,XDZ Three components of OX direction
678 # @param YDX,YDY,YDZ Three components of OY direction
679 # @return New GEOM_Object, containing the created coordinate system.
681 # @ref swig_MakeMarker "Example"
682 def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ):
683 # Example: see GEOM_TestAll.py
684 OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
685 anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
686 RaiseIfFailed("MakeMarker", self.BasicOp)
687 anObj.SetParameters(Parameters)
690 ## Create a local coordinate system from shape.
691 # @param theShape The initial shape to detect the coordinate system.
692 # @return New GEOM_Object, containing the created coordinate system.
694 # @ref tui_creation_lcs "Example"
695 def MakeMarkerFromShape(self, theShape):
696 anObj = self.BasicOp.MakeMarkerFromShape(theShape)
697 RaiseIfFailed("MakeMarkerFromShape", self.BasicOp)
700 ## Create a local coordinate system from point and two vectors.
701 # @param theOrigin Point of coordinate system origin.
702 # @param theXVec Vector of X direction
703 # @param theYVec Vector of Y direction
704 # @return New GEOM_Object, containing the created coordinate system.
706 # @ref tui_creation_lcs "Example"
707 def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec):
708 anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec)
709 RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp)
715 ## @addtogroup l4_curves
718 ## Create an arc of circle, passing through three given points.
719 # @param thePnt1 Start point of the arc.
720 # @param thePnt2 Middle point of the arc.
721 # @param thePnt3 End point of the arc.
722 # @return New GEOM_Object, containing the created arc.
724 # @ref swig_MakeArc "Example"
725 def MakeArc(self,thePnt1, thePnt2, thePnt3):
726 # Example: see GEOM_TestAll.py
727 anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
728 RaiseIfFailed("MakeArc", self.CurvesOp)
731 ## Create an arc of circle from a center and 2 points.
732 # @param thePnt1 Center of the arc
733 # @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
734 # @param thePnt3 End point of the arc (Gives also a direction)
735 # @param theSense Orientation of the arc
736 # @return New GEOM_Object, containing the created arc.
738 # @ref swig_MakeArc "Example"
739 def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False):
740 # Example: see GEOM_TestAll.py
741 anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
742 RaiseIfFailed("MakeArcCenter", self.CurvesOp)
745 ## Create an arc of ellipse, of center and two points.
746 # @param theCenter Center of the arc.
747 # @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
748 # @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
749 # @return New GEOM_Object, containing the created arc.
751 # @ref swig_MakeArc "Example"
752 def MakeArcOfEllipse(self,theCenter, thePnt1, thePnt2):
753 # Example: see GEOM_TestAll.py
754 anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
755 RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
758 ## Create a circle with given center, normal vector and radius.
759 # @param thePnt Circle center.
760 # @param theVec Vector, normal to the plane of the circle.
761 # @param theR Circle radius.
762 # @return New GEOM_Object, containing the created circle.
764 # @ref tui_creation_circle "Example"
765 def MakeCircle(self, thePnt, theVec, theR):
766 # Example: see GEOM_TestAll.py
767 theR, Parameters = ParseParameters(theR)
768 anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
769 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
770 anObj.SetParameters(Parameters)
773 ## Create a circle with given radius.
774 # Center of the circle will be in the origin of global
775 # coordinate system and normal vector will be codirected with Z axis
776 # @param theR Circle radius.
777 # @return New GEOM_Object, containing the created circle.
778 def MakeCircleR(self, theR):
779 anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
780 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
783 ## Create a circle, passing through three given points
784 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
785 # @return New GEOM_Object, containing the created circle.
787 # @ref tui_creation_circle "Example"
788 def MakeCircleThreePnt(self,thePnt1, thePnt2, thePnt3):
789 # Example: see GEOM_TestAll.py
790 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
791 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
794 ## Create a circle, with given point1 as center,
795 # passing through the point2 as radius and laying in the plane,
796 # defined by all three given points.
797 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
798 # @return New GEOM_Object, containing the created circle.
800 # @ref swig_MakeCircle "Example"
801 def MakeCircleCenter2Pnt(self,thePnt1, thePnt2, thePnt3):
802 # Example: see GEOM_example6.py
803 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
804 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
807 ## Create an ellipse with given center, normal vector and radiuses.
808 # @param thePnt Ellipse center.
809 # @param theVec Vector, normal to the plane of the ellipse.
810 # @param theRMajor Major ellipse radius.
811 # @param theRMinor Minor ellipse radius.
812 # @param theVecMaj Vector, direction of the ellipse's main axis.
813 # @return New GEOM_Object, containing the created ellipse.
815 # @ref tui_creation_ellipse "Example"
816 def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None):
817 # Example: see GEOM_TestAll.py
818 theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
819 if theVecMaj is not None:
820 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
822 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
824 RaiseIfFailed("MakeEllipse", self.CurvesOp)
825 anObj.SetParameters(Parameters)
828 ## Create an ellipse with given radiuses.
829 # Center of the ellipse will be in the origin of global
830 # coordinate system and normal vector will be codirected with Z axis
831 # @param theRMajor Major ellipse radius.
832 # @param theRMinor Minor ellipse radius.
833 # @return New GEOM_Object, containing the created ellipse.
834 def MakeEllipseRR(self, theRMajor, theRMinor):
835 anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
836 RaiseIfFailed("MakeEllipse", self.CurvesOp)
839 ## Create a polyline on the set of points.
840 # @param thePoints Sequence of points for the polyline.
841 # @return New GEOM_Object, containing the created polyline.
843 # @ref tui_creation_curve "Example"
844 def MakePolyline(self,thePoints):
845 # Example: see GEOM_TestAll.py
846 anObj = self.CurvesOp.MakePolyline(thePoints)
847 RaiseIfFailed("MakePolyline", self.CurvesOp)
850 ## Create bezier curve on the set of points.
851 # @param thePoints Sequence of points for the bezier curve.
852 # @return New GEOM_Object, containing the created bezier curve.
854 # @ref tui_creation_curve "Example"
855 def MakeBezier(self,thePoints):
856 # Example: see GEOM_TestAll.py
857 anObj = self.CurvesOp.MakeSplineBezier(thePoints)
858 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
861 ## Create B-Spline curve on the set of points.
862 # @param thePoints Sequence of points for the B-Spline curve.
863 # @param theIsClosed If True, build a closed curve.
864 # @return New GEOM_Object, containing the created B-Spline curve.
866 # @ref tui_creation_curve "Example"
867 def MakeInterpol(self, thePoints, theIsClosed=False):
868 # Example: see GEOM_TestAll.py
869 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed)
870 RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
876 ## @addtogroup l3_sketcher
879 ## Create a sketcher (wire or face), following the textual description,
880 # passed through <VAR>theCommand</VAR> argument. \n
881 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
882 # Format of the description string have to be the following:
884 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
887 # - x1, y1 are coordinates of the first sketcher point (zero by default),
889 # - "R angle" : Set the direction by angle
890 # - "D dx dy" : Set the direction by DX & DY
893 # - "TT x y" : Create segment by point at X & Y
894 # - "T dx dy" : Create segment by point with DX & DY
895 # - "L length" : Create segment by direction & Length
896 # - "IX x" : Create segment by direction & Intersect. X
897 # - "IY y" : Create segment by direction & Intersect. Y
900 # - "C radius length" : Create arc by direction, radius and length(in degree)
903 # - "WW" : Close Wire (to finish)
904 # - "WF" : Close Wire and build face (to finish)
906 # @param theCommand String, defining the sketcher in local
907 # coordinates of the working plane.
908 # @param theWorkingPlane Nine double values, defining origin,
909 # OZ and OX directions of the working plane.
910 # @return New GEOM_Object, containing the created wire.
912 # @ref tui_sketcher_page "Example"
913 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0]):
914 # Example: see GEOM_TestAll.py
915 theCommand,Parameters = ParseSketcherCommand(theCommand)
916 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
917 RaiseIfFailed("MakeSketcher", self.CurvesOp)
918 anObj.SetParameters(Parameters)
921 ## Create a sketcher (wire or face), following the textual description,
922 # passed through <VAR>theCommand</VAR> argument. \n
923 # For format of the description string see the previous method.\n
924 # @param theCommand String, defining the sketcher in local
925 # coordinates of the working plane.
926 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
927 # @return New GEOM_Object, containing the created wire.
929 # @ref tui_sketcher_page "Example"
930 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane):
931 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
932 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
935 ## Create a sketcher wire, following the numerical description,
936 # passed through <VAR>theCoordinates</VAR> argument. \n
937 # @param theCoordinates double values, defining points to create a wire,
939 # @return New GEOM_Object, containing the created wire.
941 # @ref tui_sketcher_page "Example"
942 def Make3DSketcher(self, theCoordinates):
943 anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
944 RaiseIfFailed("Make3DSketcher", self.CurvesOp)
950 ## @addtogroup l3_3d_primitives
953 ## Create a box by coordinates of two opposite vertices.
955 # @ref tui_creation_box "Example"
956 def MakeBox(self,x1,y1,z1,x2,y2,z2):
957 # Example: see GEOM_TestAll.py
958 pnt1 = self.MakeVertex(x1,y1,z1)
959 pnt2 = self.MakeVertex(x2,y2,z2)
960 return self.MakeBoxTwoPnt(pnt1,pnt2)
962 ## Create a box with specified dimensions along the coordinate axes
963 # and with edges, parallel to the coordinate axes.
964 # Center of the box will be at point (DX/2, DY/2, DZ/2).
965 # @param theDX Length of Box edges, parallel to OX axis.
966 # @param theDY Length of Box edges, parallel to OY axis.
967 # @param theDZ Length of Box edges, parallel to OZ axis.
968 # @return New GEOM_Object, containing the created box.
970 # @ref tui_creation_box "Example"
971 def MakeBoxDXDYDZ(self,theDX, theDY, theDZ):
972 # Example: see GEOM_TestAll.py
973 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
974 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
975 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
976 anObj.SetParameters(Parameters)
979 ## Create a box with two specified opposite vertices,
980 # and with edges, parallel to the coordinate axes
981 # @param thePnt1 First of two opposite vertices.
982 # @param thePnt2 Second of two opposite vertices.
983 # @return New GEOM_Object, containing the created box.
985 # @ref tui_creation_box "Example"
986 def MakeBoxTwoPnt(self,thePnt1, thePnt2):
987 # Example: see GEOM_TestAll.py
988 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
989 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
992 ## Create a face with specified dimensions along OX-OY coordinate axes,
993 # with edges, parallel to this coordinate axes.
994 # @param theH height of Face.
995 # @param theW width of Face.
996 # @param theOrientation orientation belong axis OXY OYZ OZX
997 # @return New GEOM_Object, containing the created face.
999 # @ref tui_creation_face "Example"
1000 def MakeFaceHW(self,theH, theW, theOrientation):
1001 # Example: see GEOM_TestAll.py
1002 theH,theW,Parameters = ParseParameters(theH, theW)
1003 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
1004 RaiseIfFailed("MakeFaceHW", self.PrimOp)
1005 anObj.SetParameters(Parameters)
1008 ## Create a face from another plane and two sizes,
1009 # vertical size and horisontal size.
1010 # @param theObj Normale vector to the creating face or
1012 # @param theH Height (vertical size).
1013 # @param theW Width (horisontal size).
1014 # @return New GEOM_Object, containing the created face.
1016 # @ref tui_creation_face "Example"
1017 def MakeFaceObjHW(self, theObj, theH, theW):
1018 # Example: see GEOM_TestAll.py
1019 theH,theW,Parameters = ParseParameters(theH, theW)
1020 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
1021 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
1022 anObj.SetParameters(Parameters)
1025 ## Create a disk with given center, normal vector and radius.
1026 # @param thePnt Disk center.
1027 # @param theVec Vector, normal to the plane of the disk.
1028 # @param theR Disk radius.
1029 # @return New GEOM_Object, containing the created disk.
1031 # @ref tui_creation_disk "Example"
1032 def MakeDiskPntVecR(self,thePnt, theVec, theR):
1033 # Example: see GEOM_TestAll.py
1034 theR,Parameters = ParseParameters(theR)
1035 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
1036 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
1037 anObj.SetParameters(Parameters)
1040 ## Create a disk, passing through three given points
1041 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
1042 # @return New GEOM_Object, containing the created disk.
1044 # @ref tui_creation_disk "Example"
1045 def MakeDiskThreePnt(self,thePnt1, thePnt2, thePnt3):
1046 # Example: see GEOM_TestAll.py
1047 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
1048 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
1051 ## Create a disk with specified dimensions along OX-OY coordinate axes.
1052 # @param theR Radius of Face.
1053 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
1054 # @return New GEOM_Object, containing the created disk.
1056 # @ref tui_creation_face "Example"
1057 def MakeDiskR(self,theR, theOrientation):
1058 # Example: see GEOM_TestAll.py
1059 theR,Parameters = ParseParameters(theR)
1060 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
1061 RaiseIfFailed("MakeDiskR", self.PrimOp)
1062 anObj.SetParameters(Parameters)
1065 ## Create a cylinder with given base point, axis, radius and height.
1066 # @param thePnt Central point of cylinder base.
1067 # @param theAxis Cylinder axis.
1068 # @param theR Cylinder radius.
1069 # @param theH Cylinder height.
1070 # @return New GEOM_Object, containing the created cylinder.
1072 # @ref tui_creation_cylinder "Example"
1073 def MakeCylinder(self,thePnt, theAxis, theR, theH):
1074 # Example: see GEOM_TestAll.py
1075 theR,theH,Parameters = ParseParameters(theR, theH)
1076 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
1077 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
1078 anObj.SetParameters(Parameters)
1081 ## Create a cylinder with given radius and height at
1082 # the origin of coordinate system. Axis of the cylinder
1083 # will be collinear to the OZ axis of the coordinate system.
1084 # @param theR Cylinder radius.
1085 # @param theH Cylinder height.
1086 # @return New GEOM_Object, containing the created cylinder.
1088 # @ref tui_creation_cylinder "Example"
1089 def MakeCylinderRH(self,theR, theH):
1090 # Example: see GEOM_TestAll.py
1091 theR,theH,Parameters = ParseParameters(theR, theH)
1092 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
1093 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
1094 anObj.SetParameters(Parameters)
1097 ## Create a sphere with given center and radius.
1098 # @param thePnt Sphere center.
1099 # @param theR Sphere radius.
1100 # @return New GEOM_Object, containing the created sphere.
1102 # @ref tui_creation_sphere "Example"
1103 def MakeSpherePntR(self, thePnt, theR):
1104 # Example: see GEOM_TestAll.py
1105 theR,Parameters = ParseParameters(theR)
1106 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
1107 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
1108 anObj.SetParameters(Parameters)
1111 ## Create a sphere with given center and radius.
1112 # @param x,y,z Coordinates of sphere center.
1113 # @param theR Sphere radius.
1114 # @return New GEOM_Object, containing the created sphere.
1116 # @ref tui_creation_sphere "Example"
1117 def MakeSphere(self, x, y, z, theR):
1118 # Example: see GEOM_TestAll.py
1119 point = self.MakeVertex(x, y, z)
1120 anObj = self.MakeSpherePntR(point, theR)
1123 ## Create a sphere with given radius at the origin of coordinate system.
1124 # @param theR Sphere radius.
1125 # @return New GEOM_Object, containing the created sphere.
1127 # @ref tui_creation_sphere "Example"
1128 def MakeSphereR(self, theR):
1129 # Example: see GEOM_TestAll.py
1130 theR,Parameters = ParseParameters(theR)
1131 anObj = self.PrimOp.MakeSphereR(theR)
1132 RaiseIfFailed("MakeSphereR", self.PrimOp)
1133 anObj.SetParameters(Parameters)
1136 ## Create a cone with given base point, axis, height and radiuses.
1137 # @param thePnt Central point of the first cone base.
1138 # @param theAxis Cone axis.
1139 # @param theR1 Radius of the first cone base.
1140 # @param theR2 Radius of the second cone base.
1141 # \note If both radiuses are non-zero, the cone will be truncated.
1142 # \note If the radiuses are equal, a cylinder will be created instead.
1143 # @param theH Cone height.
1144 # @return New GEOM_Object, containing the created cone.
1146 # @ref tui_creation_cone "Example"
1147 def MakeCone(self,thePnt, theAxis, theR1, theR2, theH):
1148 # Example: see GEOM_TestAll.py
1149 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
1150 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
1151 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
1152 anObj.SetParameters(Parameters)
1155 ## Create a cone with given height and radiuses at
1156 # the origin of coordinate system. Axis of the cone will
1157 # be collinear to the OZ axis of the coordinate system.
1158 # @param theR1 Radius of the first cone base.
1159 # @param theR2 Radius of the second cone base.
1160 # \note If both radiuses are non-zero, the cone will be truncated.
1161 # \note If the radiuses are equal, a cylinder will be created instead.
1162 # @param theH Cone height.
1163 # @return New GEOM_Object, containing the created cone.
1165 # @ref tui_creation_cone "Example"
1166 def MakeConeR1R2H(self,theR1, theR2, theH):
1167 # Example: see GEOM_TestAll.py
1168 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
1169 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
1170 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
1171 anObj.SetParameters(Parameters)
1174 ## Create a torus with given center, normal vector and radiuses.
1175 # @param thePnt Torus central point.
1176 # @param theVec Torus axis of symmetry.
1177 # @param theRMajor Torus major radius.
1178 # @param theRMinor Torus minor radius.
1179 # @return New GEOM_Object, containing the created torus.
1181 # @ref tui_creation_torus "Example"
1182 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor):
1183 # Example: see GEOM_TestAll.py
1184 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
1185 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
1186 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
1187 anObj.SetParameters(Parameters)
1190 ## Create a torus with given radiuses at the origin of coordinate system.
1191 # @param theRMajor Torus major radius.
1192 # @param theRMinor Torus minor radius.
1193 # @return New GEOM_Object, containing the created torus.
1195 # @ref tui_creation_torus "Example"
1196 def MakeTorusRR(self, theRMajor, theRMinor):
1197 # Example: see GEOM_TestAll.py
1198 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
1199 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
1200 RaiseIfFailed("MakeTorusRR", self.PrimOp)
1201 anObj.SetParameters(Parameters)
1204 # end of l3_3d_primitives
1207 ## @addtogroup l3_complex
1210 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
1211 # @param theBase Base shape to be extruded.
1212 # @param thePoint1 First end of extrusion vector.
1213 # @param thePoint2 Second end of extrusion vector.
1214 # @return New GEOM_Object, containing the created prism.
1216 # @ref tui_creation_prism "Example"
1217 def MakePrism(self, theBase, thePoint1, thePoint2):
1218 # Example: see GEOM_TestAll.py
1219 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
1220 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
1223 ## Create a shape by extrusion of the base shape along the vector,
1224 # i.e. all the space, transfixed by the base shape during its translation
1225 # along the vector on the given distance.
1226 # @param theBase Base shape to be extruded.
1227 # @param theVec Direction of extrusion.
1228 # @param theH Prism dimension along theVec.
1229 # @return New GEOM_Object, containing the created prism.
1231 # @ref tui_creation_prism "Example"
1232 def MakePrismVecH(self, theBase, theVec, theH):
1233 # Example: see GEOM_TestAll.py
1234 theH,Parameters = ParseParameters(theH)
1235 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
1236 RaiseIfFailed("MakePrismVecH", self.PrimOp)
1237 anObj.SetParameters(Parameters)
1240 ## Create a shape by extrusion of the base shape along the vector,
1241 # i.e. all the space, transfixed by the base shape during its translation
1242 # along the vector on the given distance in 2 Ways (forward/backward) .
1243 # @param theBase Base shape to be extruded.
1244 # @param theVec Direction of extrusion.
1245 # @param theH Prism dimension along theVec in forward direction.
1246 # @return New GEOM_Object, containing the created prism.
1248 # @ref tui_creation_prism "Example"
1249 def MakePrismVecH2Ways(self, theBase, theVec, theH):
1250 # Example: see GEOM_TestAll.py
1251 theH,Parameters = ParseParameters(theH)
1252 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
1253 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
1254 anObj.SetParameters(Parameters)
1257 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
1258 # @param theBase Base shape to be extruded.
1259 # @param theDX, theDY, theDZ Directions of extrusion.
1260 # @return New GEOM_Object, containing the created prism.
1262 # @ref tui_creation_prism "Example"
1263 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ):
1264 # Example: see GEOM_TestAll.py
1265 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1266 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
1267 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
1268 anObj.SetParameters(Parameters)
1271 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
1272 # i.e. all the space, transfixed by the base shape during its translation
1273 # along the vector on the given distance in 2 Ways (forward/backward) .
1274 # @param theBase Base shape to be extruded.
1275 # @param theDX, theDY, theDZ Directions of extrusion.
1276 # @return New GEOM_Object, containing the created prism.
1278 # @ref tui_creation_prism "Example"
1279 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ):
1280 # Example: see GEOM_TestAll.py
1281 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1282 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
1283 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
1284 anObj.SetParameters(Parameters)
1287 ## Create a shape by revolution of the base shape around the axis
1288 # on the given angle, i.e. all the space, transfixed by the base
1289 # shape during its rotation around the axis on the given angle.
1290 # @param theBase Base shape to be rotated.
1291 # @param theAxis Rotation axis.
1292 # @param theAngle Rotation angle in radians.
1293 # @return New GEOM_Object, containing the created revolution.
1295 # @ref tui_creation_revolution "Example"
1296 def MakeRevolution(self, theBase, theAxis, theAngle):
1297 # Example: see GEOM_TestAll.py
1298 theAngle,Parameters = ParseParameters(theAngle)
1299 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
1300 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
1301 anObj.SetParameters(Parameters)
1304 ## The Same Revolution but in both ways forward&backward.
1305 def MakeRevolution2Ways(self, theBase, theAxis, theAngle):
1306 theAngle,Parameters = ParseParameters(theAngle)
1307 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
1308 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
1309 anObj.SetParameters(Parameters)
1312 ## Create a filling from the given compound of contours.
1313 # @param theShape the compound of contours
1314 # @param theMinDeg a minimal degree of BSpline surface to create
1315 # @param theMaxDeg a maximal degree of BSpline surface to create
1316 # @param theTol2D a 2d tolerance to be reached
1317 # @param theTol3D a 3d tolerance to be reached
1318 # @param theNbIter a number of iteration of approximation algorithm
1319 # @param isUseOri flag for take into account orientation of edges
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,
1329 theTol3D, theNbIter, isUseOri=0, isApprox=0):
1330 # Example: see GEOM_TestAll.py
1331 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg,
1332 theTol2D, theTol3D, theNbIter)
1333 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
1334 theTol2D, theTol3D, theNbIter,
1336 RaiseIfFailed("MakeFilling", self.PrimOp)
1337 anObj.SetParameters(Parameters)
1340 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
1341 # @param theSeqSections - set of specified sections.
1342 # @param theModeSolid - mode defining building solid or shell
1343 # @param thePreci - precision 3D used for smoothing by default 1.e-6
1344 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
1345 # @return New GEOM_Object, containing the created shell or solid.
1347 # @ref swig_todo "Example"
1348 def MakeThruSections(self,theSeqSections,theModeSolid,thePreci,theRuled):
1349 # Example: see GEOM_TestAll.py
1350 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
1351 RaiseIfFailed("MakeThruSections", self.PrimOp)
1354 ## Create a shape by extrusion of the base shape along
1355 # the path shape. The path shape can be a wire or an edge.
1356 # @param theBase Base shape to be extruded.
1357 # @param thePath Path shape to extrude the base shape along it.
1358 # @return New GEOM_Object, containing the created pipe.
1360 # @ref tui_creation_pipe "Example"
1361 def MakePipe(self,theBase, thePath):
1362 # Example: see GEOM_TestAll.py
1363 anObj = self.PrimOp.MakePipe(theBase, thePath)
1364 RaiseIfFailed("MakePipe", self.PrimOp)
1367 ## Create a shape by extrusion of the profile shape along
1368 # the path shape. The path shape can be a wire or an edge.
1369 # the several profiles can be specified in the several locations of path.
1370 # @param theSeqBases - list of Bases shape to be extruded.
1371 # @param theLocations - list of locations on the path corresponding
1372 # specified list of the Bases shapes. Number of locations
1373 # should be equal to number of bases or list of locations can be empty.
1374 # @param thePath - Path shape to extrude the base shape along it.
1375 # @param theWithContact - the mode defining that the section is translated to be in
1376 # contact with the spine.
1377 # @param theWithCorrection - defining that the section is rotated to be
1378 # orthogonal to the spine tangent in the correspondent point
1379 # @return New GEOM_Object, containing the created pipe.
1381 # @ref tui_creation_pipe_with_diff_sec "Example"
1382 def MakePipeWithDifferentSections(self, theSeqBases,
1383 theLocations, thePath,
1384 theWithContact, theWithCorrection):
1385 anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
1386 theLocations, thePath,
1387 theWithContact, theWithCorrection)
1388 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
1391 ## Create a shape by extrusion of the profile shape along
1392 # the path shape. The path shape can be a wire or a edge.
1393 # the several profiles can be specified in the several locations of path.
1394 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
1395 # shell or face. If number of faces in neighbour sections
1396 # aren't coincided result solid between such sections will
1397 # be created using external boundaries of this shells.
1398 # @param theSeqSubBases - list of corresponding subshapes of section shapes.
1399 # This list is used for searching correspondences between
1400 # faces in the sections. Size of this list must be equal
1401 # to size of list of base shapes.
1402 # @param theLocations - list of locations on the path corresponding
1403 # specified list of the Bases shapes. Number of locations
1404 # should be equal to number of bases. First and last
1405 # locations must be coincided with first and last vertexes
1406 # of path correspondingly.
1407 # @param thePath - Path shape to extrude the base shape along it.
1408 # @param theWithContact - the mode defining that the section is translated to be in
1409 # contact with the spine.
1410 # @param theWithCorrection - defining that the section is rotated to be
1411 # orthogonal to the spine tangent in the correspondent point
1412 # @return New GEOM_Object, containing the created solids.
1414 # @ref tui_creation_pipe_with_shell_sec "Example"
1415 def MakePipeWithShellSections(self,theSeqBases, theSeqSubBases,
1416 theLocations, thePath,
1417 theWithContact, theWithCorrection):
1418 anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
1419 theLocations, thePath,
1420 theWithContact, theWithCorrection)
1421 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
1424 ## Create a shape by extrusion of the profile shape along
1425 # the path shape. This function is used only for debug pipe
1426 # functionality - it is a version of previous function
1427 # (MakePipeWithShellSections(...)) which give a possibility to
1428 # recieve information about creating pipe between each pair of
1429 # sections step by step.
1430 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
1431 theLocations, thePath,
1432 theWithContact, theWithCorrection):
1434 nbsect = len(theSeqBases)
1435 nbsubsect = len(theSeqSubBases)
1436 #print "nbsect = ",nbsect
1437 for i in range(1,nbsect):
1439 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
1440 tmpLocations = [ theLocations[i-1], theLocations[i] ]
1442 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
1443 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
1444 tmpLocations, thePath,
1445 theWithContact, theWithCorrection)
1446 if self.PrimOp.IsDone() == 0:
1447 print "Problems with pipe creation between ",i," and ",i+1," sections"
1448 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
1451 print "Pipe between ",i," and ",i+1," sections is OK"
1456 resc = self.MakeCompound(res)
1457 #resc = self.MakeSewing(res, 0.001)
1458 #print "resc: ",resc
1461 ## Create solids between given sections
1462 # @param theSeqBases - list of sections (shell or face).
1463 # @param theLocations - list of corresponding vertexes
1464 # @return New GEOM_Object, containing the created solids.
1466 # @ref tui_creation_pipe_without_path "Example"
1467 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations):
1468 anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
1469 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
1472 ## Create a shape by extrusion of the base shape along
1473 # the path shape with constant bi-normal direction along the given vector.
1474 # The path shape can be a wire or an edge.
1475 # @param theBase Base shape to be extruded.
1476 # @param thePath Path shape to extrude the base shape along it.
1477 # @param theVec Vector defines a constant binormal direction to keep the
1478 # same angle beetween the direction and the sections
1479 # along the sweep surface.
1480 # @return New GEOM_Object, containing the created pipe.
1482 # @ref tui_creation_pipe "Example"
1483 def MakePipeBiNormalAlongVector(self,theBase, thePath, theVec):
1484 # Example: see GEOM_TestAll.py
1485 anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
1486 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
1492 ## @addtogroup l3_advanced
1495 ## Create a linear edge with specified ends.
1496 # @param thePnt1 Point for the first end of edge.
1497 # @param thePnt2 Point for the second end of edge.
1498 # @return New GEOM_Object, containing the created edge.
1500 # @ref tui_creation_edge "Example"
1501 def MakeEdge(self,thePnt1, thePnt2):
1502 # Example: see GEOM_TestAll.py
1503 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
1504 RaiseIfFailed("MakeEdge", self.ShapesOp)
1507 ## Create a wire from the set of edges and wires.
1508 # @param theEdgesAndWires List of edges and/or wires.
1509 # @param theTolerance Maximum distance between vertices, that will be merged.
1510 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
1511 # @return New GEOM_Object, containing the created wire.
1513 # @ref tui_creation_wire "Example"
1514 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07):
1515 # Example: see GEOM_TestAll.py
1516 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
1517 RaiseIfFailed("MakeWire", self.ShapesOp)
1520 ## Create a face on the given wire.
1521 # @param theWire closed Wire or Edge to build the face on.
1522 # @param isPlanarWanted If TRUE, only planar face will be built.
1523 # If impossible, NULL object will be returned.
1524 # @return New GEOM_Object, containing the created face.
1526 # @ref tui_creation_face "Example"
1527 def MakeFace(self,theWire, isPlanarWanted):
1528 # Example: see GEOM_TestAll.py
1529 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
1530 RaiseIfFailed("MakeFace", self.ShapesOp)
1533 ## Create a face on the given wires set.
1534 # @param theWires List of closed wires or edges to build the face on.
1535 # @param isPlanarWanted If TRUE, only planar face will be built.
1536 # If impossible, NULL object will be returned.
1537 # @return New GEOM_Object, containing the created face.
1539 # @ref tui_creation_face "Example"
1540 def MakeFaceWires(self,theWires, isPlanarWanted):
1541 # Example: see GEOM_TestAll.py
1542 anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
1543 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
1546 ## Shortcut to MakeFaceWires()
1548 # @ref tui_creation_face "Example 1"
1549 # \n @ref swig_MakeFaces "Example 2"
1550 def MakeFaces(self,theWires, isPlanarWanted):
1551 # Example: see GEOM_TestOthers.py
1552 anObj = self.MakeFaceWires(theWires, isPlanarWanted)
1555 ## Create a shell from the set of faces and shells.
1556 # @param theFacesAndShells List of faces and/or shells.
1557 # @return New GEOM_Object, containing the created shell.
1559 # @ref tui_creation_shell "Example"
1560 def MakeShell(self,theFacesAndShells):
1561 # Example: see GEOM_TestAll.py
1562 anObj = self.ShapesOp.MakeShell(theFacesAndShells)
1563 RaiseIfFailed("MakeShell", self.ShapesOp)
1566 ## Create a solid, bounded by the given shells.
1567 # @param theShells Sequence of bounding shells.
1568 # @return New GEOM_Object, containing the created solid.
1570 # @ref tui_creation_solid "Example"
1571 def MakeSolid(self,theShells):
1572 # Example: see GEOM_TestAll.py
1573 anObj = self.ShapesOp.MakeSolidShells(theShells)
1574 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
1577 ## Create a compound of the given shapes.
1578 # @param theShapes List of shapes to put in compound.
1579 # @return New GEOM_Object, containing the created compound.
1581 # @ref tui_creation_compound "Example"
1582 def MakeCompound(self,theShapes):
1583 # Example: see GEOM_TestAll.py
1584 anObj = self.ShapesOp.MakeCompound(theShapes)
1585 RaiseIfFailed("MakeCompound", self.ShapesOp)
1588 # end of l3_advanced
1591 ## @addtogroup l2_measure
1594 ## Gives quantity of faces in the given shape.
1595 # @param theShape Shape to count faces of.
1596 # @return Quantity of faces.
1598 # @ref swig_NumberOf "Example"
1599 def NumberOfFaces(self, theShape):
1600 # Example: see GEOM_TestOthers.py
1601 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
1602 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
1605 ## Gives quantity of edges in the given shape.
1606 # @param theShape Shape to count edges of.
1607 # @return Quantity of edges.
1609 # @ref swig_NumberOf "Example"
1610 def NumberOfEdges(self, theShape):
1611 # Example: see GEOM_TestOthers.py
1612 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
1613 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
1616 ## Gives quantity of subshapes of type theShapeType in the given shape.
1617 # @param theShape Shape to count subshapes of.
1618 # @param theShapeType Type of subshapes to count.
1619 # @return Quantity of subshapes of given type.
1621 # @ref swig_NumberOf "Example"
1622 def NumberOfSubShapes(self, theShape, theShapeType):
1623 # Example: see GEOM_TestOthers.py
1624 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
1625 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
1628 ## Gives quantity of solids in the given shape.
1629 # @param theShape Shape to count solids in.
1630 # @return Quantity of solids.
1632 # @ref swig_NumberOf "Example"
1633 def NumberOfSolids(self, theShape):
1634 # Example: see GEOM_TestOthers.py
1635 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, ShapeType["SOLID"])
1636 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
1642 ## @addtogroup l3_healing
1645 ## Reverses an orientation the given shape.
1646 # @param theShape Shape to be reversed.
1647 # @return The reversed copy of theShape.
1649 # @ref swig_ChangeOrientation "Example"
1650 def ChangeOrientation(self,theShape):
1651 # Example: see GEOM_TestAll.py
1652 anObj = self.ShapesOp.ChangeOrientation(theShape)
1653 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
1656 ## Shortcut to ChangeOrientation()
1658 # @ref swig_OrientationChange "Example"
1659 def OrientationChange(self,theShape):
1660 # Example: see GEOM_TestOthers.py
1661 anObj = self.ChangeOrientation(theShape)
1667 ## @addtogroup l4_obtain
1670 ## Retrieve all free faces from the given shape.
1671 # Free face is a face, which is not shared between two shells of the shape.
1672 # @param theShape Shape to find free faces in.
1673 # @return List of IDs of all free faces, contained in theShape.
1675 # @ref tui_measurement_tools_page "Example"
1676 def GetFreeFacesIDs(self,theShape):
1677 # Example: see GEOM_TestOthers.py
1678 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
1679 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
1682 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
1683 # @param theShape1 Shape to find sub-shapes in.
1684 # @param theShape2 Shape to find shared sub-shapes with.
1685 # @param theShapeType Type of sub-shapes to be retrieved.
1686 # @return List of sub-shapes of theShape1, shared with theShape2.
1688 # @ref swig_GetSharedShapes "Example"
1689 def GetSharedShapes(self,theShape1, theShape2, theShapeType):
1690 # Example: see GEOM_TestOthers.py
1691 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
1692 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
1695 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
1696 # situated relatively the specified plane by the certain way,
1697 # defined through <VAR>theState</VAR> parameter.
1698 # @param theShape Shape to find sub-shapes of.
1699 # @param theShapeType Type of sub-shapes to be retrieved.
1700 # @param theAx1 Vector (or line, or linear edge), specifying normal
1701 # direction and location of the plane to find shapes on.
1702 # @param theState The state of the subshapes to find. It can be one of
1703 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1704 # @return List of all found sub-shapes.
1706 # @ref swig_GetShapesOnPlane "Example"
1707 def GetShapesOnPlane(self,theShape, theShapeType, theAx1, theState):
1708 # Example: see GEOM_TestOthers.py
1709 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
1710 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
1713 ## Works like the above method, but returns list of sub-shapes indices
1715 # @ref swig_GetShapesOnPlaneIDs "Example"
1716 def GetShapesOnPlaneIDs(self,theShape, theShapeType, theAx1, theState):
1717 # Example: see GEOM_TestOthers.py
1718 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
1719 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
1722 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
1723 # situated relatively the specified plane by the certain way,
1724 # defined through <VAR>theState</VAR> parameter.
1725 # @param theShape Shape to find sub-shapes of.
1726 # @param theShapeType Type of sub-shapes to be retrieved.
1727 # @param theAx1 Vector (or line, or linear edge), specifying normal
1728 # direction of the plane to find shapes on.
1729 # @param thePnt Point specifying location of the plane to find shapes on.
1730 # @param theState The state of the subshapes to find. It can be one of
1731 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1732 # @return List of all found sub-shapes.
1734 # @ref swig_GetShapesOnPlaneWithLocation "Example"
1735 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState):
1736 # Example: see GEOM_TestOthers.py
1737 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
1738 theAx1, thePnt, theState)
1739 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
1742 ## Works like the above method, but returns list of sub-shapes indices
1744 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
1745 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
1746 # Example: see GEOM_TestOthers.py
1747 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
1748 theAx1, thePnt, theState)
1749 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
1752 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1753 # the specified cylinder by the certain way, defined through \a theState parameter.
1754 # @param theShape Shape to find sub-shapes of.
1755 # @param theShapeType Type of sub-shapes to be retrieved.
1756 # @param theAxis Vector (or line, or linear edge), specifying
1757 # axis of the cylinder to find shapes on.
1758 # @param theRadius Radius of the cylinder to find shapes on.
1759 # @param theState The state of the subshapes to find. It can be one of
1760 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1761 # @return List of all found sub-shapes.
1763 # @ref swig_GetShapesOnCylinder "Example"
1764 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState):
1765 # Example: see GEOM_TestOthers.py
1766 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
1767 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
1770 ## Works like the above method, but returns list of sub-shapes indices
1772 # @ref swig_GetShapesOnCylinderIDs "Example"
1773 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
1774 # Example: see GEOM_TestOthers.py
1775 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
1776 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
1779 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1780 # the specified cylinder by the certain way, defined through \a theState parameter.
1781 # @param theShape Shape to find sub-shapes of.
1782 # @param theShapeType Type of sub-shapes to be retrieved.
1783 # @param theAxis Vector (or line, or linear edge), specifying
1784 # axis of the cylinder to find shapes on.
1785 # @param thePnt Point specifying location of the bottom of the cylinder.
1786 # @param theRadius Radius of the cylinder to find shapes on.
1787 # @param theState The state of the subshapes to find. It can be one of
1788 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1789 # @return List of all found sub-shapes.
1791 # @ref swig_GetShapesOnCylinderWithLocation "Example"
1792 def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
1793 # Example: see GEOM_TestOthers.py
1794 aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
1795 RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
1798 ## Works like the above method, but returns list of sub-shapes indices
1800 # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
1801 def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
1802 # Example: see GEOM_TestOthers.py
1803 aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
1804 RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
1807 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1808 # the specified sphere by the certain way, defined through \a theState parameter.
1809 # @param theShape Shape to find sub-shapes of.
1810 # @param theShapeType Type of sub-shapes to be retrieved.
1811 # @param theCenter Point, specifying center of the sphere to find shapes on.
1812 # @param theRadius Radius of the sphere to find shapes on.
1813 # @param theState The state of the subshapes to find. It can be one of
1814 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1815 # @return List of all found sub-shapes.
1817 # @ref swig_GetShapesOnSphere "Example"
1818 def GetShapesOnSphere(self,theShape, theShapeType, theCenter, theRadius, theState):
1819 # Example: see GEOM_TestOthers.py
1820 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
1821 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
1824 ## Works like the above method, but returns list of sub-shapes indices
1826 # @ref swig_GetShapesOnSphereIDs "Example"
1827 def GetShapesOnSphereIDs(self,theShape, theShapeType, theCenter, theRadius, theState):
1828 # Example: see GEOM_TestOthers.py
1829 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
1830 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
1833 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1834 # the specified quadrangle by the certain way, defined through \a theState parameter.
1835 # @param theShape Shape to find sub-shapes of.
1836 # @param theShapeType Type of sub-shapes to be retrieved.
1837 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
1838 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
1839 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
1840 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
1841 # @param theState The state of the subshapes to find. It can be one of
1842 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1843 # @return List of all found sub-shapes.
1845 # @ref swig_GetShapesOnQuadrangle "Example"
1846 def GetShapesOnQuadrangle(self, theShape, theShapeType,
1847 theTopLeftPoint, theTopRigthPoint,
1848 theBottomLeftPoint, theBottomRigthPoint, theState):
1849 # Example: see GEOM_TestOthers.py
1850 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
1851 theTopLeftPoint, theTopRigthPoint,
1852 theBottomLeftPoint, theBottomRigthPoint, theState)
1853 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
1856 ## Works like the above method, but returns list of sub-shapes indices
1858 # @ref swig_GetShapesOnQuadrangleIDs "Example"
1859 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
1860 theTopLeftPoint, theTopRigthPoint,
1861 theBottomLeftPoint, theBottomRigthPoint, theState):
1862 # Example: see GEOM_TestOthers.py
1863 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
1864 theTopLeftPoint, theTopRigthPoint,
1865 theBottomLeftPoint, theBottomRigthPoint, theState)
1866 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
1869 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1870 # the specified \a theBox by the certain way, defined through \a theState parameter.
1871 # @param theBox Shape for relative comparing.
1872 # @param theShape Shape to find sub-shapes of.
1873 # @param theShapeType Type of sub-shapes to be retrieved.
1874 # @param theState The state of the subshapes to find. It can be one of
1875 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1876 # @return List of all found sub-shapes.
1878 # @ref swig_GetShapesOnBox "Example"
1879 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState):
1880 # Example: see GEOM_TestOthers.py
1881 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
1882 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
1885 ## Works like the above method, but returns list of sub-shapes indices
1887 # @ref swig_GetShapesOnBoxIDs "Example"
1888 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
1889 # Example: see GEOM_TestOthers.py
1890 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
1891 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
1894 ## Find in \a theShape all sub-shapes of type \a theShapeType,
1895 # situated relatively the specified \a theCheckShape by the
1896 # certain way, defined through \a theState parameter.
1897 # @param theCheckShape Shape for relative comparing. It must be a solid.
1898 # @param theShape Shape to find sub-shapes of.
1899 # @param theShapeType Type of sub-shapes to be retrieved.
1900 # @param theState The state of the subshapes to find. It can be one of
1901 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1902 # @return List of all found sub-shapes.
1904 # @ref swig_GetShapesOnShape "Example"
1905 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState):
1906 # Example: see GEOM_TestOthers.py
1907 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
1908 theShapeType, theState)
1909 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
1912 ## Works like the above method, but returns result as compound
1914 # @ref swig_GetShapesOnShapeAsCompound "Example"
1915 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState):
1916 # Example: see GEOM_TestOthers.py
1917 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
1918 theShapeType, theState)
1919 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
1922 ## Works like the above method, but returns list of sub-shapes indices
1924 # @ref swig_GetShapesOnShapeIDs "Example"
1925 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
1926 # Example: see GEOM_TestOthers.py
1927 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
1928 theShapeType, theState)
1929 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
1932 ## Get sub-shape(s) of theShapeWhere, which are
1933 # coincident with \a theShapeWhat or could be a part of it.
1934 # @param theShapeWhere Shape to find sub-shapes of.
1935 # @param theShapeWhat Shape, specifying what to find.
1936 # @return Group of all found sub-shapes or a single found sub-shape.
1938 # @ref swig_GetInPlace "Example"
1939 def GetInPlace(self,theShapeWhere, theShapeWhat):
1940 # Example: see GEOM_TestOthers.py
1941 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
1942 RaiseIfFailed("GetInPlace", self.ShapesOp)
1945 ## Get sub-shape(s) of \a theShapeWhere, which are
1946 # coincident with \a theShapeWhat or could be a part of it.
1948 # Implementation of this method is based on a saved history of an operation,
1949 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
1950 # arguments (an argument shape or a sub-shape of an argument shape).
1951 # The operation could be the Partition or one of boolean operations,
1952 # performed on simple shapes (not on compounds).
1954 # @param theShapeWhere Shape to find sub-shapes of.
1955 # @param theShapeWhat Shape, specifying what to find (must be in the
1956 # building history of the ShapeWhere).
1957 # @return Group of all found sub-shapes or a single found sub-shape.
1959 # @ref swig_GetInPlace "Example"
1960 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat):
1961 # Example: see GEOM_TestOthers.py
1962 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
1963 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
1966 ## Get sub-shape of theShapeWhere, which is
1967 # equal to \a theShapeWhat.
1968 # @param theShapeWhere Shape to find sub-shape of.
1969 # @param theShapeWhat Shape, specifying what to find.
1970 # @return New GEOM_Object for found sub-shape.
1972 # @ref swig_GetSame "Example"
1973 def GetSame(self,theShapeWhere, theShapeWhat):
1974 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
1975 RaiseIfFailed("GetSame", self.ShapesOp)
1981 ## @addtogroup l4_access
1984 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
1985 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
1987 # @ref swig_all_decompose "Example"
1988 def GetSubShape(self, aShape, ListOfID):
1989 # Example: see GEOM_TestAll.py
1990 anObj = self.AddSubShape(aShape,ListOfID)
1993 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
1995 # @ref swig_all_decompose "Example"
1996 def GetSubShapeID(self, aShape, aSubShape):
1997 # Example: see GEOM_TestAll.py
1998 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
1999 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
2005 ## @addtogroup l4_decompose
2008 ## Explode a shape on subshapes of a given type.
2009 # @param aShape Shape to be exploded.
2010 # @param aType Type of sub-shapes to be retrieved.
2011 # @return List of sub-shapes of type theShapeType, contained in theShape.
2013 # @ref swig_all_decompose "Example"
2014 def SubShapeAll(self, aShape, aType):
2015 # Example: see GEOM_TestAll.py
2016 ListObj = self.ShapesOp.MakeExplode(aShape,aType,0)
2017 RaiseIfFailed("MakeExplode", self.ShapesOp)
2020 ## Explode a shape on subshapes of a given type.
2021 # @param aShape Shape to be exploded.
2022 # @param aType Type of sub-shapes to be retrieved.
2023 # @return List of IDs of sub-shapes.
2025 # @ref swig_all_decompose "Example"
2026 def SubShapeAllIDs(self, aShape, aType):
2027 ListObj = self.ShapesOp.SubShapeAllIDs(aShape,aType,0)
2028 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
2031 ## Explode a shape on subshapes of a given type.
2032 # Sub-shapes will be sorted by coordinates of their gravity centers.
2033 # @param aShape Shape to be exploded.
2034 # @param aType Type of sub-shapes to be retrieved.
2035 # @return List of sub-shapes of type theShapeType, contained in theShape.
2037 # @ref swig_SubShapeAllSorted "Example"
2038 def SubShapeAllSorted(self, aShape, aType):
2039 # Example: see GEOM_TestAll.py
2040 ListObj = self.ShapesOp.MakeExplode(aShape,aType,1)
2041 RaiseIfFailed("MakeExplode", self.ShapesOp)
2044 ## Explode a shape on subshapes of a given type.
2045 # Sub-shapes will be sorted by coordinates of their gravity centers.
2046 # @param aShape Shape to be exploded.
2047 # @param aType Type of sub-shapes to be retrieved.
2048 # @return List of IDs of sub-shapes.
2050 # @ref swig_all_decompose "Example"
2051 def SubShapeAllSortedIDs(self, aShape, aType):
2052 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape,aType,1)
2053 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
2056 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
2057 # selected by they indices in list of all sub-shapes of type <VAR>aType</VAR>.
2058 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
2060 # @ref swig_all_decompose "Example"
2061 def SubShape(self, aShape, aType, ListOfInd):
2062 # Example: see GEOM_TestAll.py
2064 AllShapeList = self.SubShapeAll(aShape, aType)
2065 for ind in ListOfInd:
2066 ListOfIDs.append(self.GetSubShapeID(aShape, AllShapeList[ind - 1]))
2067 anObj = self.GetSubShape(aShape, ListOfIDs)
2070 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
2071 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
2072 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
2074 # @ref swig_all_decompose "Example"
2075 def SubShapeSorted(self,aShape, aType, ListOfInd):
2076 # Example: see GEOM_TestAll.py
2078 AllShapeList = self.SubShapeAllSorted(aShape, aType)
2079 for ind in ListOfInd:
2080 ListOfIDs.append(self.GetSubShapeID(aShape, AllShapeList[ind - 1]))
2081 anObj = self.GetSubShape(aShape, ListOfIDs)
2084 # end of l4_decompose
2087 ## @addtogroup l3_healing
2090 ## Apply a sequence of Shape Healing operators to the given object.
2091 # @param theShape Shape to be processed.
2092 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
2093 # @param theParameters List of names of parameters
2094 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
2095 # @param theValues List of values of parameters, in the same order
2096 # as parameters are listed in <VAR>theParameters</VAR> list.
2097 # @return New GEOM_Object, containing processed shape.
2099 # @ref tui_shape_processing "Example"
2100 def ProcessShape(self,theShape, theOperators, theParameters, theValues):
2101 # Example: see GEOM_TestHealing.py
2102 theValues,Parameters = ParseList(theValues)
2103 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
2104 RaiseIfFailed("ProcessShape", self.HealOp)
2105 for string in (theOperators + theParameters):
2106 Parameters = ":" + Parameters
2108 anObj.SetParameters(Parameters)
2111 ## Remove faces from the given object (shape).
2112 # @param theObject Shape to be processed.
2113 # @param theFaces Indices of faces to be removed, if EMPTY then the method
2114 # removes ALL faces of the given object.
2115 # @return New GEOM_Object, containing processed shape.
2117 # @ref tui_suppress_faces "Example"
2118 def SuppressFaces(self,theObject, theFaces):
2119 # Example: see GEOM_TestHealing.py
2120 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
2121 RaiseIfFailed("SuppressFaces", self.HealOp)
2124 ## Sewing of some shapes into single shape.
2126 # @ref tui_sewing "Example"
2127 def MakeSewing(self, ListShape, theTolerance):
2128 # Example: see GEOM_TestHealing.py
2129 comp = self.MakeCompound(ListShape)
2130 anObj = self.Sew(comp, theTolerance)
2133 ## Sewing of the given object.
2134 # @param theObject Shape to be processed.
2135 # @param theTolerance Required tolerance value.
2136 # @return New GEOM_Object, containing processed shape.
2137 def Sew(self, theObject, theTolerance):
2138 # Example: see MakeSewing() above
2139 theTolerance,Parameters = ParseParameters(theTolerance)
2140 anObj = self.HealOp.Sew(theObject, theTolerance)
2141 RaiseIfFailed("Sew", self.HealOp)
2142 anObj.SetParameters(Parameters)
2145 ## Remove internal wires and edges from the given object (face).
2146 # @param theObject Shape to be processed.
2147 # @param theWires Indices of wires to be removed, if EMPTY then the method
2148 # removes ALL internal wires of the given object.
2149 # @return New GEOM_Object, containing processed shape.
2151 # @ref tui_suppress_internal_wires "Example"
2152 def SuppressInternalWires(self,theObject, theWires):
2153 # Example: see GEOM_TestHealing.py
2154 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
2155 RaiseIfFailed("RemoveIntWires", self.HealOp)
2158 ## Remove internal closed contours (holes) from the given object.
2159 # @param theObject Shape to be processed.
2160 # @param theWires Indices of wires to be removed, if EMPTY then the method
2161 # removes ALL internal holes of the given object
2162 # @return New GEOM_Object, containing processed shape.
2164 # @ref tui_suppress_holes "Example"
2165 def SuppressHoles(self,theObject, theWires):
2166 # Example: see GEOM_TestHealing.py
2167 anObj = self.HealOp.FillHoles(theObject, theWires)
2168 RaiseIfFailed("FillHoles", self.HealOp)
2171 ## Close an open wire.
2172 # @param theObject Shape to be processed.
2173 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
2174 # if -1, then <VAR>theObject</VAR> itself is a wire.
2175 # @param isCommonVertex If TRUE : closure by creation of a common vertex,
2176 # If FALS : closure by creation of an edge between ends.
2177 # @return New GEOM_Object, containing processed shape.
2179 # @ref tui_close_contour "Example"
2180 def CloseContour(self,theObject, theWires, isCommonVertex):
2181 # Example: see GEOM_TestHealing.py
2182 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
2183 RaiseIfFailed("CloseContour", self.HealOp)
2186 ## Addition of a point to a given edge object.
2187 # @param theObject Shape to be processed.
2188 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
2189 # if -1, then theObject itself is the edge.
2190 # @param theValue Value of parameter on edge or length parameter,
2191 # depending on \a isByParameter.
2192 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1],
2193 # if FALSE : \a theValue is treated as a length parameter [0..1]
2194 # @return New GEOM_Object, containing processed shape.
2196 # @ref tui_add_point_on_edge "Example"
2197 def DivideEdge(self,theObject, theEdgeIndex, theValue, isByParameter):
2198 # Example: see GEOM_TestHealing.py
2199 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
2200 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
2201 RaiseIfFailed("DivideEdge", self.HealOp)
2202 anObj.SetParameters(Parameters)
2205 ## Change orientation of the given object. Updates given shape.
2206 # @param theObject Shape to be processed.
2208 # @ref swig_todo "Example"
2209 def ChangeOrientationShell(self,theObject):
2210 theObject = self.HealOp.ChangeOrientation(theObject)
2211 RaiseIfFailed("ChangeOrientation", self.HealOp)
2214 ## Change orientation of the given object.
2215 # @param theObject Shape to be processed.
2216 # @return New GEOM_Object, containing processed shape.
2218 # @ref swig_todo "Example"
2219 def ChangeOrientationShellCopy(self,theObject):
2220 anObj = self.HealOp.ChangeOrientationCopy(theObject)
2221 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
2224 ## Get a list of wires (wrapped in GEOM_Object-s),
2225 # that constitute a free boundary of the given shape.
2226 # @param theObject Shape to get free boundary of.
2227 # @return [status, theClosedWires, theOpenWires]
2228 # status: FALSE, if an error(s) occured during the method execution.
2229 # theClosedWires: Closed wires on the free boundary of the given shape.
2230 # theOpenWires: Open wires on the free boundary of the given shape.
2232 # @ref tui_measurement_tools_page "Example"
2233 def GetFreeBoundary(self,theObject):
2234 # Example: see GEOM_TestHealing.py
2235 anObj = self.HealOp.GetFreeBoundary(theObject)
2236 RaiseIfFailed("GetFreeBoundary", self.HealOp)
2239 ## Replace coincident faces in theShape by one face.
2240 # @param theShape Initial shape.
2241 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
2242 # @param doKeepNonSolids If FALSE, only solids will present in the result,
2243 # otherwise all initial shapes.
2244 # @return New GEOM_Object, containing a copy of theShape without coincident faces.
2246 # @ref tui_glue_faces "Example"
2247 def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True):
2248 # Example: see GEOM_Spanner.py
2249 theTolerance,Parameters = ParseParameters(theTolerance)
2250 anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
2252 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
2253 anObj.SetParameters(Parameters)
2256 ## Find coincident faces in theShape for possible gluing.
2257 # @param theShape Initial shape.
2258 # @param theTolerance Maximum distance between faces,
2259 # which can be considered as coincident.
2262 # @ref swig_todo "Example"
2263 def GetGlueFaces(self, theShape, theTolerance):
2264 # Example: see GEOM_Spanner.py
2265 anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
2266 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
2269 ## Replace coincident faces in theShape by one face
2270 # in compliance with given list of faces
2271 # @param theShape Initial shape.
2272 # @param theTolerance Maximum distance between faces,
2273 # which can be considered as coincident.
2274 # @param theFaces List of faces for gluing.
2275 # @param doKeepNonSolids If FALSE, only solids will present in the result,
2276 # otherwise all initial shapes.
2277 # @return New GEOM_Object, containing a copy of theShape
2278 # without some faces.
2280 # @ref swig_todo "Example"
2281 def MakeGlueFacesByList(self, theShape, theTolerance, theFaces, doKeepNonSolids=True):
2282 # Example: see GEOM_Spanner.py
2283 anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces, doKeepNonSolids)
2285 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
2291 ## @addtogroup l3_boolean Boolean Operations
2294 # -----------------------------------------------------------------------------
2295 # Boolean (Common, Cut, Fuse, Section)
2296 # -----------------------------------------------------------------------------
2298 ## Perform one of boolean operations on two given shapes.
2299 # @param theShape1 First argument for boolean operation.
2300 # @param theShape2 Second argument for boolean operation.
2301 # @param theOperation Indicates the operation to be done:
2302 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
2303 # @return New GEOM_Object, containing the result shape.
2305 # @ref tui_fuse "Example"
2306 def MakeBoolean(self,theShape1, theShape2, theOperation):
2307 # Example: see GEOM_TestAll.py
2308 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation)
2309 RaiseIfFailed("MakeBoolean", self.BoolOp)
2312 ## Shortcut to MakeBoolean(s1, s2, 1)
2314 # @ref tui_common "Example 1"
2315 # \n @ref swig_MakeCommon "Example 2"
2316 def MakeCommon(self, s1, s2):
2317 # Example: see GEOM_TestOthers.py
2318 return self.MakeBoolean(s1, s2, 1)
2320 ## Shortcut to MakeBoolean(s1, s2, 2)
2322 # @ref tui_cut "Example 1"
2323 # \n @ref swig_MakeCommon "Example 2"
2324 def MakeCut(self, s1, s2):
2325 # Example: see GEOM_TestOthers.py
2326 return self.MakeBoolean(s1, s2, 2)
2328 ## Shortcut to MakeBoolean(s1, s2, 3)
2330 # @ref tui_fuse "Example 1"
2331 # \n @ref swig_MakeCommon "Example 2"
2332 def MakeFuse(self, s1, s2):
2333 # Example: see GEOM_TestOthers.py
2334 return self.MakeBoolean(s1, s2, 3)
2336 ## Shortcut to MakeBoolean(s1, s2, 4)
2338 # @ref tui_section "Example 1"
2339 # \n @ref swig_MakeCommon "Example 2"
2340 def MakeSection(self, s1, s2):
2341 # Example: see GEOM_TestOthers.py
2342 return self.MakeBoolean(s1, s2, 4)
2347 ## @addtogroup l3_basic_op
2350 ## Perform partition operation.
2351 # @param ListShapes Shapes to be intersected.
2352 # @param ListTools Shapes to intersect theShapes.
2353 # !!!NOTE: Each compound from ListShapes and ListTools will be exploded
2354 # in order to avoid possible intersection between shapes from
2356 # @param Limit Type of resulting shapes (corresponding to TopAbs_ShapeEnum).
2357 # @param KeepNonlimitShapes: if this parameter == 0 - only shapes with
2358 # type <= Limit are kept in the result,
2359 # else - shapes with type > Limit are kept
2360 # also (if they exist)
2362 # After implementation new version of PartitionAlgo (October 2006)
2363 # other parameters are ignored by current functionality. They are kept
2364 # in this function only for support old versions.
2365 # Ignored parameters:
2366 # @param ListKeepInside Shapes, outside which the results will be deleted.
2367 # Each shape from theKeepInside must belong to theShapes also.
2368 # @param ListRemoveInside Shapes, inside which the results will be deleted.
2369 # Each shape from theRemoveInside must belong to theShapes also.
2370 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
2371 # @param ListMaterials Material indices for each shape. Make sence,
2372 # only if theRemoveWebs is TRUE.
2374 # @return New GEOM_Object, containing the result shapes.
2376 # @ref tui_partition "Example"
2377 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
2378 Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
2379 KeepNonlimitShapes=0):
2380 # Example: see GEOM_TestAll.py
2381 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
2382 ListKeepInside, ListRemoveInside,
2383 Limit, RemoveWebs, ListMaterials,
2384 KeepNonlimitShapes);
2385 RaiseIfFailed("MakePartition", self.BoolOp)
2388 ## Perform partition operation.
2389 # This method may be useful if it is needed to make a partition for
2390 # compound contains nonintersected shapes. Performance will be better
2391 # since intersection between shapes from compound is not performed.
2393 # Description of all parameters as in previous method MakePartition()
2395 # !!!NOTE: Passed compounds (via ListShapes or via ListTools)
2396 # have to consist of nonintersecting shapes.
2398 # @return New GEOM_Object, containing the result shapes.
2400 # @ref swig_todo "Example"
2401 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
2402 ListKeepInside=[], ListRemoveInside=[],
2403 Limit=ShapeType["SHAPE"], RemoveWebs=0,
2404 ListMaterials=[], KeepNonlimitShapes=0):
2405 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
2406 ListKeepInside, ListRemoveInside,
2407 Limit, RemoveWebs, ListMaterials,
2408 KeepNonlimitShapes);
2409 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
2412 ## Shortcut to MakePartition()
2414 # @ref tui_partition "Example 1"
2415 # \n @ref swig_Partition "Example 2"
2416 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
2417 Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
2418 KeepNonlimitShapes=0):
2419 # Example: see GEOM_TestOthers.py
2420 anObj = self.MakePartition(ListShapes, ListTools,
2421 ListKeepInside, ListRemoveInside,
2422 Limit, RemoveWebs, ListMaterials,
2423 KeepNonlimitShapes);
2426 ## Perform partition of the Shape with the Plane
2427 # @param theShape Shape to be intersected.
2428 # @param thePlane Tool shape, to intersect theShape.
2429 # @return New GEOM_Object, containing the result shape.
2431 # @ref tui_partition "Example"
2432 def MakeHalfPartition(self,theShape, thePlane):
2433 # Example: see GEOM_TestAll.py
2434 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
2435 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
2438 # end of l3_basic_op
2441 ## @addtogroup l3_transform
2444 ## Translate the given object along the vector, specified
2445 # by its end points, creating its copy before the translation.
2446 # @param theObject The object to be translated.
2447 # @param thePoint1 Start point of translation vector.
2448 # @param thePoint2 End point of translation vector.
2449 # @return New GEOM_Object, containing the translated object.
2451 # @ref tui_translation "Example 1"
2452 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
2453 def MakeTranslationTwoPoints(self,theObject, thePoint1, thePoint2):
2454 # Example: see GEOM_TestAll.py
2455 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
2456 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
2459 ## Translate the given object along the vector, specified by its components.
2460 # @param theObject The object to be translated.
2461 # @param theDX,theDY,theDZ Components of translation vector.
2462 # @return Translated GEOM_Object.
2464 # @ref tui_translation "Example"
2465 def TranslateDXDYDZ(self,theObject, theDX, theDY, theDZ):
2466 # Example: see GEOM_TestAll.py
2467 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
2468 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
2469 anObj.SetParameters(Parameters)
2470 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
2473 ## Translate the given object along the vector, specified
2474 # by its components, creating its copy before the translation.
2475 # @param theObject The object to be translated.
2476 # @param theDX,theDY,theDZ Components of translation vector.
2477 # @return New GEOM_Object, containing the translated object.
2479 # @ref tui_translation "Example"
2480 def MakeTranslation(self,theObject, theDX, theDY, theDZ):
2481 # Example: see GEOM_TestAll.py
2482 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
2483 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
2484 anObj.SetParameters(Parameters)
2485 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
2488 ## Translate the given object along the given vector,
2489 # creating its copy before the translation.
2490 # @param theObject The object to be translated.
2491 # @param theVector The translation vector.
2492 # @return New GEOM_Object, containing the translated object.
2494 # @ref tui_translation "Example"
2495 def MakeTranslationVector(self,theObject, theVector):
2496 # Example: see GEOM_TestAll.py
2497 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
2498 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
2501 ## Translate the given object along the given vector on given distance.
2502 # @param theObject The object to be translated.
2503 # @param theVector The translation vector.
2504 # @param theDistance The translation distance.
2505 # @param theCopy Flag used to translate object itself or create a copy.
2506 # @return Translated GEOM_Object.
2508 # @ref tui_translation "Example"
2509 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy):
2510 # Example: see GEOM_TestAll.py
2511 theDistance,Parameters = ParseParameters(theDistance)
2512 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
2513 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
2514 anObj.SetParameters(Parameters)
2517 ## Translate the given object along the given vector on given distance,
2518 # creating its copy before the translation.
2519 # @param theObject The object to be translated.
2520 # @param theVector The translation vector.
2521 # @param theDistance The translation distance.
2522 # @return New GEOM_Object, containing the translated object.
2524 # @ref tui_translation "Example"
2525 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance):
2526 # Example: see GEOM_TestAll.py
2527 theDistance,Parameters = ParseParameters(theDistance)
2528 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
2529 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
2530 anObj.SetParameters(Parameters)
2533 ## Rotate the given object around the given axis on the given angle.
2534 # @param theObject The object to be rotated.
2535 # @param theAxis Rotation axis.
2536 # @param theAngle Rotation angle in radians.
2537 # @return Rotated GEOM_Object.
2539 # @ref tui_rotation "Example"
2540 def Rotate(self,theObject, theAxis, theAngle):
2541 # Example: see GEOM_TestAll.py
2543 if isinstance(theAngle,str):
2545 theAngle, Parameters = ParseParameters(theAngle)
2547 theAngle = theAngle*math.pi/180.0
2548 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
2549 RaiseIfFailed("RotateCopy", self.TrsfOp)
2550 anObj.SetParameters(Parameters)
2553 ## Rotate the given object around the given axis
2554 # on the given angle, creating its copy before the rotatation.
2555 # @param theObject The object to be rotated.
2556 # @param theAxis Rotation axis.
2557 # @param theAngle Rotation angle in radians.
2558 # @return New GEOM_Object, containing the rotated object.
2560 # @ref tui_rotation "Example"
2561 def MakeRotation(self,theObject, theAxis, theAngle):
2562 # Example: see GEOM_TestAll.py
2564 if isinstance(theAngle,str):
2566 theAngle, Parameters = ParseParameters(theAngle)
2568 theAngle = theAngle*math.pi/180.0
2569 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
2570 RaiseIfFailed("RotateCopy", self.TrsfOp)
2571 anObj.SetParameters(Parameters)
2574 ## Rotate given object around vector perpendicular to plane
2575 # containing three points, creating its copy before the rotatation.
2576 # @param theObject The object to be rotated.
2577 # @param theCentPoint central point - the axis is the vector perpendicular to the plane
2578 # containing the three points.
2579 # @param thePoint1,thePoint2 - in a perpendicular plane of the axis.
2580 # @return New GEOM_Object, containing the rotated object.
2582 # @ref tui_rotation "Example"
2583 def MakeRotationThreePoints(self,theObject, theCentPoint, thePoint1, thePoint2):
2584 # Example: see GEOM_TestAll.py
2585 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
2586 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
2589 ## Scale the given object by the factor, creating its copy before the scaling.
2590 # @param theObject The object to be scaled.
2591 # @param thePoint Center point for scaling.
2592 # Passing None for it means scaling relatively the origin of global CS.
2593 # @param theFactor Scaling factor value.
2594 # @return New GEOM_Object, containing the scaled shape.
2596 # @ref tui_scale "Example"
2597 def MakeScaleTransform(self, theObject, thePoint, theFactor):
2598 # Example: see GEOM_TestAll.py
2599 theFactor, Parameters = ParseParameters(theFactor)
2600 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
2601 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
2602 anObj.SetParameters(Parameters)
2605 ## Scale the given object by different factors along coordinate axes,
2606 # creating its copy before the scaling.
2607 # @param theObject The object to be scaled.
2608 # @param thePoint Center point for scaling.
2609 # Passing None for it means scaling relatively the origin of global CS.
2610 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
2611 # @return New GEOM_Object, containing the scaled shape.
2613 # @ref swig_scale "Example"
2614 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ):
2615 # Example: see GEOM_TestAll.py
2616 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
2617 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
2618 theFactorX, theFactorY, theFactorZ)
2619 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
2620 anObj.SetParameters(Parameters)
2623 ## Create an object, symmetrical
2624 # to the given one relatively the given plane.
2625 # @param theObject The object to be mirrored.
2626 # @param thePlane Plane of symmetry.
2627 # @return New GEOM_Object, containing the mirrored shape.
2629 # @ref tui_mirror "Example"
2630 def MakeMirrorByPlane(self,theObject, thePlane):
2631 # Example: see GEOM_TestAll.py
2632 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
2633 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
2636 ## Create an object, symmetrical
2637 # to the given one relatively the given axis.
2638 # @param theObject The object to be mirrored.
2639 # @param theAxis Axis of symmetry.
2640 # @return New GEOM_Object, containing the mirrored shape.
2642 # @ref tui_mirror "Example"
2643 def MakeMirrorByAxis(self,theObject, theAxis):
2644 # Example: see GEOM_TestAll.py
2645 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
2646 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
2649 ## Create an object, symmetrical
2650 # to the given one relatively the given point.
2651 # @param theObject The object to be mirrored.
2652 # @param thePoint Point of symmetry.
2653 # @return New GEOM_Object, containing the mirrored shape.
2655 # @ref tui_mirror "Example"
2656 def MakeMirrorByPoint(self,theObject, thePoint):
2657 # Example: see GEOM_TestAll.py
2658 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
2659 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
2662 ## Modify the Location of the given object by LCS,
2663 # creating its copy before the setting.
2664 # @param theObject The object to be displaced.
2665 # @param theStartLCS Coordinate system to perform displacement from it.
2666 # If \a theStartLCS is NULL, displacement
2667 # will be performed from global CS.
2668 # If \a theObject itself is used as \a theStartLCS,
2669 # its location will be changed to \a theEndLCS.
2670 # @param theEndLCS Coordinate system to perform displacement to it.
2671 # @return New GEOM_Object, containing the displaced shape.
2673 # @ref tui_modify_location "Example"
2674 def MakePosition(self,theObject, theStartLCS, theEndLCS):
2675 # Example: see GEOM_TestAll.py
2676 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
2677 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
2680 ## Modify the Location of the given object by Path,
2681 # @param theObject The object to be displaced.
2682 # @param thePath Wire or Edge along that the object will be translated.
2683 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
2684 # @param theCopy is to create a copy objects if true.
2685 # @param theReverse - 0 for usual direction, 1 to reverse path direction.
2686 # @return New GEOM_Object, containing the displaced shape.
2688 # @ref tui_modify_location "Example"
2689 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
2690 # Example: see GEOM_TestAll.py
2691 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
2692 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
2695 ## Create new object as offset of the given one.
2696 # @param theObject The base object for the offset.
2697 # @param theOffset Offset value.
2698 # @return New GEOM_Object, containing the offset object.
2700 # @ref tui_offset "Example"
2701 def MakeOffset(self,theObject, theOffset):
2702 # Example: see GEOM_TestAll.py
2703 theOffset, Parameters = ParseParameters(theOffset)
2704 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
2705 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
2706 anObj.SetParameters(Parameters)
2709 # -----------------------------------------------------------------------------
2711 # -----------------------------------------------------------------------------
2713 ## Translate the given object along the given vector a given number times
2714 # @param theObject The object to be translated.
2715 # @param theVector Direction of the translation.
2716 # @param theStep Distance to translate on.
2717 # @param theNbTimes Quantity of translations to be done.
2718 # @return New GEOM_Object, containing compound of all
2719 # the shapes, obtained after each translation.
2721 # @ref tui_multi_translation "Example"
2722 def MakeMultiTranslation1D(self,theObject, theVector, theStep, theNbTimes):
2723 # Example: see GEOM_TestAll.py
2724 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
2725 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
2726 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
2727 anObj.SetParameters(Parameters)
2730 ## Conseqently apply two specified translations to theObject specified number of times.
2731 # @param theObject The object to be translated.
2732 # @param theVector1 Direction of the first translation.
2733 # @param theStep1 Step of the first translation.
2734 # @param theNbTimes1 Quantity of translations to be done along theVector1.
2735 # @param theVector2 Direction of the second translation.
2736 # @param theStep2 Step of the second translation.
2737 # @param theNbTimes2 Quantity of translations to be done along theVector2.
2738 # @return New GEOM_Object, containing compound of all
2739 # the shapes, obtained after each translation.
2741 # @ref tui_multi_translation "Example"
2742 def MakeMultiTranslation2D(self,theObject, theVector1, theStep1, theNbTimes1,
2743 theVector2, theStep2, theNbTimes2):
2744 # Example: see GEOM_TestAll.py
2745 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
2746 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
2747 theVector2, theStep2, theNbTimes2)
2748 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
2749 anObj.SetParameters(Parameters)
2752 ## Rotate the given object around the given axis a given number times.
2753 # Rotation angle will be 2*PI/theNbTimes.
2754 # @param theObject The object to be rotated.
2755 # @param theAxis The rotation axis.
2756 # @param theNbTimes Quantity of rotations to be done.
2757 # @return New GEOM_Object, containing compound of all the
2758 # shapes, obtained after each rotation.
2760 # @ref tui_multi_rotation "Example"
2761 def MultiRotate1D(self,theObject, theAxis, theNbTimes):
2762 # Example: see GEOM_TestAll.py
2763 theAxis, theNbTimes, Parameters = ParseParameters(theAxis, theNbTimes)
2764 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
2765 RaiseIfFailed("MultiRotate1D", self.TrsfOp)
2766 anObj.SetParameters(Parameters)
2769 ## Rotate the given object around the
2770 # given axis on the given angle a given number
2771 # times and multi-translate each rotation result.
2772 # Translation direction passes through center of gravity
2773 # of rotated shape and its projection on the rotation axis.
2774 # @param theObject The object to be rotated.
2775 # @param theAxis Rotation axis.
2776 # @param theAngle Rotation angle in graduces.
2777 # @param theNbTimes1 Quantity of rotations to be done.
2778 # @param theStep Translation distance.
2779 # @param theNbTimes2 Quantity of translations to be done.
2780 # @return New GEOM_Object, containing compound of all the
2781 # shapes, obtained after each transformation.
2783 # @ref tui_multi_rotation "Example"
2784 def MultiRotate2D(self,theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2):
2785 # Example: see GEOM_TestAll.py
2786 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
2787 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
2788 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
2789 anObj.SetParameters(Parameters)
2792 ## The same, as MultiRotate1D(), but axis is given by direction and point
2793 # @ref swig_MakeMultiRotation "Example"
2794 def MakeMultiRotation1D(self,aShape,aDir,aPoint,aNbTimes):
2795 # Example: see GEOM_TestOthers.py
2796 aVec = self.MakeLine(aPoint,aDir)
2797 anObj = self.MultiRotate1D(aShape,aVec,aNbTimes)
2800 ## The same, as MultiRotate2D(), but axis is given by direction and point
2801 # @ref swig_MakeMultiRotation "Example"
2802 def MakeMultiRotation2D(self,aShape,aDir,aPoint,anAngle,nbtimes1,aStep,nbtimes2):
2803 # Example: see GEOM_TestOthers.py
2804 aVec = self.MakeLine(aPoint,aDir)
2805 anObj = self.MultiRotate2D(aShape,aVec,anAngle,nbtimes1,aStep,nbtimes2)
2808 # end of l3_transform
2811 ## @addtogroup l3_local
2814 ## Perform a fillet on all edges of the given shape.
2815 # @param theShape Shape, to perform fillet on.
2816 # @param theR Fillet radius.
2817 # @return New GEOM_Object, containing the result shape.
2819 # @ref tui_fillet "Example 1"
2820 # \n @ref swig_MakeFilletAll "Example 2"
2821 def MakeFilletAll(self,theShape, theR):
2822 # Example: see GEOM_TestOthers.py
2823 theR,Parameters = ParseParameters(theR)
2824 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
2825 RaiseIfFailed("MakeFilletAll", self.LocalOp)
2826 anObj.SetParameters(Parameters)
2829 ## Perform a fillet on the specified edges/faces of the given shape
2830 # @param theShape Shape, to perform fillet on.
2831 # @param theR Fillet radius.
2832 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR>.
2833 # @param theListShapes Global indices of edges/faces to perform fillet on.
2834 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2835 # @return New GEOM_Object, containing the result shape.
2837 # @ref tui_fillet "Example"
2838 def MakeFillet(self,theShape, theR, theShapeType, theListShapes):
2839 # Example: see GEOM_TestAll.py
2840 theR,Parameters = ParseParameters(theR)
2842 if theShapeType == ShapeType["EDGE"]:
2843 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
2844 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
2846 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
2847 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
2848 anObj.SetParameters(Parameters)
2851 ## The same that MakeFillet but with two Fillet Radius R1 and R2
2852 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes):
2853 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
2855 if theShapeType == ShapeType["EDGE"]:
2856 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
2857 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
2859 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
2860 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
2861 anObj.SetParameters(Parameters)
2864 ## Perform a fillet on the specified edges of the given shape
2865 # @param theShape - Wire Shape to perform fillet on.
2866 # @param theR - Fillet radius.
2867 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
2868 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2869 # \note The list of vertices could be empty,
2870 # in this case fillet will done done at all vertices in wire
2871 # @return New GEOM_Object, containing the result shape.
2873 # @ref tui_fillet2d "Example"
2874 def MakeFillet1D(self,theShape, theR, theListOfVertexes):
2875 # Example: see GEOM_TestAll.py
2876 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes)
2877 RaiseIfFailed("MakeFillet1D", self.LocalOp)
2880 ## Perform a fillet on the specified edges/faces of the given shape
2881 # @param theShape - Face Shape to perform fillet on.
2882 # @param theR - Fillet radius.
2883 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
2884 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2885 # @return New GEOM_Object, containing the result shape.
2887 # @ref tui_fillet2d "Example"
2888 def MakeFillet2D(self,theShape, theR, theListOfVertexes):
2889 # Example: see GEOM_TestAll.py
2890 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
2891 RaiseIfFailed("MakeFillet2D", self.LocalOp)
2894 ## Perform a symmetric chamfer on all edges of the given shape.
2895 # @param theShape Shape, to perform chamfer on.
2896 # @param theD Chamfer size along each face.
2897 # @return New GEOM_Object, containing the result shape.
2899 # @ref tui_chamfer "Example 1"
2900 # \n @ref swig_MakeChamferAll "Example 2"
2901 def MakeChamferAll(self,theShape, theD):
2902 # Example: see GEOM_TestOthers.py
2903 theD,Parameters = ParseParameters(theD)
2904 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
2905 RaiseIfFailed("MakeChamferAll", self.LocalOp)
2906 anObj.SetParameters(Parameters)
2909 ## Perform a chamfer on edges, common to the specified faces,
2910 # with distance D1 on the Face1
2911 # @param theShape Shape, to perform chamfer on.
2912 # @param theD1 Chamfer size along \a theFace1.
2913 # @param theD2 Chamfer size along \a theFace2.
2914 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
2915 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2916 # @return New GEOM_Object, containing the result shape.
2918 # @ref tui_chamfer "Example"
2919 def MakeChamferEdge(self,theShape, theD1, theD2, theFace1, theFace2):
2920 # Example: see GEOM_TestAll.py
2921 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
2922 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
2923 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
2924 anObj.SetParameters(Parameters)
2927 ## The Same that MakeChamferEdge but with params theD is chamfer length and
2928 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
2929 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2):
2931 if isinstance(theAngle,str):
2933 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
2935 theAngle = theAngle*math.pi/180.0
2936 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
2937 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
2938 anObj.SetParameters(Parameters)
2941 ## Perform a chamfer on all edges of the specified faces,
2942 # with distance D1 on the first specified face (if several for one edge)
2943 # @param theShape Shape, to perform chamfer on.
2944 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
2945 # connected to the edge, are in \a theFaces, \a theD1
2946 # will be get along face, which is nearer to \a theFaces beginning.
2947 # @param theD2 Chamfer size along another of two faces, connected to the edge.
2948 # @param theFaces Sequence of global indices of faces of \a theShape.
2949 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2950 # @return New GEOM_Object, containing the result shape.
2952 # @ref tui_chamfer "Example"
2953 def MakeChamferFaces(self,theShape, theD1, theD2, theFaces):
2954 # Example: see GEOM_TestAll.py
2955 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
2956 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
2957 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
2958 anObj.SetParameters(Parameters)
2961 ## The Same that MakeChamferFaces but with params theD is chamfer lenght and
2962 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
2964 # @ref swig_FilletChamfer "Example"
2965 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces):
2967 if isinstance(theAngle,str):
2969 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
2971 theAngle = theAngle*math.pi/180.0
2972 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
2973 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
2974 anObj.SetParameters(Parameters)
2977 ## Perform a chamfer on edges,
2978 # with distance D1 on the first specified face (if several for one edge)
2979 # @param theShape Shape, to perform chamfer on.
2980 # @param theD1,theD2 Chamfer size
2981 # @param theEdges Sequence of edges of \a theShape.
2982 # @return New GEOM_Object, containing the result shape.
2984 # @ref swig_FilletChamfer "Example"
2985 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges):
2986 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
2987 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
2988 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
2989 anObj.SetParameters(Parameters)
2992 ## The Same that MakeChamferEdges but with params theD is chamfer lenght and
2993 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
2994 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges):
2996 if isinstance(theAngle,str):
2998 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
3000 theAngle = theAngle*math.pi/180.0
3001 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
3002 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
3003 anObj.SetParameters(Parameters)
3006 ## Shortcut to MakeChamferEdge() and MakeChamferFaces()
3008 # @ref swig_MakeChamfer "Example"
3009 def MakeChamfer(self,aShape,d1,d2,aShapeType,ListShape):
3010 # Example: see GEOM_TestOthers.py
3012 if aShapeType == ShapeType["EDGE"]:
3013 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1])
3015 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape)
3021 ## @addtogroup l3_basic_op
3024 ## Perform an Archimde operation on the given shape with given parameters.
3025 # The object presenting the resulting face is returned.
3026 # @param theShape Shape to be put in water.
3027 # @param theWeight Weight og the shape.
3028 # @param theWaterDensity Density of the water.
3029 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
3030 # @return New GEOM_Object, containing a section of \a theShape
3031 # by a plane, corresponding to water level.
3033 # @ref tui_archimede "Example"
3034 def Archimede(self,theShape, theWeight, theWaterDensity, theMeshDeflection):
3035 # Example: see GEOM_TestAll.py
3036 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
3037 theWeight,theWaterDensity,theMeshDeflection)
3038 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
3039 RaiseIfFailed("MakeArchimede", self.LocalOp)
3040 anObj.SetParameters(Parameters)
3043 # end of l3_basic_op
3046 ## @addtogroup l2_measure
3049 ## Get point coordinates
3052 # @ref tui_measurement_tools_page "Example"
3053 def PointCoordinates(self,Point):
3054 # Example: see GEOM_TestMeasures.py
3055 aTuple = self.MeasuOp.PointCoordinates(Point)
3056 RaiseIfFailed("PointCoordinates", self.MeasuOp)
3059 ## Get summarized length of all wires,
3060 # area of surface and volume of the given shape.
3061 # @param theShape Shape to define properties of.
3062 # @return [theLength, theSurfArea, theVolume]
3063 # theLength: Summarized length of all wires of the given shape.
3064 # theSurfArea: Area of surface of the given shape.
3065 # theVolume: Volume of the given shape.
3067 # @ref tui_measurement_tools_page "Example"
3068 def BasicProperties(self,theShape):
3069 # Example: see GEOM_TestMeasures.py
3070 aTuple = self.MeasuOp.GetBasicProperties(theShape)
3071 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
3074 ## Get parameters of bounding box of the given shape
3075 # @param theShape Shape to obtain bounding box of.
3076 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
3077 # Xmin,Xmax: Limits of shape along OX axis.
3078 # Ymin,Ymax: Limits of shape along OY axis.
3079 # Zmin,Zmax: Limits of shape along OZ axis.
3081 # @ref tui_measurement_tools_page "Example"
3082 def BoundingBox(self,theShape):
3083 # Example: see GEOM_TestMeasures.py
3084 aTuple = self.MeasuOp.GetBoundingBox(theShape)
3085 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
3088 ## Get inertia matrix and moments of inertia of theShape.
3089 # @param theShape Shape to calculate inertia of.
3090 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
3091 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
3092 # Ix,Iy,Iz: Moments of inertia of the given shape.
3094 # @ref tui_measurement_tools_page "Example"
3095 def Inertia(self,theShape):
3096 # Example: see GEOM_TestMeasures.py
3097 aTuple = self.MeasuOp.GetInertia(theShape)
3098 RaiseIfFailed("GetInertia", self.MeasuOp)
3101 ## Get minimal distance between the given shapes.
3102 # @param theShape1,theShape2 Shapes to find minimal distance between.
3103 # @return Value of the minimal distance between the given shapes.
3105 # @ref tui_measurement_tools_page "Example"
3106 def MinDistance(self, theShape1, theShape2):
3107 # Example: see GEOM_TestMeasures.py
3108 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
3109 RaiseIfFailed("GetMinDistance", self.MeasuOp)
3112 ## Get minimal distance between the given shapes.
3113 # @param theShape1,theShape2 Shapes to find minimal distance between.
3114 # @return Value of the minimal distance between the given shapes.
3116 # @ref swig_all_measure "Example"
3117 def MinDistanceComponents(self, theShape1, theShape2):
3118 # Example: see GEOM_TestMeasures.py
3119 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
3120 RaiseIfFailed("GetMinDistance", self.MeasuOp)
3121 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
3124 ## Get angle between the given shapes in degrees.
3125 # @param theShape1,theShape2 Lines or linear edges to find angle between.
3126 # @return Value of the angle between the given shapes in degrees.
3128 # @ref tui_measurement_tools_page "Example"
3129 def GetAngle(self, theShape1, theShape2):
3130 # Example: see GEOM_TestMeasures.py
3131 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
3132 RaiseIfFailed("GetAngle", self.MeasuOp)
3134 ## Get angle between the given shapes in radians.
3135 # @param theShape1,theShape2 Lines or linear edges to find angle between.
3136 # @return Value of the angle between the given shapes in radians.
3138 # @ref tui_measurement_tools_page "Example"
3139 def GetAngleRadians(self, theShape1, theShape2):
3140 # Example: see GEOM_TestMeasures.py
3141 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
3142 RaiseIfFailed("GetAngle", self.MeasuOp)
3145 ## @name Curve Curvature Measurement
3146 # Methods for receiving radius of curvature of curves
3147 # in the given point
3150 ## Measure curvature of a curve at a point, set by parameter.
3151 # @ref swig_todo "Example"
3152 def CurveCurvatureByParam(self, theCurve, theParam):
3153 # Example: see GEOM_TestMeasures.py
3154 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
3155 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
3159 # @ref swig_todo "Example"
3160 def CurveCurvatureByPoint(self, theCurve, thePoint):
3161 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
3162 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
3166 ## @name Surface Curvature Measurement
3167 # Methods for receiving max and min radius of curvature of surfaces
3168 # in the given point
3172 ## @ref swig_todo "Example"
3173 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
3174 # Example: see GEOM_TestMeasures.py
3175 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
3176 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
3180 ## @ref swig_todo "Example"
3181 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
3182 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
3183 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
3187 ## @ref swig_todo "Example"
3188 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
3189 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
3190 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
3194 ## @ref swig_todo "Example"
3195 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
3196 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
3197 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
3201 ## Get min and max tolerances of sub-shapes of theShape
3202 # @param theShape Shape, to get tolerances of.
3203 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
3204 # FaceMin,FaceMax: Min and max tolerances of the faces.
3205 # EdgeMin,EdgeMax: Min and max tolerances of the edges.
3206 # VertMin,VertMax: Min and max tolerances of the vertices.
3208 # @ref tui_measurement_tools_page "Example"
3209 def Tolerance(self,theShape):
3210 # Example: see GEOM_TestMeasures.py
3211 aTuple = self.MeasuOp.GetTolerance(theShape)
3212 RaiseIfFailed("GetTolerance", self.MeasuOp)
3215 ## Obtain description of the given shape (number of sub-shapes of each type)
3216 # @param theShape Shape to be described.
3217 # @return Description of the given shape.
3219 # @ref tui_measurement_tools_page "Example"
3220 def WhatIs(self,theShape):
3221 # Example: see GEOM_TestMeasures.py
3222 aDescr = self.MeasuOp.WhatIs(theShape)
3223 RaiseIfFailed("WhatIs", self.MeasuOp)
3226 ## Get a point, situated at the centre of mass of theShape.
3227 # @param theShape Shape to define centre of mass of.
3228 # @return New GEOM_Object, containing the created point.
3230 # @ref tui_measurement_tools_page "Example"
3231 def MakeCDG(self,theShape):
3232 # Example: see GEOM_TestMeasures.py
3233 anObj = self.MeasuOp.GetCentreOfMass(theShape)
3234 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
3237 ## Get a vertex subshape by index depended with orientation.
3238 # @param theShape Shape to find subshape.
3239 # @param theIndex Index to find vertex by this index.
3240 # @return New GEOM_Object, containing the created vertex.
3242 # @ref tui_measurement_tools_page "Example"
3243 def GetVertexByIndex(self,theShape, theIndex):
3244 # Example: see GEOM_TestMeasures.py
3245 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
3246 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
3249 ## Get the first vertex of wire/edge depended orientation.
3250 # @param theShape Shape to find first vertex.
3251 # @return New GEOM_Object, containing the created vertex.
3253 # @ref tui_measurement_tools_page "Example"
3254 def GetFirstVertex(self,theShape):
3255 # Example: see GEOM_TestMeasures.py
3256 anObj = self.GetVertexByIndex(theShape, 0)
3257 RaiseIfFailed("GetFirstVertex", self.MeasuOp)
3260 ## Get the last vertex of wire/edge depended orientation.
3261 # @param theShape Shape to find last vertex.
3262 # @return New GEOM_Object, containing the created vertex.
3264 # @ref tui_measurement_tools_page "Example"
3265 def GetLastVertex(self,theShape):
3266 # Example: see GEOM_TestMeasures.py
3267 nb_vert = self.ShapesOp.NumberOfSubShapes(theShape, ShapeType["VERTEX"])
3268 anObj = self.GetVertexByIndex(theShape, (nb_vert-1))
3269 RaiseIfFailed("GetLastVertex", self.MeasuOp)
3272 ## Get a normale to the given face. If the point is not given,
3273 # the normale is calculated at the center of mass.
3274 # @param theFace Face to define normale of.
3275 # @param theOptionalPoint Point to compute the normale at.
3276 # @return New GEOM_Object, containing the created vector.
3278 # @ref swig_todo "Example"
3279 def GetNormal(self, theFace, theOptionalPoint = None):
3280 # Example: see GEOM_TestMeasures.py
3281 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
3282 RaiseIfFailed("GetNormal", self.MeasuOp)
3285 ## Check a topology of the given shape.
3286 # @param theShape Shape to check validity of.
3287 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked,
3288 # if TRUE, the shape's geometry will be checked also.
3289 # @return TRUE, if the shape "seems to be valid".
3290 # If theShape is invalid, prints a description of problem.
3292 # @ref tui_measurement_tools_page "Example"
3293 def CheckShape(self,theShape, theIsCheckGeom = 0):
3294 # Example: see GEOM_TestMeasures.py
3296 (IsValid, Status) = self.MeasuOp.CheckShapeWithGeometry(theShape)
3297 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
3299 (IsValid, Status) = self.MeasuOp.CheckShape(theShape)
3300 RaiseIfFailed("CheckShape", self.MeasuOp)
3305 ## Get position (LCS) of theShape.
3307 # Origin of the LCS is situated at the shape's center of mass.
3308 # Axes of the LCS are obtained from shape's location or,
3309 # if the shape is a planar face, from position of its plane.
3311 # @param theShape Shape to calculate position of.
3312 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
3313 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
3314 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
3315 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
3317 # @ref swig_todo "Example"
3318 def GetPosition(self,theShape):
3319 # Example: see GEOM_TestMeasures.py
3320 aTuple = self.MeasuOp.GetPosition(theShape)
3321 RaiseIfFailed("GetPosition", self.MeasuOp)
3324 ## Get kind of theShape.
3326 # @param theShape Shape to get a kind of.
3327 # @return Returns a kind of shape in terms of <VAR>GEOM_IKindOfShape.shape_kind</VAR> enumeration
3328 # and a list of parameters, describing the shape.
3329 # @note Concrete meaning of each value, returned via \a theIntegers
3330 # or \a theDoubles list depends on the kind of the shape.
3331 # The full list of possible outputs is:
3333 # - geompy.kind.COMPOUND nb_solids nb_faces nb_edges nb_vertices
3334 # - geompy.kind.COMPSOLID nb_solids nb_faces nb_edges nb_vertices
3336 # - geompy.kind.SHELL geompy.info.CLOSED nb_faces nb_edges nb_vertices
3337 # - geompy.kind.SHELL geompy.info.UNCLOSED nb_faces nb_edges nb_vertices
3339 # - geompy.kind.WIRE geompy.info.CLOSED nb_edges nb_vertices
3340 # - geompy.kind.WIRE geompy.info.UNCLOSED nb_edges nb_vertices
3342 # - geompy.kind.SPHERE xc yc zc R
3343 # - geompy.kind.CYLINDER xb yb zb dx dy dz R H
3344 # - geompy.kind.BOX xc yc zc ax ay az
3345 # - geompy.kind.ROTATED_BOX xc yc zc zx zy zz xx xy xz ax ay az
3346 # - geompy.kind.TORUS xc yc zc dx dy dz R_1 R_2
3347 # - geompy.kind.CONE xb yb zb dx dy dz R_1 R_2 H
3348 # - geompy.kind.POLYHEDRON nb_faces nb_edges nb_vertices
3349 # - geompy.kind.SOLID nb_faces nb_edges nb_vertices
3351 # - geompy.kind.SPHERE2D xc yc zc R
3352 # - geompy.kind.CYLINDER2D xb yb zb dx dy dz R H
3353 # - geompy.kind.TORUS2D xc yc zc dx dy dz R_1 R_2
3354 # - geompy.kind.CONE2D xc yc zc dx dy dz R_1 R_2 H
3355 # - geompy.kind.DISK_CIRCLE xc yc zc dx dy dz R
3356 # - geompy.kind.DISK_ELLIPSE xc yc zc dx dy dz R_1 R_2
3357 # - geompy.kind.POLYGON xo yo zo dx dy dz nb_edges nb_vertices
3358 # - geompy.kind.PLANE xo yo zo dx dy dz
3359 # - geompy.kind.PLANAR xo yo zo dx dy dz nb_edges nb_vertices
3360 # - geompy.kind.FACE nb_edges nb_vertices
3362 # - geompy.kind.CIRCLE xc yc zc dx dy dz R
3363 # - geompy.kind.ARC_CIRCLE xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2
3364 # - geompy.kind.ELLIPSE xc yc zc dx dy dz R_1 R_2
3365 # - geompy.kind.ARC_ELLIPSE xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2
3366 # - geompy.kind.LINE xo yo zo dx dy dz
3367 # - geompy.kind.SEGMENT x1 y1 z1 x2 y2 z2
3368 # - geompy.kind.EDGE nb_vertices
3370 # - geompy.kind.VERTEX x y z
3372 # @ref swig_todo "Example"
3373 def KindOfShape(self,theShape):
3374 # Example: see GEOM_TestMeasures.py
3375 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
3376 RaiseIfFailed("KindOfShape", self.MeasuOp)
3378 aKind = aRoughTuple[0]
3379 anInts = aRoughTuple[1]
3380 aDbls = aRoughTuple[2]
3382 # Now there is no exception from this rule:
3383 aKindTuple = [aKind] + aDbls + anInts
3385 # If they are we will regroup parameters for such kind of shape.
3387 #if aKind == kind.SOME_KIND:
3388 # # SOME_KIND int int double int double double
3389 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
3396 ## @addtogroup l2_import_export
3399 ## Import a shape from the BREP or IGES or STEP file
3400 # (depends on given format) with given name.
3401 # @param theFileName The file, containing the shape.
3402 # @param theFormatName Specify format for the file reading.
3403 # Available formats can be obtained with InsertOp.ImportTranslators() method.
3404 # If format 'IGES_SCALE' is used instead 'IGES' length unit will be
3405 # set to 'meter' and result model will be scaled.
3406 # @return New GEOM_Object, containing the imported shape.
3408 # @ref swig_Import_Export "Example"
3409 def Import(self,theFileName, theFormatName):
3410 # Example: see GEOM_TestOthers.py
3411 anObj = self.InsertOp.Import(theFileName, theFormatName)
3412 RaiseIfFailed("Import", self.InsertOp)
3415 ## Shortcut to Import() for BREP format
3417 # @ref swig_Import_Export "Example"
3418 def ImportBREP(self,theFileName):
3419 # Example: see GEOM_TestOthers.py
3420 return self.Import(theFileName, "BREP")
3422 ## Shortcut to Import() for IGES format
3424 # @ref swig_Import_Export "Example"
3425 def ImportIGES(self,theFileName):
3426 # Example: see GEOM_TestOthers.py
3427 return self.Import(theFileName, "IGES")
3429 ## Return length unit from given IGES file
3431 # @ref swig_Import_Export "Example"
3432 def GetIGESUnit(self,theFileName):
3433 # Example: see GEOM_TestOthers.py
3434 anObj = self.InsertOp.Import(theFileName, "IGES_UNIT")
3435 #RaiseIfFailed("Import", self.InsertOp)
3436 # recieve name using returned vertex
3438 vertices = self.SubShapeAll(anObj,ShapeType["VERTEX"])
3440 p = self.PointCoordinates(vertices[0])
3441 if abs(p[0]-0.01) < 1.e-6:
3443 elif abs(p[0]-0.001) < 1.e-6:
3447 ## Shortcut to Import() for STEP format
3449 # @ref swig_Import_Export "Example"
3450 def ImportSTEP(self,theFileName):
3451 # Example: see GEOM_TestOthers.py
3452 return self.Import(theFileName, "STEP")
3454 ## Export the given shape into a file with given name.
3455 # @param theObject Shape to be stored in the file.
3456 # @param theFileName Name of the file to store the given shape in.
3457 # @param theFormatName Specify format for the shape storage.
3458 # Available formats can be obtained with InsertOp.ImportTranslators() method.
3460 # @ref swig_Import_Export "Example"
3461 def Export(self,theObject, theFileName, theFormatName):
3462 # Example: see GEOM_TestOthers.py
3463 self.InsertOp.Export(theObject, theFileName, theFormatName)
3464 if self.InsertOp.IsDone() == 0:
3465 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
3469 ## Shortcut to Export() for BREP format
3471 # @ref swig_Import_Export "Example"
3472 def ExportBREP(self,theObject, theFileName):
3473 # Example: see GEOM_TestOthers.py
3474 return self.Export(theObject, theFileName, "BREP")
3476 ## Shortcut to Export() for IGES format
3478 # @ref swig_Import_Export "Example"
3479 def ExportIGES(self,theObject, theFileName):
3480 # Example: see GEOM_TestOthers.py
3481 return self.Export(theObject, theFileName, "IGES")
3483 ## Shortcut to Export() for STEP format
3485 # @ref swig_Import_Export "Example"
3486 def ExportSTEP(self,theObject, theFileName):
3487 # Example: see GEOM_TestOthers.py
3488 return self.Export(theObject, theFileName, "STEP")
3490 # end of l2_import_export
3493 ## @addtogroup l3_blocks
3496 ## Create a quadrangle face from four edges. Order of Edges is not
3497 # important. It is not necessary that edges share the same vertex.
3498 # @param E1,E2,E3,E4 Edges for the face bound.
3499 # @return New GEOM_Object, containing the created face.
3501 # @ref tui_building_by_blocks_page "Example"
3502 def MakeQuad(self,E1, E2, E3, E4):
3503 # Example: see GEOM_Spanner.py
3504 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
3505 RaiseIfFailed("MakeQuad", self.BlocksOp)
3508 ## Create a quadrangle face on two edges.
3509 # The missing edges will be built by creating the shortest ones.
3510 # @param E1,E2 Two opposite edges for the face.
3511 # @return New GEOM_Object, containing the created face.
3513 # @ref tui_building_by_blocks_page "Example"
3514 def MakeQuad2Edges(self,E1, E2):
3515 # Example: see GEOM_Spanner.py
3516 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
3517 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
3520 ## Create a quadrangle face with specified corners.
3521 # The missing edges will be built by creating the shortest ones.
3522 # @param V1,V2,V3,V4 Corner vertices for the face.
3523 # @return New GEOM_Object, containing the created face.
3525 # @ref tui_building_by_blocks_page "Example 1"
3526 # \n @ref swig_MakeQuad4Vertices "Example 2"
3527 def MakeQuad4Vertices(self,V1, V2, V3, V4):
3528 # Example: see GEOM_Spanner.py
3529 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
3530 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
3533 ## Create a hexahedral solid, bounded by the six given faces. Order of
3534 # faces is not important. It is not necessary that Faces share the same edge.
3535 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
3536 # @return New GEOM_Object, containing the created solid.
3538 # @ref tui_building_by_blocks_page "Example 1"
3539 # \n @ref swig_MakeHexa "Example 2"
3540 def MakeHexa(self,F1, F2, F3, F4, F5, F6):
3541 # Example: see GEOM_Spanner.py
3542 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
3543 RaiseIfFailed("MakeHexa", self.BlocksOp)
3546 ## Create a hexahedral solid between two given faces.
3547 # The missing faces will be built by creating the smallest ones.
3548 # @param F1,F2 Two opposite faces for the hexahedral solid.
3549 # @return New GEOM_Object, containing the created solid.
3551 # @ref tui_building_by_blocks_page "Example 1"
3552 # \n @ref swig_MakeHexa2Faces "Example 2"
3553 def MakeHexa2Faces(self,F1, F2):
3554 # Example: see GEOM_Spanner.py
3555 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
3556 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
3562 ## @addtogroup l3_blocks_op
3565 ## Get a vertex, found in the given shape by its coordinates.
3566 # @param theShape Block or a compound of blocks.
3567 # @param theX,theY,theZ Coordinates of the sought vertex.
3568 # @param theEpsilon Maximum allowed distance between the resulting
3569 # vertex and point with the given coordinates.
3570 # @return New GEOM_Object, containing the found vertex.
3572 # @ref swig_GetPoint "Example"
3573 def GetPoint(self,theShape, theX, theY, theZ, theEpsilon):
3574 # Example: see GEOM_TestOthers.py
3575 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
3576 RaiseIfFailed("GetPoint", self.BlocksOp)
3579 ## Get an edge, found in the given shape by two given vertices.
3580 # @param theShape Block or a compound of blocks.
3581 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
3582 # @return New GEOM_Object, containing the found edge.
3584 # @ref swig_todo "Example"
3585 def GetEdge(self,theShape, thePoint1, thePoint2):
3586 # Example: see GEOM_Spanner.py
3587 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
3588 RaiseIfFailed("GetEdge", self.BlocksOp)
3591 ## Find an edge of the given shape, which has minimal distance to the given point.
3592 # @param theShape Block or a compound of blocks.
3593 # @param thePoint Point, close to the desired edge.
3594 # @return New GEOM_Object, containing the found edge.
3596 # @ref swig_GetEdgeNearPoint "Example"
3597 def GetEdgeNearPoint(self,theShape, thePoint):
3598 # Example: see GEOM_TestOthers.py
3599 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
3600 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
3603 ## Returns a face, found in the given shape by four given corner vertices.
3604 # @param theShape Block or a compound of blocks.
3605 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
3606 # @return New GEOM_Object, containing the found face.
3608 # @ref swig_todo "Example"
3609 def GetFaceByPoints(self,theShape, thePoint1, thePoint2, thePoint3, thePoint4):
3610 # Example: see GEOM_Spanner.py
3611 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
3612 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
3615 ## Get a face of block, found in the given shape by two given edges.
3616 # @param theShape Block or a compound of blocks.
3617 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
3618 # @return New GEOM_Object, containing the found face.
3620 # @ref swig_todo "Example"
3621 def GetFaceByEdges(self,theShape, theEdge1, theEdge2):
3622 # Example: see GEOM_Spanner.py
3623 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
3624 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
3627 ## Find a face, opposite to the given one in the given block.
3628 # @param theBlock Must be a hexahedral solid.
3629 # @param theFace Face of \a theBlock, opposite to the desired face.
3630 # @return New GEOM_Object, containing the found face.
3632 # @ref swig_GetOppositeFace "Example"
3633 def GetOppositeFace(self,theBlock, theFace):
3634 # Example: see GEOM_Spanner.py
3635 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
3636 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
3639 ## Find a face of the given shape, which has minimal distance to the given point.
3640 # @param theShape Block or a compound of blocks.
3641 # @param thePoint Point, close to the desired face.
3642 # @return New GEOM_Object, containing the found face.
3644 # @ref swig_GetFaceNearPoint "Example"
3645 def GetFaceNearPoint(self,theShape, thePoint):
3646 # Example: see GEOM_Spanner.py
3647 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
3648 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
3651 ## Find a face of block, whose outside normale has minimal angle with the given vector.
3652 # @param theBlock Block or a compound of blocks.
3653 # @param theVector Vector, close to the normale of the desired face.
3654 # @return New GEOM_Object, containing the found face.
3656 # @ref swig_todo "Example"
3657 def GetFaceByNormale(self, theBlock, theVector):
3658 # Example: see GEOM_Spanner.py
3659 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
3660 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
3663 # end of l3_blocks_op
3666 ## @addtogroup l4_blocks_measure
3669 ## Check, if the compound of blocks is given.
3670 # To be considered as a compound of blocks, the
3671 # given shape must satisfy the following conditions:
3672 # - Each element of the compound should be a Block (6 faces and 12 edges).
3673 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
3674 # - The compound should be connexe.
3675 # - The glue between two quadrangle faces should be applied.
3676 # @param theCompound The compound to check.
3677 # @return TRUE, if the given shape is a compound of blocks.
3678 # If theCompound is not valid, prints all discovered errors.
3680 # @ref tui_measurement_tools_page "Example 1"
3681 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
3682 def CheckCompoundOfBlocks(self,theCompound):
3683 # Example: see GEOM_Spanner.py
3684 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
3685 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
3687 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
3691 ## Remove all seam and degenerated edges from \a theShape.
3692 # Unite faces and edges, sharing one surface. It means that
3693 # this faces must have references to one C++ surface object (handle).
3694 # @param theShape The compound or single solid to remove irregular edges from.
3695 # @param doUnionFaces If True, then unite faces. If False (the default value),
3696 # do not unite faces.
3697 # @return Improved shape.
3699 # @ref swig_RemoveExtraEdges "Example"
3700 def RemoveExtraEdges(self, theShape, doUnionFaces=False):
3701 # Example: see GEOM_TestOthers.py
3702 nbFacesOptimum = -1 # -1 means do not unite faces
3703 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
3704 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
3705 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
3708 ## Check, if the given shape is a blocks compound.
3709 # Fix all detected errors.
3710 # \note Single block can be also fixed by this method.
3711 # @param theShape The compound to check and improve.
3712 # @return Improved compound.
3714 # @ref swig_CheckAndImprove "Example"
3715 def CheckAndImprove(self,theShape):
3716 # Example: see GEOM_TestOthers.py
3717 anObj = self.BlocksOp.CheckAndImprove(theShape)
3718 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
3721 # end of l4_blocks_measure
3724 ## @addtogroup l3_blocks_op
3727 ## Get all the blocks, contained in the given compound.
3728 # @param theCompound The compound to explode.
3729 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
3730 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
3731 # \note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
3732 # @return List of GEOM_Objects, containing the retrieved blocks.
3734 # @ref tui_explode_on_blocks "Example 1"
3735 # \n @ref swig_MakeBlockExplode "Example 2"
3736 def MakeBlockExplode(self,theCompound, theMinNbFaces, theMaxNbFaces):
3737 # Example: see GEOM_TestOthers.py
3738 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
3739 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
3740 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
3742 anObj.SetParameters(Parameters)
3746 ## Find block, containing the given point inside its volume or on boundary.
3747 # @param theCompound Compound, to find block in.
3748 # @param thePoint Point, close to the desired block. If the point lays on
3749 # boundary between some blocks, we return block with nearest center.
3750 # @return New GEOM_Object, containing the found block.
3752 # @ref swig_todo "Example"
3753 def GetBlockNearPoint(self,theCompound, thePoint):
3754 # Example: see GEOM_Spanner.py
3755 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
3756 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
3759 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
3760 # @param theCompound Compound, to find block in.
3761 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
3762 # @return New GEOM_Object, containing the found block.
3764 # @ref swig_GetBlockByParts "Example"
3765 def GetBlockByParts(self,theCompound, theParts):
3766 # Example: see GEOM_TestOthers.py
3767 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
3768 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
3771 ## Return all blocks, containing all the elements, passed as the parts.
3772 # @param theCompound Compound, to find blocks in.
3773 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
3774 # @return List of GEOM_Objects, containing the found blocks.
3776 # @ref swig_todo "Example"
3777 def GetBlocksByParts(self,theCompound, theParts):
3778 # Example: see GEOM_Spanner.py
3779 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
3780 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
3783 ## Multi-transformate block and glue the result.
3784 # Transformation is defined so, as to superpose direction faces.
3785 # @param Block Hexahedral solid to be multi-transformed.
3786 # @param DirFace1 ID of First direction face.
3787 # @param DirFace2 ID of Second direction face.
3788 # @param NbTimes Quantity of transformations to be done.
3789 # \note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
3790 # @return New GEOM_Object, containing the result shape.
3792 # @ref tui_multi_transformation "Example"
3793 def MakeMultiTransformation1D(self,Block, DirFace1, DirFace2, NbTimes):
3794 # Example: see GEOM_Spanner.py
3795 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
3796 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
3797 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
3798 anObj.SetParameters(Parameters)
3801 ## Multi-transformate block and glue the result.
3802 # @param Block Hexahedral solid to be multi-transformed.
3803 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
3804 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
3805 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
3806 # @return New GEOM_Object, containing the result shape.
3808 # @ref tui_multi_transformation "Example"
3809 def MakeMultiTransformation2D(self,Block, DirFace1U, DirFace2U, NbTimesU,
3810 DirFace1V, DirFace2V, NbTimesV):
3811 # Example: see GEOM_Spanner.py
3812 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
3813 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
3814 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
3815 DirFace1V, DirFace2V, NbTimesV)
3816 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
3817 anObj.SetParameters(Parameters)
3820 ## Build all possible propagation groups.
3821 # Propagation group is a set of all edges, opposite to one (main)
3822 # edge of this group directly or through other opposite edges.
3823 # Notion of Opposite Edge make sence only on quadrangle face.
3824 # @param theShape Shape to build propagation groups on.
3825 # @return List of GEOM_Objects, each of them is a propagation group.
3827 # @ref swig_Propagate "Example"
3828 def Propagate(self,theShape):
3829 # Example: see GEOM_TestOthers.py
3830 listChains = self.BlocksOp.Propagate(theShape)
3831 RaiseIfFailed("Propagate", self.BlocksOp)
3834 # end of l3_blocks_op
3837 ## @addtogroup l3_groups
3840 ## Creates a new group which will store sub shapes of theMainShape
3841 # @param theMainShape is a GEOM object on which the group is selected
3842 # @param theShapeType defines a shape type of the group
3843 # @return a newly created GEOM group
3845 # @ref tui_working_with_groups_page "Example 1"
3846 # \n @ref swig_CreateGroup "Example 2"
3847 def CreateGroup(self,theMainShape, theShapeType):
3848 # Example: see GEOM_TestOthers.py
3849 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
3850 RaiseIfFailed("CreateGroup", self.GroupOp)
3853 ## Adds a sub object with ID theSubShapeId to the group
3854 # @param theGroup is a GEOM group to which the new sub shape is added
3855 # @param theSubShapeID is a sub shape ID in the main object.
3856 # \note Use method GetSubShapeID() to get an unique ID of the sub shape
3858 # @ref tui_working_with_groups_page "Example"
3859 def AddObject(self,theGroup, theSubShapeID):
3860 # Example: see GEOM_TestOthers.py
3861 self.GroupOp.AddObject(theGroup, theSubShapeID)
3862 RaiseIfFailed("AddObject", self.GroupOp)
3865 ## Removes a sub object with ID \a theSubShapeId from the group
3866 # @param theGroup is a GEOM group from which the new sub shape is removed
3867 # @param theSubShapeID is a sub shape ID in the main object.
3868 # \note Use method GetSubShapeID() to get an unique ID of the sub shape
3870 # @ref tui_working_with_groups_page "Example"
3871 def RemoveObject(self,theGroup, theSubShapeID):
3872 # Example: see GEOM_TestOthers.py
3873 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
3874 RaiseIfFailed("RemoveObject", self.GroupOp)
3877 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
3878 # @param theGroup is a GEOM group to which the new sub shapes are added.
3879 # @param theSubShapes is a list of sub shapes to be added.
3881 # @ref tui_working_with_groups_page "Example"
3882 def UnionList (self,theGroup, theSubShapes):
3883 # Example: see GEOM_TestOthers.py
3884 self.GroupOp.UnionList(theGroup, theSubShapes)
3885 RaiseIfFailed("UnionList", self.GroupOp)
3888 ## Works like the above method, but argument
3889 # theSubShapes here is a list of sub-shapes indices
3891 # @ref swig_UnionIDs "Example"
3892 def UnionIDs(self,theGroup, theSubShapes):
3893 # Example: see GEOM_TestOthers.py
3894 self.GroupOp.UnionIDs(theGroup, theSubShapes)
3895 RaiseIfFailed("UnionIDs", self.GroupOp)
3898 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
3899 # @param theGroup is a GEOM group from which the sub-shapes are removed.
3900 # @param theSubShapes is a list of sub-shapes to be removed.
3902 # @ref tui_working_with_groups_page "Example"
3903 def DifferenceList (self,theGroup, theSubShapes):
3904 # Example: see GEOM_TestOthers.py
3905 self.GroupOp.DifferenceList(theGroup, theSubShapes)
3906 RaiseIfFailed("DifferenceList", self.GroupOp)
3909 ## Works like the above method, but argument
3910 # theSubShapes here is a list of sub-shapes indices
3912 # @ref swig_DifferenceIDs "Example"
3913 def DifferenceIDs(self,theGroup, theSubShapes):
3914 # Example: see GEOM_TestOthers.py
3915 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
3916 RaiseIfFailed("DifferenceIDs", self.GroupOp)
3919 ## Returns a list of sub objects ID stored in the group
3920 # @param theGroup is a GEOM group for which a list of IDs is requested
3922 # @ref swig_GetObjectIDs "Example"
3923 def GetObjectIDs(self,theGroup):
3924 # Example: see GEOM_TestOthers.py
3925 ListIDs = self.GroupOp.GetObjects(theGroup)
3926 RaiseIfFailed("GetObjects", self.GroupOp)
3929 ## Returns a type of sub objects stored in the group
3930 # @param theGroup is a GEOM group which type is returned.
3932 # @ref swig_GetType "Example"
3933 def GetType(self,theGroup):
3934 # Example: see GEOM_TestOthers.py
3935 aType = self.GroupOp.GetType(theGroup)
3936 RaiseIfFailed("GetType", self.GroupOp)
3939 ## Convert a type of geom object from id to string value
3940 # @param theId is a GEOM obect type id.
3942 # @ref swig_GetType "Example"
3943 def ShapeIdToType(self, theId):
4017 return "FREE_BOUNDS"
4025 return "THRUSECTIONS"
4027 return "COMPOUNDFILTER"
4029 return "SHAPES_ON_SHAPE"
4031 return "ELLIPSE_ARC"
4038 return "Shape Id not exist."
4040 ## Returns a main shape associated with the group
4041 # @param theGroup is a GEOM group for which a main shape object is requested
4042 # @return a GEOM object which is a main shape for theGroup
4044 # @ref swig_GetMainShape "Example"
4045 def GetMainShape(self,theGroup):
4046 # Example: see GEOM_TestOthers.py
4047 anObj = self.GroupOp.GetMainShape(theGroup)
4048 RaiseIfFailed("GetMainShape", self.GroupOp)
4051 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
4052 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
4054 # @ref swig_todo "Example"
4055 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1):
4056 edges = self.SubShapeAll(theShape, ShapeType["EDGE"])
4059 Props = self.BasicProperties(edge)
4060 if min_length <= Props[0] and Props[0] <= max_length:
4061 if (not include_min) and (min_length == Props[0]):
4064 if (not include_max) and (Props[0] == max_length):
4067 edges_in_range.append(edge)
4069 if len(edges_in_range) <= 0:
4070 print "No edges found by given criteria"
4073 group_edges = self.CreateGroup(theShape, ShapeType["EDGE"])
4074 self.UnionList(group_edges, edges_in_range)
4078 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
4079 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
4081 # @ref swig_todo "Example"
4082 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
4083 nb_selected = sg.SelectedCount()
4085 print "Select a shape before calling this function, please."
4088 print "Only one shape must be selected"
4091 id_shape = sg.getSelected(0)
4092 shape = IDToObject( id_shape )
4094 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
4098 if include_min: left_str = " <= "
4099 if include_max: right_str = " <= "
4101 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
4102 + left_str + "length" + right_str + `max_length`)
4104 sg.updateObjBrowser(1)
4111 ## Create a copy of the given object
4112 # @ingroup l1_geompy_auxiliary
4114 # @ref swig_all_advanced "Example"
4115 def MakeCopy(self,theOriginal):
4116 # Example: see GEOM_TestAll.py
4117 anObj = self.InsertOp.MakeCopy(theOriginal)
4118 RaiseIfFailed("MakeCopy", self.InsertOp)
4121 ## Add Path to load python scripts from
4122 # @ingroup l1_geompy_auxiliary
4123 def addPath(self,Path):
4124 if (sys.path.count(Path) < 1):
4125 sys.path.append(Path)
4129 ## Load marker texture from the file
4130 # @param Path a path to the texture file
4131 # @return unique texture identifier
4132 # @ingroup l1_geompy_auxiliary
4133 def LoadTexture(self, Path):
4134 # Example: see GEOM_TestAll.py
4135 ID = self.InsertOp.LoadTexture(Path)
4136 RaiseIfFailed("LoadTexture", self.InsertOp)
4139 ## Add marker texture. @a Width and @a Height parameters
4140 # specify width and height of the texture in pixels.
4141 # If @a RowData is @c True, @a Texture parameter should represent texture data
4142 # packed into the byte array. If @a RowData is @c False (default), @a Texture
4143 # parameter should be unpacked string, in which '1' symbols represent opaque
4144 # pixels and '0' represent transparent pixels of the texture bitmap.
4146 # @param Width texture width in pixels
4147 # @param Height texture height in pixels
4148 # @param Texture texture data
4149 # @param RowData if @c True, @a Texture data are packed in the byte stream
4150 # @ingroup l1_geompy_auxiliary
4151 def AddTexture(self, Width, Height, Texture, RowData=False):
4152 # Example: see GEOM_TestAll.py
4153 if not RowData: Texture = PackData(Texture)
4154 ID = self.InsertOp.AddTexture(Width, Height, Texture)
4155 RaiseIfFailed("AddTexture", self.InsertOp)
4159 #Register the new proxy for GEOM_Gen
4160 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geompyDC)