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
59 ## @defgroup l4_advanced Advanced objects creation functions
64 ## @defgroup l2_transforming Transforming geometrical objects
66 ## @defgroup l3_basic_op Basic Operations
67 ## @defgroup l3_boolean Boolean Operations
68 ## @defgroup l3_transform Transformation Operations
69 ## @defgroup l3_local Local Operations (Fillet and Chamfer)
70 ## @defgroup l3_blocks_op Blocks Operations
71 ## @defgroup l3_healing Repairing Operations
72 ## @defgroup l3_restore_ss Restore presentation parameters and a tree of subshapes
75 ## @defgroup l2_measure Using measurement tools
83 from salome_notebook import *
88 ## Enumeration ShapeType as a dictionary
89 # @ingroup l1_geompy_auxiliary
90 ShapeType = {"COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8}
92 ## Raise an Error, containing the Method_name, if Operation is Failed
93 ## @ingroup l1_geompy_auxiliary
94 def RaiseIfFailed (Method_name, Operation):
95 if Operation.IsDone() == 0 and Operation.GetErrorCode() != "NOT_FOUND_ANY":
96 raise RuntimeError, Method_name + " : " + Operation.GetErrorCode()
98 ## Return list of variables value from salome notebook
99 ## @ingroup l1_geompy_auxiliary
100 def ParseParameters(*parameters):
103 for parameter in parameters:
104 if isinstance(parameter,str):
105 if notebook.isVariable(parameter):
106 Result.append(notebook.get(parameter))
108 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
110 Result.append(parameter)
113 StringResult.append(str(parameter))
116 Result.append(":".join(StringResult))
118 Result = ":".join(StringResult)
121 ## Return list of variables value from salome notebook
122 ## @ingroup l1_geompy_auxiliary
126 for parameter in list:
127 if isinstance(parameter,str) and notebook.isVariable(parameter):
128 Result.append(str(notebook.get(parameter)))
131 Result.append(str(parameter))
134 StringResult = StringResult + str(parameter)
135 StringResult = StringResult + ":"
137 StringResult = StringResult[:len(StringResult)-1]
138 return Result, StringResult
140 ## Return list of variables value from salome notebook
141 ## @ingroup l1_geompy_auxiliary
142 def ParseSketcherCommand(command):
145 sections = command.split(":")
146 for section in sections:
147 parameters = section.split(" ")
149 for parameter in parameters:
150 if paramIndex > 1 and parameter.find("'") != -1:
151 parameter = parameter.replace("'","")
152 if notebook.isVariable(parameter):
153 Result = Result + str(notebook.get(parameter)) + " "
156 raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
160 Result = Result + str(parameter) + " "
163 StringResult = StringResult + parameter
164 StringResult = StringResult + ":"
166 paramIndex = paramIndex + 1
168 Result = Result[:len(Result)-1] + ":"
170 Result = Result[:len(Result)-1]
171 return Result, StringResult
173 ## Helper function which can be used to pack the passed string to the byte data.
174 ## Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
175 ## If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
178 ## val = PackData("10001110") # val = 0xAE
179 ## val = PackData("1") # val = 0x80
181 ## @param data unpacked data - a string containing '1' and '0' symbols
182 ## @return data packed to the byte stream
183 ## @ingroup l1_geompy_auxiliary
186 if len(data)%8: bytes += 1
188 for b in range(bytes):
189 d = data[b*8:(b+1)*8]
194 if d[i] == "1": val += 1
196 raise "Invalid symbol %s" % d[i]
203 ## Read bitmap texture from the text file.
204 ## In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
205 ## A zero symbol ('0') represents transparent pixel of the texture bitmap.
206 ## The function returns width and height of the pixmap in pixels and byte stream representing
207 ## texture bitmap itself.
209 ## This function can be used to read the texture to the byte stream in order to pass it to
210 ## the AddTexture() function of geompy class.
214 ## geompy.init_geom(salome.myStudy)
215 ## texture = geompy.readtexture('mytexture.dat')
216 ## texture = geompy.AddTexture(*texture)
217 ## obj.SetMarkerTexture(texture)
219 ## @param fname texture file name
220 ## @return sequence of tree values: texture's width, height in pixels and its byte stream
221 ## @ingroup l1_geompy_auxiliary
222 def ReadTexture(fname):
225 lines = [ l.strip() for l in f.readlines()]
228 if lines: maxlen = max([len(x) for x in lines])
230 if maxlen%8: lenbytes += 1
234 lenline = (len(line)/8+1)*8
237 lenline = (len(line)/8)*8
239 for i in range(lenline/8):
242 if i*8+j < len(line) and line[i*8+j] != "0": byte += "1"
245 bytedata += PackData(byte)
247 for i in range(lenline/8, lenbytes):
248 bytedata += PackData("0")
250 return lenbytes*8, len(lines), bytedata
255 ## Kinds of shape enumeration
256 # @ingroup l1_geompy_auxiliary
257 kind = GEOM.GEOM_IKindOfShape
259 ## Information about closed/unclosed state of shell or wire
260 # @ingroup l1_geompy_auxiliary
266 class geompyDC(GEOM._objref_GEOM_Gen):
269 GEOM._objref_GEOM_Gen.__init__(self)
270 self.myBuilder = None
289 ## @addtogroup l1_geompy_auxiliary
291 def init_geom(self,theStudy):
292 self.myStudy = theStudy
293 self.myStudyId = self.myStudy._get_StudyId()
294 self.myBuilder = self.myStudy.NewBuilder()
295 self.father = self.myStudy.FindComponent("GEOM")
296 if self.father is None:
297 self.father = self.myBuilder.NewComponent("GEOM")
298 A1 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributeName")
299 FName = A1._narrow(SALOMEDS.AttributeName)
300 FName.SetValue("Geometry")
301 A2 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributePixMap")
302 aPixmap = A2._narrow(SALOMEDS.AttributePixMap)
303 aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry")
304 self.myBuilder.DefineComponentInstance(self.father,self)
306 self.BasicOp = self.GetIBasicOperations (self.myStudyId)
307 self.CurvesOp = self.GetICurvesOperations (self.myStudyId)
308 self.PrimOp = self.GetI3DPrimOperations (self.myStudyId)
309 self.ShapesOp = self.GetIShapesOperations (self.myStudyId)
310 self.HealOp = self.GetIHealingOperations (self.myStudyId)
311 self.InsertOp = self.GetIInsertOperations (self.myStudyId)
312 self.BoolOp = self.GetIBooleanOperations (self.myStudyId)
313 self.TrsfOp = self.GetITransformOperations(self.myStudyId)
314 self.LocalOp = self.GetILocalOperations (self.myStudyId)
315 self.MeasuOp = self.GetIMeasureOperations (self.myStudyId)
316 self.BlocksOp = self.GetIBlocksOperations (self.myStudyId)
317 self.GroupOp = self.GetIGroupOperations (self.myStudyId)
318 self.AdvOp = self.GetIAdvancedOperations (self.myStudyId)
321 ## Get name for sub-shape aSubObj of shape aMainObj
323 # @ref swig_SubShapeAllSorted "Example"
324 def SubShapeName(self,aSubObj, aMainObj):
325 # Example: see GEOM_TestAll.py
327 #aSubId = orb.object_to_string(aSubObj)
328 #aMainId = orb.object_to_string(aMainObj)
329 #index = gg.getIndexTopology(aSubId, aMainId)
330 #name = gg.getShapeTypeString(aSubId) + "_%d"%(index)
331 index = self.ShapesOp.GetTopologyIndex(aMainObj, aSubObj)
332 name = self.ShapesOp.GetShapeTypeString(aSubObj) + "_%d"%(index)
335 ## Publish in study aShape with name aName
337 # \param aShape the shape to be published
338 # \param aName the name for the shape
339 # \param doRestoreSubShapes if True, finds and publishes also
340 # sub-shapes of <VAR>aShape</VAR>, corresponding to its arguments
341 # and published sub-shapes of arguments
342 # \param theArgs,theFindMethod,theInheritFirstArg see geompy.RestoreSubShapes for
343 # these arguments description
344 # \return study entry of the published shape in form of string
346 # @ref swig_MakeQuad4Vertices "Example"
347 def addToStudy(self, aShape, aName, doRestoreSubShapes=False,
348 theArgs=[], theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
349 # Example: see GEOM_TestAll.py
351 aSObject = self.AddInStudy(self.myStudy, aShape, aName, None)
352 if doRestoreSubShapes:
353 self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs,
354 theFindMethod, theInheritFirstArg)
356 print "addToStudy() failed"
358 return aShape.GetStudyEntry()
360 ## Publish in study aShape with name aName as sub-object of previously published aFather
362 # @ref swig_SubShapeAllSorted "Example"
363 def addToStudyInFather(self, aFather, aShape, aName):
364 # Example: see GEOM_TestAll.py
366 aSObject = self.AddInStudy(self.myStudy, aShape, aName, aFather)
368 print "addToStudyInFather() failed"
370 return aShape.GetStudyEntry()
372 # end of l1_geompy_auxiliary
375 ## @addtogroup l3_restore_ss
378 ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
379 # To be used from python scripts out of geompy.addToStudy (non-default usage)
380 # \param theObject published GEOM object, arguments of which will be published
381 # \param theArgs list of GEOM_Object, operation arguments to be published.
382 # If this list is empty, all operation arguments will be published
383 # \param theFindMethod method to search subshapes, corresponding to arguments and
384 # their subshapes. Value from enumeration GEOM::find_shape_method.
385 # \param theInheritFirstArg set properties of the first argument for <VAR>theObject</VAR>.
386 # Do not publish subshapes in place of arguments, but only
387 # in place of subshapes of the first argument,
388 # because the whole shape corresponds to the first argument.
389 # Mainly to be used after transformations, but it also can be
390 # usefull after partition with one object shape, and some other
391 # operations, where only the first argument has to be considered.
392 # If theObject has only one argument shape, this flag is automatically
393 # considered as True, not regarding really passed value.
394 # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
395 # and prefix "from_subshapes_of_" to names of partially restored subshapes.
396 # \return list of published sub-shapes
398 # @ref tui_restore_prs_params "Example"
399 def RestoreSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
400 theInheritFirstArg=False, theAddPrefix=True):
401 # Example: see GEOM_TestAll.py
402 return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
403 theFindMethod, theInheritFirstArg, theAddPrefix)
405 # end of l3_restore_ss
408 ## @addtogroup l3_basic_go
411 ## Create point by three coordinates.
412 # @param theX The X coordinate of the point.
413 # @param theY The Y coordinate of the point.
414 # @param theZ The Z coordinate of the point.
415 # @return New GEOM_Object, containing the created point.
417 # @ref tui_creation_point "Example"
418 def MakeVertex(self,theX, theY, theZ):
419 # Example: see GEOM_TestAll.py
420 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
421 anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
422 RaiseIfFailed("MakePointXYZ", self.BasicOp)
423 anObj.SetParameters(Parameters)
426 ## Create a point, distant from the referenced point
427 # on the given distances along the coordinate axes.
428 # @param theReference The referenced point.
429 # @param theX Displacement from the referenced point along OX axis.
430 # @param theY Displacement from the referenced point along OY axis.
431 # @param theZ Displacement from the referenced point along OZ axis.
432 # @return New GEOM_Object, containing the created point.
434 # @ref tui_creation_point "Example"
435 def MakeVertexWithRef(self,theReference, theX, theY, theZ):
436 # Example: see GEOM_TestAll.py
437 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
438 anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
439 RaiseIfFailed("MakePointWithReference", self.BasicOp)
440 anObj.SetParameters(Parameters)
443 ## Create a point, corresponding to the given parameter on the given curve.
444 # @param theRefCurve The referenced curve.
445 # @param theParameter Value of parameter on the referenced curve.
446 # @return New GEOM_Object, containing the created point.
448 # @ref tui_creation_point "Example"
449 def MakeVertexOnCurve(self,theRefCurve, theParameter):
450 # Example: see GEOM_TestAll.py
451 theParameter, Parameters = ParseParameters(theParameter)
452 anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter)
453 RaiseIfFailed("MakePointOnCurve", self.BasicOp)
454 anObj.SetParameters(Parameters)
457 ## Create a point by projection give coordinates on the given curve
458 # @param theRefCurve The referenced curve.
459 # @param theX X-coordinate in 3D space
460 # @param theY Y-coordinate in 3D space
461 # @param theZ Z-coordinate in 3D space
462 # @return New GEOM_Object, containing the created point.
464 # @ref tui_creation_point "Example"
465 def MakeVertexOnCurveByCoord(self,theRefCurve, theX, theY, theZ):
466 # Example: see GEOM_TestAll.py
467 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
468 anObj = self.BasicOp.MakePointOnCurveByCoord(theRefCurve, theX, theY, theZ)
469 RaiseIfFailed("MakeVertexOnCurveByCoord", self.BasicOp)
470 anObj.SetParameters(Parameters)
473 ## Create a point, corresponding to the given parameters on the
475 # @param theRefSurf The referenced surface.
476 # @param theUParameter Value of U-parameter on the referenced surface.
477 # @param theVParameter Value of V-parameter on the referenced surface.
478 # @return New GEOM_Object, containing the created point.
480 # @ref swig_MakeVertexOnSurface "Example"
481 def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter):
482 theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
483 # Example: see GEOM_TestAll.py
484 anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
485 RaiseIfFailed("MakePointOnSurface", self.BasicOp)
486 anObj.SetParameters(Parameters);
489 ## Create a point by projection give coordinates on the given surface
490 # @param theRefSurf The referenced surface.
491 # @param theX X-coordinate in 3D space
492 # @param theY Y-coordinate in 3D space
493 # @param theZ Z-coordinate in 3D space
494 # @return New GEOM_Object, containing the created point.
496 # @ref swig_MakeVertexOnSurfaceByCoord "Example"
497 def MakeVertexOnSurfaceByCoord(self, theRefSurf, theX, theY, theZ):
498 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
499 # Example: see GEOM_TestAll.py
500 anObj = self.BasicOp.MakePointOnSurfaceByCoord(theRefSurf, theX, theY, theZ)
501 RaiseIfFailed("MakeVertexOnSurfaceByCoord", self.BasicOp)
502 anObj.SetParameters(Parameters);
505 ## Create a point on intersection of two lines.
506 # @param theRefLine1, theRefLine2 The referenced lines.
507 # @return New GEOM_Object, containing the created point.
509 # @ref swig_MakeVertexOnLinesIntersection "Example"
510 def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2):
511 # Example: see GEOM_TestAll.py
512 anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
513 RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
516 ## Create a tangent, corresponding to the given parameter on the given curve.
517 # @param theRefCurve The referenced curve.
518 # @param theParameter Value of parameter on the referenced curve.
519 # @return New GEOM_Object, containing the created tangent.
521 # @ref swig_MakeTangentOnCurve "Example"
522 def MakeTangentOnCurve(self, theRefCurve, theParameter):
523 anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
524 RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
527 ## Create a tangent plane, corresponding to the given parameter on the given face.
528 # @param theFace The face for which tangent plane should be built.
529 # @param theParameterV vertical value of the center point (0.0 - 1.0).
530 # @param theParameterU horisontal value of the center point (0.0 - 1.0).
531 # @param theTrimSize the size of plane.
532 # @return New GEOM_Object, containing the created tangent.
534 # @ref swig_MakeTangentPlaneOnFace "Example"
535 def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize):
536 anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
537 RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
540 ## Create a vector with the given components.
541 # @param theDX X component of the vector.
542 # @param theDY Y component of the vector.
543 # @param theDZ Z component of the vector.
544 # @return New GEOM_Object, containing the created vector.
546 # @ref tui_creation_vector "Example"
547 def MakeVectorDXDYDZ(self,theDX, theDY, theDZ):
548 # Example: see GEOM_TestAll.py
549 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
550 anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
551 RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
552 anObj.SetParameters(Parameters)
555 ## Create a vector between two points.
556 # @param thePnt1 Start point for the vector.
557 # @param thePnt2 End point for the vector.
558 # @return New GEOM_Object, containing the created vector.
560 # @ref tui_creation_vector "Example"
561 def MakeVector(self,thePnt1, thePnt2):
562 # Example: see GEOM_TestAll.py
563 anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
564 RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
567 ## Create a line, passing through the given point
568 # and parrallel to the given direction
569 # @param thePnt Point. The resulting line will pass through it.
570 # @param theDir Direction. The resulting line will be parallel to it.
571 # @return New GEOM_Object, containing the created line.
573 # @ref tui_creation_line "Example"
574 def MakeLine(self,thePnt, theDir):
575 # Example: see GEOM_TestAll.py
576 anObj = self.BasicOp.MakeLine(thePnt, theDir)
577 RaiseIfFailed("MakeLine", self.BasicOp)
580 ## Create a line, passing through the given points
581 # @param thePnt1 First of two points, defining the line.
582 # @param thePnt2 Second of two points, defining the line.
583 # @return New GEOM_Object, containing the created line.
585 # @ref tui_creation_line "Example"
586 def MakeLineTwoPnt(self,thePnt1, thePnt2):
587 # Example: see GEOM_TestAll.py
588 anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
589 RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
592 ## Create a line on two faces intersection.
593 # @param theFace1 First of two faces, defining the line.
594 # @param theFace2 Second of two faces, defining the line.
595 # @return New GEOM_Object, containing the created line.
597 # @ref swig_MakeLineTwoFaces "Example"
598 def MakeLineTwoFaces(self, theFace1, theFace2):
599 # Example: see GEOM_TestAll.py
600 anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
601 RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
604 ## Create a plane, passing through the given point
605 # and normal to the given vector.
606 # @param thePnt Point, the plane has to pass through.
607 # @param theVec Vector, defining the plane normal direction.
608 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
609 # @return New GEOM_Object, containing the created plane.
611 # @ref tui_creation_plane "Example"
612 def MakePlane(self,thePnt, theVec, theTrimSize):
613 # Example: see GEOM_TestAll.py
614 theTrimSize, Parameters = ParseParameters(theTrimSize);
615 anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
616 RaiseIfFailed("MakePlanePntVec", self.BasicOp)
617 anObj.SetParameters(Parameters)
620 ## Create a plane, passing through the three given points
621 # @param thePnt1 First of three points, defining the plane.
622 # @param thePnt2 Second of three points, defining the plane.
623 # @param thePnt3 Fird of three points, defining the plane.
624 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
625 # @return New GEOM_Object, containing the created plane.
627 # @ref tui_creation_plane "Example"
628 def MakePlaneThreePnt(self,thePnt1, thePnt2, thePnt3, theTrimSize):
629 # Example: see GEOM_TestAll.py
630 theTrimSize, Parameters = ParseParameters(theTrimSize);
631 anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
632 RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
633 anObj.SetParameters(Parameters)
636 ## Create a plane, similar to the existing one, but with another size of representing face.
637 # @param theFace Referenced plane or LCS(Marker).
638 # @param theTrimSize New half size of a side of quadrangle face, representing the plane.
639 # @return New GEOM_Object, containing the created plane.
641 # @ref tui_creation_plane "Example"
642 def MakePlaneFace(self,theFace, theTrimSize):
643 # Example: see GEOM_TestAll.py
644 theTrimSize, Parameters = ParseParameters(theTrimSize);
645 anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
646 RaiseIfFailed("MakePlaneFace", self.BasicOp)
647 anObj.SetParameters(Parameters)
650 ## Create a plane, passing through the 2 vectors
651 # with center in a start point of the first vector.
652 # @param theVec1 Vector, defining center point and plane direction.
653 # @param theVec2 Vector, defining the plane normal direction.
654 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
655 # @return New GEOM_Object, containing the created plane.
657 # @ref tui_creation_plane "Example"
658 def MakePlane2Vec(self,theVec1, theVec2, theTrimSize):
659 # Example: see GEOM_TestAll.py
660 theTrimSize, Parameters = ParseParameters(theTrimSize);
661 anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
662 RaiseIfFailed("MakePlane2Vec", self.BasicOp)
663 anObj.SetParameters(Parameters)
666 ## Create a plane, based on a Local coordinate system.
667 # @param theLCS coordinate system, defining plane.
668 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
669 # @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
670 # @return New GEOM_Object, containing the created plane.
672 # @ref tui_creation_plane "Example"
673 def MakePlaneLCS(self,theLCS, theTrimSize, theOrientation):
674 # Example: see GEOM_TestAll.py
675 theTrimSize, Parameters = ParseParameters(theTrimSize);
676 anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
677 RaiseIfFailed("MakePlaneLCS", self.BasicOp)
678 anObj.SetParameters(Parameters)
681 ## Create a local coordinate system.
682 # @param OX,OY,OZ Three coordinates of coordinate system origin.
683 # @param XDX,XDY,XDZ Three components of OX direction
684 # @param YDX,YDY,YDZ Three components of OY direction
685 # @return New GEOM_Object, containing the created coordinate system.
687 # @ref swig_MakeMarker "Example"
688 def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ):
689 # Example: see GEOM_TestAll.py
690 OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
691 anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
692 RaiseIfFailed("MakeMarker", self.BasicOp)
693 anObj.SetParameters(Parameters)
696 ## Create a local coordinate system from shape.
697 # @param theShape The initial shape to detect the coordinate system.
698 # @return New GEOM_Object, containing the created coordinate system.
700 # @ref tui_creation_lcs "Example"
701 def MakeMarkerFromShape(self, theShape):
702 anObj = self.BasicOp.MakeMarkerFromShape(theShape)
703 RaiseIfFailed("MakeMarkerFromShape", self.BasicOp)
706 ## Create a local coordinate system from point and two vectors.
707 # @param theOrigin Point of coordinate system origin.
708 # @param theXVec Vector of X direction
709 # @param theYVec Vector of Y direction
710 # @return New GEOM_Object, containing the created coordinate system.
712 # @ref tui_creation_lcs "Example"
713 def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec):
714 anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec)
715 RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp)
721 ## @addtogroup l4_curves
724 ## Create an arc of circle, passing through three given points.
725 # @param thePnt1 Start point of the arc.
726 # @param thePnt2 Middle point of the arc.
727 # @param thePnt3 End point of the arc.
728 # @return New GEOM_Object, containing the created arc.
730 # @ref swig_MakeArc "Example"
731 def MakeArc(self,thePnt1, thePnt2, thePnt3):
732 # Example: see GEOM_TestAll.py
733 anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
734 RaiseIfFailed("MakeArc", self.CurvesOp)
737 ## Create an arc of circle from a center and 2 points.
738 # @param thePnt1 Center of the arc
739 # @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
740 # @param thePnt3 End point of the arc (Gives also a direction)
741 # @param theSense Orientation of the arc
742 # @return New GEOM_Object, containing the created arc.
744 # @ref swig_MakeArc "Example"
745 def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False):
746 # Example: see GEOM_TestAll.py
747 anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
748 RaiseIfFailed("MakeArcCenter", self.CurvesOp)
751 ## Create an arc of ellipse, of center and two points.
752 # @param theCenter Center of the arc.
753 # @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
754 # @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
755 # @return New GEOM_Object, containing the created arc.
757 # @ref swig_MakeArc "Example"
758 def MakeArcOfEllipse(self,theCenter, thePnt1, thePnt2):
759 # Example: see GEOM_TestAll.py
760 anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
761 RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
764 ## Create a circle with given center, normal vector and radius.
765 # @param thePnt Circle center.
766 # @param theVec Vector, normal to the plane of the circle.
767 # @param theR Circle radius.
768 # @return New GEOM_Object, containing the created circle.
770 # @ref tui_creation_circle "Example"
771 def MakeCircle(self, thePnt, theVec, theR):
772 # Example: see GEOM_TestAll.py
773 theR, Parameters = ParseParameters(theR)
774 anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
775 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
776 anObj.SetParameters(Parameters)
779 ## Create a circle with given radius.
780 # Center of the circle will be in the origin of global
781 # coordinate system and normal vector will be codirected with Z axis
782 # @param theR Circle radius.
783 # @return New GEOM_Object, containing the created circle.
784 def MakeCircleR(self, theR):
785 anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
786 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
789 ## Create a circle, passing through three given points
790 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
791 # @return New GEOM_Object, containing the created circle.
793 # @ref tui_creation_circle "Example"
794 def MakeCircleThreePnt(self,thePnt1, thePnt2, thePnt3):
795 # Example: see GEOM_TestAll.py
796 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
797 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
800 ## Create a circle, with given point1 as center,
801 # passing through the point2 as radius and laying in the plane,
802 # defined by all three given points.
803 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
804 # @return New GEOM_Object, containing the created circle.
806 # @ref swig_MakeCircle "Example"
807 def MakeCircleCenter2Pnt(self,thePnt1, thePnt2, thePnt3):
808 # Example: see GEOM_example6.py
809 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
810 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
813 ## Create an ellipse with given center, normal vector and radiuses.
814 # @param thePnt Ellipse center.
815 # @param theVec Vector, normal to the plane of the ellipse.
816 # @param theRMajor Major ellipse radius.
817 # @param theRMinor Minor ellipse radius.
818 # @param theVecMaj Vector, direction of the ellipse's main axis.
819 # @return New GEOM_Object, containing the created ellipse.
821 # @ref tui_creation_ellipse "Example"
822 def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None):
823 # Example: see GEOM_TestAll.py
824 theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
825 if theVecMaj is not None:
826 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
828 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
830 RaiseIfFailed("MakeEllipse", self.CurvesOp)
831 anObj.SetParameters(Parameters)
834 ## Create an ellipse with given radiuses.
835 # Center of the ellipse will be in the origin of global
836 # coordinate system and normal vector will be codirected with Z axis
837 # @param theRMajor Major ellipse radius.
838 # @param theRMinor Minor ellipse radius.
839 # @return New GEOM_Object, containing the created ellipse.
840 def MakeEllipseRR(self, theRMajor, theRMinor):
841 anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
842 RaiseIfFailed("MakeEllipse", self.CurvesOp)
845 ## Create a polyline on the set of points.
846 # @param thePoints Sequence of points for the polyline.
847 # @return New GEOM_Object, containing the created polyline.
849 # @ref tui_creation_curve "Example"
850 def MakePolyline(self,thePoints):
851 # Example: see GEOM_TestAll.py
852 anObj = self.CurvesOp.MakePolyline(thePoints)
853 RaiseIfFailed("MakePolyline", self.CurvesOp)
856 ## Create bezier curve on the set of points.
857 # @param thePoints Sequence of points for the bezier curve.
858 # @return New GEOM_Object, containing the created bezier curve.
860 # @ref tui_creation_curve "Example"
861 def MakeBezier(self,thePoints):
862 # Example: see GEOM_TestAll.py
863 anObj = self.CurvesOp.MakeSplineBezier(thePoints)
864 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
867 ## Create B-Spline curve on the set of points.
868 # @param thePoints Sequence of points for the B-Spline curve.
869 # @param theIsClosed If True, build a closed curve.
870 # @return New GEOM_Object, containing the created B-Spline curve.
872 # @ref tui_creation_curve "Example"
873 def MakeInterpol(self, thePoints, theIsClosed=False):
874 # Example: see GEOM_TestAll.py
875 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed)
876 RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
882 ## @addtogroup l3_sketcher
885 ## Create a sketcher (wire or face), following the textual description,
886 # passed through <VAR>theCommand</VAR> argument. \n
887 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
888 # Format of the description string have to be the following:
890 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
893 # - x1, y1 are coordinates of the first sketcher point (zero by default),
895 # - "R angle" : Set the direction by angle
896 # - "D dx dy" : Set the direction by DX & DY
899 # - "TT x y" : Create segment by point at X & Y
900 # - "T dx dy" : Create segment by point with DX & DY
901 # - "L length" : Create segment by direction & Length
902 # - "IX x" : Create segment by direction & Intersect. X
903 # - "IY y" : Create segment by direction & Intersect. Y
906 # - "C radius length" : Create arc by direction, radius and length(in degree)
909 # - "WW" : Close Wire (to finish)
910 # - "WF" : Close Wire and build face (to finish)
912 # @param theCommand String, defining the sketcher in local
913 # coordinates of the working plane.
914 # @param theWorkingPlane Nine double values, defining origin,
915 # OZ and OX directions of the working plane.
916 # @return New GEOM_Object, containing the created wire.
918 # @ref tui_sketcher_page "Example"
919 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0]):
920 # Example: see GEOM_TestAll.py
921 theCommand,Parameters = ParseSketcherCommand(theCommand)
922 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
923 RaiseIfFailed("MakeSketcher", self.CurvesOp)
924 anObj.SetParameters(Parameters)
927 ## Create a sketcher (wire or face), following the textual description,
928 # passed through <VAR>theCommand</VAR> argument. \n
929 # For format of the description string see the previous method.\n
930 # @param theCommand String, defining the sketcher in local
931 # coordinates of the working plane.
932 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
933 # @return New GEOM_Object, containing the created wire.
935 # @ref tui_sketcher_page "Example"
936 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane):
937 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
938 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
941 ## Create a sketcher wire, following the numerical description,
942 # passed through <VAR>theCoordinates</VAR> argument. \n
943 # @param theCoordinates double values, defining points to create a wire,
945 # @return New GEOM_Object, containing the created wire.
947 # @ref tui_sketcher_page "Example"
948 def Make3DSketcher(self, theCoordinates):
949 anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
950 RaiseIfFailed("Make3DSketcher", self.CurvesOp)
956 ## @addtogroup l3_3d_primitives
959 ## Create a box by coordinates of two opposite vertices.
961 # @ref tui_creation_box "Example"
962 def MakeBox(self,x1,y1,z1,x2,y2,z2):
963 # Example: see GEOM_TestAll.py
964 pnt1 = self.MakeVertex(x1,y1,z1)
965 pnt2 = self.MakeVertex(x2,y2,z2)
966 return self.MakeBoxTwoPnt(pnt1,pnt2)
968 ## Create a box with specified dimensions along the coordinate axes
969 # and with edges, parallel to the coordinate axes.
970 # Center of the box will be at point (DX/2, DY/2, DZ/2).
971 # @param theDX Length of Box edges, parallel to OX axis.
972 # @param theDY Length of Box edges, parallel to OY axis.
973 # @param theDZ Length of Box edges, parallel to OZ axis.
974 # @return New GEOM_Object, containing the created box.
976 # @ref tui_creation_box "Example"
977 def MakeBoxDXDYDZ(self,theDX, theDY, theDZ):
978 # Example: see GEOM_TestAll.py
979 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
980 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
981 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
982 anObj.SetParameters(Parameters)
985 ## Create a box with two specified opposite vertices,
986 # and with edges, parallel to the coordinate axes
987 # @param thePnt1 First of two opposite vertices.
988 # @param thePnt2 Second of two opposite vertices.
989 # @return New GEOM_Object, containing the created box.
991 # @ref tui_creation_box "Example"
992 def MakeBoxTwoPnt(self,thePnt1, thePnt2):
993 # Example: see GEOM_TestAll.py
994 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
995 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
998 ## Create a face with specified dimensions along OX-OY coordinate axes,
999 # with edges, parallel to this coordinate axes.
1000 # @param theH height of Face.
1001 # @param theW width of Face.
1002 # @param theOrientation orientation belong axis OXY OYZ OZX
1003 # @return New GEOM_Object, containing the created face.
1005 # @ref tui_creation_face "Example"
1006 def MakeFaceHW(self,theH, theW, theOrientation):
1007 # Example: see GEOM_TestAll.py
1008 theH,theW,Parameters = ParseParameters(theH, theW)
1009 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
1010 RaiseIfFailed("MakeFaceHW", self.PrimOp)
1011 anObj.SetParameters(Parameters)
1014 ## Create a face from another plane and two sizes,
1015 # vertical size and horisontal size.
1016 # @param theObj Normale vector to the creating face or
1018 # @param theH Height (vertical size).
1019 # @param theW Width (horisontal size).
1020 # @return New GEOM_Object, containing the created face.
1022 # @ref tui_creation_face "Example"
1023 def MakeFaceObjHW(self, theObj, theH, theW):
1024 # Example: see GEOM_TestAll.py
1025 theH,theW,Parameters = ParseParameters(theH, theW)
1026 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
1027 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
1028 anObj.SetParameters(Parameters)
1031 ## Create a disk with given center, normal vector and radius.
1032 # @param thePnt Disk center.
1033 # @param theVec Vector, normal to the plane of the disk.
1034 # @param theR Disk radius.
1035 # @return New GEOM_Object, containing the created disk.
1037 # @ref tui_creation_disk "Example"
1038 def MakeDiskPntVecR(self,thePnt, theVec, theR):
1039 # Example: see GEOM_TestAll.py
1040 theR,Parameters = ParseParameters(theR)
1041 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
1042 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
1043 anObj.SetParameters(Parameters)
1046 ## Create a disk, passing through three given points
1047 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
1048 # @return New GEOM_Object, containing the created disk.
1050 # @ref tui_creation_disk "Example"
1051 def MakeDiskThreePnt(self,thePnt1, thePnt2, thePnt3):
1052 # Example: see GEOM_TestAll.py
1053 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
1054 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
1057 ## Create a disk with specified dimensions along OX-OY coordinate axes.
1058 # @param theR Radius of Face.
1059 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
1060 # @return New GEOM_Object, containing the created disk.
1062 # @ref tui_creation_face "Example"
1063 def MakeDiskR(self,theR, theOrientation):
1064 # Example: see GEOM_TestAll.py
1065 theR,Parameters = ParseParameters(theR)
1066 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
1067 RaiseIfFailed("MakeDiskR", self.PrimOp)
1068 anObj.SetParameters(Parameters)
1071 ## Create a cylinder with given base point, axis, radius and height.
1072 # @param thePnt Central point of cylinder base.
1073 # @param theAxis Cylinder axis.
1074 # @param theR Cylinder radius.
1075 # @param theH Cylinder height.
1076 # @return New GEOM_Object, containing the created cylinder.
1078 # @ref tui_creation_cylinder "Example"
1079 def MakeCylinder(self,thePnt, theAxis, theR, theH):
1080 # Example: see GEOM_TestAll.py
1081 theR,theH,Parameters = ParseParameters(theR, theH)
1082 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
1083 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
1084 anObj.SetParameters(Parameters)
1087 ## Create a cylinder with given radius and height at
1088 # the origin of coordinate system. Axis of the cylinder
1089 # will be collinear to the OZ axis of the coordinate system.
1090 # @param theR Cylinder radius.
1091 # @param theH Cylinder height.
1092 # @return New GEOM_Object, containing the created cylinder.
1094 # @ref tui_creation_cylinder "Example"
1095 def MakeCylinderRH(self,theR, theH):
1096 # Example: see GEOM_TestAll.py
1097 theR,theH,Parameters = ParseParameters(theR, theH)
1098 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
1099 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
1100 anObj.SetParameters(Parameters)
1103 ## Create a sphere with given center and radius.
1104 # @param thePnt Sphere center.
1105 # @param theR Sphere radius.
1106 # @return New GEOM_Object, containing the created sphere.
1108 # @ref tui_creation_sphere "Example"
1109 def MakeSpherePntR(self, thePnt, theR):
1110 # Example: see GEOM_TestAll.py
1111 theR,Parameters = ParseParameters(theR)
1112 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
1113 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
1114 anObj.SetParameters(Parameters)
1117 ## Create a sphere with given center and radius.
1118 # @param x,y,z Coordinates of sphere center.
1119 # @param theR Sphere radius.
1120 # @return New GEOM_Object, containing the created sphere.
1122 # @ref tui_creation_sphere "Example"
1123 def MakeSphere(self, x, y, z, theR):
1124 # Example: see GEOM_TestAll.py
1125 point = self.MakeVertex(x, y, z)
1126 anObj = self.MakeSpherePntR(point, theR)
1129 ## Create a sphere with given radius at the origin of coordinate system.
1130 # @param theR Sphere radius.
1131 # @return New GEOM_Object, containing the created sphere.
1133 # @ref tui_creation_sphere "Example"
1134 def MakeSphereR(self, theR):
1135 # Example: see GEOM_TestAll.py
1136 theR,Parameters = ParseParameters(theR)
1137 anObj = self.PrimOp.MakeSphereR(theR)
1138 RaiseIfFailed("MakeSphereR", self.PrimOp)
1139 anObj.SetParameters(Parameters)
1142 ## Create a cone with given base point, axis, height and radiuses.
1143 # @param thePnt Central point of the first cone base.
1144 # @param theAxis Cone axis.
1145 # @param theR1 Radius of the first cone base.
1146 # @param theR2 Radius of the second cone base.
1147 # \note If both radiuses are non-zero, the cone will be truncated.
1148 # \note If the radiuses are equal, a cylinder will be created instead.
1149 # @param theH Cone height.
1150 # @return New GEOM_Object, containing the created cone.
1152 # @ref tui_creation_cone "Example"
1153 def MakeCone(self,thePnt, theAxis, theR1, theR2, theH):
1154 # Example: see GEOM_TestAll.py
1155 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
1156 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
1157 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
1158 anObj.SetParameters(Parameters)
1161 ## Create a cone with given height and radiuses at
1162 # the origin of coordinate system. Axis of the cone will
1163 # be collinear to the OZ axis of the coordinate system.
1164 # @param theR1 Radius of the first cone base.
1165 # @param theR2 Radius of the second cone base.
1166 # \note If both radiuses are non-zero, the cone will be truncated.
1167 # \note If the radiuses are equal, a cylinder will be created instead.
1168 # @param theH Cone height.
1169 # @return New GEOM_Object, containing the created cone.
1171 # @ref tui_creation_cone "Example"
1172 def MakeConeR1R2H(self,theR1, theR2, theH):
1173 # Example: see GEOM_TestAll.py
1174 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
1175 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
1176 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
1177 anObj.SetParameters(Parameters)
1180 ## Create a torus with given center, normal vector and radiuses.
1181 # @param thePnt Torus central point.
1182 # @param theVec Torus axis of symmetry.
1183 # @param theRMajor Torus major radius.
1184 # @param theRMinor Torus minor radius.
1185 # @return New GEOM_Object, containing the created torus.
1187 # @ref tui_creation_torus "Example"
1188 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor):
1189 # Example: see GEOM_TestAll.py
1190 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
1191 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
1192 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
1193 anObj.SetParameters(Parameters)
1196 ## Create a torus with given radiuses at the origin of coordinate system.
1197 # @param theRMajor Torus major radius.
1198 # @param theRMinor Torus minor radius.
1199 # @return New GEOM_Object, containing the created torus.
1201 # @ref tui_creation_torus "Example"
1202 def MakeTorusRR(self, theRMajor, theRMinor):
1203 # Example: see GEOM_TestAll.py
1204 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
1205 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
1206 RaiseIfFailed("MakeTorusRR", self.PrimOp)
1207 anObj.SetParameters(Parameters)
1210 # end of l3_3d_primitives
1213 ## @addtogroup l3_complex
1216 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
1217 # @param theBase Base shape to be extruded.
1218 # @param thePoint1 First end of extrusion vector.
1219 # @param thePoint2 Second end of extrusion vector.
1220 # @return New GEOM_Object, containing the created prism.
1222 # @ref tui_creation_prism "Example"
1223 def MakePrism(self, theBase, thePoint1, thePoint2):
1224 # Example: see GEOM_TestAll.py
1225 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
1226 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
1229 ## Create a shape by extrusion of the base shape along the vector,
1230 # i.e. all the space, transfixed by the base shape during its translation
1231 # along the vector on the given distance.
1232 # @param theBase Base shape to be extruded.
1233 # @param theVec Direction of extrusion.
1234 # @param theH Prism dimension along theVec.
1235 # @return New GEOM_Object, containing the created prism.
1237 # @ref tui_creation_prism "Example"
1238 def MakePrismVecH(self, theBase, theVec, theH):
1239 # Example: see GEOM_TestAll.py
1240 theH,Parameters = ParseParameters(theH)
1241 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
1242 RaiseIfFailed("MakePrismVecH", self.PrimOp)
1243 anObj.SetParameters(Parameters)
1246 ## Create a shape by extrusion of the base shape along the vector,
1247 # i.e. all the space, transfixed by the base shape during its translation
1248 # along the vector on the given distance in 2 Ways (forward/backward) .
1249 # @param theBase Base shape to be extruded.
1250 # @param theVec Direction of extrusion.
1251 # @param theH Prism dimension along theVec in forward direction.
1252 # @return New GEOM_Object, containing the created prism.
1254 # @ref tui_creation_prism "Example"
1255 def MakePrismVecH2Ways(self, theBase, theVec, theH):
1256 # Example: see GEOM_TestAll.py
1257 theH,Parameters = ParseParameters(theH)
1258 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
1259 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
1260 anObj.SetParameters(Parameters)
1263 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
1264 # @param theBase Base shape to be extruded.
1265 # @param theDX, theDY, theDZ Directions of extrusion.
1266 # @return New GEOM_Object, containing the created prism.
1268 # @ref tui_creation_prism "Example"
1269 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ):
1270 # Example: see GEOM_TestAll.py
1271 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1272 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
1273 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
1274 anObj.SetParameters(Parameters)
1277 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
1278 # i.e. all the space, transfixed by the base shape during its translation
1279 # along the vector on the given distance in 2 Ways (forward/backward) .
1280 # @param theBase Base shape to be extruded.
1281 # @param theDX, theDY, theDZ Directions of extrusion.
1282 # @return New GEOM_Object, containing the created prism.
1284 # @ref tui_creation_prism "Example"
1285 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ):
1286 # Example: see GEOM_TestAll.py
1287 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1288 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
1289 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
1290 anObj.SetParameters(Parameters)
1293 ## Create a shape by revolution of the base shape around the axis
1294 # on the given angle, i.e. all the space, transfixed by the base
1295 # shape during its rotation around the axis on the given angle.
1296 # @param theBase Base shape to be rotated.
1297 # @param theAxis Rotation axis.
1298 # @param theAngle Rotation angle in radians.
1299 # @return New GEOM_Object, containing the created revolution.
1301 # @ref tui_creation_revolution "Example"
1302 def MakeRevolution(self, theBase, theAxis, theAngle):
1303 # Example: see GEOM_TestAll.py
1304 theAngle,Parameters = ParseParameters(theAngle)
1305 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
1306 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
1307 anObj.SetParameters(Parameters)
1310 ## The Same Revolution but in both ways forward&backward.
1311 def MakeRevolution2Ways(self, theBase, theAxis, theAngle):
1312 theAngle,Parameters = ParseParameters(theAngle)
1313 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
1314 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
1315 anObj.SetParameters(Parameters)
1318 ## Create a filling from the given compound of contours.
1319 # @param theShape the compound of contours
1320 # @param theMinDeg a minimal degree of BSpline surface to create
1321 # @param theMaxDeg a maximal degree of BSpline surface to create
1322 # @param theTol2D a 2d tolerance to be reached
1323 # @param theTol3D a 3d tolerance to be reached
1324 # @param theNbIter a number of iteration of approximation algorithm
1325 # @param theMethod Kind of method to perform filling operation:
1326 # 0 - Default - standard behaviour
1327 # 1 - Use edges orientation - orientation of edges are
1328 # used: if edge is reversed curve from this edge
1329 # is reversed before using in filling algorithm.
1330 # 2 - Auto-correct orientation - change orientation
1331 # of curves using minimization of sum of distances
1332 # between ends points of edges.
1333 # @param isApprox if True, BSpline curves are generated in the process
1334 # of surface construction. By default it is False, that means
1335 # the surface is created using Besier curves. The usage of
1336 # Approximation makes the algorithm work slower, but allows
1337 # building the surface for rather complex cases
1338 # @return New GEOM_Object, containing the created filling surface.
1340 # @ref tui_creation_filling "Example"
1341 def MakeFilling(self, theShape, theMinDeg, theMaxDeg, theTol2D,
1342 theTol3D, theNbIter, theMethod=GEOM.FOM_Default, isApprox=0):
1343 # Example: see GEOM_TestAll.py
1344 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
1345 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
1346 theTol2D, theTol3D, theNbIter,
1347 theMethod, isApprox)
1348 RaiseIfFailed("MakeFilling", self.PrimOp)
1349 anObj.SetParameters(Parameters)
1352 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
1353 # @param theSeqSections - set of specified sections.
1354 # @param theModeSolid - mode defining building solid or shell
1355 # @param thePreci - precision 3D used for smoothing by default 1.e-6
1356 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
1357 # @return New GEOM_Object, containing the created shell or solid.
1359 # @ref swig_todo "Example"
1360 def MakeThruSections(self,theSeqSections,theModeSolid,thePreci,theRuled):
1361 # Example: see GEOM_TestAll.py
1362 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
1363 RaiseIfFailed("MakeThruSections", self.PrimOp)
1366 ## Create a shape by extrusion of the base shape along
1367 # the path shape. The path shape can be a wire or an edge.
1368 # @param theBase Base shape to be extruded.
1369 # @param thePath Path shape to extrude the base shape along it.
1370 # @return New GEOM_Object, containing the created pipe.
1372 # @ref tui_creation_pipe "Example"
1373 def MakePipe(self,theBase, thePath):
1374 # Example: see GEOM_TestAll.py
1375 anObj = self.PrimOp.MakePipe(theBase, thePath)
1376 RaiseIfFailed("MakePipe", self.PrimOp)
1379 ## Create a shape by extrusion of the profile shape along
1380 # the path shape. The path shape can be a wire or an edge.
1381 # the several profiles can be specified in the several locations of path.
1382 # @param theSeqBases - list of Bases shape to be extruded.
1383 # @param theLocations - list of locations on the path corresponding
1384 # specified list of the Bases shapes. Number of locations
1385 # should be equal to number of bases or list of locations can be empty.
1386 # @param thePath - Path shape to extrude the base shape along it.
1387 # @param theWithContact - the mode defining that the section is translated to be in
1388 # contact with the spine.
1389 # @param theWithCorrection - defining that the section is rotated to be
1390 # orthogonal to the spine tangent in the correspondent point
1391 # @return New GEOM_Object, containing the created pipe.
1393 # @ref tui_creation_pipe_with_diff_sec "Example"
1394 def MakePipeWithDifferentSections(self, theSeqBases,
1395 theLocations, thePath,
1396 theWithContact, theWithCorrection):
1397 anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
1398 theLocations, thePath,
1399 theWithContact, theWithCorrection)
1400 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
1403 ## Create a shape by extrusion of the profile shape along
1404 # the path shape. The path shape can be a wire or a edge.
1405 # the several profiles can be specified in the several locations of path.
1406 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
1407 # shell or face. If number of faces in neighbour sections
1408 # aren't coincided result solid between such sections will
1409 # be created using external boundaries of this shells.
1410 # @param theSeqSubBases - list of corresponding subshapes of section shapes.
1411 # This list is used for searching correspondences between
1412 # faces in the sections. Size of this list must be equal
1413 # to size of list of base shapes.
1414 # @param theLocations - list of locations on the path corresponding
1415 # specified list of the Bases shapes. Number of locations
1416 # should be equal to number of bases. First and last
1417 # locations must be coincided with first and last vertexes
1418 # of path correspondingly.
1419 # @param thePath - Path shape to extrude the base shape along it.
1420 # @param theWithContact - the mode defining that the section is translated to be in
1421 # contact with the spine.
1422 # @param theWithCorrection - defining that the section is rotated to be
1423 # orthogonal to the spine tangent in the correspondent point
1424 # @return New GEOM_Object, containing the created solids.
1426 # @ref tui_creation_pipe_with_shell_sec "Example"
1427 def MakePipeWithShellSections(self,theSeqBases, theSeqSubBases,
1428 theLocations, thePath,
1429 theWithContact, theWithCorrection):
1430 anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
1431 theLocations, thePath,
1432 theWithContact, theWithCorrection)
1433 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
1436 ## Create a shape by extrusion of the profile shape along
1437 # the path shape. This function is used only for debug pipe
1438 # functionality - it is a version of previous function
1439 # (MakePipeWithShellSections(...)) which give a possibility to
1440 # recieve information about creating pipe between each pair of
1441 # sections step by step.
1442 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
1443 theLocations, thePath,
1444 theWithContact, theWithCorrection):
1446 nbsect = len(theSeqBases)
1447 nbsubsect = len(theSeqSubBases)
1448 #print "nbsect = ",nbsect
1449 for i in range(1,nbsect):
1451 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
1452 tmpLocations = [ theLocations[i-1], theLocations[i] ]
1454 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
1455 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
1456 tmpLocations, thePath,
1457 theWithContact, theWithCorrection)
1458 if self.PrimOp.IsDone() == 0:
1459 print "Problems with pipe creation between ",i," and ",i+1," sections"
1460 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
1463 print "Pipe between ",i," and ",i+1," sections is OK"
1468 resc = self.MakeCompound(res)
1469 #resc = self.MakeSewing(res, 0.001)
1470 #print "resc: ",resc
1473 ## Create solids between given sections
1474 # @param theSeqBases - list of sections (shell or face).
1475 # @param theLocations - list of corresponding vertexes
1476 # @return New GEOM_Object, containing the created solids.
1478 # @ref tui_creation_pipe_without_path "Example"
1479 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations):
1480 anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
1481 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
1484 ## Create a shape by extrusion of the base shape along
1485 # the path shape with constant bi-normal direction along the given vector.
1486 # The path shape can be a wire or an edge.
1487 # @param theBase Base shape to be extruded.
1488 # @param thePath Path shape to extrude the base shape along it.
1489 # @param theVec Vector defines a constant binormal direction to keep the
1490 # same angle beetween the direction and the sections
1491 # along the sweep surface.
1492 # @return New GEOM_Object, containing the created pipe.
1494 # @ref tui_creation_pipe "Example"
1495 def MakePipeBiNormalAlongVector(self,theBase, thePath, theVec):
1496 # Example: see GEOM_TestAll.py
1497 anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
1498 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
1504 ## @addtogroup l3_advanced
1507 ## Create a linear edge with specified ends.
1508 # @param thePnt1 Point for the first end of edge.
1509 # @param thePnt2 Point for the second end of edge.
1510 # @return New GEOM_Object, containing the created edge.
1512 # @ref tui_creation_edge "Example"
1513 def MakeEdge(self,thePnt1, thePnt2):
1514 # Example: see GEOM_TestAll.py
1515 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
1516 RaiseIfFailed("MakeEdge", self.ShapesOp)
1519 ## Create a wire from the set of edges and wires.
1520 # @param theEdgesAndWires List of edges and/or wires.
1521 # @param theTolerance Maximum distance between vertices, that will be merged.
1522 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
1523 # @return New GEOM_Object, containing the created wire.
1525 # @ref tui_creation_wire "Example"
1526 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07):
1527 # Example: see GEOM_TestAll.py
1528 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
1529 RaiseIfFailed("MakeWire", self.ShapesOp)
1532 ## Create a face on the given wire.
1533 # @param theWire closed Wire or Edge to build the face on.
1534 # @param isPlanarWanted If TRUE, only planar face will be built.
1535 # If impossible, NULL object will be returned.
1536 # @return New GEOM_Object, containing the created face.
1538 # @ref tui_creation_face "Example"
1539 def MakeFace(self,theWire, isPlanarWanted):
1540 # Example: see GEOM_TestAll.py
1541 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
1542 RaiseIfFailed("MakeFace", self.ShapesOp)
1545 ## Create a face on the given wires set.
1546 # @param theWires List of closed wires or edges to build the face on.
1547 # @param isPlanarWanted If TRUE, only planar face will be built.
1548 # If impossible, NULL object will be returned.
1549 # @return New GEOM_Object, containing the created face.
1551 # @ref tui_creation_face "Example"
1552 def MakeFaceWires(self,theWires, isPlanarWanted):
1553 # Example: see GEOM_TestAll.py
1554 anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
1555 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
1558 ## Shortcut to MakeFaceWires()
1560 # @ref tui_creation_face "Example 1"
1561 # \n @ref swig_MakeFaces "Example 2"
1562 def MakeFaces(self,theWires, isPlanarWanted):
1563 # Example: see GEOM_TestOthers.py
1564 anObj = self.MakeFaceWires(theWires, isPlanarWanted)
1567 ## Create a shell from the set of faces and shells.
1568 # @param theFacesAndShells List of faces and/or shells.
1569 # @return New GEOM_Object, containing the created shell.
1571 # @ref tui_creation_shell "Example"
1572 def MakeShell(self,theFacesAndShells):
1573 # Example: see GEOM_TestAll.py
1574 anObj = self.ShapesOp.MakeShell(theFacesAndShells)
1575 RaiseIfFailed("MakeShell", self.ShapesOp)
1578 ## Create a solid, bounded by the given shells.
1579 # @param theShells Sequence of bounding shells.
1580 # @return New GEOM_Object, containing the created solid.
1582 # @ref tui_creation_solid "Example"
1583 def MakeSolid(self,theShells):
1584 # Example: see GEOM_TestAll.py
1585 anObj = self.ShapesOp.MakeSolidShells(theShells)
1586 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
1589 ## Create a compound of the given shapes.
1590 # @param theShapes List of shapes to put in compound.
1591 # @return New GEOM_Object, containing the created compound.
1593 # @ref tui_creation_compound "Example"
1594 def MakeCompound(self,theShapes):
1595 # Example: see GEOM_TestAll.py
1596 anObj = self.ShapesOp.MakeCompound(theShapes)
1597 RaiseIfFailed("MakeCompound", self.ShapesOp)
1600 # end of l3_advanced
1603 ## @addtogroup l2_measure
1606 ## Gives quantity of faces in the given shape.
1607 # @param theShape Shape to count faces of.
1608 # @return Quantity of faces.
1610 # @ref swig_NumberOf "Example"
1611 def NumberOfFaces(self, theShape):
1612 # Example: see GEOM_TestOthers.py
1613 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
1614 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
1617 ## Gives quantity of edges in the given shape.
1618 # @param theShape Shape to count edges of.
1619 # @return Quantity of edges.
1621 # @ref swig_NumberOf "Example"
1622 def NumberOfEdges(self, theShape):
1623 # Example: see GEOM_TestOthers.py
1624 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
1625 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
1628 ## Gives quantity of subshapes of type theShapeType in the given shape.
1629 # @param theShape Shape to count subshapes of.
1630 # @param theShapeType Type of subshapes to count.
1631 # @return Quantity of subshapes of given type.
1633 # @ref swig_NumberOf "Example"
1634 def NumberOfSubShapes(self, theShape, theShapeType):
1635 # Example: see GEOM_TestOthers.py
1636 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
1637 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
1640 ## Gives quantity of solids in the given shape.
1641 # @param theShape Shape to count solids in.
1642 # @return Quantity of solids.
1644 # @ref swig_NumberOf "Example"
1645 def NumberOfSolids(self, theShape):
1646 # Example: see GEOM_TestOthers.py
1647 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, ShapeType["SOLID"])
1648 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
1654 ## @addtogroup l3_healing
1657 ## Reverses an orientation the given shape.
1658 # @param theShape Shape to be reversed.
1659 # @return The reversed copy of theShape.
1661 # @ref swig_ChangeOrientation "Example"
1662 def ChangeOrientation(self,theShape):
1663 # Example: see GEOM_TestAll.py
1664 anObj = self.ShapesOp.ChangeOrientation(theShape)
1665 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
1668 ## Shortcut to ChangeOrientation()
1670 # @ref swig_OrientationChange "Example"
1671 def OrientationChange(self,theShape):
1672 # Example: see GEOM_TestOthers.py
1673 anObj = self.ChangeOrientation(theShape)
1679 ## @addtogroup l4_obtain
1682 ## Retrieve all free faces from the given shape.
1683 # Free face is a face, which is not shared between two shells of the shape.
1684 # @param theShape Shape to find free faces in.
1685 # @return List of IDs of all free faces, contained in theShape.
1687 # @ref tui_measurement_tools_page "Example"
1688 def GetFreeFacesIDs(self,theShape):
1689 # Example: see GEOM_TestOthers.py
1690 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
1691 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
1694 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
1695 # @param theShape1 Shape to find sub-shapes in.
1696 # @param theShape2 Shape to find shared sub-shapes with.
1697 # @param theShapeType Type of sub-shapes to be retrieved.
1698 # @return List of sub-shapes of theShape1, shared with theShape2.
1700 # @ref swig_GetSharedShapes "Example"
1701 def GetSharedShapes(self,theShape1, theShape2, theShapeType):
1702 # Example: see GEOM_TestOthers.py
1703 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
1704 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
1707 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
1708 # situated relatively the specified plane by the certain way,
1709 # defined through <VAR>theState</VAR> parameter.
1710 # @param theShape Shape to find sub-shapes of.
1711 # @param theShapeType Type of sub-shapes to be retrieved.
1712 # @param theAx1 Vector (or line, or linear edge), specifying normal
1713 # direction and location of the plane to find shapes on.
1714 # @param theState The state of the subshapes to find. It can be one of
1715 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1716 # @return List of all found sub-shapes.
1718 # @ref swig_GetShapesOnPlane "Example"
1719 def GetShapesOnPlane(self,theShape, theShapeType, theAx1, theState):
1720 # Example: see GEOM_TestOthers.py
1721 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
1722 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
1725 ## Works like the above method, but returns list of sub-shapes indices
1727 # @ref swig_GetShapesOnPlaneIDs "Example"
1728 def GetShapesOnPlaneIDs(self,theShape, theShapeType, theAx1, theState):
1729 # Example: see GEOM_TestOthers.py
1730 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
1731 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
1734 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
1735 # situated relatively the specified plane by the certain way,
1736 # defined through <VAR>theState</VAR> parameter.
1737 # @param theShape Shape to find sub-shapes of.
1738 # @param theShapeType Type of sub-shapes to be retrieved.
1739 # @param theAx1 Vector (or line, or linear edge), specifying normal
1740 # direction of the plane to find shapes on.
1741 # @param thePnt Point specifying location of the plane to find shapes on.
1742 # @param theState The state of the subshapes to find. It can be one of
1743 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1744 # @return List of all found sub-shapes.
1746 # @ref swig_GetShapesOnPlaneWithLocation "Example"
1747 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState):
1748 # Example: see GEOM_TestOthers.py
1749 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
1750 theAx1, thePnt, theState)
1751 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
1754 ## Works like the above method, but returns list of sub-shapes indices
1756 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
1757 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
1758 # Example: see GEOM_TestOthers.py
1759 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
1760 theAx1, thePnt, theState)
1761 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
1764 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1765 # the specified cylinder by the certain way, defined through \a theState parameter.
1766 # @param theShape Shape to find sub-shapes of.
1767 # @param theShapeType Type of sub-shapes to be retrieved.
1768 # @param theAxis Vector (or line, or linear edge), specifying
1769 # axis of the cylinder to find shapes on.
1770 # @param theRadius Radius of the cylinder to find shapes on.
1771 # @param theState The state of the subshapes to find. It can be one of
1772 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1773 # @return List of all found sub-shapes.
1775 # @ref swig_GetShapesOnCylinder "Example"
1776 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState):
1777 # Example: see GEOM_TestOthers.py
1778 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
1779 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
1782 ## Works like the above method, but returns list of sub-shapes indices
1784 # @ref swig_GetShapesOnCylinderIDs "Example"
1785 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
1786 # Example: see GEOM_TestOthers.py
1787 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
1788 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
1791 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1792 # the specified cylinder by the certain way, defined through \a theState parameter.
1793 # @param theShape Shape to find sub-shapes of.
1794 # @param theShapeType Type of sub-shapes to be retrieved.
1795 # @param theAxis Vector (or line, or linear edge), specifying
1796 # axis of the cylinder to find shapes on.
1797 # @param thePnt Point specifying location of the bottom of the cylinder.
1798 # @param theRadius Radius of the cylinder to find shapes on.
1799 # @param theState The state of the subshapes to find. It can be one of
1800 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1801 # @return List of all found sub-shapes.
1803 # @ref swig_GetShapesOnCylinderWithLocation "Example"
1804 def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
1805 # Example: see GEOM_TestOthers.py
1806 aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
1807 RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
1810 ## Works like the above method, but returns list of sub-shapes indices
1812 # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
1813 def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
1814 # Example: see GEOM_TestOthers.py
1815 aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
1816 RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
1819 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1820 # the specified sphere by the certain way, defined through \a theState parameter.
1821 # @param theShape Shape to find sub-shapes of.
1822 # @param theShapeType Type of sub-shapes to be retrieved.
1823 # @param theCenter Point, specifying center of the sphere to find shapes on.
1824 # @param theRadius Radius of the sphere to find shapes on.
1825 # @param theState The state of the subshapes to find. It can be one of
1826 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1827 # @return List of all found sub-shapes.
1829 # @ref swig_GetShapesOnSphere "Example"
1830 def GetShapesOnSphere(self,theShape, theShapeType, theCenter, theRadius, theState):
1831 # Example: see GEOM_TestOthers.py
1832 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
1833 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
1836 ## Works like the above method, but returns list of sub-shapes indices
1838 # @ref swig_GetShapesOnSphereIDs "Example"
1839 def GetShapesOnSphereIDs(self,theShape, theShapeType, theCenter, theRadius, theState):
1840 # Example: see GEOM_TestOthers.py
1841 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
1842 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
1845 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1846 # the specified quadrangle by the certain way, defined through \a theState parameter.
1847 # @param theShape Shape to find sub-shapes of.
1848 # @param theShapeType Type of sub-shapes to be retrieved.
1849 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
1850 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
1851 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
1852 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
1853 # @param theState The state of the subshapes to find. It can be one of
1854 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1855 # @return List of all found sub-shapes.
1857 # @ref swig_GetShapesOnQuadrangle "Example"
1858 def GetShapesOnQuadrangle(self, theShape, theShapeType,
1859 theTopLeftPoint, theTopRigthPoint,
1860 theBottomLeftPoint, theBottomRigthPoint, theState):
1861 # Example: see GEOM_TestOthers.py
1862 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
1863 theTopLeftPoint, theTopRigthPoint,
1864 theBottomLeftPoint, theBottomRigthPoint, theState)
1865 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
1868 ## Works like the above method, but returns list of sub-shapes indices
1870 # @ref swig_GetShapesOnQuadrangleIDs "Example"
1871 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
1872 theTopLeftPoint, theTopRigthPoint,
1873 theBottomLeftPoint, theBottomRigthPoint, theState):
1874 # Example: see GEOM_TestOthers.py
1875 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
1876 theTopLeftPoint, theTopRigthPoint,
1877 theBottomLeftPoint, theBottomRigthPoint, theState)
1878 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
1881 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1882 # the specified \a theBox by the certain way, defined through \a theState parameter.
1883 # @param theBox Shape for relative comparing.
1884 # @param theShape Shape to find sub-shapes of.
1885 # @param theShapeType Type of sub-shapes to be retrieved.
1886 # @param theState The state of the subshapes to find. It can be one of
1887 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1888 # @return List of all found sub-shapes.
1890 # @ref swig_GetShapesOnBox "Example"
1891 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState):
1892 # Example: see GEOM_TestOthers.py
1893 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
1894 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
1897 ## Works like the above method, but returns list of sub-shapes indices
1899 # @ref swig_GetShapesOnBoxIDs "Example"
1900 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
1901 # Example: see GEOM_TestOthers.py
1902 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
1903 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
1906 ## Find in \a theShape all sub-shapes of type \a theShapeType,
1907 # situated relatively the specified \a theCheckShape by the
1908 # certain way, defined through \a theState parameter.
1909 # @param theCheckShape Shape for relative comparing. It must be a solid.
1910 # @param theShape Shape to find sub-shapes of.
1911 # @param theShapeType Type of sub-shapes to be retrieved.
1912 # @param theState The state of the subshapes to find. It can be one of
1913 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1914 # @return List of all found sub-shapes.
1916 # @ref swig_GetShapesOnShape "Example"
1917 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState):
1918 # Example: see GEOM_TestOthers.py
1919 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
1920 theShapeType, theState)
1921 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
1924 ## Works like the above method, but returns result as compound
1926 # @ref swig_GetShapesOnShapeAsCompound "Example"
1927 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState):
1928 # Example: see GEOM_TestOthers.py
1929 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
1930 theShapeType, theState)
1931 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
1934 ## Works like the above method, but returns list of sub-shapes indices
1936 # @ref swig_GetShapesOnShapeIDs "Example"
1937 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
1938 # Example: see GEOM_TestOthers.py
1939 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
1940 theShapeType, theState)
1941 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
1944 ## Get sub-shape(s) of theShapeWhere, which are
1945 # coincident with \a theShapeWhat or could be a part of it.
1946 # @param theShapeWhere Shape to find sub-shapes of.
1947 # @param theShapeWhat Shape, specifying what to find.
1948 # @return Group of all found sub-shapes or a single found sub-shape.
1950 # @ref swig_GetInPlace "Example"
1951 def GetInPlace(self,theShapeWhere, theShapeWhat):
1952 # Example: see GEOM_TestOthers.py
1953 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
1954 RaiseIfFailed("GetInPlace", self.ShapesOp)
1957 ## Get sub-shape(s) of \a theShapeWhere, which are
1958 # coincident with \a theShapeWhat or could be a part of it.
1960 # Implementation of this method is based on a saved history of an operation,
1961 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
1962 # arguments (an argument shape or a sub-shape of an argument shape).
1963 # The operation could be the Partition or one of boolean operations,
1964 # performed on simple shapes (not on compounds).
1966 # @param theShapeWhere Shape to find sub-shapes of.
1967 # @param theShapeWhat Shape, specifying what to find (must be in the
1968 # building history of the ShapeWhere).
1969 # @return Group of all found sub-shapes or a single found sub-shape.
1971 # @ref swig_GetInPlace "Example"
1972 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat):
1973 # Example: see GEOM_TestOthers.py
1974 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
1975 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
1978 ## Get sub-shape of theShapeWhere, which is
1979 # equal to \a theShapeWhat.
1980 # @param theShapeWhere Shape to find sub-shape of.
1981 # @param theShapeWhat Shape, specifying what to find.
1982 # @return New GEOM_Object for found sub-shape.
1984 # @ref swig_GetSame "Example"
1985 def GetSame(self,theShapeWhere, theShapeWhat):
1986 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
1987 RaiseIfFailed("GetSame", self.ShapesOp)
1993 ## @addtogroup l4_access
1996 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
1997 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
1999 # @ref swig_all_decompose "Example"
2000 def GetSubShape(self, aShape, ListOfID):
2001 # Example: see GEOM_TestAll.py
2002 anObj = self.AddSubShape(aShape,ListOfID)
2005 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
2007 # @ref swig_all_decompose "Example"
2008 def GetSubShapeID(self, aShape, aSubShape):
2009 # Example: see GEOM_TestAll.py
2010 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
2011 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
2017 ## @addtogroup l4_decompose
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 sub-shapes of type theShapeType, contained in theShape.
2025 # @ref swig_all_decompose "Example"
2026 def SubShapeAll(self, aShape, aType):
2027 # Example: see GEOM_TestAll.py
2028 ListObj = self.ShapesOp.MakeExplode(aShape,aType,0)
2029 RaiseIfFailed("MakeExplode", self.ShapesOp)
2032 ## Explode a shape on subshapes of a given type.
2033 # @param aShape Shape to be exploded.
2034 # @param aType Type of sub-shapes to be retrieved.
2035 # @return List of IDs of sub-shapes.
2037 # @ref swig_all_decompose "Example"
2038 def SubShapeAllIDs(self, aShape, aType):
2039 ListObj = self.ShapesOp.SubShapeAllIDs(aShape,aType,0)
2040 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
2043 ## Explode a shape on subshapes of a given type.
2044 # Sub-shapes will be sorted by coordinates of their gravity centers.
2045 # @param aShape Shape to be exploded.
2046 # @param aType Type of sub-shapes to be retrieved.
2047 # @return List of sub-shapes of type theShapeType, contained in theShape.
2049 # @ref swig_SubShapeAllSorted "Example"
2050 def SubShapeAllSorted(self, aShape, aType):
2051 # Example: see GEOM_TestAll.py
2052 ListObj = self.ShapesOp.MakeExplode(aShape,aType,1)
2053 RaiseIfFailed("MakeExplode", self.ShapesOp)
2056 ## Explode a shape on subshapes of a given type.
2057 # Sub-shapes will be sorted by coordinates of their gravity centers.
2058 # @param aShape Shape to be exploded.
2059 # @param aType Type of sub-shapes to be retrieved.
2060 # @return List of IDs of sub-shapes.
2062 # @ref swig_all_decompose "Example"
2063 def SubShapeAllSortedIDs(self, aShape, aType):
2064 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape,aType,1)
2065 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
2068 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
2069 # selected by they indices in list of all sub-shapes of type <VAR>aType</VAR>.
2070 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
2072 # @ref swig_all_decompose "Example"
2073 def SubShape(self, aShape, aType, ListOfInd):
2074 # Example: see GEOM_TestAll.py
2076 AllShapeList = self.SubShapeAll(aShape, aType)
2077 for ind in ListOfInd:
2078 ListOfIDs.append(self.GetSubShapeID(aShape, AllShapeList[ind - 1]))
2079 anObj = self.GetSubShape(aShape, ListOfIDs)
2082 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
2083 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
2084 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
2086 # @ref swig_all_decompose "Example"
2087 def SubShapeSorted(self,aShape, aType, ListOfInd):
2088 # Example: see GEOM_TestAll.py
2090 AllShapeList = self.SubShapeAllSorted(aShape, aType)
2091 for ind in ListOfInd:
2092 ListOfIDs.append(self.GetSubShapeID(aShape, AllShapeList[ind - 1]))
2093 anObj = self.GetSubShape(aShape, ListOfIDs)
2096 # end of l4_decompose
2099 ## @addtogroup l3_healing
2102 ## Apply a sequence of Shape Healing operators to the given object.
2103 # @param theShape Shape to be processed.
2104 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
2105 # @param theParameters List of names of parameters
2106 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
2107 # @param theValues List of values of parameters, in the same order
2108 # as parameters are listed in <VAR>theParameters</VAR> list.
2109 # @return New GEOM_Object, containing processed shape.
2111 # @ref tui_shape_processing "Example"
2112 def ProcessShape(self,theShape, theOperators, theParameters, theValues):
2113 # Example: see GEOM_TestHealing.py
2114 theValues,Parameters = ParseList(theValues)
2115 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
2116 RaiseIfFailed("ProcessShape", self.HealOp)
2117 for string in (theOperators + theParameters):
2118 Parameters = ":" + Parameters
2120 anObj.SetParameters(Parameters)
2123 ## Remove faces from the given object (shape).
2124 # @param theObject Shape to be processed.
2125 # @param theFaces Indices of faces to be removed, if EMPTY then the method
2126 # removes ALL faces of the given object.
2127 # @return New GEOM_Object, containing processed shape.
2129 # @ref tui_suppress_faces "Example"
2130 def SuppressFaces(self,theObject, theFaces):
2131 # Example: see GEOM_TestHealing.py
2132 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
2133 RaiseIfFailed("SuppressFaces", self.HealOp)
2136 ## Sewing of some shapes into single shape.
2138 # @ref tui_sewing "Example"
2139 def MakeSewing(self, ListShape, theTolerance):
2140 # Example: see GEOM_TestHealing.py
2141 comp = self.MakeCompound(ListShape)
2142 anObj = self.Sew(comp, theTolerance)
2145 ## Sewing of the given object.
2146 # @param theObject Shape to be processed.
2147 # @param theTolerance Required tolerance value.
2148 # @return New GEOM_Object, containing processed shape.
2149 def Sew(self, theObject, theTolerance):
2150 # Example: see MakeSewing() above
2151 theTolerance,Parameters = ParseParameters(theTolerance)
2152 anObj = self.HealOp.Sew(theObject, theTolerance)
2153 RaiseIfFailed("Sew", self.HealOp)
2154 anObj.SetParameters(Parameters)
2157 ## Remove internal wires and edges from the given object (face).
2158 # @param theObject Shape to be processed.
2159 # @param theWires Indices of wires to be removed, if EMPTY then the method
2160 # removes ALL internal wires of the given object.
2161 # @return New GEOM_Object, containing processed shape.
2163 # @ref tui_suppress_internal_wires "Example"
2164 def SuppressInternalWires(self,theObject, theWires):
2165 # Example: see GEOM_TestHealing.py
2166 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
2167 RaiseIfFailed("RemoveIntWires", self.HealOp)
2170 ## Remove internal closed contours (holes) from the given object.
2171 # @param theObject Shape to be processed.
2172 # @param theWires Indices of wires to be removed, if EMPTY then the method
2173 # removes ALL internal holes of the given object
2174 # @return New GEOM_Object, containing processed shape.
2176 # @ref tui_suppress_holes "Example"
2177 def SuppressHoles(self,theObject, theWires):
2178 # Example: see GEOM_TestHealing.py
2179 anObj = self.HealOp.FillHoles(theObject, theWires)
2180 RaiseIfFailed("FillHoles", self.HealOp)
2183 ## Close an open wire.
2184 # @param theObject Shape to be processed.
2185 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
2186 # if -1, then <VAR>theObject</VAR> itself is a wire.
2187 # @param isCommonVertex If TRUE : closure by creation of a common vertex,
2188 # If FALS : closure by creation of an edge between ends.
2189 # @return New GEOM_Object, containing processed shape.
2191 # @ref tui_close_contour "Example"
2192 def CloseContour(self,theObject, theWires, isCommonVertex):
2193 # Example: see GEOM_TestHealing.py
2194 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
2195 RaiseIfFailed("CloseContour", self.HealOp)
2198 ## Addition of a point to a given edge object.
2199 # @param theObject Shape to be processed.
2200 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
2201 # if -1, then theObject itself is the edge.
2202 # @param theValue Value of parameter on edge or length parameter,
2203 # depending on \a isByParameter.
2204 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1],
2205 # if FALSE : \a theValue is treated as a length parameter [0..1]
2206 # @return New GEOM_Object, containing processed shape.
2208 # @ref tui_add_point_on_edge "Example"
2209 def DivideEdge(self,theObject, theEdgeIndex, theValue, isByParameter):
2210 # Example: see GEOM_TestHealing.py
2211 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
2212 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
2213 RaiseIfFailed("DivideEdge", self.HealOp)
2214 anObj.SetParameters(Parameters)
2217 ## Change orientation of the given object. Updates given shape.
2218 # @param theObject Shape to be processed.
2220 # @ref swig_todo "Example"
2221 def ChangeOrientationShell(self,theObject):
2222 theObject = self.HealOp.ChangeOrientation(theObject)
2223 RaiseIfFailed("ChangeOrientation", self.HealOp)
2226 ## Change orientation of the given object.
2227 # @param theObject Shape to be processed.
2228 # @return New GEOM_Object, containing processed shape.
2230 # @ref swig_todo "Example"
2231 def ChangeOrientationShellCopy(self,theObject):
2232 anObj = self.HealOp.ChangeOrientationCopy(theObject)
2233 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
2236 ## Get a list of wires (wrapped in GEOM_Object-s),
2237 # that constitute a free boundary of the given shape.
2238 # @param theObject Shape to get free boundary of.
2239 # @return [status, theClosedWires, theOpenWires]
2240 # status: FALSE, if an error(s) occured during the method execution.
2241 # theClosedWires: Closed wires on the free boundary of the given shape.
2242 # theOpenWires: Open wires on the free boundary of the given shape.
2244 # @ref tui_measurement_tools_page "Example"
2245 def GetFreeBoundary(self,theObject):
2246 # Example: see GEOM_TestHealing.py
2247 anObj = self.HealOp.GetFreeBoundary(theObject)
2248 RaiseIfFailed("GetFreeBoundary", self.HealOp)
2251 ## Replace coincident faces in theShape by one face.
2252 # @param theShape Initial shape.
2253 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
2254 # @param doKeepNonSolids If FALSE, only solids will present in the result,
2255 # otherwise all initial shapes.
2256 # @return New GEOM_Object, containing a copy of theShape without coincident faces.
2258 # @ref tui_glue_faces "Example"
2259 def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True):
2260 # Example: see GEOM_Spanner.py
2261 theTolerance,Parameters = ParseParameters(theTolerance)
2262 anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
2264 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
2265 anObj.SetParameters(Parameters)
2268 ## Find coincident faces in theShape for possible gluing.
2269 # @param theShape Initial shape.
2270 # @param theTolerance Maximum distance between faces,
2271 # which can be considered as coincident.
2274 # @ref swig_todo "Example"
2275 def GetGlueFaces(self, theShape, theTolerance):
2276 # Example: see GEOM_Spanner.py
2277 anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
2278 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
2281 ## Replace coincident faces in theShape by one face
2282 # in compliance with given list of faces
2283 # @param theShape Initial shape.
2284 # @param theTolerance Maximum distance between faces,
2285 # which can be considered as coincident.
2286 # @param theFaces List of faces for gluing.
2287 # @param doKeepNonSolids If FALSE, only solids will present in the result,
2288 # otherwise all initial shapes.
2289 # @return New GEOM_Object, containing a copy of theShape
2290 # without some faces.
2292 # @ref swig_todo "Example"
2293 def MakeGlueFacesByList(self, theShape, theTolerance, theFaces, doKeepNonSolids=True):
2294 # Example: see GEOM_Spanner.py
2295 anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces, doKeepNonSolids)
2297 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
2303 ## @addtogroup l3_boolean Boolean Operations
2306 # -----------------------------------------------------------------------------
2307 # Boolean (Common, Cut, Fuse, Section)
2308 # -----------------------------------------------------------------------------
2310 ## Perform one of boolean operations on two given shapes.
2311 # @param theShape1 First argument for boolean operation.
2312 # @param theShape2 Second argument for boolean operation.
2313 # @param theOperation Indicates the operation to be done:
2314 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
2315 # @return New GEOM_Object, containing the result shape.
2317 # @ref tui_fuse "Example"
2318 def MakeBoolean(self,theShape1, theShape2, theOperation):
2319 # Example: see GEOM_TestAll.py
2320 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation)
2321 RaiseIfFailed("MakeBoolean", self.BoolOp)
2324 ## Shortcut to MakeBoolean(s1, s2, 1)
2326 # @ref tui_common "Example 1"
2327 # \n @ref swig_MakeCommon "Example 2"
2328 def MakeCommon(self, s1, s2):
2329 # Example: see GEOM_TestOthers.py
2330 return self.MakeBoolean(s1, s2, 1)
2332 ## Shortcut to MakeBoolean(s1, s2, 2)
2334 # @ref tui_cut "Example 1"
2335 # \n @ref swig_MakeCommon "Example 2"
2336 def MakeCut(self, s1, s2):
2337 # Example: see GEOM_TestOthers.py
2338 return self.MakeBoolean(s1, s2, 2)
2340 ## Shortcut to MakeBoolean(s1, s2, 3)
2342 # @ref tui_fuse "Example 1"
2343 # \n @ref swig_MakeCommon "Example 2"
2344 def MakeFuse(self, s1, s2):
2345 # Example: see GEOM_TestOthers.py
2346 return self.MakeBoolean(s1, s2, 3)
2348 ## Shortcut to MakeBoolean(s1, s2, 4)
2350 # @ref tui_section "Example 1"
2351 # \n @ref swig_MakeCommon "Example 2"
2352 def MakeSection(self, s1, s2):
2353 # Example: see GEOM_TestOthers.py
2354 return self.MakeBoolean(s1, s2, 4)
2359 ## @addtogroup l3_basic_op
2362 ## Perform partition operation.
2363 # @param ListShapes Shapes to be intersected.
2364 # @param ListTools Shapes to intersect theShapes.
2365 # !!!NOTE: Each compound from ListShapes and ListTools will be exploded
2366 # in order to avoid possible intersection between shapes from
2368 # @param Limit Type of resulting shapes (corresponding to TopAbs_ShapeEnum).
2369 # @param KeepNonlimitShapes: if this parameter == 0 - only shapes with
2370 # type <= Limit are kept in the result,
2371 # else - shapes with type > Limit are kept
2372 # also (if they exist)
2374 # After implementation new version of PartitionAlgo (October 2006)
2375 # other parameters are ignored by current functionality. They are kept
2376 # in this function only for support old versions.
2377 # Ignored parameters:
2378 # @param ListKeepInside Shapes, outside which the results will be deleted.
2379 # Each shape from theKeepInside must belong to theShapes also.
2380 # @param ListRemoveInside Shapes, inside which the results will be deleted.
2381 # Each shape from theRemoveInside must belong to theShapes also.
2382 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
2383 # @param ListMaterials Material indices for each shape. Make sence,
2384 # only if theRemoveWebs is TRUE.
2386 # @return New GEOM_Object, containing the result shapes.
2388 # @ref tui_partition "Example"
2389 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
2390 Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
2391 KeepNonlimitShapes=0):
2392 # Example: see GEOM_TestAll.py
2393 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
2394 ListKeepInside, ListRemoveInside,
2395 Limit, RemoveWebs, ListMaterials,
2396 KeepNonlimitShapes);
2397 RaiseIfFailed("MakePartition", self.BoolOp)
2400 ## Perform partition operation.
2401 # This method may be useful if it is needed to make a partition for
2402 # compound contains nonintersected shapes. Performance will be better
2403 # since intersection between shapes from compound is not performed.
2405 # Description of all parameters as in previous method MakePartition()
2407 # !!!NOTE: Passed compounds (via ListShapes or via ListTools)
2408 # have to consist of nonintersecting shapes.
2410 # @return New GEOM_Object, containing the result shapes.
2412 # @ref swig_todo "Example"
2413 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
2414 ListKeepInside=[], ListRemoveInside=[],
2415 Limit=ShapeType["SHAPE"], RemoveWebs=0,
2416 ListMaterials=[], KeepNonlimitShapes=0):
2417 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
2418 ListKeepInside, ListRemoveInside,
2419 Limit, RemoveWebs, ListMaterials,
2420 KeepNonlimitShapes);
2421 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
2424 ## Shortcut to MakePartition()
2426 # @ref tui_partition "Example 1"
2427 # \n @ref swig_Partition "Example 2"
2428 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
2429 Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
2430 KeepNonlimitShapes=0):
2431 # Example: see GEOM_TestOthers.py
2432 anObj = self.MakePartition(ListShapes, ListTools,
2433 ListKeepInside, ListRemoveInside,
2434 Limit, RemoveWebs, ListMaterials,
2435 KeepNonlimitShapes);
2438 ## Perform partition of the Shape with the Plane
2439 # @param theShape Shape to be intersected.
2440 # @param thePlane Tool shape, to intersect theShape.
2441 # @return New GEOM_Object, containing the result shape.
2443 # @ref tui_partition "Example"
2444 def MakeHalfPartition(self,theShape, thePlane):
2445 # Example: see GEOM_TestAll.py
2446 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
2447 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
2450 # end of l3_basic_op
2453 ## @addtogroup l3_transform
2456 ## Translate the given object along the vector, specified
2457 # by its end points, creating its copy before the translation.
2458 # @param theObject The object to be translated.
2459 # @param thePoint1 Start point of translation vector.
2460 # @param thePoint2 End point of translation vector.
2461 # @return New GEOM_Object, containing the translated object.
2463 # @ref tui_translation "Example 1"
2464 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
2465 def MakeTranslationTwoPoints(self,theObject, thePoint1, thePoint2):
2466 # Example: see GEOM_TestAll.py
2467 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
2468 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
2471 ## Translate the given object along the vector, specified by its components.
2472 # @param theObject The object to be translated.
2473 # @param theDX,theDY,theDZ Components of translation vector.
2474 # @return Translated GEOM_Object.
2476 # @ref tui_translation "Example"
2477 def TranslateDXDYDZ(self,theObject, theDX, theDY, theDZ):
2478 # Example: see GEOM_TestAll.py
2479 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
2480 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
2481 anObj.SetParameters(Parameters)
2482 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
2485 ## Translate the given object along the vector, specified
2486 # by its components, creating its copy before the translation.
2487 # @param theObject The object to be translated.
2488 # @param theDX,theDY,theDZ Components of translation vector.
2489 # @return New GEOM_Object, containing the translated object.
2491 # @ref tui_translation "Example"
2492 def MakeTranslation(self,theObject, theDX, theDY, theDZ):
2493 # Example: see GEOM_TestAll.py
2494 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
2495 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
2496 anObj.SetParameters(Parameters)
2497 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
2500 ## Translate the given object along the given vector,
2501 # creating its copy before the translation.
2502 # @param theObject The object to be translated.
2503 # @param theVector The translation vector.
2504 # @return New GEOM_Object, containing the translated object.
2506 # @ref tui_translation "Example"
2507 def MakeTranslationVector(self,theObject, theVector):
2508 # Example: see GEOM_TestAll.py
2509 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
2510 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
2513 ## Translate the given object along the given vector on given distance.
2514 # @param theObject The object to be translated.
2515 # @param theVector The translation vector.
2516 # @param theDistance The translation distance.
2517 # @param theCopy Flag used to translate object itself or create a copy.
2518 # @return Translated GEOM_Object.
2520 # @ref tui_translation "Example"
2521 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy):
2522 # Example: see GEOM_TestAll.py
2523 theDistance,Parameters = ParseParameters(theDistance)
2524 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
2525 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
2526 anObj.SetParameters(Parameters)
2529 ## Translate the given object along the given vector on given distance,
2530 # creating its copy before the translation.
2531 # @param theObject The object to be translated.
2532 # @param theVector The translation vector.
2533 # @param theDistance The translation distance.
2534 # @return New GEOM_Object, containing the translated object.
2536 # @ref tui_translation "Example"
2537 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance):
2538 # Example: see GEOM_TestAll.py
2539 theDistance,Parameters = ParseParameters(theDistance)
2540 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
2541 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
2542 anObj.SetParameters(Parameters)
2545 ## Rotate the given object around the given axis on the given angle.
2546 # @param theObject The object to be rotated.
2547 # @param theAxis Rotation axis.
2548 # @param theAngle Rotation angle in radians.
2549 # @return Rotated GEOM_Object.
2551 # @ref tui_rotation "Example"
2552 def Rotate(self,theObject, theAxis, theAngle):
2553 # Example: see GEOM_TestAll.py
2555 if isinstance(theAngle,str):
2557 theAngle, Parameters = ParseParameters(theAngle)
2559 theAngle = theAngle*math.pi/180.0
2560 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
2561 RaiseIfFailed("RotateCopy", self.TrsfOp)
2562 anObj.SetParameters(Parameters)
2565 ## Rotate the given object around the given axis
2566 # on the given angle, creating its copy before the rotatation.
2567 # @param theObject The object to be rotated.
2568 # @param theAxis Rotation axis.
2569 # @param theAngle Rotation angle in radians.
2570 # @return New GEOM_Object, containing the rotated object.
2572 # @ref tui_rotation "Example"
2573 def MakeRotation(self,theObject, theAxis, theAngle):
2574 # Example: see GEOM_TestAll.py
2576 if isinstance(theAngle,str):
2578 theAngle, Parameters = ParseParameters(theAngle)
2580 theAngle = theAngle*math.pi/180.0
2581 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
2582 RaiseIfFailed("RotateCopy", self.TrsfOp)
2583 anObj.SetParameters(Parameters)
2586 ## Rotate given object around vector perpendicular to plane
2587 # containing three points, creating its copy before the rotatation.
2588 # @param theObject The object to be rotated.
2589 # @param theCentPoint central point - the axis is the vector perpendicular to the plane
2590 # containing the three points.
2591 # @param thePoint1,thePoint2 - in a perpendicular plane of the axis.
2592 # @return New GEOM_Object, containing the rotated object.
2594 # @ref tui_rotation "Example"
2595 def MakeRotationThreePoints(self,theObject, theCentPoint, thePoint1, thePoint2):
2596 # Example: see GEOM_TestAll.py
2597 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
2598 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
2601 ## Scale the given object by the factor, creating its copy before the scaling.
2602 # @param theObject The object to be scaled.
2603 # @param thePoint Center point for scaling.
2604 # Passing None for it means scaling relatively the origin of global CS.
2605 # @param theFactor Scaling factor value.
2606 # @return New GEOM_Object, containing the scaled shape.
2608 # @ref tui_scale "Example"
2609 def MakeScaleTransform(self, theObject, thePoint, theFactor):
2610 # Example: see GEOM_TestAll.py
2611 theFactor, Parameters = ParseParameters(theFactor)
2612 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
2613 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
2614 anObj.SetParameters(Parameters)
2617 ## Scale the given object by different factors along coordinate axes,
2618 # creating its copy before the scaling.
2619 # @param theObject The object to be scaled.
2620 # @param thePoint Center point for scaling.
2621 # Passing None for it means scaling relatively the origin of global CS.
2622 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
2623 # @return New GEOM_Object, containing the scaled shape.
2625 # @ref swig_scale "Example"
2626 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ):
2627 # Example: see GEOM_TestAll.py
2628 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
2629 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
2630 theFactorX, theFactorY, theFactorZ)
2631 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
2632 anObj.SetParameters(Parameters)
2635 ## Create an object, symmetrical
2636 # to the given one relatively the given plane.
2637 # @param theObject The object to be mirrored.
2638 # @param thePlane Plane of symmetry.
2639 # @return New GEOM_Object, containing the mirrored shape.
2641 # @ref tui_mirror "Example"
2642 def MakeMirrorByPlane(self,theObject, thePlane):
2643 # Example: see GEOM_TestAll.py
2644 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
2645 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
2648 ## Create an object, symmetrical
2649 # to the given one relatively the given axis.
2650 # @param theObject The object to be mirrored.
2651 # @param theAxis Axis of symmetry.
2652 # @return New GEOM_Object, containing the mirrored shape.
2654 # @ref tui_mirror "Example"
2655 def MakeMirrorByAxis(self,theObject, theAxis):
2656 # Example: see GEOM_TestAll.py
2657 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
2658 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
2661 ## Create an object, symmetrical
2662 # to the given one relatively the given point.
2663 # @param theObject The object to be mirrored.
2664 # @param thePoint Point of symmetry.
2665 # @return New GEOM_Object, containing the mirrored shape.
2667 # @ref tui_mirror "Example"
2668 def MakeMirrorByPoint(self,theObject, thePoint):
2669 # Example: see GEOM_TestAll.py
2670 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
2671 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
2674 ## Modify the Location of the given object by LCS,
2675 # creating its copy before the setting.
2676 # @param theObject The object to be displaced.
2677 # @param theStartLCS Coordinate system to perform displacement from it.
2678 # If \a theStartLCS is NULL, displacement
2679 # will be performed from global CS.
2680 # If \a theObject itself is used as \a theStartLCS,
2681 # its location will be changed to \a theEndLCS.
2682 # @param theEndLCS Coordinate system to perform displacement to it.
2683 # @return New GEOM_Object, containing the displaced shape.
2685 # @ref tui_modify_location "Example"
2686 def MakePosition(self,theObject, theStartLCS, theEndLCS):
2687 # Example: see GEOM_TestAll.py
2688 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
2689 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
2692 ## Modify the Location of the given object by Path,
2693 # @param theObject The object to be displaced.
2694 # @param thePath Wire or Edge along that the object will be translated.
2695 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
2696 # @param theCopy is to create a copy objects if true.
2697 # @param theReverse - 0 for usual direction, 1 to reverse path direction.
2698 # @return New GEOM_Object, containing the displaced shape.
2700 # @ref tui_modify_location "Example"
2701 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
2702 # Example: see GEOM_TestAll.py
2703 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
2704 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
2707 ## Create new object as offset of the given one.
2708 # @param theObject The base object for the offset.
2709 # @param theOffset Offset value.
2710 # @return New GEOM_Object, containing the offset object.
2712 # @ref tui_offset "Example"
2713 def MakeOffset(self,theObject, theOffset):
2714 # Example: see GEOM_TestAll.py
2715 theOffset, Parameters = ParseParameters(theOffset)
2716 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
2717 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
2718 anObj.SetParameters(Parameters)
2721 # -----------------------------------------------------------------------------
2723 # -----------------------------------------------------------------------------
2725 ## Translate the given object along the given vector a given number times
2726 # @param theObject The object to be translated.
2727 # @param theVector Direction of the translation.
2728 # @param theStep Distance to translate on.
2729 # @param theNbTimes Quantity of translations to be done.
2730 # @return New GEOM_Object, containing compound of all
2731 # the shapes, obtained after each translation.
2733 # @ref tui_multi_translation "Example"
2734 def MakeMultiTranslation1D(self,theObject, theVector, theStep, theNbTimes):
2735 # Example: see GEOM_TestAll.py
2736 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
2737 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
2738 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
2739 anObj.SetParameters(Parameters)
2742 ## Conseqently apply two specified translations to theObject specified number of times.
2743 # @param theObject The object to be translated.
2744 # @param theVector1 Direction of the first translation.
2745 # @param theStep1 Step of the first translation.
2746 # @param theNbTimes1 Quantity of translations to be done along theVector1.
2747 # @param theVector2 Direction of the second translation.
2748 # @param theStep2 Step of the second translation.
2749 # @param theNbTimes2 Quantity of translations to be done along theVector2.
2750 # @return New GEOM_Object, containing compound of all
2751 # the shapes, obtained after each translation.
2753 # @ref tui_multi_translation "Example"
2754 def MakeMultiTranslation2D(self,theObject, theVector1, theStep1, theNbTimes1,
2755 theVector2, theStep2, theNbTimes2):
2756 # Example: see GEOM_TestAll.py
2757 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
2758 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
2759 theVector2, theStep2, theNbTimes2)
2760 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
2761 anObj.SetParameters(Parameters)
2764 ## Rotate the given object around the given axis a given number times.
2765 # Rotation angle will be 2*PI/theNbTimes.
2766 # @param theObject The object to be rotated.
2767 # @param theAxis The rotation axis.
2768 # @param theNbTimes Quantity of rotations to be done.
2769 # @return New GEOM_Object, containing compound of all the
2770 # shapes, obtained after each rotation.
2772 # @ref tui_multi_rotation "Example"
2773 def MultiRotate1D(self,theObject, theAxis, theNbTimes):
2774 # Example: see GEOM_TestAll.py
2775 theAxis, theNbTimes, Parameters = ParseParameters(theAxis, theNbTimes)
2776 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
2777 RaiseIfFailed("MultiRotate1D", self.TrsfOp)
2778 anObj.SetParameters(Parameters)
2781 ## Rotate the given object around the
2782 # given axis on the given angle a given number
2783 # times and multi-translate each rotation result.
2784 # Translation direction passes through center of gravity
2785 # of rotated shape and its projection on the rotation axis.
2786 # @param theObject The object to be rotated.
2787 # @param theAxis Rotation axis.
2788 # @param theAngle Rotation angle in graduces.
2789 # @param theNbTimes1 Quantity of rotations to be done.
2790 # @param theStep Translation distance.
2791 # @param theNbTimes2 Quantity of translations to be done.
2792 # @return New GEOM_Object, containing compound of all the
2793 # shapes, obtained after each transformation.
2795 # @ref tui_multi_rotation "Example"
2796 def MultiRotate2D(self,theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2):
2797 # Example: see GEOM_TestAll.py
2798 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
2799 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
2800 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
2801 anObj.SetParameters(Parameters)
2804 ## The same, as MultiRotate1D(), but axis is given by direction and point
2805 # @ref swig_MakeMultiRotation "Example"
2806 def MakeMultiRotation1D(self,aShape,aDir,aPoint,aNbTimes):
2807 # Example: see GEOM_TestOthers.py
2808 aVec = self.MakeLine(aPoint,aDir)
2809 anObj = self.MultiRotate1D(aShape,aVec,aNbTimes)
2812 ## The same, as MultiRotate2D(), but axis is given by direction and point
2813 # @ref swig_MakeMultiRotation "Example"
2814 def MakeMultiRotation2D(self,aShape,aDir,aPoint,anAngle,nbtimes1,aStep,nbtimes2):
2815 # Example: see GEOM_TestOthers.py
2816 aVec = self.MakeLine(aPoint,aDir)
2817 anObj = self.MultiRotate2D(aShape,aVec,anAngle,nbtimes1,aStep,nbtimes2)
2820 # end of l3_transform
2823 ## @addtogroup l3_local
2826 ## Perform a fillet on all edges of the given shape.
2827 # @param theShape Shape, to perform fillet on.
2828 # @param theR Fillet radius.
2829 # @return New GEOM_Object, containing the result shape.
2831 # @ref tui_fillet "Example 1"
2832 # \n @ref swig_MakeFilletAll "Example 2"
2833 def MakeFilletAll(self,theShape, theR):
2834 # Example: see GEOM_TestOthers.py
2835 theR,Parameters = ParseParameters(theR)
2836 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
2837 RaiseIfFailed("MakeFilletAll", self.LocalOp)
2838 anObj.SetParameters(Parameters)
2841 ## Perform a fillet on the specified edges/faces of the given shape
2842 # @param theShape Shape, to perform fillet on.
2843 # @param theR Fillet radius.
2844 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR>.
2845 # @param theListShapes Global indices of edges/faces to perform fillet on.
2846 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2847 # @return New GEOM_Object, containing the result shape.
2849 # @ref tui_fillet "Example"
2850 def MakeFillet(self,theShape, theR, theShapeType, theListShapes):
2851 # Example: see GEOM_TestAll.py
2852 theR,Parameters = ParseParameters(theR)
2854 if theShapeType == ShapeType["EDGE"]:
2855 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
2856 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
2858 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
2859 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
2860 anObj.SetParameters(Parameters)
2863 ## The same that MakeFillet but with two Fillet Radius R1 and R2
2864 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes):
2865 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
2867 if theShapeType == ShapeType["EDGE"]:
2868 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
2869 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
2871 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
2872 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
2873 anObj.SetParameters(Parameters)
2876 ## Perform a fillet on the specified edges of the given shape
2877 # @param theShape - Wire Shape to perform fillet on.
2878 # @param theR - Fillet radius.
2879 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
2880 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2881 # \note The list of vertices could be empty,
2882 # in this case fillet will done done at all vertices in wire
2883 # @return New GEOM_Object, containing the result shape.
2885 # @ref tui_fillet2d "Example"
2886 def MakeFillet1D(self,theShape, theR, theListOfVertexes):
2887 # Example: see GEOM_TestAll.py
2888 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes)
2889 RaiseIfFailed("MakeFillet1D", self.LocalOp)
2892 ## Perform a fillet on the specified edges/faces of the given shape
2893 # @param theShape - Face Shape to perform fillet on.
2894 # @param theR - Fillet radius.
2895 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
2896 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2897 # @return New GEOM_Object, containing the result shape.
2899 # @ref tui_fillet2d "Example"
2900 def MakeFillet2D(self,theShape, theR, theListOfVertexes):
2901 # Example: see GEOM_TestAll.py
2902 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
2903 RaiseIfFailed("MakeFillet2D", self.LocalOp)
2906 ## Perform a symmetric chamfer on all edges of the given shape.
2907 # @param theShape Shape, to perform chamfer on.
2908 # @param theD Chamfer size along each face.
2909 # @return New GEOM_Object, containing the result shape.
2911 # @ref tui_chamfer "Example 1"
2912 # \n @ref swig_MakeChamferAll "Example 2"
2913 def MakeChamferAll(self,theShape, theD):
2914 # Example: see GEOM_TestOthers.py
2915 theD,Parameters = ParseParameters(theD)
2916 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
2917 RaiseIfFailed("MakeChamferAll", self.LocalOp)
2918 anObj.SetParameters(Parameters)
2921 ## Perform a chamfer on edges, common to the specified faces,
2922 # with distance D1 on the Face1
2923 # @param theShape Shape, to perform chamfer on.
2924 # @param theD1 Chamfer size along \a theFace1.
2925 # @param theD2 Chamfer size along \a theFace2.
2926 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
2927 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2928 # @return New GEOM_Object, containing the result shape.
2930 # @ref tui_chamfer "Example"
2931 def MakeChamferEdge(self,theShape, theD1, theD2, theFace1, theFace2):
2932 # Example: see GEOM_TestAll.py
2933 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
2934 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
2935 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
2936 anObj.SetParameters(Parameters)
2939 ## The Same that MakeChamferEdge but with params theD is chamfer length and
2940 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
2941 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2):
2943 if isinstance(theAngle,str):
2945 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
2947 theAngle = theAngle*math.pi/180.0
2948 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
2949 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
2950 anObj.SetParameters(Parameters)
2953 ## Perform a chamfer on all edges of the specified faces,
2954 # with distance D1 on the first specified face (if several for one edge)
2955 # @param theShape Shape, to perform chamfer on.
2956 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
2957 # connected to the edge, are in \a theFaces, \a theD1
2958 # will be get along face, which is nearer to \a theFaces beginning.
2959 # @param theD2 Chamfer size along another of two faces, connected to the edge.
2960 # @param theFaces Sequence of global indices of faces of \a theShape.
2961 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2962 # @return New GEOM_Object, containing the result shape.
2964 # @ref tui_chamfer "Example"
2965 def MakeChamferFaces(self,theShape, theD1, theD2, theFaces):
2966 # Example: see GEOM_TestAll.py
2967 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
2968 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
2969 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
2970 anObj.SetParameters(Parameters)
2973 ## The Same that MakeChamferFaces but with params theD is chamfer lenght and
2974 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
2976 # @ref swig_FilletChamfer "Example"
2977 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces):
2979 if isinstance(theAngle,str):
2981 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
2983 theAngle = theAngle*math.pi/180.0
2984 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
2985 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
2986 anObj.SetParameters(Parameters)
2989 ## Perform a chamfer on edges,
2990 # with distance D1 on the first specified face (if several for one edge)
2991 # @param theShape Shape, to perform chamfer on.
2992 # @param theD1,theD2 Chamfer size
2993 # @param theEdges Sequence of edges of \a theShape.
2994 # @return New GEOM_Object, containing the result shape.
2996 # @ref swig_FilletChamfer "Example"
2997 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges):
2998 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
2999 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
3000 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
3001 anObj.SetParameters(Parameters)
3004 ## The Same that MakeChamferEdges but with params theD is chamfer lenght and
3005 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
3006 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges):
3008 if isinstance(theAngle,str):
3010 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
3012 theAngle = theAngle*math.pi/180.0
3013 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
3014 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
3015 anObj.SetParameters(Parameters)
3018 ## Shortcut to MakeChamferEdge() and MakeChamferFaces()
3020 # @ref swig_MakeChamfer "Example"
3021 def MakeChamfer(self,aShape,d1,d2,aShapeType,ListShape):
3022 # Example: see GEOM_TestOthers.py
3024 if aShapeType == ShapeType["EDGE"]:
3025 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1])
3027 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape)
3033 ## @addtogroup l3_basic_op
3036 ## Perform an Archimde operation on the given shape with given parameters.
3037 # The object presenting the resulting face is returned.
3038 # @param theShape Shape to be put in water.
3039 # @param theWeight Weight og the shape.
3040 # @param theWaterDensity Density of the water.
3041 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
3042 # @return New GEOM_Object, containing a section of \a theShape
3043 # by a plane, corresponding to water level.
3045 # @ref tui_archimede "Example"
3046 def Archimede(self,theShape, theWeight, theWaterDensity, theMeshDeflection):
3047 # Example: see GEOM_TestAll.py
3048 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
3049 theWeight,theWaterDensity,theMeshDeflection)
3050 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
3051 RaiseIfFailed("MakeArchimede", self.LocalOp)
3052 anObj.SetParameters(Parameters)
3055 # end of l3_basic_op
3058 ## @addtogroup l2_measure
3061 ## Get point coordinates
3064 # @ref tui_measurement_tools_page "Example"
3065 def PointCoordinates(self,Point):
3066 # Example: see GEOM_TestMeasures.py
3067 aTuple = self.MeasuOp.PointCoordinates(Point)
3068 RaiseIfFailed("PointCoordinates", self.MeasuOp)
3071 ## Get summarized length of all wires,
3072 # area of surface and volume of the given shape.
3073 # @param theShape Shape to define properties of.
3074 # @return [theLength, theSurfArea, theVolume]
3075 # theLength: Summarized length of all wires of the given shape.
3076 # theSurfArea: Area of surface of the given shape.
3077 # theVolume: Volume of the given shape.
3079 # @ref tui_measurement_tools_page "Example"
3080 def BasicProperties(self,theShape):
3081 # Example: see GEOM_TestMeasures.py
3082 aTuple = self.MeasuOp.GetBasicProperties(theShape)
3083 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
3086 ## Get parameters of bounding box of the given shape
3087 # @param theShape Shape to obtain bounding box of.
3088 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
3089 # Xmin,Xmax: Limits of shape along OX axis.
3090 # Ymin,Ymax: Limits of shape along OY axis.
3091 # Zmin,Zmax: Limits of shape along OZ axis.
3093 # @ref tui_measurement_tools_page "Example"
3094 def BoundingBox(self,theShape):
3095 # Example: see GEOM_TestMeasures.py
3096 aTuple = self.MeasuOp.GetBoundingBox(theShape)
3097 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
3100 ## Get inertia matrix and moments of inertia of theShape.
3101 # @param theShape Shape to calculate inertia of.
3102 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
3103 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
3104 # Ix,Iy,Iz: Moments of inertia of the given shape.
3106 # @ref tui_measurement_tools_page "Example"
3107 def Inertia(self,theShape):
3108 # Example: see GEOM_TestMeasures.py
3109 aTuple = self.MeasuOp.GetInertia(theShape)
3110 RaiseIfFailed("GetInertia", self.MeasuOp)
3113 ## Get minimal distance between the given shapes.
3114 # @param theShape1,theShape2 Shapes to find minimal distance between.
3115 # @return Value of the minimal distance between the given shapes.
3117 # @ref tui_measurement_tools_page "Example"
3118 def MinDistance(self, theShape1, theShape2):
3119 # Example: see GEOM_TestMeasures.py
3120 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
3121 RaiseIfFailed("GetMinDistance", self.MeasuOp)
3124 ## Get minimal distance between the given shapes.
3125 # @param theShape1,theShape2 Shapes to find minimal distance between.
3126 # @return Value of the minimal distance between the given shapes.
3128 # @ref swig_all_measure "Example"
3129 def MinDistanceComponents(self, theShape1, theShape2):
3130 # Example: see GEOM_TestMeasures.py
3131 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
3132 RaiseIfFailed("GetMinDistance", self.MeasuOp)
3133 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
3136 ## Get angle between the given shapes in degrees.
3137 # @param theShape1,theShape2 Lines or linear edges to find angle between.
3138 # @return Value of the angle between the given shapes in degrees.
3140 # @ref tui_measurement_tools_page "Example"
3141 def GetAngle(self, theShape1, theShape2):
3142 # Example: see GEOM_TestMeasures.py
3143 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
3144 RaiseIfFailed("GetAngle", self.MeasuOp)
3146 ## Get angle between the given shapes in radians.
3147 # @param theShape1,theShape2 Lines or linear edges to find angle between.
3148 # @return Value of the angle between the given shapes in radians.
3150 # @ref tui_measurement_tools_page "Example"
3151 def GetAngleRadians(self, theShape1, theShape2):
3152 # Example: see GEOM_TestMeasures.py
3153 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
3154 RaiseIfFailed("GetAngle", self.MeasuOp)
3157 ## @name Curve Curvature Measurement
3158 # Methods for receiving radius of curvature of curves
3159 # in the given point
3162 ## Measure curvature of a curve at a point, set by parameter.
3163 # @ref swig_todo "Example"
3164 def CurveCurvatureByParam(self, theCurve, theParam):
3165 # Example: see GEOM_TestMeasures.py
3166 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
3167 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
3171 # @ref swig_todo "Example"
3172 def CurveCurvatureByPoint(self, theCurve, thePoint):
3173 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
3174 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
3178 ## @name Surface Curvature Measurement
3179 # Methods for receiving max and min radius of curvature of surfaces
3180 # in the given point
3184 ## @ref swig_todo "Example"
3185 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
3186 # Example: see GEOM_TestMeasures.py
3187 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
3188 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
3192 ## @ref swig_todo "Example"
3193 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
3194 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
3195 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
3199 ## @ref swig_todo "Example"
3200 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
3201 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
3202 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
3206 ## @ref swig_todo "Example"
3207 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
3208 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
3209 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
3213 ## Get min and max tolerances of sub-shapes of theShape
3214 # @param theShape Shape, to get tolerances of.
3215 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
3216 # FaceMin,FaceMax: Min and max tolerances of the faces.
3217 # EdgeMin,EdgeMax: Min and max tolerances of the edges.
3218 # VertMin,VertMax: Min and max tolerances of the vertices.
3220 # @ref tui_measurement_tools_page "Example"
3221 def Tolerance(self,theShape):
3222 # Example: see GEOM_TestMeasures.py
3223 aTuple = self.MeasuOp.GetTolerance(theShape)
3224 RaiseIfFailed("GetTolerance", self.MeasuOp)
3227 ## Obtain description of the given shape (number of sub-shapes of each type)
3228 # @param theShape Shape to be described.
3229 # @return Description of the given shape.
3231 # @ref tui_measurement_tools_page "Example"
3232 def WhatIs(self,theShape):
3233 # Example: see GEOM_TestMeasures.py
3234 aDescr = self.MeasuOp.WhatIs(theShape)
3235 RaiseIfFailed("WhatIs", self.MeasuOp)
3238 ## Get a point, situated at the centre of mass of theShape.
3239 # @param theShape Shape to define centre of mass of.
3240 # @return New GEOM_Object, containing the created point.
3242 # @ref tui_measurement_tools_page "Example"
3243 def MakeCDG(self,theShape):
3244 # Example: see GEOM_TestMeasures.py
3245 anObj = self.MeasuOp.GetCentreOfMass(theShape)
3246 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
3249 ## Get a vertex subshape by index depended with orientation.
3250 # @param theShape Shape to find subshape.
3251 # @param theIndex Index to find vertex by this index.
3252 # @return New GEOM_Object, containing the created vertex.
3254 # @ref tui_measurement_tools_page "Example"
3255 def GetVertexByIndex(self,theShape, theIndex):
3256 # Example: see GEOM_TestMeasures.py
3257 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
3258 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
3261 ## Get the first vertex of wire/edge depended orientation.
3262 # @param theShape Shape to find first vertex.
3263 # @return New GEOM_Object, containing the created vertex.
3265 # @ref tui_measurement_tools_page "Example"
3266 def GetFirstVertex(self,theShape):
3267 # Example: see GEOM_TestMeasures.py
3268 anObj = self.GetVertexByIndex(theShape, 0)
3269 RaiseIfFailed("GetFirstVertex", self.MeasuOp)
3272 ## Get the last vertex of wire/edge depended orientation.
3273 # @param theShape Shape to find last vertex.
3274 # @return New GEOM_Object, containing the created vertex.
3276 # @ref tui_measurement_tools_page "Example"
3277 def GetLastVertex(self,theShape):
3278 # Example: see GEOM_TestMeasures.py
3279 nb_vert = self.ShapesOp.NumberOfSubShapes(theShape, ShapeType["VERTEX"])
3280 anObj = self.GetVertexByIndex(theShape, (nb_vert-1))
3281 RaiseIfFailed("GetLastVertex", self.MeasuOp)
3284 ## Get a normale to the given face. If the point is not given,
3285 # the normale is calculated at the center of mass.
3286 # @param theFace Face to define normale of.
3287 # @param theOptionalPoint Point to compute the normale at.
3288 # @return New GEOM_Object, containing the created vector.
3290 # @ref swig_todo "Example"
3291 def GetNormal(self, theFace, theOptionalPoint = None):
3292 # Example: see GEOM_TestMeasures.py
3293 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
3294 RaiseIfFailed("GetNormal", self.MeasuOp)
3297 ## Check a topology of the given shape.
3298 # @param theShape Shape to check validity of.
3299 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked,
3300 # if TRUE, the shape's geometry will be checked also.
3301 # @return TRUE, if the shape "seems to be valid".
3302 # If theShape is invalid, prints a description of problem.
3304 # @ref tui_measurement_tools_page "Example"
3305 def CheckShape(self,theShape, theIsCheckGeom = 0):
3306 # Example: see GEOM_TestMeasures.py
3308 (IsValid, Status) = self.MeasuOp.CheckShapeWithGeometry(theShape)
3309 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
3311 (IsValid, Status) = self.MeasuOp.CheckShape(theShape)
3312 RaiseIfFailed("CheckShape", self.MeasuOp)
3317 ## Get position (LCS) of theShape.
3319 # Origin of the LCS is situated at the shape's center of mass.
3320 # Axes of the LCS are obtained from shape's location or,
3321 # if the shape is a planar face, from position of its plane.
3323 # @param theShape Shape to calculate position of.
3324 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
3325 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
3326 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
3327 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
3329 # @ref swig_todo "Example"
3330 def GetPosition(self,theShape):
3331 # Example: see GEOM_TestMeasures.py
3332 aTuple = self.MeasuOp.GetPosition(theShape)
3333 RaiseIfFailed("GetPosition", self.MeasuOp)
3336 ## Get kind of theShape.
3338 # @param theShape Shape to get a kind of.
3339 # @return Returns a kind of shape in terms of <VAR>GEOM_IKindOfShape.shape_kind</VAR> enumeration
3340 # and a list of parameters, describing the shape.
3341 # @note Concrete meaning of each value, returned via \a theIntegers
3342 # or \a theDoubles list depends on the kind of the shape.
3343 # The full list of possible outputs is:
3345 # - geompy.kind.COMPOUND nb_solids nb_faces nb_edges nb_vertices
3346 # - geompy.kind.COMPSOLID nb_solids nb_faces nb_edges nb_vertices
3348 # - geompy.kind.SHELL geompy.info.CLOSED nb_faces nb_edges nb_vertices
3349 # - geompy.kind.SHELL geompy.info.UNCLOSED nb_faces nb_edges nb_vertices
3351 # - geompy.kind.WIRE geompy.info.CLOSED nb_edges nb_vertices
3352 # - geompy.kind.WIRE geompy.info.UNCLOSED nb_edges nb_vertices
3354 # - geompy.kind.SPHERE xc yc zc R
3355 # - geompy.kind.CYLINDER xb yb zb dx dy dz R H
3356 # - geompy.kind.BOX xc yc zc ax ay az
3357 # - geompy.kind.ROTATED_BOX xc yc zc zx zy zz xx xy xz ax ay az
3358 # - geompy.kind.TORUS xc yc zc dx dy dz R_1 R_2
3359 # - geompy.kind.CONE xb yb zb dx dy dz R_1 R_2 H
3360 # - geompy.kind.POLYHEDRON nb_faces nb_edges nb_vertices
3361 # - geompy.kind.SOLID nb_faces nb_edges nb_vertices
3363 # - geompy.kind.SPHERE2D xc yc zc R
3364 # - geompy.kind.CYLINDER2D xb yb zb dx dy dz R H
3365 # - geompy.kind.TORUS2D xc yc zc dx dy dz R_1 R_2
3366 # - geompy.kind.CONE2D xc yc zc dx dy dz R_1 R_2 H
3367 # - geompy.kind.DISK_CIRCLE xc yc zc dx dy dz R
3368 # - geompy.kind.DISK_ELLIPSE xc yc zc dx dy dz R_1 R_2
3369 # - geompy.kind.POLYGON xo yo zo dx dy dz nb_edges nb_vertices
3370 # - geompy.kind.PLANE xo yo zo dx dy dz
3371 # - geompy.kind.PLANAR xo yo zo dx dy dz nb_edges nb_vertices
3372 # - geompy.kind.FACE nb_edges nb_vertices
3374 # - geompy.kind.CIRCLE xc yc zc dx dy dz R
3375 # - geompy.kind.ARC_CIRCLE xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2
3376 # - geompy.kind.ELLIPSE xc yc zc dx dy dz R_1 R_2
3377 # - geompy.kind.ARC_ELLIPSE xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2
3378 # - geompy.kind.LINE xo yo zo dx dy dz
3379 # - geompy.kind.SEGMENT x1 y1 z1 x2 y2 z2
3380 # - geompy.kind.EDGE nb_vertices
3382 # - geompy.kind.VERTEX x y z
3384 # @ref swig_todo "Example"
3385 def KindOfShape(self,theShape):
3386 # Example: see GEOM_TestMeasures.py
3387 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
3388 RaiseIfFailed("KindOfShape", self.MeasuOp)
3390 aKind = aRoughTuple[0]
3391 anInts = aRoughTuple[1]
3392 aDbls = aRoughTuple[2]
3394 # Now there is no exception from this rule:
3395 aKindTuple = [aKind] + aDbls + anInts
3397 # If they are we will regroup parameters for such kind of shape.
3399 #if aKind == kind.SOME_KIND:
3400 # # SOME_KIND int int double int double double
3401 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
3408 ## @addtogroup l2_import_export
3411 ## Import a shape from the BREP or IGES or STEP file
3412 # (depends on given format) with given name.
3413 # @param theFileName The file, containing the shape.
3414 # @param theFormatName Specify format for the file reading.
3415 # Available formats can be obtained with InsertOp.ImportTranslators() method.
3416 # If format 'IGES_SCALE' is used instead 'IGES' length unit will be
3417 # set to 'meter' and result model will be scaled.
3418 # @return New GEOM_Object, containing the imported shape.
3420 # @ref swig_Import_Export "Example"
3421 def Import(self,theFileName, theFormatName):
3422 # Example: see GEOM_TestOthers.py
3423 anObj = self.InsertOp.Import(theFileName, theFormatName)
3424 RaiseIfFailed("Import", self.InsertOp)
3427 ## Shortcut to Import() for BREP format
3429 # @ref swig_Import_Export "Example"
3430 def ImportBREP(self,theFileName):
3431 # Example: see GEOM_TestOthers.py
3432 return self.Import(theFileName, "BREP")
3434 ## Shortcut to Import() for IGES format
3436 # @ref swig_Import_Export "Example"
3437 def ImportIGES(self,theFileName):
3438 # Example: see GEOM_TestOthers.py
3439 return self.Import(theFileName, "IGES")
3441 ## Return length unit from given IGES file
3443 # @ref swig_Import_Export "Example"
3444 def GetIGESUnit(self,theFileName):
3445 # Example: see GEOM_TestOthers.py
3446 anObj = self.InsertOp.Import(theFileName, "IGES_UNIT")
3447 #RaiseIfFailed("Import", self.InsertOp)
3448 # recieve name using returned vertex
3450 vertices = self.SubShapeAll(anObj,ShapeType["VERTEX"])
3452 p = self.PointCoordinates(vertices[0])
3453 if abs(p[0]-0.01) < 1.e-6:
3455 elif abs(p[0]-0.001) < 1.e-6:
3459 ## Shortcut to Import() for STEP format
3461 # @ref swig_Import_Export "Example"
3462 def ImportSTEP(self,theFileName):
3463 # Example: see GEOM_TestOthers.py
3464 return self.Import(theFileName, "STEP")
3466 ## Export the given shape into a file with given name.
3467 # @param theObject Shape to be stored in the file.
3468 # @param theFileName Name of the file to store the given shape in.
3469 # @param theFormatName Specify format for the shape storage.
3470 # Available formats can be obtained with InsertOp.ImportTranslators() method.
3472 # @ref swig_Import_Export "Example"
3473 def Export(self,theObject, theFileName, theFormatName):
3474 # Example: see GEOM_TestOthers.py
3475 self.InsertOp.Export(theObject, theFileName, theFormatName)
3476 if self.InsertOp.IsDone() == 0:
3477 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
3481 ## Shortcut to Export() for BREP format
3483 # @ref swig_Import_Export "Example"
3484 def ExportBREP(self,theObject, theFileName):
3485 # Example: see GEOM_TestOthers.py
3486 return self.Export(theObject, theFileName, "BREP")
3488 ## Shortcut to Export() for IGES format
3490 # @ref swig_Import_Export "Example"
3491 def ExportIGES(self,theObject, theFileName):
3492 # Example: see GEOM_TestOthers.py
3493 return self.Export(theObject, theFileName, "IGES")
3495 ## Shortcut to Export() for STEP format
3497 # @ref swig_Import_Export "Example"
3498 def ExportSTEP(self,theObject, theFileName):
3499 # Example: see GEOM_TestOthers.py
3500 return self.Export(theObject, theFileName, "STEP")
3502 # end of l2_import_export
3505 ## @addtogroup l3_blocks
3508 ## Create a quadrangle face from four edges. Order of Edges is not
3509 # important. It is not necessary that edges share the same vertex.
3510 # @param E1,E2,E3,E4 Edges for the face bound.
3511 # @return New GEOM_Object, containing the created face.
3513 # @ref tui_building_by_blocks_page "Example"
3514 def MakeQuad(self,E1, E2, E3, E4):
3515 # Example: see GEOM_Spanner.py
3516 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
3517 RaiseIfFailed("MakeQuad", self.BlocksOp)
3520 ## Create a quadrangle face on two edges.
3521 # The missing edges will be built by creating the shortest ones.
3522 # @param E1,E2 Two opposite edges for the face.
3523 # @return New GEOM_Object, containing the created face.
3525 # @ref tui_building_by_blocks_page "Example"
3526 def MakeQuad2Edges(self,E1, E2):
3527 # Example: see GEOM_Spanner.py
3528 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
3529 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
3532 ## Create a quadrangle face with specified corners.
3533 # The missing edges will be built by creating the shortest ones.
3534 # @param V1,V2,V3,V4 Corner vertices for the face.
3535 # @return New GEOM_Object, containing the created face.
3537 # @ref tui_building_by_blocks_page "Example 1"
3538 # \n @ref swig_MakeQuad4Vertices "Example 2"
3539 def MakeQuad4Vertices(self,V1, V2, V3, V4):
3540 # Example: see GEOM_Spanner.py
3541 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
3542 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
3545 ## Create a hexahedral solid, bounded by the six given faces. Order of
3546 # faces is not important. It is not necessary that Faces share the same edge.
3547 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
3548 # @return New GEOM_Object, containing the created solid.
3550 # @ref tui_building_by_blocks_page "Example 1"
3551 # \n @ref swig_MakeHexa "Example 2"
3552 def MakeHexa(self,F1, F2, F3, F4, F5, F6):
3553 # Example: see GEOM_Spanner.py
3554 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
3555 RaiseIfFailed("MakeHexa", self.BlocksOp)
3558 ## Create a hexahedral solid between two given faces.
3559 # The missing faces will be built by creating the smallest ones.
3560 # @param F1,F2 Two opposite faces for the hexahedral solid.
3561 # @return New GEOM_Object, containing the created solid.
3563 # @ref tui_building_by_blocks_page "Example 1"
3564 # \n @ref swig_MakeHexa2Faces "Example 2"
3565 def MakeHexa2Faces(self,F1, F2):
3566 # Example: see GEOM_Spanner.py
3567 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
3568 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
3574 ## @addtogroup l3_blocks_op
3577 ## Get a vertex, found in the given shape by its coordinates.
3578 # @param theShape Block or a compound of blocks.
3579 # @param theX,theY,theZ Coordinates of the sought vertex.
3580 # @param theEpsilon Maximum allowed distance between the resulting
3581 # vertex and point with the given coordinates.
3582 # @return New GEOM_Object, containing the found vertex.
3584 # @ref swig_GetPoint "Example"
3585 def GetPoint(self,theShape, theX, theY, theZ, theEpsilon):
3586 # Example: see GEOM_TestOthers.py
3587 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
3588 RaiseIfFailed("GetPoint", self.BlocksOp)
3591 ## Get an edge, found in the given shape by two given vertices.
3592 # @param theShape Block or a compound of blocks.
3593 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
3594 # @return New GEOM_Object, containing the found edge.
3596 # @ref swig_todo "Example"
3597 def GetEdge(self,theShape, thePoint1, thePoint2):
3598 # Example: see GEOM_Spanner.py
3599 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
3600 RaiseIfFailed("GetEdge", self.BlocksOp)
3603 ## Find an edge of the given shape, which has minimal distance to the given point.
3604 # @param theShape Block or a compound of blocks.
3605 # @param thePoint Point, close to the desired edge.
3606 # @return New GEOM_Object, containing the found edge.
3608 # @ref swig_GetEdgeNearPoint "Example"
3609 def GetEdgeNearPoint(self,theShape, thePoint):
3610 # Example: see GEOM_TestOthers.py
3611 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
3612 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
3615 ## Returns a face, found in the given shape by four given corner vertices.
3616 # @param theShape Block or a compound of blocks.
3617 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
3618 # @return New GEOM_Object, containing the found face.
3620 # @ref swig_todo "Example"
3621 def GetFaceByPoints(self,theShape, thePoint1, thePoint2, thePoint3, thePoint4):
3622 # Example: see GEOM_Spanner.py
3623 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
3624 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
3627 ## Get a face of block, found in the given shape by two given edges.
3628 # @param theShape Block or a compound of blocks.
3629 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
3630 # @return New GEOM_Object, containing the found face.
3632 # @ref swig_todo "Example"
3633 def GetFaceByEdges(self,theShape, theEdge1, theEdge2):
3634 # Example: see GEOM_Spanner.py
3635 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
3636 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
3639 ## Find a face, opposite to the given one in the given block.
3640 # @param theBlock Must be a hexahedral solid.
3641 # @param theFace Face of \a theBlock, opposite to the desired face.
3642 # @return New GEOM_Object, containing the found face.
3644 # @ref swig_GetOppositeFace "Example"
3645 def GetOppositeFace(self,theBlock, theFace):
3646 # Example: see GEOM_Spanner.py
3647 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
3648 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
3651 ## Find a face of the given shape, which has minimal distance to the given point.
3652 # @param theShape Block or a compound of blocks.
3653 # @param thePoint Point, close to the desired face.
3654 # @return New GEOM_Object, containing the found face.
3656 # @ref swig_GetFaceNearPoint "Example"
3657 def GetFaceNearPoint(self,theShape, thePoint):
3658 # Example: see GEOM_Spanner.py
3659 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
3660 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
3663 ## Find a face of block, whose outside normale has minimal angle with the given vector.
3664 # @param theBlock Block or a compound of blocks.
3665 # @param theVector Vector, close to the normale of the desired face.
3666 # @return New GEOM_Object, containing the found face.
3668 # @ref swig_todo "Example"
3669 def GetFaceByNormale(self, theBlock, theVector):
3670 # Example: see GEOM_Spanner.py
3671 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
3672 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
3675 # end of l3_blocks_op
3678 ## @addtogroup l4_blocks_measure
3681 ## Check, if the compound of blocks is given.
3682 # To be considered as a compound of blocks, the
3683 # given shape must satisfy the following conditions:
3684 # - Each element of the compound should be a Block (6 faces and 12 edges).
3685 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
3686 # - The compound should be connexe.
3687 # - The glue between two quadrangle faces should be applied.
3688 # @param theCompound The compound to check.
3689 # @return TRUE, if the given shape is a compound of blocks.
3690 # If theCompound is not valid, prints all discovered errors.
3692 # @ref tui_measurement_tools_page "Example 1"
3693 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
3694 def CheckCompoundOfBlocks(self,theCompound):
3695 # Example: see GEOM_Spanner.py
3696 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
3697 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
3699 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
3703 ## Remove all seam and degenerated edges from \a theShape.
3704 # Unite faces and edges, sharing one surface. It means that
3705 # this faces must have references to one C++ surface object (handle).
3706 # @param theShape The compound or single solid to remove irregular edges from.
3707 # @param doUnionFaces If True, then unite faces. If False (the default value),
3708 # do not unite faces.
3709 # @return Improved shape.
3711 # @ref swig_RemoveExtraEdges "Example"
3712 def RemoveExtraEdges(self, theShape, doUnionFaces=False):
3713 # Example: see GEOM_TestOthers.py
3714 nbFacesOptimum = -1 # -1 means do not unite faces
3715 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
3716 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
3717 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
3720 ## Check, if the given shape is a blocks compound.
3721 # Fix all detected errors.
3722 # \note Single block can be also fixed by this method.
3723 # @param theShape The compound to check and improve.
3724 # @return Improved compound.
3726 # @ref swig_CheckAndImprove "Example"
3727 def CheckAndImprove(self,theShape):
3728 # Example: see GEOM_TestOthers.py
3729 anObj = self.BlocksOp.CheckAndImprove(theShape)
3730 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
3733 # end of l4_blocks_measure
3736 ## @addtogroup l3_blocks_op
3739 ## Get all the blocks, contained in the given compound.
3740 # @param theCompound The compound to explode.
3741 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
3742 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
3743 # \note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
3744 # @return List of GEOM_Objects, containing the retrieved blocks.
3746 # @ref tui_explode_on_blocks "Example 1"
3747 # \n @ref swig_MakeBlockExplode "Example 2"
3748 def MakeBlockExplode(self,theCompound, theMinNbFaces, theMaxNbFaces):
3749 # Example: see GEOM_TestOthers.py
3750 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
3751 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
3752 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
3754 anObj.SetParameters(Parameters)
3758 ## Find block, containing the given point inside its volume or on boundary.
3759 # @param theCompound Compound, to find block in.
3760 # @param thePoint Point, close to the desired block. If the point lays on
3761 # boundary between some blocks, we return block with nearest center.
3762 # @return New GEOM_Object, containing the found block.
3764 # @ref swig_todo "Example"
3765 def GetBlockNearPoint(self,theCompound, thePoint):
3766 # Example: see GEOM_Spanner.py
3767 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
3768 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
3771 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
3772 # @param theCompound Compound, to find block in.
3773 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
3774 # @return New GEOM_Object, containing the found block.
3776 # @ref swig_GetBlockByParts "Example"
3777 def GetBlockByParts(self,theCompound, theParts):
3778 # Example: see GEOM_TestOthers.py
3779 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
3780 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
3783 ## Return all blocks, containing all the elements, passed as the parts.
3784 # @param theCompound Compound, to find blocks in.
3785 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
3786 # @return List of GEOM_Objects, containing the found blocks.
3788 # @ref swig_todo "Example"
3789 def GetBlocksByParts(self,theCompound, theParts):
3790 # Example: see GEOM_Spanner.py
3791 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
3792 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
3795 ## Multi-transformate block and glue the result.
3796 # Transformation is defined so, as to superpose direction faces.
3797 # @param Block Hexahedral solid to be multi-transformed.
3798 # @param DirFace1 ID of First direction face.
3799 # @param DirFace2 ID of Second direction face.
3800 # @param NbTimes Quantity of transformations to be done.
3801 # \note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
3802 # @return New GEOM_Object, containing the result shape.
3804 # @ref tui_multi_transformation "Example"
3805 def MakeMultiTransformation1D(self,Block, DirFace1, DirFace2, NbTimes):
3806 # Example: see GEOM_Spanner.py
3807 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
3808 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
3809 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
3810 anObj.SetParameters(Parameters)
3813 ## Multi-transformate block and glue the result.
3814 # @param Block Hexahedral solid to be multi-transformed.
3815 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
3816 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
3817 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
3818 # @return New GEOM_Object, containing the result shape.
3820 # @ref tui_multi_transformation "Example"
3821 def MakeMultiTransformation2D(self,Block, DirFace1U, DirFace2U, NbTimesU,
3822 DirFace1V, DirFace2V, NbTimesV):
3823 # Example: see GEOM_Spanner.py
3824 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
3825 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
3826 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
3827 DirFace1V, DirFace2V, NbTimesV)
3828 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
3829 anObj.SetParameters(Parameters)
3832 ## Build all possible propagation groups.
3833 # Propagation group is a set of all edges, opposite to one (main)
3834 # edge of this group directly or through other opposite edges.
3835 # Notion of Opposite Edge make sence only on quadrangle face.
3836 # @param theShape Shape to build propagation groups on.
3837 # @return List of GEOM_Objects, each of them is a propagation group.
3839 # @ref swig_Propagate "Example"
3840 def Propagate(self,theShape):
3841 # Example: see GEOM_TestOthers.py
3842 listChains = self.BlocksOp.Propagate(theShape)
3843 RaiseIfFailed("Propagate", self.BlocksOp)
3846 # end of l3_blocks_op
3849 ## @addtogroup l3_groups
3852 ## Creates a new group which will store sub shapes of theMainShape
3853 # @param theMainShape is a GEOM object on which the group is selected
3854 # @param theShapeType defines a shape type of the group
3855 # @return a newly created GEOM group
3857 # @ref tui_working_with_groups_page "Example 1"
3858 # \n @ref swig_CreateGroup "Example 2"
3859 def CreateGroup(self,theMainShape, theShapeType):
3860 # Example: see GEOM_TestOthers.py
3861 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
3862 RaiseIfFailed("CreateGroup", self.GroupOp)
3865 ## Adds a sub object with ID theSubShapeId to the group
3866 # @param theGroup is a GEOM group to which the new sub shape is added
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 AddObject(self,theGroup, theSubShapeID):
3872 # Example: see GEOM_TestOthers.py
3873 self.GroupOp.AddObject(theGroup, theSubShapeID)
3874 RaiseIfFailed("AddObject", self.GroupOp)
3877 ## Removes a sub object with ID \a theSubShapeId from the group
3878 # @param theGroup is a GEOM group from which the new sub shape is removed
3879 # @param theSubShapeID is a sub shape ID in the main object.
3880 # \note Use method GetSubShapeID() to get an unique ID of the sub shape
3882 # @ref tui_working_with_groups_page "Example"
3883 def RemoveObject(self,theGroup, theSubShapeID):
3884 # Example: see GEOM_TestOthers.py
3885 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
3886 RaiseIfFailed("RemoveObject", self.GroupOp)
3889 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
3890 # @param theGroup is a GEOM group to which the new sub shapes are added.
3891 # @param theSubShapes is a list of sub shapes to be added.
3893 # @ref tui_working_with_groups_page "Example"
3894 def UnionList (self,theGroup, theSubShapes):
3895 # Example: see GEOM_TestOthers.py
3896 self.GroupOp.UnionList(theGroup, theSubShapes)
3897 RaiseIfFailed("UnionList", self.GroupOp)
3900 ## Works like the above method, but argument
3901 # theSubShapes here is a list of sub-shapes indices
3903 # @ref swig_UnionIDs "Example"
3904 def UnionIDs(self,theGroup, theSubShapes):
3905 # Example: see GEOM_TestOthers.py
3906 self.GroupOp.UnionIDs(theGroup, theSubShapes)
3907 RaiseIfFailed("UnionIDs", self.GroupOp)
3910 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
3911 # @param theGroup is a GEOM group from which the sub-shapes are removed.
3912 # @param theSubShapes is a list of sub-shapes to be removed.
3914 # @ref tui_working_with_groups_page "Example"
3915 def DifferenceList (self,theGroup, theSubShapes):
3916 # Example: see GEOM_TestOthers.py
3917 self.GroupOp.DifferenceList(theGroup, theSubShapes)
3918 RaiseIfFailed("DifferenceList", self.GroupOp)
3921 ## Works like the above method, but argument
3922 # theSubShapes here is a list of sub-shapes indices
3924 # @ref swig_DifferenceIDs "Example"
3925 def DifferenceIDs(self,theGroup, theSubShapes):
3926 # Example: see GEOM_TestOthers.py
3927 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
3928 RaiseIfFailed("DifferenceIDs", self.GroupOp)
3931 ## Returns a list of sub objects ID stored in the group
3932 # @param theGroup is a GEOM group for which a list of IDs is requested
3934 # @ref swig_GetObjectIDs "Example"
3935 def GetObjectIDs(self,theGroup):
3936 # Example: see GEOM_TestOthers.py
3937 ListIDs = self.GroupOp.GetObjects(theGroup)
3938 RaiseIfFailed("GetObjects", self.GroupOp)
3941 ## Returns a type of sub objects stored in the group
3942 # @param theGroup is a GEOM group which type is returned.
3944 # @ref swig_GetType "Example"
3945 def GetType(self,theGroup):
3946 # Example: see GEOM_TestOthers.py
3947 aType = self.GroupOp.GetType(theGroup)
3948 RaiseIfFailed("GetType", self.GroupOp)
3951 ## Convert a type of geom object from id to string value
3952 # @param theId is a GEOM obect type id.
3954 # @ref swig_GetType "Example"
3955 def ShapeIdToType(self, theId):
4029 return "FREE_BOUNDS"
4037 return "THRUSECTIONS"
4039 return "COMPOUNDFILTER"
4041 return "SHAPES_ON_SHAPE"
4043 return "ELLIPSE_ARC"
4050 return "Shape Id not exist."
4052 ## Returns a main shape associated with the group
4053 # @param theGroup is a GEOM group for which a main shape object is requested
4054 # @return a GEOM object which is a main shape for theGroup
4056 # @ref swig_GetMainShape "Example"
4057 def GetMainShape(self,theGroup):
4058 # Example: see GEOM_TestOthers.py
4059 anObj = self.GroupOp.GetMainShape(theGroup)
4060 RaiseIfFailed("GetMainShape", self.GroupOp)
4063 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
4064 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
4066 # @ref swig_todo "Example"
4067 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1):
4068 edges = self.SubShapeAll(theShape, ShapeType["EDGE"])
4071 Props = self.BasicProperties(edge)
4072 if min_length <= Props[0] and Props[0] <= max_length:
4073 if (not include_min) and (min_length == Props[0]):
4076 if (not include_max) and (Props[0] == max_length):
4079 edges_in_range.append(edge)
4081 if len(edges_in_range) <= 0:
4082 print "No edges found by given criteria"
4085 group_edges = self.CreateGroup(theShape, ShapeType["EDGE"])
4086 self.UnionList(group_edges, edges_in_range)
4090 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
4091 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
4093 # @ref swig_todo "Example"
4094 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
4095 nb_selected = sg.SelectedCount()
4097 print "Select a shape before calling this function, please."
4100 print "Only one shape must be selected"
4103 id_shape = sg.getSelected(0)
4104 shape = IDToObject( id_shape )
4106 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
4110 if include_min: left_str = " <= "
4111 if include_max: right_str = " <= "
4113 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
4114 + left_str + "length" + right_str + `max_length`)
4116 sg.updateObjBrowser(1)
4123 ## @addtogroup l4_advanced
4126 #@@ insert new functions before this line @@#
4128 # end of l4_advanced
4131 ## Create a copy of the given object
4132 # @ingroup l1_geompy_auxiliary
4134 # @ref swig_all_advanced "Example"
4135 def MakeCopy(self,theOriginal):
4136 # Example: see GEOM_TestAll.py
4137 anObj = self.InsertOp.MakeCopy(theOriginal)
4138 RaiseIfFailed("MakeCopy", self.InsertOp)
4141 ## Add Path to load python scripts from
4142 # @ingroup l1_geompy_auxiliary
4143 def addPath(self,Path):
4144 if (sys.path.count(Path) < 1):
4145 sys.path.append(Path)
4149 ## Load marker texture from the file
4150 # @param Path a path to the texture file
4151 # @return unique texture identifier
4152 # @ingroup l1_geompy_auxiliary
4153 def LoadTexture(self, Path):
4154 # Example: see GEOM_TestAll.py
4155 ID = self.InsertOp.LoadTexture(Path)
4156 RaiseIfFailed("LoadTexture", self.InsertOp)
4159 ## Add marker texture. @a Width and @a Height parameters
4160 # specify width and height of the texture in pixels.
4161 # If @a RowData is @c True, @a Texture parameter should represent texture data
4162 # packed into the byte array. If @a RowData is @c False (default), @a Texture
4163 # parameter should be unpacked string, in which '1' symbols represent opaque
4164 # pixels and '0' represent transparent pixels of the texture bitmap.
4166 # @param Width texture width in pixels
4167 # @param Height texture height in pixels
4168 # @param Texture texture data
4169 # @param RowData if @c True, @a Texture data are packed in the byte stream
4170 # @ingroup l1_geompy_auxiliary
4171 def AddTexture(self, Width, Height, Texture, RowData=False):
4172 # Example: see GEOM_TestAll.py
4173 if not RowData: Texture = PackData(Texture)
4174 ID = self.InsertOp.AddTexture(Width, Height, Texture)
4175 RaiseIfFailed("AddTexture", self.InsertOp)
4179 #Register the new proxy for GEOM_Gen
4180 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geompyDC)