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 # \return list of published sub-shapes
396 # @ref tui_restore_prs_params "Example"
397 def RestoreSubShapes (self, theObject, theArgs=[],
398 theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
399 # Example: see GEOM_TestAll.py
400 return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
401 theFindMethod, theInheritFirstArg)
403 # end of l3_restore_ss
406 ## @addtogroup l3_basic_go
409 ## Create point by three coordinates.
410 # @param theX The X coordinate of the point.
411 # @param theY The Y coordinate of the point.
412 # @param theZ The Z coordinate of the point.
413 # @return New GEOM_Object, containing the created point.
415 # @ref tui_creation_point "Example"
416 def MakeVertex(self,theX, theY, theZ):
417 # Example: see GEOM_TestAll.py
418 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
419 anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
420 RaiseIfFailed("MakePointXYZ", self.BasicOp)
421 anObj.SetParameters(Parameters)
424 ## Create a point, distant from the referenced point
425 # on the given distances along the coordinate axes.
426 # @param theReference The referenced point.
427 # @param theX Displacement from the referenced point along OX axis.
428 # @param theY Displacement from the referenced point along OY axis.
429 # @param theZ Displacement from the referenced point along OZ axis.
430 # @return New GEOM_Object, containing the created point.
432 # @ref tui_creation_point "Example"
433 def MakeVertexWithRef(self,theReference, theX, theY, theZ):
434 # Example: see GEOM_TestAll.py
435 theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
436 anObj = self.BasicOp.MakePointWithReference(theReference, theX, theY, theZ)
437 RaiseIfFailed("MakePointWithReference", self.BasicOp)
438 anObj.SetParameters(Parameters)
441 ## Create a point, corresponding to the given parameter on the given curve.
442 # @param theRefCurve The referenced curve.
443 # @param theParameter Value of parameter on the referenced curve.
444 # @return New GEOM_Object, containing the created point.
446 # @ref tui_creation_point "Example"
447 def MakeVertexOnCurve(self,theRefCurve, theParameter):
448 # Example: see GEOM_TestAll.py
449 theParameter, Parameters = ParseParameters(theParameter)
450 anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter)
451 RaiseIfFailed("MakePointOnCurve", self.BasicOp)
452 anObj.SetParameters(Parameters)
455 ## Create a point by projection give coordinates on the given curve
456 # @param theRefCurve The referenced curve.
457 # @param theX X-coordinate in 3D space
458 # @param theY Y-coordinate in 3D space
459 # @param theZ Z-coordinate in 3D space
460 # @return New GEOM_Object, containing the created point.
462 # @ref tui_creation_point "Example"
463 def MakeVertexOnCurveByCoord(self,theRefCurve, theX, theY, theZ):
464 # Example: see GEOM_TestAll.py
465 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
466 anObj = self.BasicOp.MakePointOnCurveByCoord(theRefCurve, theX, theY, theZ)
467 RaiseIfFailed("MakeVertexOnCurveByCoord", self.BasicOp)
468 anObj.SetParameters(Parameters)
471 ## Create a point, corresponding to the given parameters on the
473 # @param theRefSurf The referenced surface.
474 # @param theUParameter Value of U-parameter on the referenced surface.
475 # @param theVParameter Value of V-parameter on the referenced surface.
476 # @return New GEOM_Object, containing the created point.
478 # @ref swig_MakeVertexOnSurface "Example"
479 def MakeVertexOnSurface(self, theRefSurf, theUParameter, theVParameter):
480 theUParameter, theVParameter, Parameters = ParseParameters(theUParameter, theVParameter)
481 # Example: see GEOM_TestAll.py
482 anObj = self.BasicOp.MakePointOnSurface(theRefSurf, theUParameter, theVParameter)
483 RaiseIfFailed("MakePointOnSurface", self.BasicOp)
484 anObj.SetParameters(Parameters);
487 ## Create a point by projection give coordinates on the given surface
488 # @param theRefSurf The referenced surface.
489 # @param theX X-coordinate in 3D space
490 # @param theY Y-coordinate in 3D space
491 # @param theZ Z-coordinate in 3D space
492 # @return New GEOM_Object, containing the created point.
494 # @ref swig_MakeVertexOnSurfaceByCoord "Example"
495 def MakeVertexOnSurfaceByCoord(self, theRefSurf, theX, theY, theZ):
496 theX, theY, theZ, Parameters = ParseParameters(theX, theY, theZ)
497 # Example: see GEOM_TestAll.py
498 anObj = self.BasicOp.MakePointOnSurfaceByCoord(theRefSurf, theX, theY, theZ)
499 RaiseIfFailed("MakeVertexOnSurfaceByCoord", self.BasicOp)
500 anObj.SetParameters(Parameters);
503 ## Create a point on intersection of two lines.
504 # @param theRefLine1, theRefLine2 The referenced lines.
505 # @return New GEOM_Object, containing the created point.
507 # @ref swig_MakeVertexOnLinesIntersection "Example"
508 def MakeVertexOnLinesIntersection(self, theRefLine1, theRefLine2):
509 # Example: see GEOM_TestAll.py
510 anObj = self.BasicOp.MakePointOnLinesIntersection(theRefLine1, theRefLine2)
511 RaiseIfFailed("MakePointOnLinesIntersection", self.BasicOp)
514 ## Create a tangent, corresponding to the given parameter on the given curve.
515 # @param theRefCurve The referenced curve.
516 # @param theParameter Value of parameter on the referenced curve.
517 # @return New GEOM_Object, containing the created tangent.
519 # @ref swig_MakeTangentOnCurve "Example"
520 def MakeTangentOnCurve(self, theRefCurve, theParameter):
521 anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
522 RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
525 ## Create a tangent plane, corresponding to the given parameter on the given face.
526 # @param theFace The face for which tangent plane should be built.
527 # @param theParameterV vertical value of the center point (0.0 - 1.0).
528 # @param theParameterU horisontal value of the center point (0.0 - 1.0).
529 # @param theTrimSize the size of plane.
530 # @return New GEOM_Object, containing the created tangent.
532 # @ref swig_MakeTangentPlaneOnFace "Example"
533 def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize):
534 anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
535 RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
538 ## Create a vector with the given components.
539 # @param theDX X component of the vector.
540 # @param theDY Y component of the vector.
541 # @param theDZ Z component of the vector.
542 # @return New GEOM_Object, containing the created vector.
544 # @ref tui_creation_vector "Example"
545 def MakeVectorDXDYDZ(self,theDX, theDY, theDZ):
546 # Example: see GEOM_TestAll.py
547 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
548 anObj = self.BasicOp.MakeVectorDXDYDZ(theDX, theDY, theDZ)
549 RaiseIfFailed("MakeVectorDXDYDZ", self.BasicOp)
550 anObj.SetParameters(Parameters)
553 ## Create a vector between two points.
554 # @param thePnt1 Start point for the vector.
555 # @param thePnt2 End point for the vector.
556 # @return New GEOM_Object, containing the created vector.
558 # @ref tui_creation_vector "Example"
559 def MakeVector(self,thePnt1, thePnt2):
560 # Example: see GEOM_TestAll.py
561 anObj = self.BasicOp.MakeVectorTwoPnt(thePnt1, thePnt2)
562 RaiseIfFailed("MakeVectorTwoPnt", self.BasicOp)
565 ## Create a line, passing through the given point
566 # and parrallel to the given direction
567 # @param thePnt Point. The resulting line will pass through it.
568 # @param theDir Direction. The resulting line will be parallel to it.
569 # @return New GEOM_Object, containing the created line.
571 # @ref tui_creation_line "Example"
572 def MakeLine(self,thePnt, theDir):
573 # Example: see GEOM_TestAll.py
574 anObj = self.BasicOp.MakeLine(thePnt, theDir)
575 RaiseIfFailed("MakeLine", self.BasicOp)
578 ## Create a line, passing through the given points
579 # @param thePnt1 First of two points, defining the line.
580 # @param thePnt2 Second of two points, defining the line.
581 # @return New GEOM_Object, containing the created line.
583 # @ref tui_creation_line "Example"
584 def MakeLineTwoPnt(self,thePnt1, thePnt2):
585 # Example: see GEOM_TestAll.py
586 anObj = self.BasicOp.MakeLineTwoPnt(thePnt1, thePnt2)
587 RaiseIfFailed("MakeLineTwoPnt", self.BasicOp)
590 ## Create a line on two faces intersection.
591 # @param theFace1 First of two faces, defining the line.
592 # @param theFace2 Second of two faces, defining the line.
593 # @return New GEOM_Object, containing the created line.
595 # @ref swig_MakeLineTwoFaces "Example"
596 def MakeLineTwoFaces(self, theFace1, theFace2):
597 # Example: see GEOM_TestAll.py
598 anObj = self.BasicOp.MakeLineTwoFaces(theFace1, theFace2)
599 RaiseIfFailed("MakeLineTwoFaces", self.BasicOp)
602 ## Create a plane, passing through the given point
603 # and normal to the given vector.
604 # @param thePnt Point, the plane has to pass through.
605 # @param theVec Vector, defining the plane normal direction.
606 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
607 # @return New GEOM_Object, containing the created plane.
609 # @ref tui_creation_plane "Example"
610 def MakePlane(self,thePnt, theVec, theTrimSize):
611 # Example: see GEOM_TestAll.py
612 theTrimSize, Parameters = ParseParameters(theTrimSize);
613 anObj = self.BasicOp.MakePlanePntVec(thePnt, theVec, theTrimSize)
614 RaiseIfFailed("MakePlanePntVec", self.BasicOp)
615 anObj.SetParameters(Parameters)
618 ## Create a plane, passing through the three given points
619 # @param thePnt1 First of three points, defining the plane.
620 # @param thePnt2 Second of three points, defining the plane.
621 # @param thePnt3 Fird of three points, defining the plane.
622 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
623 # @return New GEOM_Object, containing the created plane.
625 # @ref tui_creation_plane "Example"
626 def MakePlaneThreePnt(self,thePnt1, thePnt2, thePnt3, theTrimSize):
627 # Example: see GEOM_TestAll.py
628 theTrimSize, Parameters = ParseParameters(theTrimSize);
629 anObj = self.BasicOp.MakePlaneThreePnt(thePnt1, thePnt2, thePnt3, theTrimSize)
630 RaiseIfFailed("MakePlaneThreePnt", self.BasicOp)
631 anObj.SetParameters(Parameters)
634 ## Create a plane, similar to the existing one, but with another size of representing face.
635 # @param theFace Referenced plane or LCS(Marker).
636 # @param theTrimSize New half size of a side of quadrangle face, representing the plane.
637 # @return New GEOM_Object, containing the created plane.
639 # @ref tui_creation_plane "Example"
640 def MakePlaneFace(self,theFace, theTrimSize):
641 # Example: see GEOM_TestAll.py
642 theTrimSize, Parameters = ParseParameters(theTrimSize);
643 anObj = self.BasicOp.MakePlaneFace(theFace, theTrimSize)
644 RaiseIfFailed("MakePlaneFace", self.BasicOp)
645 anObj.SetParameters(Parameters)
648 ## Create a plane, passing through the 2 vectors
649 # with center in a start point of the first vector.
650 # @param theVec1 Vector, defining center point and plane direction.
651 # @param theVec2 Vector, defining the plane normal direction.
652 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
653 # @return New GEOM_Object, containing the created plane.
655 # @ref tui_creation_plane "Example"
656 def MakePlane2Vec(self,theVec1, theVec2, theTrimSize):
657 # Example: see GEOM_TestAll.py
658 theTrimSize, Parameters = ParseParameters(theTrimSize);
659 anObj = self.BasicOp.MakePlane2Vec(theVec1, theVec2, theTrimSize)
660 RaiseIfFailed("MakePlane2Vec", self.BasicOp)
661 anObj.SetParameters(Parameters)
664 ## Create a plane, based on a Local coordinate system.
665 # @param theLCS coordinate system, defining plane.
666 # @param theTrimSize Half size of a side of quadrangle face, representing the plane.
667 # @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
668 # @return New GEOM_Object, containing the created plane.
670 # @ref tui_creation_plane "Example"
671 def MakePlaneLCS(self,theLCS, theTrimSize, theOrientation):
672 # Example: see GEOM_TestAll.py
673 theTrimSize, Parameters = ParseParameters(theTrimSize);
674 anObj = self.BasicOp.MakePlaneLCS(theLCS, theTrimSize, theOrientation)
675 RaiseIfFailed("MakePlaneLCS", self.BasicOp)
676 anObj.SetParameters(Parameters)
679 ## Create a local coordinate system.
680 # @param OX,OY,OZ Three coordinates of coordinate system origin.
681 # @param XDX,XDY,XDZ Three components of OX direction
682 # @param YDX,YDY,YDZ Three components of OY direction
683 # @return New GEOM_Object, containing the created coordinate system.
685 # @ref swig_MakeMarker "Example"
686 def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ):
687 # Example: see GEOM_TestAll.py
688 OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
689 anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
690 RaiseIfFailed("MakeMarker", self.BasicOp)
691 anObj.SetParameters(Parameters)
694 ## Create a local coordinate system from shape.
695 # @param theShape The initial shape to detect the coordinate system.
696 # @return New GEOM_Object, containing the created coordinate system.
698 # @ref tui_creation_lcs "Example"
699 def MakeMarkerFromShape(self, theShape):
700 anObj = self.BasicOp.MakeMarkerFromShape(theShape)
701 RaiseIfFailed("MakeMarkerFromShape", self.BasicOp)
704 ## Create a local coordinate system from point and two vectors.
705 # @param theOrigin Point of coordinate system origin.
706 # @param theXVec Vector of X direction
707 # @param theYVec Vector of Y direction
708 # @return New GEOM_Object, containing the created coordinate system.
710 # @ref tui_creation_lcs "Example"
711 def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec):
712 anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec)
713 RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp)
719 ## @addtogroup l4_curves
722 ## Create an arc of circle, passing through three given points.
723 # @param thePnt1 Start point of the arc.
724 # @param thePnt2 Middle point of the arc.
725 # @param thePnt3 End point of the arc.
726 # @return New GEOM_Object, containing the created arc.
728 # @ref swig_MakeArc "Example"
729 def MakeArc(self,thePnt1, thePnt2, thePnt3):
730 # Example: see GEOM_TestAll.py
731 anObj = self.CurvesOp.MakeArc(thePnt1, thePnt2, thePnt3)
732 RaiseIfFailed("MakeArc", self.CurvesOp)
735 ## Create an arc of circle from a center and 2 points.
736 # @param thePnt1 Center of the arc
737 # @param thePnt2 Start point of the arc. (Gives also the radius of the arc)
738 # @param thePnt3 End point of the arc (Gives also a direction)
739 # @param theSense Orientation of the arc
740 # @return New GEOM_Object, containing the created arc.
742 # @ref swig_MakeArc "Example"
743 def MakeArcCenter(self, thePnt1, thePnt2, thePnt3, theSense=False):
744 # Example: see GEOM_TestAll.py
745 anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
746 RaiseIfFailed("MakeArcCenter", self.CurvesOp)
749 ## Create an arc of ellipse, of center and two points.
750 # @param theCenter Center of the arc.
751 # @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
752 # @param thePnt2 defines plane of ellipse and minor radius as distance from Pnt3 to line from Pnt1 to Pnt2.
753 # @return New GEOM_Object, containing the created arc.
755 # @ref swig_MakeArc "Example"
756 def MakeArcOfEllipse(self,theCenter, thePnt1, thePnt2):
757 # Example: see GEOM_TestAll.py
758 anObj = self.CurvesOp.MakeArcOfEllipse(theCenter, thePnt1, thePnt2)
759 RaiseIfFailed("MakeArcOfEllipse", self.CurvesOp)
762 ## Create a circle with given center, normal vector and radius.
763 # @param thePnt Circle center.
764 # @param theVec Vector, normal to the plane of the circle.
765 # @param theR Circle radius.
766 # @return New GEOM_Object, containing the created circle.
768 # @ref tui_creation_circle "Example"
769 def MakeCircle(self, thePnt, theVec, theR):
770 # Example: see GEOM_TestAll.py
771 theR, Parameters = ParseParameters(theR)
772 anObj = self.CurvesOp.MakeCirclePntVecR(thePnt, theVec, theR)
773 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
774 anObj.SetParameters(Parameters)
777 ## Create a circle with given radius.
778 # Center of the circle will be in the origin of global
779 # coordinate system and normal vector will be codirected with Z axis
780 # @param theR Circle radius.
781 # @return New GEOM_Object, containing the created circle.
782 def MakeCircleR(self, theR):
783 anObj = self.CurvesOp.MakeCirclePntVecR(None, None, theR)
784 RaiseIfFailed("MakeCirclePntVecR", self.CurvesOp)
787 ## Create a circle, passing through three given points
788 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
789 # @return New GEOM_Object, containing the created circle.
791 # @ref tui_creation_circle "Example"
792 def MakeCircleThreePnt(self,thePnt1, thePnt2, thePnt3):
793 # Example: see GEOM_TestAll.py
794 anObj = self.CurvesOp.MakeCircleThreePnt(thePnt1, thePnt2, thePnt3)
795 RaiseIfFailed("MakeCircleThreePnt", self.CurvesOp)
798 ## Create a circle, with given point1 as center,
799 # passing through the point2 as radius and laying in the plane,
800 # defined by all three given points.
801 # @param thePnt1,thePnt2,thePnt3 Points, defining the circle.
802 # @return New GEOM_Object, containing the created circle.
804 # @ref swig_MakeCircle "Example"
805 def MakeCircleCenter2Pnt(self,thePnt1, thePnt2, thePnt3):
806 # Example: see GEOM_example6.py
807 anObj = self.CurvesOp.MakeCircleCenter2Pnt(thePnt1, thePnt2, thePnt3)
808 RaiseIfFailed("MakeCircleCenter2Pnt", self.CurvesOp)
811 ## Create an ellipse with given center, normal vector and radiuses.
812 # @param thePnt Ellipse center.
813 # @param theVec Vector, normal to the plane of the ellipse.
814 # @param theRMajor Major ellipse radius.
815 # @param theRMinor Minor ellipse radius.
816 # @param theVecMaj Vector, direction of the ellipse's main axis.
817 # @return New GEOM_Object, containing the created ellipse.
819 # @ref tui_creation_ellipse "Example"
820 def MakeEllipse(self, thePnt, theVec, theRMajor, theRMinor, theVecMaj=None):
821 # Example: see GEOM_TestAll.py
822 theRMajor, theRMinor, Parameters = ParseParameters(theRMajor, theRMinor)
823 if theVecMaj is not None:
824 anObj = self.CurvesOp.MakeEllipseVec(thePnt, theVec, theRMajor, theRMinor, theVecMaj)
826 anObj = self.CurvesOp.MakeEllipse(thePnt, theVec, theRMajor, theRMinor)
828 RaiseIfFailed("MakeEllipse", self.CurvesOp)
829 anObj.SetParameters(Parameters)
832 ## Create an ellipse with given radiuses.
833 # Center of the ellipse will be in the origin of global
834 # coordinate system and normal vector will be codirected with Z axis
835 # @param theRMajor Major ellipse radius.
836 # @param theRMinor Minor ellipse radius.
837 # @return New GEOM_Object, containing the created ellipse.
838 def MakeEllipseRR(self, theRMajor, theRMinor):
839 anObj = self.CurvesOp.MakeEllipse(None, None, theRMajor, theRMinor)
840 RaiseIfFailed("MakeEllipse", self.CurvesOp)
843 ## Create a polyline on the set of points.
844 # @param thePoints Sequence of points for the polyline.
845 # @return New GEOM_Object, containing the created polyline.
847 # @ref tui_creation_curve "Example"
848 def MakePolyline(self,thePoints):
849 # Example: see GEOM_TestAll.py
850 anObj = self.CurvesOp.MakePolyline(thePoints)
851 RaiseIfFailed("MakePolyline", self.CurvesOp)
854 ## Create bezier curve on the set of points.
855 # @param thePoints Sequence of points for the bezier curve.
856 # @return New GEOM_Object, containing the created bezier curve.
858 # @ref tui_creation_curve "Example"
859 def MakeBezier(self,thePoints):
860 # Example: see GEOM_TestAll.py
861 anObj = self.CurvesOp.MakeSplineBezier(thePoints)
862 RaiseIfFailed("MakeSplineBezier", self.CurvesOp)
865 ## Create B-Spline curve on the set of points.
866 # @param thePoints Sequence of points for the B-Spline curve.
867 # @param theIsClosed If True, build a closed curve.
868 # @return New GEOM_Object, containing the created B-Spline curve.
870 # @ref tui_creation_curve "Example"
871 def MakeInterpol(self, thePoints, theIsClosed=False):
872 # Example: see GEOM_TestAll.py
873 anObj = self.CurvesOp.MakeSplineInterpolation(thePoints, theIsClosed)
874 RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
880 ## @addtogroup l3_sketcher
883 ## Create a sketcher (wire or face), following the textual description,
884 # passed through <VAR>theCommand</VAR> argument. \n
885 # Edges of the resulting wire or face will be arcs of circles and/or linear segments. \n
886 # Format of the description string have to be the following:
888 # "Sketcher[:F x1 y1]:CMD[:CMD[:CMD...]]"
891 # - x1, y1 are coordinates of the first sketcher point (zero by default),
893 # - "R angle" : Set the direction by angle
894 # - "D dx dy" : Set the direction by DX & DY
897 # - "TT x y" : Create segment by point at X & Y
898 # - "T dx dy" : Create segment by point with DX & DY
899 # - "L length" : Create segment by direction & Length
900 # - "IX x" : Create segment by direction & Intersect. X
901 # - "IY y" : Create segment by direction & Intersect. Y
904 # - "C radius length" : Create arc by direction, radius and length(in degree)
907 # - "WW" : Close Wire (to finish)
908 # - "WF" : Close Wire and build face (to finish)
910 # @param theCommand String, defining the sketcher in local
911 # coordinates of the working plane.
912 # @param theWorkingPlane Nine double values, defining origin,
913 # OZ and OX directions of the working plane.
914 # @return New GEOM_Object, containing the created wire.
916 # @ref tui_sketcher_page "Example"
917 def MakeSketcher(self, theCommand, theWorkingPlane = [0,0,0, 0,0,1, 1,0,0]):
918 # Example: see GEOM_TestAll.py
919 theCommand,Parameters = ParseSketcherCommand(theCommand)
920 anObj = self.CurvesOp.MakeSketcher(theCommand, theWorkingPlane)
921 RaiseIfFailed("MakeSketcher", self.CurvesOp)
922 anObj.SetParameters(Parameters)
925 ## Create a sketcher (wire or face), following the textual description,
926 # passed through <VAR>theCommand</VAR> argument. \n
927 # For format of the description string see the previous method.\n
928 # @param theCommand String, defining the sketcher in local
929 # coordinates of the working plane.
930 # @param theWorkingPlane Planar Face or LCS(Marker) of the working plane.
931 # @return New GEOM_Object, containing the created wire.
933 # @ref tui_sketcher_page "Example"
934 def MakeSketcherOnPlane(self, theCommand, theWorkingPlane):
935 anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
936 RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
939 ## Create a sketcher wire, following the numerical description,
940 # passed through <VAR>theCoordinates</VAR> argument. \n
941 # @param theCoordinates double values, defining points to create a wire,
943 # @return New GEOM_Object, containing the created wire.
945 # @ref tui_sketcher_page "Example"
946 def Make3DSketcher(self, theCoordinates):
947 anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
948 RaiseIfFailed("Make3DSketcher", self.CurvesOp)
954 ## @addtogroup l3_3d_primitives
957 ## Create a box by coordinates of two opposite vertices.
959 # @ref tui_creation_box "Example"
960 def MakeBox(self,x1,y1,z1,x2,y2,z2):
961 # Example: see GEOM_TestAll.py
962 pnt1 = self.MakeVertex(x1,y1,z1)
963 pnt2 = self.MakeVertex(x2,y2,z2)
964 return self.MakeBoxTwoPnt(pnt1,pnt2)
966 ## Create a box with specified dimensions along the coordinate axes
967 # and with edges, parallel to the coordinate axes.
968 # Center of the box will be at point (DX/2, DY/2, DZ/2).
969 # @param theDX Length of Box edges, parallel to OX axis.
970 # @param theDY Length of Box edges, parallel to OY axis.
971 # @param theDZ Length of Box edges, parallel to OZ axis.
972 # @return New GEOM_Object, containing the created box.
974 # @ref tui_creation_box "Example"
975 def MakeBoxDXDYDZ(self,theDX, theDY, theDZ):
976 # Example: see GEOM_TestAll.py
977 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
978 anObj = self.PrimOp.MakeBoxDXDYDZ(theDX, theDY, theDZ)
979 RaiseIfFailed("MakeBoxDXDYDZ", self.PrimOp)
980 anObj.SetParameters(Parameters)
983 ## Create a box with two specified opposite vertices,
984 # and with edges, parallel to the coordinate axes
985 # @param thePnt1 First of two opposite vertices.
986 # @param thePnt2 Second of two opposite vertices.
987 # @return New GEOM_Object, containing the created box.
989 # @ref tui_creation_box "Example"
990 def MakeBoxTwoPnt(self,thePnt1, thePnt2):
991 # Example: see GEOM_TestAll.py
992 anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
993 RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
996 ## Create a face with specified dimensions along OX-OY coordinate axes,
997 # with edges, parallel to this coordinate axes.
998 # @param theH height of Face.
999 # @param theW width of Face.
1000 # @param theOrientation orientation belong axis OXY OYZ OZX
1001 # @return New GEOM_Object, containing the created face.
1003 # @ref tui_creation_face "Example"
1004 def MakeFaceHW(self,theH, theW, theOrientation):
1005 # Example: see GEOM_TestAll.py
1006 theH,theW,Parameters = ParseParameters(theH, theW)
1007 anObj = self.PrimOp.MakeFaceHW(theH, theW, theOrientation)
1008 RaiseIfFailed("MakeFaceHW", self.PrimOp)
1009 anObj.SetParameters(Parameters)
1012 ## Create a face from another plane and two sizes,
1013 # vertical size and horisontal size.
1014 # @param theObj Normale vector to the creating face or
1016 # @param theH Height (vertical size).
1017 # @param theW Width (horisontal size).
1018 # @return New GEOM_Object, containing the created face.
1020 # @ref tui_creation_face "Example"
1021 def MakeFaceObjHW(self, theObj, theH, theW):
1022 # Example: see GEOM_TestAll.py
1023 theH,theW,Parameters = ParseParameters(theH, theW)
1024 anObj = self.PrimOp.MakeFaceObjHW(theObj, theH, theW)
1025 RaiseIfFailed("MakeFaceObjHW", self.PrimOp)
1026 anObj.SetParameters(Parameters)
1029 ## Create a disk with given center, normal vector and radius.
1030 # @param thePnt Disk center.
1031 # @param theVec Vector, normal to the plane of the disk.
1032 # @param theR Disk radius.
1033 # @return New GEOM_Object, containing the created disk.
1035 # @ref tui_creation_disk "Example"
1036 def MakeDiskPntVecR(self,thePnt, theVec, theR):
1037 # Example: see GEOM_TestAll.py
1038 theR,Parameters = ParseParameters(theR)
1039 anObj = self.PrimOp.MakeDiskPntVecR(thePnt, theVec, theR)
1040 RaiseIfFailed("MakeDiskPntVecR", self.PrimOp)
1041 anObj.SetParameters(Parameters)
1044 ## Create a disk, passing through three given points
1045 # @param thePnt1,thePnt2,thePnt3 Points, defining the disk.
1046 # @return New GEOM_Object, containing the created disk.
1048 # @ref tui_creation_disk "Example"
1049 def MakeDiskThreePnt(self,thePnt1, thePnt2, thePnt3):
1050 # Example: see GEOM_TestAll.py
1051 anObj = self.PrimOp.MakeDiskThreePnt(thePnt1, thePnt2, thePnt3)
1052 RaiseIfFailed("MakeDiskThreePnt", self.PrimOp)
1055 ## Create a disk with specified dimensions along OX-OY coordinate axes.
1056 # @param theR Radius of Face.
1057 # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
1058 # @return New GEOM_Object, containing the created disk.
1060 # @ref tui_creation_face "Example"
1061 def MakeDiskR(self,theR, theOrientation):
1062 # Example: see GEOM_TestAll.py
1063 theR,Parameters = ParseParameters(theR)
1064 anObj = self.PrimOp.MakeDiskR(theR, theOrientation)
1065 RaiseIfFailed("MakeDiskR", self.PrimOp)
1066 anObj.SetParameters(Parameters)
1069 ## Create a cylinder with given base point, axis, radius and height.
1070 # @param thePnt Central point of cylinder base.
1071 # @param theAxis Cylinder axis.
1072 # @param theR Cylinder radius.
1073 # @param theH Cylinder height.
1074 # @return New GEOM_Object, containing the created cylinder.
1076 # @ref tui_creation_cylinder "Example"
1077 def MakeCylinder(self,thePnt, theAxis, theR, theH):
1078 # Example: see GEOM_TestAll.py
1079 theR,theH,Parameters = ParseParameters(theR, theH)
1080 anObj = self.PrimOp.MakeCylinderPntVecRH(thePnt, theAxis, theR, theH)
1081 RaiseIfFailed("MakeCylinderPntVecRH", self.PrimOp)
1082 anObj.SetParameters(Parameters)
1085 ## Create a cylinder with given radius and height at
1086 # the origin of coordinate system. Axis of the cylinder
1087 # will be collinear to the OZ axis of the coordinate system.
1088 # @param theR Cylinder radius.
1089 # @param theH Cylinder height.
1090 # @return New GEOM_Object, containing the created cylinder.
1092 # @ref tui_creation_cylinder "Example"
1093 def MakeCylinderRH(self,theR, theH):
1094 # Example: see GEOM_TestAll.py
1095 theR,theH,Parameters = ParseParameters(theR, theH)
1096 anObj = self.PrimOp.MakeCylinderRH(theR, theH)
1097 RaiseIfFailed("MakeCylinderRH", self.PrimOp)
1098 anObj.SetParameters(Parameters)
1101 ## Create a sphere with given center and radius.
1102 # @param thePnt Sphere center.
1103 # @param theR Sphere radius.
1104 # @return New GEOM_Object, containing the created sphere.
1106 # @ref tui_creation_sphere "Example"
1107 def MakeSpherePntR(self, thePnt, theR):
1108 # Example: see GEOM_TestAll.py
1109 theR,Parameters = ParseParameters(theR)
1110 anObj = self.PrimOp.MakeSpherePntR(thePnt, theR)
1111 RaiseIfFailed("MakeSpherePntR", self.PrimOp)
1112 anObj.SetParameters(Parameters)
1115 ## Create a sphere with given center and radius.
1116 # @param x,y,z Coordinates of sphere center.
1117 # @param theR Sphere radius.
1118 # @return New GEOM_Object, containing the created sphere.
1120 # @ref tui_creation_sphere "Example"
1121 def MakeSphere(self, x, y, z, theR):
1122 # Example: see GEOM_TestAll.py
1123 point = self.MakeVertex(x, y, z)
1124 anObj = self.MakeSpherePntR(point, theR)
1127 ## Create a sphere with given radius at the origin of coordinate system.
1128 # @param theR Sphere radius.
1129 # @return New GEOM_Object, containing the created sphere.
1131 # @ref tui_creation_sphere "Example"
1132 def MakeSphereR(self, theR):
1133 # Example: see GEOM_TestAll.py
1134 theR,Parameters = ParseParameters(theR)
1135 anObj = self.PrimOp.MakeSphereR(theR)
1136 RaiseIfFailed("MakeSphereR", self.PrimOp)
1137 anObj.SetParameters(Parameters)
1140 ## Create a cone with given base point, axis, height and radiuses.
1141 # @param thePnt Central point of the first cone base.
1142 # @param theAxis Cone axis.
1143 # @param theR1 Radius of the first cone base.
1144 # @param theR2 Radius of the second cone base.
1145 # \note If both radiuses are non-zero, the cone will be truncated.
1146 # \note If the radiuses are equal, a cylinder will be created instead.
1147 # @param theH Cone height.
1148 # @return New GEOM_Object, containing the created cone.
1150 # @ref tui_creation_cone "Example"
1151 def MakeCone(self,thePnt, theAxis, theR1, theR2, theH):
1152 # Example: see GEOM_TestAll.py
1153 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
1154 anObj = self.PrimOp.MakeConePntVecR1R2H(thePnt, theAxis, theR1, theR2, theH)
1155 RaiseIfFailed("MakeConePntVecR1R2H", self.PrimOp)
1156 anObj.SetParameters(Parameters)
1159 ## Create a cone with given height and radiuses at
1160 # the origin of coordinate system. Axis of the cone will
1161 # be collinear to the OZ axis of the coordinate system.
1162 # @param theR1 Radius of the first cone base.
1163 # @param theR2 Radius of the second cone base.
1164 # \note If both radiuses are non-zero, the cone will be truncated.
1165 # \note If the radiuses are equal, a cylinder will be created instead.
1166 # @param theH Cone height.
1167 # @return New GEOM_Object, containing the created cone.
1169 # @ref tui_creation_cone "Example"
1170 def MakeConeR1R2H(self,theR1, theR2, theH):
1171 # Example: see GEOM_TestAll.py
1172 theR1,theR2,theH,Parameters = ParseParameters(theR1,theR2,theH)
1173 anObj = self.PrimOp.MakeConeR1R2H(theR1, theR2, theH)
1174 RaiseIfFailed("MakeConeR1R2H", self.PrimOp)
1175 anObj.SetParameters(Parameters)
1178 ## Create a torus with given center, normal vector and radiuses.
1179 # @param thePnt Torus central point.
1180 # @param theVec Torus axis of symmetry.
1181 # @param theRMajor Torus major radius.
1182 # @param theRMinor Torus minor radius.
1183 # @return New GEOM_Object, containing the created torus.
1185 # @ref tui_creation_torus "Example"
1186 def MakeTorus(self, thePnt, theVec, theRMajor, theRMinor):
1187 # Example: see GEOM_TestAll.py
1188 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
1189 anObj = self.PrimOp.MakeTorusPntVecRR(thePnt, theVec, theRMajor, theRMinor)
1190 RaiseIfFailed("MakeTorusPntVecRR", self.PrimOp)
1191 anObj.SetParameters(Parameters)
1194 ## Create a torus with given radiuses at the origin of coordinate system.
1195 # @param theRMajor Torus major radius.
1196 # @param theRMinor Torus minor radius.
1197 # @return New GEOM_Object, containing the created torus.
1199 # @ref tui_creation_torus "Example"
1200 def MakeTorusRR(self, theRMajor, theRMinor):
1201 # Example: see GEOM_TestAll.py
1202 theRMajor,theRMinor,Parameters = ParseParameters(theRMajor,theRMinor)
1203 anObj = self.PrimOp.MakeTorusRR(theRMajor, theRMinor)
1204 RaiseIfFailed("MakeTorusRR", self.PrimOp)
1205 anObj.SetParameters(Parameters)
1208 # end of l3_3d_primitives
1211 ## @addtogroup l3_complex
1214 ## Create a shape by extrusion of the base shape along a vector, defined by two points.
1215 # @param theBase Base shape to be extruded.
1216 # @param thePoint1 First end of extrusion vector.
1217 # @param thePoint2 Second end of extrusion vector.
1218 # @return New GEOM_Object, containing the created prism.
1220 # @ref tui_creation_prism "Example"
1221 def MakePrism(self, theBase, thePoint1, thePoint2):
1222 # Example: see GEOM_TestAll.py
1223 anObj = self.PrimOp.MakePrismTwoPnt(theBase, thePoint1, thePoint2)
1224 RaiseIfFailed("MakePrismTwoPnt", self.PrimOp)
1227 ## Create a shape by extrusion of the base shape along the vector,
1228 # i.e. all the space, transfixed by the base shape during its translation
1229 # along the vector on the given distance.
1230 # @param theBase Base shape to be extruded.
1231 # @param theVec Direction of extrusion.
1232 # @param theH Prism dimension along theVec.
1233 # @return New GEOM_Object, containing the created prism.
1235 # @ref tui_creation_prism "Example"
1236 def MakePrismVecH(self, theBase, theVec, theH):
1237 # Example: see GEOM_TestAll.py
1238 theH,Parameters = ParseParameters(theH)
1239 anObj = self.PrimOp.MakePrismVecH(theBase, theVec, theH)
1240 RaiseIfFailed("MakePrismVecH", self.PrimOp)
1241 anObj.SetParameters(Parameters)
1244 ## Create a shape by extrusion of the base shape along the vector,
1245 # i.e. all the space, transfixed by the base shape during its translation
1246 # along the vector on the given distance in 2 Ways (forward/backward) .
1247 # @param theBase Base shape to be extruded.
1248 # @param theVec Direction of extrusion.
1249 # @param theH Prism dimension along theVec in forward direction.
1250 # @return New GEOM_Object, containing the created prism.
1252 # @ref tui_creation_prism "Example"
1253 def MakePrismVecH2Ways(self, theBase, theVec, theH):
1254 # Example: see GEOM_TestAll.py
1255 theH,Parameters = ParseParameters(theH)
1256 anObj = self.PrimOp.MakePrismVecH2Ways(theBase, theVec, theH)
1257 RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
1258 anObj.SetParameters(Parameters)
1261 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
1262 # @param theBase Base shape to be extruded.
1263 # @param theDX, theDY, theDZ Directions of extrusion.
1264 # @return New GEOM_Object, containing the created prism.
1266 # @ref tui_creation_prism "Example"
1267 def MakePrismDXDYDZ(self, theBase, theDX, theDY, theDZ):
1268 # Example: see GEOM_TestAll.py
1269 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1270 anObj = self.PrimOp.MakePrismDXDYDZ(theBase, theDX, theDY, theDZ)
1271 RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
1272 anObj.SetParameters(Parameters)
1275 ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
1276 # i.e. all the space, transfixed by the base shape during its translation
1277 # along the vector on the given distance in 2 Ways (forward/backward) .
1278 # @param theBase Base shape to be extruded.
1279 # @param theDX, theDY, theDZ Directions of extrusion.
1280 # @return New GEOM_Object, containing the created prism.
1282 # @ref tui_creation_prism "Example"
1283 def MakePrismDXDYDZ2Ways(self, theBase, theDX, theDY, theDZ):
1284 # Example: see GEOM_TestAll.py
1285 theDX,theDY,theDZ,Parameters = ParseParameters(theDX, theDY, theDZ)
1286 anObj = self.PrimOp.MakePrismDXDYDZ2Ways(theBase, theDX, theDY, theDZ)
1287 RaiseIfFailed("MakePrismDXDYDZ2Ways", self.PrimOp)
1288 anObj.SetParameters(Parameters)
1291 ## Create a shape by revolution of the base shape around the axis
1292 # on the given angle, i.e. all the space, transfixed by the base
1293 # shape during its rotation around the axis on the given angle.
1294 # @param theBase Base shape to be rotated.
1295 # @param theAxis Rotation axis.
1296 # @param theAngle Rotation angle in radians.
1297 # @return New GEOM_Object, containing the created revolution.
1299 # @ref tui_creation_revolution "Example"
1300 def MakeRevolution(self, theBase, theAxis, theAngle):
1301 # Example: see GEOM_TestAll.py
1302 theAngle,Parameters = ParseParameters(theAngle)
1303 anObj = self.PrimOp.MakeRevolutionAxisAngle(theBase, theAxis, theAngle)
1304 RaiseIfFailed("MakeRevolutionAxisAngle", self.PrimOp)
1305 anObj.SetParameters(Parameters)
1308 ## The Same Revolution but in both ways forward&backward.
1309 def MakeRevolution2Ways(self, theBase, theAxis, theAngle):
1310 theAngle,Parameters = ParseParameters(theAngle)
1311 anObj = self.PrimOp.MakeRevolutionAxisAngle2Ways(theBase, theAxis, theAngle)
1312 RaiseIfFailed("MakeRevolutionAxisAngle2Ways", self.PrimOp)
1313 anObj.SetParameters(Parameters)
1316 ## Create a filling from the given compound of contours.
1317 # @param theShape the compound of contours
1318 # @param theMinDeg a minimal degree of BSpline surface to create
1319 # @param theMaxDeg a maximal degree of BSpline surface to create
1320 # @param theTol2D a 2d tolerance to be reached
1321 # @param theTol3D a 3d tolerance to be reached
1322 # @param theNbIter a number of iteration of approximation algorithm
1323 # @param isUseOri flag for take into account orientation of edges
1324 # @param isApprox if True, BSpline curves are generated in the process
1325 # of surface construction. By default it is False, that means
1326 # the surface is created using Besier curves. The usage of
1327 # Approximation makes the algorithm work slower, but allows
1328 # building the surface for rather complex cases
1329 # @return New GEOM_Object, containing the created filling surface.
1331 # @ref tui_creation_filling "Example"
1332 def MakeFilling(self, theShape, theMinDeg, theMaxDeg, theTol2D,
1333 theTol3D, theNbIter, isUseOri=0, isApprox=0):
1334 # Example: see GEOM_TestAll.py
1335 theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg,
1336 theTol2D, theTol3D, theNbIter)
1337 anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
1338 theTol2D, theTol3D, theNbIter,
1340 RaiseIfFailed("MakeFilling", self.PrimOp)
1341 anObj.SetParameters(Parameters)
1344 ## Create a shell or solid passing through set of sections.Sections should be wires,edges or vertices.
1345 # @param theSeqSections - set of specified sections.
1346 # @param theModeSolid - mode defining building solid or shell
1347 # @param thePreci - precision 3D used for smoothing by default 1.e-6
1348 # @param theRuled - mode defining type of the result surfaces (ruled or smoothed).
1349 # @return New GEOM_Object, containing the created shell or solid.
1351 # @ref swig_todo "Example"
1352 def MakeThruSections(self,theSeqSections,theModeSolid,thePreci,theRuled):
1353 # Example: see GEOM_TestAll.py
1354 anObj = self.PrimOp.MakeThruSections(theSeqSections,theModeSolid,thePreci,theRuled)
1355 RaiseIfFailed("MakeThruSections", self.PrimOp)
1358 ## Create a shape by extrusion of the base shape along
1359 # the path shape. The path shape can be a wire or an edge.
1360 # @param theBase Base shape to be extruded.
1361 # @param thePath Path shape to extrude the base shape along it.
1362 # @return New GEOM_Object, containing the created pipe.
1364 # @ref tui_creation_pipe "Example"
1365 def MakePipe(self,theBase, thePath):
1366 # Example: see GEOM_TestAll.py
1367 anObj = self.PrimOp.MakePipe(theBase, thePath)
1368 RaiseIfFailed("MakePipe", self.PrimOp)
1371 ## Create a shape by extrusion of the profile shape along
1372 # the path shape. The path shape can be a wire or an edge.
1373 # the several profiles can be specified in the several locations of path.
1374 # @param theSeqBases - list of Bases shape to be extruded.
1375 # @param theLocations - list of locations on the path corresponding
1376 # specified list of the Bases shapes. Number of locations
1377 # should be equal to number of bases or list of locations can be empty.
1378 # @param thePath - Path shape to extrude the base shape along it.
1379 # @param theWithContact - the mode defining that the section is translated to be in
1380 # contact with the spine.
1381 # @param theWithCorrection - defining that the section is rotated to be
1382 # orthogonal to the spine tangent in the correspondent point
1383 # @return New GEOM_Object, containing the created pipe.
1385 # @ref tui_creation_pipe_with_diff_sec "Example"
1386 def MakePipeWithDifferentSections(self, theSeqBases,
1387 theLocations, thePath,
1388 theWithContact, theWithCorrection):
1389 anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
1390 theLocations, thePath,
1391 theWithContact, theWithCorrection)
1392 RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
1395 ## Create a shape by extrusion of the profile shape along
1396 # the path shape. The path shape can be a wire or a edge.
1397 # the several profiles can be specified in the several locations of path.
1398 # @param theSeqBases - list of Bases shape to be extruded. Base shape must be
1399 # shell or face. If number of faces in neighbour sections
1400 # aren't coincided result solid between such sections will
1401 # be created using external boundaries of this shells.
1402 # @param theSeqSubBases - list of corresponding subshapes of section shapes.
1403 # This list is used for searching correspondences between
1404 # faces in the sections. Size of this list must be equal
1405 # to size of list of base shapes.
1406 # @param theLocations - list of locations on the path corresponding
1407 # specified list of the Bases shapes. Number of locations
1408 # should be equal to number of bases. First and last
1409 # locations must be coincided with first and last vertexes
1410 # of path correspondingly.
1411 # @param thePath - Path shape to extrude the base shape along it.
1412 # @param theWithContact - the mode defining that the section is translated to be in
1413 # contact with the spine.
1414 # @param theWithCorrection - defining that the section is rotated to be
1415 # orthogonal to the spine tangent in the correspondent point
1416 # @return New GEOM_Object, containing the created solids.
1418 # @ref tui_creation_pipe_with_shell_sec "Example"
1419 def MakePipeWithShellSections(self,theSeqBases, theSeqSubBases,
1420 theLocations, thePath,
1421 theWithContact, theWithCorrection):
1422 anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
1423 theLocations, thePath,
1424 theWithContact, theWithCorrection)
1425 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
1428 ## Create a shape by extrusion of the profile shape along
1429 # the path shape. This function is used only for debug pipe
1430 # functionality - it is a version of previous function
1431 # (MakePipeWithShellSections(...)) which give a possibility to
1432 # recieve information about creating pipe between each pair of
1433 # sections step by step.
1434 def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
1435 theLocations, thePath,
1436 theWithContact, theWithCorrection):
1438 nbsect = len(theSeqBases)
1439 nbsubsect = len(theSeqSubBases)
1440 #print "nbsect = ",nbsect
1441 for i in range(1,nbsect):
1443 tmpSeqBases = [ theSeqBases[i-1], theSeqBases[i] ]
1444 tmpLocations = [ theLocations[i-1], theLocations[i] ]
1446 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
1447 anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
1448 tmpLocations, thePath,
1449 theWithContact, theWithCorrection)
1450 if self.PrimOp.IsDone() == 0:
1451 print "Problems with pipe creation between ",i," and ",i+1," sections"
1452 RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
1455 print "Pipe between ",i," and ",i+1," sections is OK"
1460 resc = self.MakeCompound(res)
1461 #resc = self.MakeSewing(res, 0.001)
1462 #print "resc: ",resc
1465 ## Create solids between given sections
1466 # @param theSeqBases - list of sections (shell or face).
1467 # @param theLocations - list of corresponding vertexes
1468 # @return New GEOM_Object, containing the created solids.
1470 # @ref tui_creation_pipe_without_path "Example"
1471 def MakePipeShellsWithoutPath(self, theSeqBases, theLocations):
1472 anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
1473 RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
1476 ## Create a shape by extrusion of the base shape along
1477 # the path shape with constant bi-normal direction along the given vector.
1478 # The path shape can be a wire or an edge.
1479 # @param theBase Base shape to be extruded.
1480 # @param thePath Path shape to extrude the base shape along it.
1481 # @param theVec Vector defines a constant binormal direction to keep the
1482 # same angle beetween the direction and the sections
1483 # along the sweep surface.
1484 # @return New GEOM_Object, containing the created pipe.
1486 # @ref tui_creation_pipe "Example"
1487 def MakePipeBiNormalAlongVector(self,theBase, thePath, theVec):
1488 # Example: see GEOM_TestAll.py
1489 anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
1490 RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
1496 ## @addtogroup l3_advanced
1499 ## Create a linear edge with specified ends.
1500 # @param thePnt1 Point for the first end of edge.
1501 # @param thePnt2 Point for the second end of edge.
1502 # @return New GEOM_Object, containing the created edge.
1504 # @ref tui_creation_edge "Example"
1505 def MakeEdge(self,thePnt1, thePnt2):
1506 # Example: see GEOM_TestAll.py
1507 anObj = self.ShapesOp.MakeEdge(thePnt1, thePnt2)
1508 RaiseIfFailed("MakeEdge", self.ShapesOp)
1511 ## Create a wire from the set of edges and wires.
1512 # @param theEdgesAndWires List of edges and/or wires.
1513 # @param theTolerance Maximum distance between vertices, that will be merged.
1514 # Values less than 1e-07 are equivalent to 1e-07 (Precision::Confusion()).
1515 # @return New GEOM_Object, containing the created wire.
1517 # @ref tui_creation_wire "Example"
1518 def MakeWire(self, theEdgesAndWires, theTolerance = 1e-07):
1519 # Example: see GEOM_TestAll.py
1520 anObj = self.ShapesOp.MakeWire(theEdgesAndWires, theTolerance)
1521 RaiseIfFailed("MakeWire", self.ShapesOp)
1524 ## Create a face on the given wire.
1525 # @param theWire closed Wire or Edge to build the face on.
1526 # @param isPlanarWanted If TRUE, only planar face will be built.
1527 # If impossible, NULL object will be returned.
1528 # @return New GEOM_Object, containing the created face.
1530 # @ref tui_creation_face "Example"
1531 def MakeFace(self,theWire, isPlanarWanted):
1532 # Example: see GEOM_TestAll.py
1533 anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
1534 RaiseIfFailed("MakeFace", self.ShapesOp)
1537 ## Create a face on the given wires set.
1538 # @param theWires List of closed wires or edges to build the face on.
1539 # @param isPlanarWanted If TRUE, only planar face will be built.
1540 # If impossible, NULL object will be returned.
1541 # @return New GEOM_Object, containing the created face.
1543 # @ref tui_creation_face "Example"
1544 def MakeFaceWires(self,theWires, isPlanarWanted):
1545 # Example: see GEOM_TestAll.py
1546 anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
1547 RaiseIfFailed("MakeFaceWires", self.ShapesOp)
1550 ## Shortcut to MakeFaceWires()
1552 # @ref tui_creation_face "Example 1"
1553 # \n @ref swig_MakeFaces "Example 2"
1554 def MakeFaces(self,theWires, isPlanarWanted):
1555 # Example: see GEOM_TestOthers.py
1556 anObj = self.MakeFaceWires(theWires, isPlanarWanted)
1559 ## Create a shell from the set of faces and shells.
1560 # @param theFacesAndShells List of faces and/or shells.
1561 # @return New GEOM_Object, containing the created shell.
1563 # @ref tui_creation_shell "Example"
1564 def MakeShell(self,theFacesAndShells):
1565 # Example: see GEOM_TestAll.py
1566 anObj = self.ShapesOp.MakeShell(theFacesAndShells)
1567 RaiseIfFailed("MakeShell", self.ShapesOp)
1570 ## Create a solid, bounded by the given shells.
1571 # @param theShells Sequence of bounding shells.
1572 # @return New GEOM_Object, containing the created solid.
1574 # @ref tui_creation_solid "Example"
1575 def MakeSolid(self,theShells):
1576 # Example: see GEOM_TestAll.py
1577 anObj = self.ShapesOp.MakeSolidShells(theShells)
1578 RaiseIfFailed("MakeSolidShells", self.ShapesOp)
1581 ## Create a compound of the given shapes.
1582 # @param theShapes List of shapes to put in compound.
1583 # @return New GEOM_Object, containing the created compound.
1585 # @ref tui_creation_compound "Example"
1586 def MakeCompound(self,theShapes):
1587 # Example: see GEOM_TestAll.py
1588 anObj = self.ShapesOp.MakeCompound(theShapes)
1589 RaiseIfFailed("MakeCompound", self.ShapesOp)
1592 # end of l3_advanced
1595 ## @addtogroup l2_measure
1598 ## Gives quantity of faces in the given shape.
1599 # @param theShape Shape to count faces of.
1600 # @return Quantity of faces.
1602 # @ref swig_NumberOf "Example"
1603 def NumberOfFaces(self, theShape):
1604 # Example: see GEOM_TestOthers.py
1605 nb_faces = self.ShapesOp.NumberOfFaces(theShape)
1606 RaiseIfFailed("NumberOfFaces", self.ShapesOp)
1609 ## Gives quantity of edges in the given shape.
1610 # @param theShape Shape to count edges of.
1611 # @return Quantity of edges.
1613 # @ref swig_NumberOf "Example"
1614 def NumberOfEdges(self, theShape):
1615 # Example: see GEOM_TestOthers.py
1616 nb_edges = self.ShapesOp.NumberOfEdges(theShape)
1617 RaiseIfFailed("NumberOfEdges", self.ShapesOp)
1620 ## Gives quantity of subshapes of type theShapeType in the given shape.
1621 # @param theShape Shape to count subshapes of.
1622 # @param theShapeType Type of subshapes to count.
1623 # @return Quantity of subshapes of given type.
1625 # @ref swig_NumberOf "Example"
1626 def NumberOfSubShapes(self, theShape, theShapeType):
1627 # Example: see GEOM_TestOthers.py
1628 nb_ss = self.ShapesOp.NumberOfSubShapes(theShape, theShapeType)
1629 RaiseIfFailed("NumberOfSubShapes", self.ShapesOp)
1632 ## Gives quantity of solids in the given shape.
1633 # @param theShape Shape to count solids in.
1634 # @return Quantity of solids.
1636 # @ref swig_NumberOf "Example"
1637 def NumberOfSolids(self, theShape):
1638 # Example: see GEOM_TestOthers.py
1639 nb_solids = self.ShapesOp.NumberOfSubShapes(theShape, ShapeType["SOLID"])
1640 RaiseIfFailed("NumberOfSolids", self.ShapesOp)
1646 ## @addtogroup l3_healing
1649 ## Reverses an orientation the given shape.
1650 # @param theShape Shape to be reversed.
1651 # @return The reversed copy of theShape.
1653 # @ref swig_ChangeOrientation "Example"
1654 def ChangeOrientation(self,theShape):
1655 # Example: see GEOM_TestAll.py
1656 anObj = self.ShapesOp.ChangeOrientation(theShape)
1657 RaiseIfFailed("ChangeOrientation", self.ShapesOp)
1660 ## Shortcut to ChangeOrientation()
1662 # @ref swig_OrientationChange "Example"
1663 def OrientationChange(self,theShape):
1664 # Example: see GEOM_TestOthers.py
1665 anObj = self.ChangeOrientation(theShape)
1671 ## @addtogroup l4_obtain
1674 ## Retrieve all free faces from the given shape.
1675 # Free face is a face, which is not shared between two shells of the shape.
1676 # @param theShape Shape to find free faces in.
1677 # @return List of IDs of all free faces, contained in theShape.
1679 # @ref tui_measurement_tools_page "Example"
1680 def GetFreeFacesIDs(self,theShape):
1681 # Example: see GEOM_TestOthers.py
1682 anIDs = self.ShapesOp.GetFreeFacesIDs(theShape)
1683 RaiseIfFailed("GetFreeFacesIDs", self.ShapesOp)
1686 ## Get all sub-shapes of theShape1 of the given type, shared with theShape2.
1687 # @param theShape1 Shape to find sub-shapes in.
1688 # @param theShape2 Shape to find shared sub-shapes with.
1689 # @param theShapeType Type of sub-shapes to be retrieved.
1690 # @return List of sub-shapes of theShape1, shared with theShape2.
1692 # @ref swig_GetSharedShapes "Example"
1693 def GetSharedShapes(self,theShape1, theShape2, theShapeType):
1694 # Example: see GEOM_TestOthers.py
1695 aList = self.ShapesOp.GetSharedShapes(theShape1, theShape2, theShapeType)
1696 RaiseIfFailed("GetSharedShapes", self.ShapesOp)
1699 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
1700 # situated relatively the specified plane by the certain way,
1701 # defined through <VAR>theState</VAR> parameter.
1702 # @param theShape Shape to find sub-shapes of.
1703 # @param theShapeType Type of sub-shapes to be retrieved.
1704 # @param theAx1 Vector (or line, or linear edge), specifying normal
1705 # direction and location of the plane to find shapes on.
1706 # @param theState The state of the subshapes to find. It can be one of
1707 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1708 # @return List of all found sub-shapes.
1710 # @ref swig_GetShapesOnPlane "Example"
1711 def GetShapesOnPlane(self,theShape, theShapeType, theAx1, theState):
1712 # Example: see GEOM_TestOthers.py
1713 aList = self.ShapesOp.GetShapesOnPlane(theShape, theShapeType, theAx1, theState)
1714 RaiseIfFailed("GetShapesOnPlane", self.ShapesOp)
1717 ## Works like the above method, but returns list of sub-shapes indices
1719 # @ref swig_GetShapesOnPlaneIDs "Example"
1720 def GetShapesOnPlaneIDs(self,theShape, theShapeType, theAx1, theState):
1721 # Example: see GEOM_TestOthers.py
1722 aList = self.ShapesOp.GetShapesOnPlaneIDs(theShape, theShapeType, theAx1, theState)
1723 RaiseIfFailed("GetShapesOnPlaneIDs", self.ShapesOp)
1726 ## Find in <VAR>theShape</VAR> all sub-shapes of type <VAR>theShapeType</VAR>,
1727 # situated relatively the specified plane by the certain way,
1728 # defined through <VAR>theState</VAR> parameter.
1729 # @param theShape Shape to find sub-shapes of.
1730 # @param theShapeType Type of sub-shapes to be retrieved.
1731 # @param theAx1 Vector (or line, or linear edge), specifying normal
1732 # direction of the plane to find shapes on.
1733 # @param thePnt Point specifying location of the plane to find shapes on.
1734 # @param theState The state of the subshapes to find. It can be one of
1735 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1736 # @return List of all found sub-shapes.
1738 # @ref swig_GetShapesOnPlaneWithLocation "Example"
1739 def GetShapesOnPlaneWithLocation(self, theShape, theShapeType, theAx1, thePnt, theState):
1740 # Example: see GEOM_TestOthers.py
1741 aList = self.ShapesOp.GetShapesOnPlaneWithLocation(theShape, theShapeType,
1742 theAx1, thePnt, theState)
1743 RaiseIfFailed("GetShapesOnPlaneWithLocation", self.ShapesOp)
1746 ## Works like the above method, but returns list of sub-shapes indices
1748 # @ref swig_GetShapesOnPlaneWithLocationIDs "Example"
1749 def GetShapesOnPlaneWithLocationIDs(self, theShape, theShapeType, theAx1, thePnt, theState):
1750 # Example: see GEOM_TestOthers.py
1751 aList = self.ShapesOp.GetShapesOnPlaneWithLocationIDs(theShape, theShapeType,
1752 theAx1, thePnt, theState)
1753 RaiseIfFailed("GetShapesOnPlaneWithLocationIDs", self.ShapesOp)
1756 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1757 # the specified cylinder by the certain way, defined through \a theState parameter.
1758 # @param theShape Shape to find sub-shapes of.
1759 # @param theShapeType Type of sub-shapes to be retrieved.
1760 # @param theAxis Vector (or line, or linear edge), specifying
1761 # axis of the cylinder to find shapes on.
1762 # @param theRadius Radius of the cylinder to find shapes on.
1763 # @param theState The state of the subshapes to find. It can be one of
1764 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1765 # @return List of all found sub-shapes.
1767 # @ref swig_GetShapesOnCylinder "Example"
1768 def GetShapesOnCylinder(self, theShape, theShapeType, theAxis, theRadius, theState):
1769 # Example: see GEOM_TestOthers.py
1770 aList = self.ShapesOp.GetShapesOnCylinder(theShape, theShapeType, theAxis, theRadius, theState)
1771 RaiseIfFailed("GetShapesOnCylinder", self.ShapesOp)
1774 ## Works like the above method, but returns list of sub-shapes indices
1776 # @ref swig_GetShapesOnCylinderIDs "Example"
1777 def GetShapesOnCylinderIDs(self, theShape, theShapeType, theAxis, theRadius, theState):
1778 # Example: see GEOM_TestOthers.py
1779 aList = self.ShapesOp.GetShapesOnCylinderIDs(theShape, theShapeType, theAxis, theRadius, theState)
1780 RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
1783 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1784 # the specified cylinder by the certain way, defined through \a theState parameter.
1785 # @param theShape Shape to find sub-shapes of.
1786 # @param theShapeType Type of sub-shapes to be retrieved.
1787 # @param theAxis Vector (or line, or linear edge), specifying
1788 # axis of the cylinder to find shapes on.
1789 # @param thePnt Point specifying location of the bottom of the cylinder.
1790 # @param theRadius Radius of the cylinder to find shapes on.
1791 # @param theState The state of the subshapes to find. It can be one of
1792 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1793 # @return List of all found sub-shapes.
1795 # @ref swig_GetShapesOnCylinderWithLocation "Example"
1796 def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
1797 # Example: see GEOM_TestOthers.py
1798 aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
1799 RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
1802 ## Works like the above method, but returns list of sub-shapes indices
1804 # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
1805 def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
1806 # Example: see GEOM_TestOthers.py
1807 aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
1808 RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
1811 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1812 # the specified sphere by the certain way, defined through \a theState parameter.
1813 # @param theShape Shape to find sub-shapes of.
1814 # @param theShapeType Type of sub-shapes to be retrieved.
1815 # @param theCenter Point, specifying center of the sphere to find shapes on.
1816 # @param theRadius Radius of the sphere to find shapes on.
1817 # @param theState The state of the subshapes to find. It can be one of
1818 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1819 # @return List of all found sub-shapes.
1821 # @ref swig_GetShapesOnSphere "Example"
1822 def GetShapesOnSphere(self,theShape, theShapeType, theCenter, theRadius, theState):
1823 # Example: see GEOM_TestOthers.py
1824 aList = self.ShapesOp.GetShapesOnSphere(theShape, theShapeType, theCenter, theRadius, theState)
1825 RaiseIfFailed("GetShapesOnSphere", self.ShapesOp)
1828 ## Works like the above method, but returns list of sub-shapes indices
1830 # @ref swig_GetShapesOnSphereIDs "Example"
1831 def GetShapesOnSphereIDs(self,theShape, theShapeType, theCenter, theRadius, theState):
1832 # Example: see GEOM_TestOthers.py
1833 aList = self.ShapesOp.GetShapesOnSphereIDs(theShape, theShapeType, theCenter, theRadius, theState)
1834 RaiseIfFailed("GetShapesOnSphereIDs", self.ShapesOp)
1837 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1838 # the specified quadrangle by the certain way, defined through \a theState parameter.
1839 # @param theShape Shape to find sub-shapes of.
1840 # @param theShapeType Type of sub-shapes to be retrieved.
1841 # @param theTopLeftPoint Point, specifying top left corner of a quadrangle
1842 # @param theTopRigthPoint Point, specifying top right corner of a quadrangle
1843 # @param theBottomLeftPoint Point, specifying bottom left corner of a quadrangle
1844 # @param theBottomRigthPoint Point, specifying bottom right corner of a quadrangle
1845 # @param theState The state of the subshapes to find. It can be one of
1846 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1847 # @return List of all found sub-shapes.
1849 # @ref swig_GetShapesOnQuadrangle "Example"
1850 def GetShapesOnQuadrangle(self, theShape, theShapeType,
1851 theTopLeftPoint, theTopRigthPoint,
1852 theBottomLeftPoint, theBottomRigthPoint, theState):
1853 # Example: see GEOM_TestOthers.py
1854 aList = self.ShapesOp.GetShapesOnQuadrangle(theShape, theShapeType,
1855 theTopLeftPoint, theTopRigthPoint,
1856 theBottomLeftPoint, theBottomRigthPoint, theState)
1857 RaiseIfFailed("GetShapesOnQuadrangle", self.ShapesOp)
1860 ## Works like the above method, but returns list of sub-shapes indices
1862 # @ref swig_GetShapesOnQuadrangleIDs "Example"
1863 def GetShapesOnQuadrangleIDs(self, theShape, theShapeType,
1864 theTopLeftPoint, theTopRigthPoint,
1865 theBottomLeftPoint, theBottomRigthPoint, theState):
1866 # Example: see GEOM_TestOthers.py
1867 aList = self.ShapesOp.GetShapesOnQuadrangleIDs(theShape, theShapeType,
1868 theTopLeftPoint, theTopRigthPoint,
1869 theBottomLeftPoint, theBottomRigthPoint, theState)
1870 RaiseIfFailed("GetShapesOnQuadrangleIDs", self.ShapesOp)
1873 ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
1874 # the specified \a theBox by the certain way, defined through \a theState parameter.
1875 # @param theBox Shape for relative comparing.
1876 # @param theShape Shape to find sub-shapes of.
1877 # @param theShapeType Type of sub-shapes to be retrieved.
1878 # @param theState The state of the subshapes to find. It can be one of
1879 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1880 # @return List of all found sub-shapes.
1882 # @ref swig_GetShapesOnBox "Example"
1883 def GetShapesOnBox(self, theBox, theShape, theShapeType, theState):
1884 # Example: see GEOM_TestOthers.py
1885 aList = self.ShapesOp.GetShapesOnBox(theBox, theShape, theShapeType, theState)
1886 RaiseIfFailed("GetShapesOnBox", self.ShapesOp)
1889 ## Works like the above method, but returns list of sub-shapes indices
1891 # @ref swig_GetShapesOnBoxIDs "Example"
1892 def GetShapesOnBoxIDs(self, theBox, theShape, theShapeType, theState):
1893 # Example: see GEOM_TestOthers.py
1894 aList = self.ShapesOp.GetShapesOnBoxIDs(theBox, theShape, theShapeType, theState)
1895 RaiseIfFailed("GetShapesOnBoxIDs", self.ShapesOp)
1898 ## Find in \a theShape all sub-shapes of type \a theShapeType,
1899 # situated relatively the specified \a theCheckShape by the
1900 # certain way, defined through \a theState parameter.
1901 # @param theCheckShape Shape for relative comparing. It must be a solid.
1902 # @param theShape Shape to find sub-shapes of.
1903 # @param theShapeType Type of sub-shapes to be retrieved.
1904 # @param theState The state of the subshapes to find. It can be one of
1905 # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
1906 # @return List of all found sub-shapes.
1908 # @ref swig_GetShapesOnShape "Example"
1909 def GetShapesOnShape(self, theCheckShape, theShape, theShapeType, theState):
1910 # Example: see GEOM_TestOthers.py
1911 aList = self.ShapesOp.GetShapesOnShape(theCheckShape, theShape,
1912 theShapeType, theState)
1913 RaiseIfFailed("GetShapesOnShape", self.ShapesOp)
1916 ## Works like the above method, but returns result as compound
1918 # @ref swig_GetShapesOnShapeAsCompound "Example"
1919 def GetShapesOnShapeAsCompound(self, theCheckShape, theShape, theShapeType, theState):
1920 # Example: see GEOM_TestOthers.py
1921 anObj = self.ShapesOp.GetShapesOnShapeAsCompound(theCheckShape, theShape,
1922 theShapeType, theState)
1923 RaiseIfFailed("GetShapesOnShapeAsCompound", self.ShapesOp)
1926 ## Works like the above method, but returns list of sub-shapes indices
1928 # @ref swig_GetShapesOnShapeIDs "Example"
1929 def GetShapesOnShapeIDs(self, theCheckShape, theShape, theShapeType, theState):
1930 # Example: see GEOM_TestOthers.py
1931 aList = self.ShapesOp.GetShapesOnShapeIDs(theCheckShape, theShape,
1932 theShapeType, theState)
1933 RaiseIfFailed("GetShapesOnShapeIDs", self.ShapesOp)
1936 ## Get sub-shape(s) of theShapeWhere, which are
1937 # coincident with \a theShapeWhat or could be a part of it.
1938 # @param theShapeWhere Shape to find sub-shapes of.
1939 # @param theShapeWhat Shape, specifying what to find.
1940 # @return Group of all found sub-shapes or a single found sub-shape.
1942 # @ref swig_GetInPlace "Example"
1943 def GetInPlace(self,theShapeWhere, theShapeWhat):
1944 # Example: see GEOM_TestOthers.py
1945 anObj = self.ShapesOp.GetInPlace(theShapeWhere, theShapeWhat)
1946 RaiseIfFailed("GetInPlace", self.ShapesOp)
1949 ## Get sub-shape(s) of \a theShapeWhere, which are
1950 # coincident with \a theShapeWhat or could be a part of it.
1952 # Implementation of this method is based on a saved history of an operation,
1953 # produced \a theShapeWhere. The \a theShapeWhat must be among this operation's
1954 # arguments (an argument shape or a sub-shape of an argument shape).
1955 # The operation could be the Partition or one of boolean operations,
1956 # performed on simple shapes (not on compounds).
1958 # @param theShapeWhere Shape to find sub-shapes of.
1959 # @param theShapeWhat Shape, specifying what to find (must be in the
1960 # building history of the ShapeWhere).
1961 # @return Group of all found sub-shapes or a single found sub-shape.
1963 # @ref swig_GetInPlace "Example"
1964 def GetInPlaceByHistory(self, theShapeWhere, theShapeWhat):
1965 # Example: see GEOM_TestOthers.py
1966 anObj = self.ShapesOp.GetInPlaceByHistory(theShapeWhere, theShapeWhat)
1967 RaiseIfFailed("GetInPlaceByHistory", self.ShapesOp)
1970 ## Get sub-shape of theShapeWhere, which is
1971 # equal to \a theShapeWhat.
1972 # @param theShapeWhere Shape to find sub-shape of.
1973 # @param theShapeWhat Shape, specifying what to find.
1974 # @return New GEOM_Object for found sub-shape.
1976 # @ref swig_GetSame "Example"
1977 def GetSame(self,theShapeWhere, theShapeWhat):
1978 anObj = self.ShapesOp.GetSame(theShapeWhere, theShapeWhat)
1979 RaiseIfFailed("GetSame", self.ShapesOp)
1985 ## @addtogroup l4_access
1988 ## Obtain a composite sub-shape of <VAR>aShape</VAR>, composed from sub-shapes
1989 # of aShape, selected by their unique IDs inside <VAR>aShape</VAR>
1991 # @ref swig_all_decompose "Example"
1992 def GetSubShape(self, aShape, ListOfID):
1993 # Example: see GEOM_TestAll.py
1994 anObj = self.AddSubShape(aShape,ListOfID)
1997 ## Obtain unique ID of sub-shape <VAR>aSubShape</VAR> inside <VAR>aShape</VAR>
1999 # @ref swig_all_decompose "Example"
2000 def GetSubShapeID(self, aShape, aSubShape):
2001 # Example: see GEOM_TestAll.py
2002 anID = self.LocalOp.GetSubShapeIndex(aShape, aSubShape)
2003 RaiseIfFailed("GetSubShapeIndex", self.LocalOp)
2009 ## @addtogroup l4_decompose
2012 ## Explode a shape on subshapes of a given type.
2013 # @param aShape Shape to be exploded.
2014 # @param aType Type of sub-shapes to be retrieved.
2015 # @return List of sub-shapes of type theShapeType, contained in theShape.
2017 # @ref swig_all_decompose "Example"
2018 def SubShapeAll(self, aShape, aType):
2019 # Example: see GEOM_TestAll.py
2020 ListObj = self.ShapesOp.MakeExplode(aShape,aType,0)
2021 RaiseIfFailed("MakeExplode", self.ShapesOp)
2024 ## Explode a shape on subshapes of a given type.
2025 # @param aShape Shape to be exploded.
2026 # @param aType Type of sub-shapes to be retrieved.
2027 # @return List of IDs of sub-shapes.
2029 # @ref swig_all_decompose "Example"
2030 def SubShapeAllIDs(self, aShape, aType):
2031 ListObj = self.ShapesOp.SubShapeAllIDs(aShape,aType,0)
2032 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
2035 ## Explode a shape on subshapes of a given type.
2036 # Sub-shapes will be sorted by coordinates of their gravity centers.
2037 # @param aShape Shape to be exploded.
2038 # @param aType Type of sub-shapes to be retrieved.
2039 # @return List of sub-shapes of type theShapeType, contained in theShape.
2041 # @ref swig_SubShapeAllSorted "Example"
2042 def SubShapeAllSorted(self, aShape, aType):
2043 # Example: see GEOM_TestAll.py
2044 ListObj = self.ShapesOp.MakeExplode(aShape,aType,1)
2045 RaiseIfFailed("MakeExplode", self.ShapesOp)
2048 ## Explode a shape on subshapes of a given type.
2049 # Sub-shapes will be sorted by coordinates of their gravity centers.
2050 # @param aShape Shape to be exploded.
2051 # @param aType Type of sub-shapes to be retrieved.
2052 # @return List of IDs of sub-shapes.
2054 # @ref swig_all_decompose "Example"
2055 def SubShapeAllSortedIDs(self, aShape, aType):
2056 ListIDs = self.ShapesOp.SubShapeAllIDs(aShape,aType,1)
2057 RaiseIfFailed("SubShapeAllIDs", self.ShapesOp)
2060 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
2061 # selected by they indices in list of all sub-shapes of type <VAR>aType</VAR>.
2062 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
2064 # @ref swig_all_decompose "Example"
2065 def SubShape(self, aShape, aType, ListOfInd):
2066 # Example: see GEOM_TestAll.py
2068 AllShapeList = self.SubShapeAll(aShape, aType)
2069 for ind in ListOfInd:
2070 ListOfIDs.append(self.GetSubShapeID(aShape, AllShapeList[ind - 1]))
2071 anObj = self.GetSubShape(aShape, ListOfIDs)
2074 ## Obtain a compound of sub-shapes of <VAR>aShape</VAR>,
2075 # selected by they indices in sorted list of all sub-shapes of type <VAR>aType</VAR>.
2076 # Each index is in range [1, Nb_Sub-Shapes_Of_Given_Type]
2078 # @ref swig_all_decompose "Example"
2079 def SubShapeSorted(self,aShape, aType, ListOfInd):
2080 # Example: see GEOM_TestAll.py
2082 AllShapeList = self.SubShapeAllSorted(aShape, aType)
2083 for ind in ListOfInd:
2084 ListOfIDs.append(self.GetSubShapeID(aShape, AllShapeList[ind - 1]))
2085 anObj = self.GetSubShape(aShape, ListOfIDs)
2088 # end of l4_decompose
2091 ## @addtogroup l3_healing
2094 ## Apply a sequence of Shape Healing operators to the given object.
2095 # @param theShape Shape to be processed.
2096 # @param theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
2097 # @param theParameters List of names of parameters
2098 # ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
2099 # @param theValues List of values of parameters, in the same order
2100 # as parameters are listed in <VAR>theParameters</VAR> list.
2101 # @return New GEOM_Object, containing processed shape.
2103 # @ref tui_shape_processing "Example"
2104 def ProcessShape(self,theShape, theOperators, theParameters, theValues):
2105 # Example: see GEOM_TestHealing.py
2106 theValues,Parameters = ParseList(theValues)
2107 anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
2108 RaiseIfFailed("ProcessShape", self.HealOp)
2109 for string in (theOperators + theParameters):
2110 Parameters = ":" + Parameters
2112 anObj.SetParameters(Parameters)
2115 ## Remove faces from the given object (shape).
2116 # @param theObject Shape to be processed.
2117 # @param theFaces Indices of faces to be removed, if EMPTY then the method
2118 # removes ALL faces of the given object.
2119 # @return New GEOM_Object, containing processed shape.
2121 # @ref tui_suppress_faces "Example"
2122 def SuppressFaces(self,theObject, theFaces):
2123 # Example: see GEOM_TestHealing.py
2124 anObj = self.HealOp.SuppressFaces(theObject, theFaces)
2125 RaiseIfFailed("SuppressFaces", self.HealOp)
2128 ## Sewing of some shapes into single shape.
2130 # @ref tui_sewing "Example"
2131 def MakeSewing(self, ListShape, theTolerance):
2132 # Example: see GEOM_TestHealing.py
2133 comp = self.MakeCompound(ListShape)
2134 anObj = self.Sew(comp, theTolerance)
2137 ## Sewing of the given object.
2138 # @param theObject Shape to be processed.
2139 # @param theTolerance Required tolerance value.
2140 # @return New GEOM_Object, containing processed shape.
2141 def Sew(self, theObject, theTolerance):
2142 # Example: see MakeSewing() above
2143 theTolerance,Parameters = ParseParameters(theTolerance)
2144 anObj = self.HealOp.Sew(theObject, theTolerance)
2145 RaiseIfFailed("Sew", self.HealOp)
2146 anObj.SetParameters(Parameters)
2149 ## Remove internal wires and edges from the given object (face).
2150 # @param theObject Shape to be processed.
2151 # @param theWires Indices of wires to be removed, if EMPTY then the method
2152 # removes ALL internal wires of the given object.
2153 # @return New GEOM_Object, containing processed shape.
2155 # @ref tui_suppress_internal_wires "Example"
2156 def SuppressInternalWires(self,theObject, theWires):
2157 # Example: see GEOM_TestHealing.py
2158 anObj = self.HealOp.RemoveIntWires(theObject, theWires)
2159 RaiseIfFailed("RemoveIntWires", self.HealOp)
2162 ## Remove internal closed contours (holes) from the given object.
2163 # @param theObject Shape to be processed.
2164 # @param theWires Indices of wires to be removed, if EMPTY then the method
2165 # removes ALL internal holes of the given object
2166 # @return New GEOM_Object, containing processed shape.
2168 # @ref tui_suppress_holes "Example"
2169 def SuppressHoles(self,theObject, theWires):
2170 # Example: see GEOM_TestHealing.py
2171 anObj = self.HealOp.FillHoles(theObject, theWires)
2172 RaiseIfFailed("FillHoles", self.HealOp)
2175 ## Close an open wire.
2176 # @param theObject Shape to be processed.
2177 # @param theWires Indexes of edge(s) and wire(s) to be closed within <VAR>theObject</VAR>'s shape,
2178 # if -1, then <VAR>theObject</VAR> itself is a wire.
2179 # @param isCommonVertex If TRUE : closure by creation of a common vertex,
2180 # If FALS : closure by creation of an edge between ends.
2181 # @return New GEOM_Object, containing processed shape.
2183 # @ref tui_close_contour "Example"
2184 def CloseContour(self,theObject, theWires, isCommonVertex):
2185 # Example: see GEOM_TestHealing.py
2186 anObj = self.HealOp.CloseContour(theObject, theWires, isCommonVertex)
2187 RaiseIfFailed("CloseContour", self.HealOp)
2190 ## Addition of a point to a given edge object.
2191 # @param theObject Shape to be processed.
2192 # @param theEdgeIndex Index of edge to be divided within theObject's shape,
2193 # if -1, then theObject itself is the edge.
2194 # @param theValue Value of parameter on edge or length parameter,
2195 # depending on \a isByParameter.
2196 # @param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1],
2197 # if FALSE : \a theValue is treated as a length parameter [0..1]
2198 # @return New GEOM_Object, containing processed shape.
2200 # @ref tui_add_point_on_edge "Example"
2201 def DivideEdge(self,theObject, theEdgeIndex, theValue, isByParameter):
2202 # Example: see GEOM_TestHealing.py
2203 theEdgeIndex,theValue,isByParameter,Parameters = ParseParameters(theEdgeIndex,theValue,isByParameter)
2204 anObj = self.HealOp.DivideEdge(theObject, theEdgeIndex, theValue, isByParameter)
2205 RaiseIfFailed("DivideEdge", self.HealOp)
2206 anObj.SetParameters(Parameters)
2209 ## Change orientation of the given object. Updates given shape.
2210 # @param theObject Shape to be processed.
2212 # @ref swig_todo "Example"
2213 def ChangeOrientationShell(self,theObject):
2214 theObject = self.HealOp.ChangeOrientation(theObject)
2215 RaiseIfFailed("ChangeOrientation", self.HealOp)
2218 ## Change orientation of the given object.
2219 # @param theObject Shape to be processed.
2220 # @return New GEOM_Object, containing processed shape.
2222 # @ref swig_todo "Example"
2223 def ChangeOrientationShellCopy(self,theObject):
2224 anObj = self.HealOp.ChangeOrientationCopy(theObject)
2225 RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
2228 ## Get a list of wires (wrapped in GEOM_Object-s),
2229 # that constitute a free boundary of the given shape.
2230 # @param theObject Shape to get free boundary of.
2231 # @return [status, theClosedWires, theOpenWires]
2232 # status: FALSE, if an error(s) occured during the method execution.
2233 # theClosedWires: Closed wires on the free boundary of the given shape.
2234 # theOpenWires: Open wires on the free boundary of the given shape.
2236 # @ref tui_measurement_tools_page "Example"
2237 def GetFreeBoundary(self,theObject):
2238 # Example: see GEOM_TestHealing.py
2239 anObj = self.HealOp.GetFreeBoundary(theObject)
2240 RaiseIfFailed("GetFreeBoundary", self.HealOp)
2243 ## Replace coincident faces in theShape by one face.
2244 # @param theShape Initial shape.
2245 # @param theTolerance Maximum distance between faces, which can be considered as coincident.
2246 # @param doKeepNonSolids If FALSE, only solids will present in the result,
2247 # otherwise all initial shapes.
2248 # @return New GEOM_Object, containing a copy of theShape without coincident faces.
2250 # @ref tui_glue_faces "Example"
2251 def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True):
2252 # Example: see GEOM_Spanner.py
2253 theTolerance,Parameters = ParseParameters(theTolerance)
2254 anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
2256 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
2257 anObj.SetParameters(Parameters)
2260 ## Find coincident faces in theShape for possible gluing.
2261 # @param theShape Initial shape.
2262 # @param theTolerance Maximum distance between faces,
2263 # which can be considered as coincident.
2266 # @ref swig_todo "Example"
2267 def GetGlueFaces(self, theShape, theTolerance):
2268 # Example: see GEOM_Spanner.py
2269 anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
2270 RaiseIfFailed("GetGlueFaces", self.ShapesOp)
2273 ## Replace coincident faces in theShape by one face
2274 # in compliance with given list of faces
2275 # @param theShape Initial shape.
2276 # @param theTolerance Maximum distance between faces,
2277 # which can be considered as coincident.
2278 # @param theFaces List of faces for gluing.
2279 # @param doKeepNonSolids If FALSE, only solids will present in the result,
2280 # otherwise all initial shapes.
2281 # @return New GEOM_Object, containing a copy of theShape
2282 # without some faces.
2284 # @ref swig_todo "Example"
2285 def MakeGlueFacesByList(self, theShape, theTolerance, theFaces, doKeepNonSolids=True):
2286 # Example: see GEOM_Spanner.py
2287 anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces, doKeepNonSolids)
2289 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
2295 ## @addtogroup l3_boolean Boolean Operations
2298 # -----------------------------------------------------------------------------
2299 # Boolean (Common, Cut, Fuse, Section)
2300 # -----------------------------------------------------------------------------
2302 ## Perform one of boolean operations on two given shapes.
2303 # @param theShape1 First argument for boolean operation.
2304 # @param theShape2 Second argument for boolean operation.
2305 # @param theOperation Indicates the operation to be done:
2306 # 1 - Common, 2 - Cut, 3 - Fuse, 4 - Section.
2307 # @return New GEOM_Object, containing the result shape.
2309 # @ref tui_fuse "Example"
2310 def MakeBoolean(self,theShape1, theShape2, theOperation):
2311 # Example: see GEOM_TestAll.py
2312 anObj = self.BoolOp.MakeBoolean(theShape1, theShape2, theOperation)
2313 RaiseIfFailed("MakeBoolean", self.BoolOp)
2316 ## Shortcut to MakeBoolean(s1, s2, 1)
2318 # @ref tui_common "Example 1"
2319 # \n @ref swig_MakeCommon "Example 2"
2320 def MakeCommon(self, s1, s2):
2321 # Example: see GEOM_TestOthers.py
2322 return self.MakeBoolean(s1, s2, 1)
2324 ## Shortcut to MakeBoolean(s1, s2, 2)
2326 # @ref tui_cut "Example 1"
2327 # \n @ref swig_MakeCommon "Example 2"
2328 def MakeCut(self, s1, s2):
2329 # Example: see GEOM_TestOthers.py
2330 return self.MakeBoolean(s1, s2, 2)
2332 ## Shortcut to MakeBoolean(s1, s2, 3)
2334 # @ref tui_fuse "Example 1"
2335 # \n @ref swig_MakeCommon "Example 2"
2336 def MakeFuse(self, s1, s2):
2337 # Example: see GEOM_TestOthers.py
2338 return self.MakeBoolean(s1, s2, 3)
2340 ## Shortcut to MakeBoolean(s1, s2, 4)
2342 # @ref tui_section "Example 1"
2343 # \n @ref swig_MakeCommon "Example 2"
2344 def MakeSection(self, s1, s2):
2345 # Example: see GEOM_TestOthers.py
2346 return self.MakeBoolean(s1, s2, 4)
2351 ## @addtogroup l3_basic_op
2354 ## Perform partition operation.
2355 # @param ListShapes Shapes to be intersected.
2356 # @param ListTools Shapes to intersect theShapes.
2357 # !!!NOTE: Each compound from ListShapes and ListTools will be exploded
2358 # in order to avoid possible intersection between shapes from
2360 # @param Limit Type of resulting shapes (corresponding to TopAbs_ShapeEnum).
2361 # @param KeepNonlimitShapes: if this parameter == 0 - only shapes with
2362 # type <= Limit are kept in the result,
2363 # else - shapes with type > Limit are kept
2364 # also (if they exist)
2366 # After implementation new version of PartitionAlgo (October 2006)
2367 # other parameters are ignored by current functionality. They are kept
2368 # in this function only for support old versions.
2369 # Ignored parameters:
2370 # @param ListKeepInside Shapes, outside which the results will be deleted.
2371 # Each shape from theKeepInside must belong to theShapes also.
2372 # @param ListRemoveInside Shapes, inside which the results will be deleted.
2373 # Each shape from theRemoveInside must belong to theShapes also.
2374 # @param RemoveWebs If TRUE, perform Glue 3D algorithm.
2375 # @param ListMaterials Material indices for each shape. Make sence,
2376 # only if theRemoveWebs is TRUE.
2378 # @return New GEOM_Object, containing the result shapes.
2380 # @ref tui_partition "Example"
2381 def MakePartition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
2382 Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
2383 KeepNonlimitShapes=0):
2384 # Example: see GEOM_TestAll.py
2385 anObj = self.BoolOp.MakePartition(ListShapes, ListTools,
2386 ListKeepInside, ListRemoveInside,
2387 Limit, RemoveWebs, ListMaterials,
2388 KeepNonlimitShapes);
2389 RaiseIfFailed("MakePartition", self.BoolOp)
2392 ## Perform partition operation.
2393 # This method may be useful if it is needed to make a partition for
2394 # compound contains nonintersected shapes. Performance will be better
2395 # since intersection between shapes from compound is not performed.
2397 # Description of all parameters as in previous method MakePartition()
2399 # !!!NOTE: Passed compounds (via ListShapes or via ListTools)
2400 # have to consist of nonintersecting shapes.
2402 # @return New GEOM_Object, containing the result shapes.
2404 # @ref swig_todo "Example"
2405 def MakePartitionNonSelfIntersectedShape(self, ListShapes, ListTools=[],
2406 ListKeepInside=[], ListRemoveInside=[],
2407 Limit=ShapeType["SHAPE"], RemoveWebs=0,
2408 ListMaterials=[], KeepNonlimitShapes=0):
2409 anObj = self.BoolOp.MakePartitionNonSelfIntersectedShape(ListShapes, ListTools,
2410 ListKeepInside, ListRemoveInside,
2411 Limit, RemoveWebs, ListMaterials,
2412 KeepNonlimitShapes);
2413 RaiseIfFailed("MakePartitionNonSelfIntersectedShape", self.BoolOp)
2416 ## Shortcut to MakePartition()
2418 # @ref tui_partition "Example 1"
2419 # \n @ref swig_Partition "Example 2"
2420 def Partition(self, ListShapes, ListTools=[], ListKeepInside=[], ListRemoveInside=[],
2421 Limit=ShapeType["SHAPE"], RemoveWebs=0, ListMaterials=[],
2422 KeepNonlimitShapes=0):
2423 # Example: see GEOM_TestOthers.py
2424 anObj = self.MakePartition(ListShapes, ListTools,
2425 ListKeepInside, ListRemoveInside,
2426 Limit, RemoveWebs, ListMaterials,
2427 KeepNonlimitShapes);
2430 ## Perform partition of the Shape with the Plane
2431 # @param theShape Shape to be intersected.
2432 # @param thePlane Tool shape, to intersect theShape.
2433 # @return New GEOM_Object, containing the result shape.
2435 # @ref tui_partition "Example"
2436 def MakeHalfPartition(self,theShape, thePlane):
2437 # Example: see GEOM_TestAll.py
2438 anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
2439 RaiseIfFailed("MakeHalfPartition", self.BoolOp)
2442 # end of l3_basic_op
2445 ## @addtogroup l3_transform
2448 ## Translate the given object along the vector, specified
2449 # by its end points, creating its copy before the translation.
2450 # @param theObject The object to be translated.
2451 # @param thePoint1 Start point of translation vector.
2452 # @param thePoint2 End point of translation vector.
2453 # @return New GEOM_Object, containing the translated object.
2455 # @ref tui_translation "Example 1"
2456 # \n @ref swig_MakeTranslationTwoPoints "Example 2"
2457 def MakeTranslationTwoPoints(self,theObject, thePoint1, thePoint2):
2458 # Example: see GEOM_TestAll.py
2459 anObj = self.TrsfOp.TranslateTwoPointsCopy(theObject, thePoint1, thePoint2)
2460 RaiseIfFailed("TranslateTwoPointsCopy", self.TrsfOp)
2463 ## Translate the given object along the vector, specified by its components.
2464 # @param theObject The object to be translated.
2465 # @param theDX,theDY,theDZ Components of translation vector.
2466 # @return Translated GEOM_Object.
2468 # @ref tui_translation "Example"
2469 def TranslateDXDYDZ(self,theObject, theDX, theDY, theDZ):
2470 # Example: see GEOM_TestAll.py
2471 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
2472 anObj = self.TrsfOp.TranslateDXDYDZ(theObject, theDX, theDY, theDZ)
2473 anObj.SetParameters(Parameters)
2474 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
2477 ## Translate the given object along the vector, specified
2478 # by its components, creating its copy before the translation.
2479 # @param theObject The object to be translated.
2480 # @param theDX,theDY,theDZ Components of translation vector.
2481 # @return New GEOM_Object, containing the translated object.
2483 # @ref tui_translation "Example"
2484 def MakeTranslation(self,theObject, theDX, theDY, theDZ):
2485 # Example: see GEOM_TestAll.py
2486 theDX, theDY, theDZ, Parameters = ParseParameters(theDX, theDY, theDZ)
2487 anObj = self.TrsfOp.TranslateDXDYDZCopy(theObject, theDX, theDY, theDZ)
2488 anObj.SetParameters(Parameters)
2489 RaiseIfFailed("TranslateDXDYDZ", self.TrsfOp)
2492 ## Translate the given object along the given vector,
2493 # creating its copy before the translation.
2494 # @param theObject The object to be translated.
2495 # @param theVector The translation vector.
2496 # @return New GEOM_Object, containing the translated object.
2498 # @ref tui_translation "Example"
2499 def MakeTranslationVector(self,theObject, theVector):
2500 # Example: see GEOM_TestAll.py
2501 anObj = self.TrsfOp.TranslateVectorCopy(theObject, theVector)
2502 RaiseIfFailed("TranslateVectorCopy", self.TrsfOp)
2505 ## Translate the given object along the given vector on given distance.
2506 # @param theObject The object to be translated.
2507 # @param theVector The translation vector.
2508 # @param theDistance The translation distance.
2509 # @param theCopy Flag used to translate object itself or create a copy.
2510 # @return Translated GEOM_Object.
2512 # @ref tui_translation "Example"
2513 def TranslateVectorDistance(self, theObject, theVector, theDistance, theCopy):
2514 # Example: see GEOM_TestAll.py
2515 theDistance,Parameters = ParseParameters(theDistance)
2516 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, theCopy)
2517 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
2518 anObj.SetParameters(Parameters)
2521 ## Translate the given object along the given vector on given distance,
2522 # creating its copy before the translation.
2523 # @param theObject The object to be translated.
2524 # @param theVector The translation vector.
2525 # @param theDistance The translation distance.
2526 # @return New GEOM_Object, containing the translated object.
2528 # @ref tui_translation "Example"
2529 def MakeTranslationVectorDistance(self, theObject, theVector, theDistance):
2530 # Example: see GEOM_TestAll.py
2531 theDistance,Parameters = ParseParameters(theDistance)
2532 anObj = self.TrsfOp.TranslateVectorDistance(theObject, theVector, theDistance, 1)
2533 RaiseIfFailed("TranslateVectorDistance", self.TrsfOp)
2534 anObj.SetParameters(Parameters)
2537 ## Rotate the given object around the given axis on the given angle.
2538 # @param theObject The object to be rotated.
2539 # @param theAxis Rotation axis.
2540 # @param theAngle Rotation angle in radians.
2541 # @return Rotated GEOM_Object.
2543 # @ref tui_rotation "Example"
2544 def Rotate(self,theObject, theAxis, theAngle):
2545 # Example: see GEOM_TestAll.py
2547 if isinstance(theAngle,str):
2549 theAngle, Parameters = ParseParameters(theAngle)
2551 theAngle = theAngle*math.pi/180.0
2552 anObj = self.TrsfOp.Rotate(theObject, theAxis, theAngle)
2553 RaiseIfFailed("RotateCopy", self.TrsfOp)
2554 anObj.SetParameters(Parameters)
2557 ## Rotate the given object around the given axis
2558 # on the given angle, creating its copy before the rotatation.
2559 # @param theObject The object to be rotated.
2560 # @param theAxis Rotation axis.
2561 # @param theAngle Rotation angle in radians.
2562 # @return New GEOM_Object, containing the rotated object.
2564 # @ref tui_rotation "Example"
2565 def MakeRotation(self,theObject, theAxis, theAngle):
2566 # Example: see GEOM_TestAll.py
2568 if isinstance(theAngle,str):
2570 theAngle, Parameters = ParseParameters(theAngle)
2572 theAngle = theAngle*math.pi/180.0
2573 anObj = self.TrsfOp.RotateCopy(theObject, theAxis, theAngle)
2574 RaiseIfFailed("RotateCopy", self.TrsfOp)
2575 anObj.SetParameters(Parameters)
2578 ## Rotate given object around vector perpendicular to plane
2579 # containing three points, creating its copy before the rotatation.
2580 # @param theObject The object to be rotated.
2581 # @param theCentPoint central point - the axis is the vector perpendicular to the plane
2582 # containing the three points.
2583 # @param thePoint1,thePoint2 - in a perpendicular plane of the axis.
2584 # @return New GEOM_Object, containing the rotated object.
2586 # @ref tui_rotation "Example"
2587 def MakeRotationThreePoints(self,theObject, theCentPoint, thePoint1, thePoint2):
2588 # Example: see GEOM_TestAll.py
2589 anObj = self.TrsfOp.RotateThreePointsCopy(theObject, theCentPoint, thePoint1, thePoint2)
2590 RaiseIfFailed("RotateThreePointsCopy", self.TrsfOp)
2593 ## Scale the given object by the factor, creating its copy before the scaling.
2594 # @param theObject The object to be scaled.
2595 # @param thePoint Center point for scaling.
2596 # Passing None for it means scaling relatively the origin of global CS.
2597 # @param theFactor Scaling factor value.
2598 # @return New GEOM_Object, containing the scaled shape.
2600 # @ref tui_scale "Example"
2601 def MakeScaleTransform(self, theObject, thePoint, theFactor):
2602 # Example: see GEOM_TestAll.py
2603 theFactor, Parameters = ParseParameters(theFactor)
2604 anObj = self.TrsfOp.ScaleShapeCopy(theObject, thePoint, theFactor)
2605 RaiseIfFailed("ScaleShapeCopy", self.TrsfOp)
2606 anObj.SetParameters(Parameters)
2609 ## Scale the given object by different factors along coordinate axes,
2610 # creating its copy before the scaling.
2611 # @param theObject The object to be scaled.
2612 # @param thePoint Center point for scaling.
2613 # Passing None for it means scaling relatively the origin of global CS.
2614 # @param theFactorX,theFactorY,theFactorZ Scaling factors along each axis.
2615 # @return New GEOM_Object, containing the scaled shape.
2617 # @ref swig_scale "Example"
2618 def MakeScaleAlongAxes(self, theObject, thePoint, theFactorX, theFactorY, theFactorZ):
2619 # Example: see GEOM_TestAll.py
2620 theFactorX, theFactorY, theFactorZ, Parameters = ParseParameters(theFactorX, theFactorY, theFactorZ)
2621 anObj = self.TrsfOp.ScaleShapeAlongAxesCopy(theObject, thePoint,
2622 theFactorX, theFactorY, theFactorZ)
2623 RaiseIfFailed("MakeScaleAlongAxes", self.TrsfOp)
2624 anObj.SetParameters(Parameters)
2627 ## Create an object, symmetrical
2628 # to the given one relatively the given plane.
2629 # @param theObject The object to be mirrored.
2630 # @param thePlane Plane of symmetry.
2631 # @return New GEOM_Object, containing the mirrored shape.
2633 # @ref tui_mirror "Example"
2634 def MakeMirrorByPlane(self,theObject, thePlane):
2635 # Example: see GEOM_TestAll.py
2636 anObj = self.TrsfOp.MirrorPlaneCopy(theObject, thePlane)
2637 RaiseIfFailed("MirrorPlaneCopy", self.TrsfOp)
2640 ## Create an object, symmetrical
2641 # to the given one relatively the given axis.
2642 # @param theObject The object to be mirrored.
2643 # @param theAxis Axis of symmetry.
2644 # @return New GEOM_Object, containing the mirrored shape.
2646 # @ref tui_mirror "Example"
2647 def MakeMirrorByAxis(self,theObject, theAxis):
2648 # Example: see GEOM_TestAll.py
2649 anObj = self.TrsfOp.MirrorAxisCopy(theObject, theAxis)
2650 RaiseIfFailed("MirrorAxisCopy", self.TrsfOp)
2653 ## Create an object, symmetrical
2654 # to the given one relatively the given point.
2655 # @param theObject The object to be mirrored.
2656 # @param thePoint Point of symmetry.
2657 # @return New GEOM_Object, containing the mirrored shape.
2659 # @ref tui_mirror "Example"
2660 def MakeMirrorByPoint(self,theObject, thePoint):
2661 # Example: see GEOM_TestAll.py
2662 anObj = self.TrsfOp.MirrorPointCopy(theObject, thePoint)
2663 RaiseIfFailed("MirrorPointCopy", self.TrsfOp)
2666 ## Modify the Location of the given object by LCS,
2667 # creating its copy before the setting.
2668 # @param theObject The object to be displaced.
2669 # @param theStartLCS Coordinate system to perform displacement from it.
2670 # If \a theStartLCS is NULL, displacement
2671 # will be performed from global CS.
2672 # If \a theObject itself is used as \a theStartLCS,
2673 # its location will be changed to \a theEndLCS.
2674 # @param theEndLCS Coordinate system to perform displacement to it.
2675 # @return New GEOM_Object, containing the displaced shape.
2677 # @ref tui_modify_location "Example"
2678 def MakePosition(self,theObject, theStartLCS, theEndLCS):
2679 # Example: see GEOM_TestAll.py
2680 anObj = self.TrsfOp.PositionShapeCopy(theObject, theStartLCS, theEndLCS)
2681 RaiseIfFailed("PositionShapeCopy", self.TrsfOp)
2684 ## Modify the Location of the given object by Path,
2685 # @param theObject The object to be displaced.
2686 # @param thePath Wire or Edge along that the object will be translated.
2687 # @param theDistance progress of Path (0 = start location, 1 = end of path location).
2688 # @param theCopy is to create a copy objects if true.
2689 # @param theReverse - 0 for usual direction, 1 to reverse path direction.
2690 # @return New GEOM_Object, containing the displaced shape.
2692 # @ref tui_modify_location "Example"
2693 def PositionAlongPath(self,theObject, thePath, theDistance, theCopy, theReverse):
2694 # Example: see GEOM_TestAll.py
2695 anObj = self.TrsfOp.PositionAlongPath(theObject, thePath, theDistance, theCopy, theReverse)
2696 RaiseIfFailed("PositionAlongPath", self.TrsfOp)
2699 ## Create new object as offset of the given one.
2700 # @param theObject The base object for the offset.
2701 # @param theOffset Offset value.
2702 # @return New GEOM_Object, containing the offset object.
2704 # @ref tui_offset "Example"
2705 def MakeOffset(self,theObject, theOffset):
2706 # Example: see GEOM_TestAll.py
2707 theOffset, Parameters = ParseParameters(theOffset)
2708 anObj = self.TrsfOp.OffsetShapeCopy(theObject, theOffset)
2709 RaiseIfFailed("OffsetShapeCopy", self.TrsfOp)
2710 anObj.SetParameters(Parameters)
2713 # -----------------------------------------------------------------------------
2715 # -----------------------------------------------------------------------------
2717 ## Translate the given object along the given vector a given number times
2718 # @param theObject The object to be translated.
2719 # @param theVector Direction of the translation.
2720 # @param theStep Distance to translate on.
2721 # @param theNbTimes Quantity of translations to be done.
2722 # @return New GEOM_Object, containing compound of all
2723 # the shapes, obtained after each translation.
2725 # @ref tui_multi_translation "Example"
2726 def MakeMultiTranslation1D(self,theObject, theVector, theStep, theNbTimes):
2727 # Example: see GEOM_TestAll.py
2728 theStep, theNbTimes, Parameters = ParseParameters(theStep, theNbTimes)
2729 anObj = self.TrsfOp.MultiTranslate1D(theObject, theVector, theStep, theNbTimes)
2730 RaiseIfFailed("MultiTranslate1D", self.TrsfOp)
2731 anObj.SetParameters(Parameters)
2734 ## Conseqently apply two specified translations to theObject specified number of times.
2735 # @param theObject The object to be translated.
2736 # @param theVector1 Direction of the first translation.
2737 # @param theStep1 Step of the first translation.
2738 # @param theNbTimes1 Quantity of translations to be done along theVector1.
2739 # @param theVector2 Direction of the second translation.
2740 # @param theStep2 Step of the second translation.
2741 # @param theNbTimes2 Quantity of translations to be done along theVector2.
2742 # @return New GEOM_Object, containing compound of all
2743 # the shapes, obtained after each translation.
2745 # @ref tui_multi_translation "Example"
2746 def MakeMultiTranslation2D(self,theObject, theVector1, theStep1, theNbTimes1,
2747 theVector2, theStep2, theNbTimes2):
2748 # Example: see GEOM_TestAll.py
2749 theStep1,theNbTimes1,theStep2,theNbTimes2, Parameters = ParseParameters(theStep1,theNbTimes1,theStep2,theNbTimes2)
2750 anObj = self.TrsfOp.MultiTranslate2D(theObject, theVector1, theStep1, theNbTimes1,
2751 theVector2, theStep2, theNbTimes2)
2752 RaiseIfFailed("MultiTranslate2D", self.TrsfOp)
2753 anObj.SetParameters(Parameters)
2756 ## Rotate the given object around the given axis a given number times.
2757 # Rotation angle will be 2*PI/theNbTimes.
2758 # @param theObject The object to be rotated.
2759 # @param theAxis The rotation axis.
2760 # @param theNbTimes Quantity of rotations to be done.
2761 # @return New GEOM_Object, containing compound of all the
2762 # shapes, obtained after each rotation.
2764 # @ref tui_multi_rotation "Example"
2765 def MultiRotate1D(self,theObject, theAxis, theNbTimes):
2766 # Example: see GEOM_TestAll.py
2767 theAxis, theNbTimes, Parameters = ParseParameters(theAxis, theNbTimes)
2768 anObj = self.TrsfOp.MultiRotate1D(theObject, theAxis, theNbTimes)
2769 RaiseIfFailed("MultiRotate1D", self.TrsfOp)
2770 anObj.SetParameters(Parameters)
2773 ## Rotate the given object around the
2774 # given axis on the given angle a given number
2775 # times and multi-translate each rotation result.
2776 # Translation direction passes through center of gravity
2777 # of rotated shape and its projection on the rotation axis.
2778 # @param theObject The object to be rotated.
2779 # @param theAxis Rotation axis.
2780 # @param theAngle Rotation angle in graduces.
2781 # @param theNbTimes1 Quantity of rotations to be done.
2782 # @param theStep Translation distance.
2783 # @param theNbTimes2 Quantity of translations to be done.
2784 # @return New GEOM_Object, containing compound of all the
2785 # shapes, obtained after each transformation.
2787 # @ref tui_multi_rotation "Example"
2788 def MultiRotate2D(self,theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2):
2789 # Example: see GEOM_TestAll.py
2790 theAngle, theNbTimes1, theStep, theNbTimes2, Parameters = ParseParameters(theAngle, theNbTimes1, theStep, theNbTimes2)
2791 anObj = self.TrsfOp.MultiRotate2D(theObject, theAxis, theAngle, theNbTimes1, theStep, theNbTimes2)
2792 RaiseIfFailed("MultiRotate2D", self.TrsfOp)
2793 anObj.SetParameters(Parameters)
2796 ## The same, as MultiRotate1D(), but axis is given by direction and point
2797 # @ref swig_MakeMultiRotation "Example"
2798 def MakeMultiRotation1D(self,aShape,aDir,aPoint,aNbTimes):
2799 # Example: see GEOM_TestOthers.py
2800 aVec = self.MakeLine(aPoint,aDir)
2801 anObj = self.MultiRotate1D(aShape,aVec,aNbTimes)
2804 ## The same, as MultiRotate2D(), but axis is given by direction and point
2805 # @ref swig_MakeMultiRotation "Example"
2806 def MakeMultiRotation2D(self,aShape,aDir,aPoint,anAngle,nbtimes1,aStep,nbtimes2):
2807 # Example: see GEOM_TestOthers.py
2808 aVec = self.MakeLine(aPoint,aDir)
2809 anObj = self.MultiRotate2D(aShape,aVec,anAngle,nbtimes1,aStep,nbtimes2)
2812 # end of l3_transform
2815 ## @addtogroup l3_local
2818 ## Perform a fillet on all edges of the given shape.
2819 # @param theShape Shape, to perform fillet on.
2820 # @param theR Fillet radius.
2821 # @return New GEOM_Object, containing the result shape.
2823 # @ref tui_fillet "Example 1"
2824 # \n @ref swig_MakeFilletAll "Example 2"
2825 def MakeFilletAll(self,theShape, theR):
2826 # Example: see GEOM_TestOthers.py
2827 theR,Parameters = ParseParameters(theR)
2828 anObj = self.LocalOp.MakeFilletAll(theShape, theR)
2829 RaiseIfFailed("MakeFilletAll", self.LocalOp)
2830 anObj.SetParameters(Parameters)
2833 ## Perform a fillet on the specified edges/faces of the given shape
2834 # @param theShape Shape, to perform fillet on.
2835 # @param theR Fillet radius.
2836 # @param theShapeType Type of shapes in <VAR>theListShapes</VAR>.
2837 # @param theListShapes Global indices of edges/faces to perform fillet on.
2838 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2839 # @return New GEOM_Object, containing the result shape.
2841 # @ref tui_fillet "Example"
2842 def MakeFillet(self,theShape, theR, theShapeType, theListShapes):
2843 # Example: see GEOM_TestAll.py
2844 theR,Parameters = ParseParameters(theR)
2846 if theShapeType == ShapeType["EDGE"]:
2847 anObj = self.LocalOp.MakeFilletEdges(theShape, theR, theListShapes)
2848 RaiseIfFailed("MakeFilletEdges", self.LocalOp)
2850 anObj = self.LocalOp.MakeFilletFaces(theShape, theR, theListShapes)
2851 RaiseIfFailed("MakeFilletFaces", self.LocalOp)
2852 anObj.SetParameters(Parameters)
2855 ## The same that MakeFillet but with two Fillet Radius R1 and R2
2856 def MakeFilletR1R2(self, theShape, theR1, theR2, theShapeType, theListShapes):
2857 theR1,theR2,Parameters = ParseParameters(theR1,theR2)
2859 if theShapeType == ShapeType["EDGE"]:
2860 anObj = self.LocalOp.MakeFilletEdgesR1R2(theShape, theR1, theR2, theListShapes)
2861 RaiseIfFailed("MakeFilletEdgesR1R2", self.LocalOp)
2863 anObj = self.LocalOp.MakeFilletFacesR1R2(theShape, theR1, theR2, theListShapes)
2864 RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
2865 anObj.SetParameters(Parameters)
2868 ## Perform a fillet on the specified edges of the given shape
2869 # @param theShape - Wire Shape to perform fillet on.
2870 # @param theR - Fillet radius.
2871 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
2872 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2873 # \note The list of vertices could be empty,
2874 # in this case fillet will done done at all vertices in wire
2875 # @return New GEOM_Object, containing the result shape.
2877 # @ref tui_fillet2d "Example"
2878 def MakeFillet1D(self,theShape, theR, theListOfVertexes):
2879 # Example: see GEOM_TestAll.py
2880 anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes)
2881 RaiseIfFailed("MakeFillet1D", self.LocalOp)
2884 ## Perform a fillet on the specified edges/faces of the given shape
2885 # @param theShape - Face Shape to perform fillet on.
2886 # @param theR - Fillet radius.
2887 # @param theListOfVertexes Global indices of vertexes to perform fillet on.
2888 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2889 # @return New GEOM_Object, containing the result shape.
2891 # @ref tui_fillet2d "Example"
2892 def MakeFillet2D(self,theShape, theR, theListOfVertexes):
2893 # Example: see GEOM_TestAll.py
2894 anObj = self.LocalOp.MakeFillet2D(theShape, theR, theListOfVertexes)
2895 RaiseIfFailed("MakeFillet2D", self.LocalOp)
2898 ## Perform a symmetric chamfer on all edges of the given shape.
2899 # @param theShape Shape, to perform chamfer on.
2900 # @param theD Chamfer size along each face.
2901 # @return New GEOM_Object, containing the result shape.
2903 # @ref tui_chamfer "Example 1"
2904 # \n @ref swig_MakeChamferAll "Example 2"
2905 def MakeChamferAll(self,theShape, theD):
2906 # Example: see GEOM_TestOthers.py
2907 theD,Parameters = ParseParameters(theD)
2908 anObj = self.LocalOp.MakeChamferAll(theShape, theD)
2909 RaiseIfFailed("MakeChamferAll", self.LocalOp)
2910 anObj.SetParameters(Parameters)
2913 ## Perform a chamfer on edges, common to the specified faces,
2914 # with distance D1 on the Face1
2915 # @param theShape Shape, to perform chamfer on.
2916 # @param theD1 Chamfer size along \a theFace1.
2917 # @param theD2 Chamfer size along \a theFace2.
2918 # @param theFace1,theFace2 Global indices of two faces of \a theShape.
2919 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2920 # @return New GEOM_Object, containing the result shape.
2922 # @ref tui_chamfer "Example"
2923 def MakeChamferEdge(self,theShape, theD1, theD2, theFace1, theFace2):
2924 # Example: see GEOM_TestAll.py
2925 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
2926 anObj = self.LocalOp.MakeChamferEdge(theShape, theD1, theD2, theFace1, theFace2)
2927 RaiseIfFailed("MakeChamferEdge", self.LocalOp)
2928 anObj.SetParameters(Parameters)
2931 ## The Same that MakeChamferEdge but with params theD is chamfer length and
2932 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
2933 def MakeChamferEdgeAD(self, theShape, theD, theAngle, theFace1, theFace2):
2935 if isinstance(theAngle,str):
2937 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
2939 theAngle = theAngle*math.pi/180.0
2940 anObj = self.LocalOp.MakeChamferEdgeAD(theShape, theD, theAngle, theFace1, theFace2)
2941 RaiseIfFailed("MakeChamferEdgeAD", self.LocalOp)
2942 anObj.SetParameters(Parameters)
2945 ## Perform a chamfer on all edges of the specified faces,
2946 # with distance D1 on the first specified face (if several for one edge)
2947 # @param theShape Shape, to perform chamfer on.
2948 # @param theD1 Chamfer size along face from \a theFaces. If both faces,
2949 # connected to the edge, are in \a theFaces, \a theD1
2950 # will be get along face, which is nearer to \a theFaces beginning.
2951 # @param theD2 Chamfer size along another of two faces, connected to the edge.
2952 # @param theFaces Sequence of global indices of faces of \a theShape.
2953 # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
2954 # @return New GEOM_Object, containing the result shape.
2956 # @ref tui_chamfer "Example"
2957 def MakeChamferFaces(self,theShape, theD1, theD2, theFaces):
2958 # Example: see GEOM_TestAll.py
2959 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
2960 anObj = self.LocalOp.MakeChamferFaces(theShape, theD1, theD2, theFaces)
2961 RaiseIfFailed("MakeChamferFaces", self.LocalOp)
2962 anObj.SetParameters(Parameters)
2965 ## The Same that MakeChamferFaces but with params theD is chamfer lenght and
2966 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
2968 # @ref swig_FilletChamfer "Example"
2969 def MakeChamferFacesAD(self, theShape, theD, theAngle, theFaces):
2971 if isinstance(theAngle,str):
2973 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
2975 theAngle = theAngle*math.pi/180.0
2976 anObj = self.LocalOp.MakeChamferFacesAD(theShape, theD, theAngle, theFaces)
2977 RaiseIfFailed("MakeChamferFacesAD", self.LocalOp)
2978 anObj.SetParameters(Parameters)
2981 ## Perform a chamfer on edges,
2982 # with distance D1 on the first specified face (if several for one edge)
2983 # @param theShape Shape, to perform chamfer on.
2984 # @param theD1,theD2 Chamfer size
2985 # @param theEdges Sequence of edges of \a theShape.
2986 # @return New GEOM_Object, containing the result shape.
2988 # @ref swig_FilletChamfer "Example"
2989 def MakeChamferEdges(self, theShape, theD1, theD2, theEdges):
2990 theD1,theD2,Parameters = ParseParameters(theD1,theD2)
2991 anObj = self.LocalOp.MakeChamferEdges(theShape, theD1, theD2, theEdges)
2992 RaiseIfFailed("MakeChamferEdges", self.LocalOp)
2993 anObj.SetParameters(Parameters)
2996 ## The Same that MakeChamferEdges but with params theD is chamfer lenght and
2997 # theAngle is Angle of chamfer (angle in radians or a name of variable which defines angle in degrees)
2998 def MakeChamferEdgesAD(self, theShape, theD, theAngle, theEdges):
3000 if isinstance(theAngle,str):
3002 theD,theAngle,Parameters = ParseParameters(theD,theAngle)
3004 theAngle = theAngle*math.pi/180.0
3005 anObj = self.LocalOp.MakeChamferEdgesAD(theShape, theD, theAngle, theEdges)
3006 RaiseIfFailed("MakeChamferEdgesAD", self.LocalOp)
3007 anObj.SetParameters(Parameters)
3010 ## Shortcut to MakeChamferEdge() and MakeChamferFaces()
3012 # @ref swig_MakeChamfer "Example"
3013 def MakeChamfer(self,aShape,d1,d2,aShapeType,ListShape):
3014 # Example: see GEOM_TestOthers.py
3016 if aShapeType == ShapeType["EDGE"]:
3017 anObj = self.MakeChamferEdge(aShape,d1,d2,ListShape[0],ListShape[1])
3019 anObj = self.MakeChamferFaces(aShape,d1,d2,ListShape)
3025 ## @addtogroup l3_basic_op
3028 ## Perform an Archimde operation on the given shape with given parameters.
3029 # The object presenting the resulting face is returned.
3030 # @param theShape Shape to be put in water.
3031 # @param theWeight Weight og the shape.
3032 # @param theWaterDensity Density of the water.
3033 # @param theMeshDeflection Deflection of the mesh, using to compute the section.
3034 # @return New GEOM_Object, containing a section of \a theShape
3035 # by a plane, corresponding to water level.
3037 # @ref tui_archimede "Example"
3038 def Archimede(self,theShape, theWeight, theWaterDensity, theMeshDeflection):
3039 # Example: see GEOM_TestAll.py
3040 theWeight,theWaterDensity,theMeshDeflection,Parameters = ParseParameters(
3041 theWeight,theWaterDensity,theMeshDeflection)
3042 anObj = self.LocalOp.MakeArchimede(theShape, theWeight, theWaterDensity, theMeshDeflection)
3043 RaiseIfFailed("MakeArchimede", self.LocalOp)
3044 anObj.SetParameters(Parameters)
3047 # end of l3_basic_op
3050 ## @addtogroup l2_measure
3053 ## Get point coordinates
3056 # @ref tui_measurement_tools_page "Example"
3057 def PointCoordinates(self,Point):
3058 # Example: see GEOM_TestMeasures.py
3059 aTuple = self.MeasuOp.PointCoordinates(Point)
3060 RaiseIfFailed("PointCoordinates", self.MeasuOp)
3063 ## Get summarized length of all wires,
3064 # area of surface and volume of the given shape.
3065 # @param theShape Shape to define properties of.
3066 # @return [theLength, theSurfArea, theVolume]
3067 # theLength: Summarized length of all wires of the given shape.
3068 # theSurfArea: Area of surface of the given shape.
3069 # theVolume: Volume of the given shape.
3071 # @ref tui_measurement_tools_page "Example"
3072 def BasicProperties(self,theShape):
3073 # Example: see GEOM_TestMeasures.py
3074 aTuple = self.MeasuOp.GetBasicProperties(theShape)
3075 RaiseIfFailed("GetBasicProperties", self.MeasuOp)
3078 ## Get parameters of bounding box of the given shape
3079 # @param theShape Shape to obtain bounding box of.
3080 # @return [Xmin,Xmax, Ymin,Ymax, Zmin,Zmax]
3081 # Xmin,Xmax: Limits of shape along OX axis.
3082 # Ymin,Ymax: Limits of shape along OY axis.
3083 # Zmin,Zmax: Limits of shape along OZ axis.
3085 # @ref tui_measurement_tools_page "Example"
3086 def BoundingBox(self,theShape):
3087 # Example: see GEOM_TestMeasures.py
3088 aTuple = self.MeasuOp.GetBoundingBox(theShape)
3089 RaiseIfFailed("GetBoundingBox", self.MeasuOp)
3092 ## Get inertia matrix and moments of inertia of theShape.
3093 # @param theShape Shape to calculate inertia of.
3094 # @return [I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz]
3095 # I(1-3)(1-3): Components of the inertia matrix of the given shape.
3096 # Ix,Iy,Iz: Moments of inertia of the given shape.
3098 # @ref tui_measurement_tools_page "Example"
3099 def Inertia(self,theShape):
3100 # Example: see GEOM_TestMeasures.py
3101 aTuple = self.MeasuOp.GetInertia(theShape)
3102 RaiseIfFailed("GetInertia", self.MeasuOp)
3105 ## Get minimal distance between the given shapes.
3106 # @param theShape1,theShape2 Shapes to find minimal distance between.
3107 # @return Value of the minimal distance between the given shapes.
3109 # @ref tui_measurement_tools_page "Example"
3110 def MinDistance(self, theShape1, theShape2):
3111 # Example: see GEOM_TestMeasures.py
3112 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
3113 RaiseIfFailed("GetMinDistance", self.MeasuOp)
3116 ## Get minimal distance between the given shapes.
3117 # @param theShape1,theShape2 Shapes to find minimal distance between.
3118 # @return Value of the minimal distance between the given shapes.
3120 # @ref swig_all_measure "Example"
3121 def MinDistanceComponents(self, theShape1, theShape2):
3122 # Example: see GEOM_TestMeasures.py
3123 aTuple = self.MeasuOp.GetMinDistance(theShape1, theShape2)
3124 RaiseIfFailed("GetMinDistance", self.MeasuOp)
3125 aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
3128 ## Get angle between the given shapes in degrees.
3129 # @param theShape1,theShape2 Lines or linear edges to find angle between.
3130 # @return Value of the angle between the given shapes in degrees.
3132 # @ref tui_measurement_tools_page "Example"
3133 def GetAngle(self, theShape1, theShape2):
3134 # Example: see GEOM_TestMeasures.py
3135 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
3136 RaiseIfFailed("GetAngle", self.MeasuOp)
3138 ## Get angle between the given shapes in radians.
3139 # @param theShape1,theShape2 Lines or linear edges to find angle between.
3140 # @return Value of the angle between the given shapes in radians.
3142 # @ref tui_measurement_tools_page "Example"
3143 def GetAngleRadians(self, theShape1, theShape2):
3144 # Example: see GEOM_TestMeasures.py
3145 anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.
3146 RaiseIfFailed("GetAngle", self.MeasuOp)
3149 ## @name Curve Curvature Measurement
3150 # Methods for receiving radius of curvature of curves
3151 # in the given point
3154 ## Measure curvature of a curve at a point, set by parameter.
3155 # @ref swig_todo "Example"
3156 def CurveCurvatureByParam(self, theCurve, theParam):
3157 # Example: see GEOM_TestMeasures.py
3158 aCurv = self.MeasuOp.CurveCurvatureByParam(theCurve,theParam)
3159 RaiseIfFailed("CurveCurvatureByParam", self.MeasuOp)
3163 # @ref swig_todo "Example"
3164 def CurveCurvatureByPoint(self, theCurve, thePoint):
3165 aCurv = self.MeasuOp.CurveCurvatureByPoint(theCurve,thePoint)
3166 RaiseIfFailed("CurveCurvatureByPoint", self.MeasuOp)
3170 ## @name Surface Curvature Measurement
3171 # Methods for receiving max and min radius of curvature of surfaces
3172 # in the given point
3176 ## @ref swig_todo "Example"
3177 def MaxSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
3178 # Example: see GEOM_TestMeasures.py
3179 aSurf = self.MeasuOp.MaxSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
3180 RaiseIfFailed("MaxSurfaceCurvatureByParam", self.MeasuOp)
3184 ## @ref swig_todo "Example"
3185 def MaxSurfaceCurvatureByPoint(self, theSurf, thePoint):
3186 aSurf = self.MeasuOp.MaxSurfaceCurvatureByPoint(theSurf,thePoint)
3187 RaiseIfFailed("MaxSurfaceCurvatureByPoint", self.MeasuOp)
3191 ## @ref swig_todo "Example"
3192 def MinSurfaceCurvatureByParam(self, theSurf, theUParam, theVParam):
3193 aSurf = self.MeasuOp.MinSurfaceCurvatureByParam(theSurf,theUParam,theVParam)
3194 RaiseIfFailed("MinSurfaceCurvatureByParam", self.MeasuOp)
3198 ## @ref swig_todo "Example"
3199 def MinSurfaceCurvatureByPoint(self, theSurf, thePoint):
3200 aSurf = self.MeasuOp.MinSurfaceCurvatureByPoint(theSurf,thePoint)
3201 RaiseIfFailed("MinSurfaceCurvatureByPoint", self.MeasuOp)
3205 ## Get min and max tolerances of sub-shapes of theShape
3206 # @param theShape Shape, to get tolerances of.
3207 # @return [FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
3208 # FaceMin,FaceMax: Min and max tolerances of the faces.
3209 # EdgeMin,EdgeMax: Min and max tolerances of the edges.
3210 # VertMin,VertMax: Min and max tolerances of the vertices.
3212 # @ref tui_measurement_tools_page "Example"
3213 def Tolerance(self,theShape):
3214 # Example: see GEOM_TestMeasures.py
3215 aTuple = self.MeasuOp.GetTolerance(theShape)
3216 RaiseIfFailed("GetTolerance", self.MeasuOp)
3219 ## Obtain description of the given shape (number of sub-shapes of each type)
3220 # @param theShape Shape to be described.
3221 # @return Description of the given shape.
3223 # @ref tui_measurement_tools_page "Example"
3224 def WhatIs(self,theShape):
3225 # Example: see GEOM_TestMeasures.py
3226 aDescr = self.MeasuOp.WhatIs(theShape)
3227 RaiseIfFailed("WhatIs", self.MeasuOp)
3230 ## Get a point, situated at the centre of mass of theShape.
3231 # @param theShape Shape to define centre of mass of.
3232 # @return New GEOM_Object, containing the created point.
3234 # @ref tui_measurement_tools_page "Example"
3235 def MakeCDG(self,theShape):
3236 # Example: see GEOM_TestMeasures.py
3237 anObj = self.MeasuOp.GetCentreOfMass(theShape)
3238 RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
3241 ## Get a vertex subshape by index depended with orientation.
3242 # @param theShape Shape to find subshape.
3243 # @param theIndex Index to find vertex by this index.
3244 # @return New GEOM_Object, containing the created vertex.
3246 # @ref tui_measurement_tools_page "Example"
3247 def GetVertexByIndex(self,theShape, theIndex):
3248 # Example: see GEOM_TestMeasures.py
3249 anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
3250 RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
3253 ## Get the first vertex of wire/edge depended orientation.
3254 # @param theShape Shape to find first vertex.
3255 # @return New GEOM_Object, containing the created vertex.
3257 # @ref tui_measurement_tools_page "Example"
3258 def GetFirstVertex(self,theShape):
3259 # Example: see GEOM_TestMeasures.py
3260 anObj = self.GetVertexByIndex(theShape, 0)
3261 RaiseIfFailed("GetFirstVertex", self.MeasuOp)
3264 ## Get the last vertex of wire/edge depended orientation.
3265 # @param theShape Shape to find last vertex.
3266 # @return New GEOM_Object, containing the created vertex.
3268 # @ref tui_measurement_tools_page "Example"
3269 def GetLastVertex(self,theShape):
3270 # Example: see GEOM_TestMeasures.py
3271 nb_vert = self.ShapesOp.NumberOfSubShapes(theShape, ShapeType["VERTEX"])
3272 anObj = self.GetVertexByIndex(theShape, (nb_vert-1))
3273 RaiseIfFailed("GetLastVertex", self.MeasuOp)
3276 ## Get a normale to the given face. If the point is not given,
3277 # the normale is calculated at the center of mass.
3278 # @param theFace Face to define normale of.
3279 # @param theOptionalPoint Point to compute the normale at.
3280 # @return New GEOM_Object, containing the created vector.
3282 # @ref swig_todo "Example"
3283 def GetNormal(self, theFace, theOptionalPoint = None):
3284 # Example: see GEOM_TestMeasures.py
3285 anObj = self.MeasuOp.GetNormal(theFace, theOptionalPoint)
3286 RaiseIfFailed("GetNormal", self.MeasuOp)
3289 ## Check a topology of the given shape.
3290 # @param theShape Shape to check validity of.
3291 # @param theIsCheckGeom If FALSE, only the shape's topology will be checked,
3292 # if TRUE, the shape's geometry will be checked also.
3293 # @return TRUE, if the shape "seems to be valid".
3294 # If theShape is invalid, prints a description of problem.
3296 # @ref tui_measurement_tools_page "Example"
3297 def CheckShape(self,theShape, theIsCheckGeom = 0):
3298 # Example: see GEOM_TestMeasures.py
3300 (IsValid, Status) = self.MeasuOp.CheckShapeWithGeometry(theShape)
3301 RaiseIfFailed("CheckShapeWithGeometry", self.MeasuOp)
3303 (IsValid, Status) = self.MeasuOp.CheckShape(theShape)
3304 RaiseIfFailed("CheckShape", self.MeasuOp)
3309 ## Get position (LCS) of theShape.
3311 # Origin of the LCS is situated at the shape's center of mass.
3312 # Axes of the LCS are obtained from shape's location or,
3313 # if the shape is a planar face, from position of its plane.
3315 # @param theShape Shape to calculate position of.
3316 # @return [Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz].
3317 # Ox,Oy,Oz: Coordinates of shape's LCS origin.
3318 # Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction.
3319 # Xx,Xy,Xz: Coordinates of shape's LCS X direction.
3321 # @ref swig_todo "Example"
3322 def GetPosition(self,theShape):
3323 # Example: see GEOM_TestMeasures.py
3324 aTuple = self.MeasuOp.GetPosition(theShape)
3325 RaiseIfFailed("GetPosition", self.MeasuOp)
3328 ## Get kind of theShape.
3330 # @param theShape Shape to get a kind of.
3331 # @return Returns a kind of shape in terms of <VAR>GEOM_IKindOfShape.shape_kind</VAR> enumeration
3332 # and a list of parameters, describing the shape.
3333 # @note Concrete meaning of each value, returned via \a theIntegers
3334 # or \a theDoubles list depends on the kind of the shape.
3335 # The full list of possible outputs is:
3337 # - geompy.kind.COMPOUND nb_solids nb_faces nb_edges nb_vertices
3338 # - geompy.kind.COMPSOLID nb_solids nb_faces nb_edges nb_vertices
3340 # - geompy.kind.SHELL geompy.info.CLOSED nb_faces nb_edges nb_vertices
3341 # - geompy.kind.SHELL geompy.info.UNCLOSED nb_faces nb_edges nb_vertices
3343 # - geompy.kind.WIRE geompy.info.CLOSED nb_edges nb_vertices
3344 # - geompy.kind.WIRE geompy.info.UNCLOSED nb_edges nb_vertices
3346 # - geompy.kind.SPHERE xc yc zc R
3347 # - geompy.kind.CYLINDER xb yb zb dx dy dz R H
3348 # - geompy.kind.BOX xc yc zc ax ay az
3349 # - geompy.kind.ROTATED_BOX xc yc zc zx zy zz xx xy xz ax ay az
3350 # - geompy.kind.TORUS xc yc zc dx dy dz R_1 R_2
3351 # - geompy.kind.CONE xb yb zb dx dy dz R_1 R_2 H
3352 # - geompy.kind.POLYHEDRON nb_faces nb_edges nb_vertices
3353 # - geompy.kind.SOLID nb_faces nb_edges nb_vertices
3355 # - geompy.kind.SPHERE2D xc yc zc R
3356 # - geompy.kind.CYLINDER2D xb yb zb dx dy dz R H
3357 # - geompy.kind.TORUS2D xc yc zc dx dy dz R_1 R_2
3358 # - geompy.kind.CONE2D xc yc zc dx dy dz R_1 R_2 H
3359 # - geompy.kind.DISK_CIRCLE xc yc zc dx dy dz R
3360 # - geompy.kind.DISK_ELLIPSE xc yc zc dx dy dz R_1 R_2
3361 # - geompy.kind.POLYGON xo yo zo dx dy dz nb_edges nb_vertices
3362 # - geompy.kind.PLANE xo yo zo dx dy dz
3363 # - geompy.kind.PLANAR xo yo zo dx dy dz nb_edges nb_vertices
3364 # - geompy.kind.FACE nb_edges nb_vertices
3366 # - geompy.kind.CIRCLE xc yc zc dx dy dz R
3367 # - geompy.kind.ARC_CIRCLE xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2
3368 # - geompy.kind.ELLIPSE xc yc zc dx dy dz R_1 R_2
3369 # - geompy.kind.ARC_ELLIPSE xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2
3370 # - geompy.kind.LINE xo yo zo dx dy dz
3371 # - geompy.kind.SEGMENT x1 y1 z1 x2 y2 z2
3372 # - geompy.kind.EDGE nb_vertices
3374 # - geompy.kind.VERTEX x y z
3376 # @ref swig_todo "Example"
3377 def KindOfShape(self,theShape):
3378 # Example: see GEOM_TestMeasures.py
3379 aRoughTuple = self.MeasuOp.KindOfShape(theShape)
3380 RaiseIfFailed("KindOfShape", self.MeasuOp)
3382 aKind = aRoughTuple[0]
3383 anInts = aRoughTuple[1]
3384 aDbls = aRoughTuple[2]
3386 # Now there is no exception from this rule:
3387 aKindTuple = [aKind] + aDbls + anInts
3389 # If they are we will regroup parameters for such kind of shape.
3391 #if aKind == kind.SOME_KIND:
3392 # # SOME_KIND int int double int double double
3393 # aKindTuple = [aKind, anInts[0], anInts[1], aDbls[0], anInts[2], aDbls[1], aDbls[2]]
3400 ## @addtogroup l2_import_export
3403 ## Import a shape from the BREP or IGES or STEP file
3404 # (depends on given format) with given name.
3405 # @param theFileName The file, containing the shape.
3406 # @param theFormatName Specify format for the file reading.
3407 # Available formats can be obtained with InsertOp.ImportTranslators() method.
3408 # If format 'IGES_SCALE' is used instead 'IGES' length unit will be
3409 # set to 'meter' and result model will be scaled.
3410 # @return New GEOM_Object, containing the imported shape.
3412 # @ref swig_Import_Export "Example"
3413 def Import(self,theFileName, theFormatName):
3414 # Example: see GEOM_TestOthers.py
3415 anObj = self.InsertOp.Import(theFileName, theFormatName)
3416 RaiseIfFailed("Import", self.InsertOp)
3419 ## Shortcut to Import() for BREP format
3421 # @ref swig_Import_Export "Example"
3422 def ImportBREP(self,theFileName):
3423 # Example: see GEOM_TestOthers.py
3424 return self.Import(theFileName, "BREP")
3426 ## Shortcut to Import() for IGES format
3428 # @ref swig_Import_Export "Example"
3429 def ImportIGES(self,theFileName):
3430 # Example: see GEOM_TestOthers.py
3431 return self.Import(theFileName, "IGES")
3433 ## Return length unit from given IGES file
3435 # @ref swig_Import_Export "Example"
3436 def GetIGESUnit(self,theFileName):
3437 # Example: see GEOM_TestOthers.py
3438 anObj = self.InsertOp.Import(theFileName, "IGES_UNIT")
3439 #RaiseIfFailed("Import", self.InsertOp)
3440 # recieve name using returned vertex
3442 vertices = self.SubShapeAll(anObj,ShapeType["VERTEX"])
3444 p = self.PointCoordinates(vertices[0])
3445 if abs(p[0]-0.01) < 1.e-6:
3447 elif abs(p[0]-0.001) < 1.e-6:
3451 ## Shortcut to Import() for STEP format
3453 # @ref swig_Import_Export "Example"
3454 def ImportSTEP(self,theFileName):
3455 # Example: see GEOM_TestOthers.py
3456 return self.Import(theFileName, "STEP")
3458 ## Export the given shape into a file with given name.
3459 # @param theObject Shape to be stored in the file.
3460 # @param theFileName Name of the file to store the given shape in.
3461 # @param theFormatName Specify format for the shape storage.
3462 # Available formats can be obtained with InsertOp.ImportTranslators() method.
3464 # @ref swig_Import_Export "Example"
3465 def Export(self,theObject, theFileName, theFormatName):
3466 # Example: see GEOM_TestOthers.py
3467 self.InsertOp.Export(theObject, theFileName, theFormatName)
3468 if self.InsertOp.IsDone() == 0:
3469 raise RuntimeError, "Export : " + self.InsertOp.GetErrorCode()
3473 ## Shortcut to Export() for BREP format
3475 # @ref swig_Import_Export "Example"
3476 def ExportBREP(self,theObject, theFileName):
3477 # Example: see GEOM_TestOthers.py
3478 return self.Export(theObject, theFileName, "BREP")
3480 ## Shortcut to Export() for IGES format
3482 # @ref swig_Import_Export "Example"
3483 def ExportIGES(self,theObject, theFileName):
3484 # Example: see GEOM_TestOthers.py
3485 return self.Export(theObject, theFileName, "IGES")
3487 ## Shortcut to Export() for STEP format
3489 # @ref swig_Import_Export "Example"
3490 def ExportSTEP(self,theObject, theFileName):
3491 # Example: see GEOM_TestOthers.py
3492 return self.Export(theObject, theFileName, "STEP")
3494 # end of l2_import_export
3497 ## @addtogroup l3_blocks
3500 ## Create a quadrangle face from four edges. Order of Edges is not
3501 # important. It is not necessary that edges share the same vertex.
3502 # @param E1,E2,E3,E4 Edges for the face bound.
3503 # @return New GEOM_Object, containing the created face.
3505 # @ref tui_building_by_blocks_page "Example"
3506 def MakeQuad(self,E1, E2, E3, E4):
3507 # Example: see GEOM_Spanner.py
3508 anObj = self.BlocksOp.MakeQuad(E1, E2, E3, E4)
3509 RaiseIfFailed("MakeQuad", self.BlocksOp)
3512 ## Create a quadrangle face on two edges.
3513 # The missing edges will be built by creating the shortest ones.
3514 # @param E1,E2 Two opposite edges for the face.
3515 # @return New GEOM_Object, containing the created face.
3517 # @ref tui_building_by_blocks_page "Example"
3518 def MakeQuad2Edges(self,E1, E2):
3519 # Example: see GEOM_Spanner.py
3520 anObj = self.BlocksOp.MakeQuad2Edges(E1, E2)
3521 RaiseIfFailed("MakeQuad2Edges", self.BlocksOp)
3524 ## Create a quadrangle face with specified corners.
3525 # The missing edges will be built by creating the shortest ones.
3526 # @param V1,V2,V3,V4 Corner vertices for the face.
3527 # @return New GEOM_Object, containing the created face.
3529 # @ref tui_building_by_blocks_page "Example 1"
3530 # \n @ref swig_MakeQuad4Vertices "Example 2"
3531 def MakeQuad4Vertices(self,V1, V2, V3, V4):
3532 # Example: see GEOM_Spanner.py
3533 anObj = self.BlocksOp.MakeQuad4Vertices(V1, V2, V3, V4)
3534 RaiseIfFailed("MakeQuad4Vertices", self.BlocksOp)
3537 ## Create a hexahedral solid, bounded by the six given faces. Order of
3538 # faces is not important. It is not necessary that Faces share the same edge.
3539 # @param F1,F2,F3,F4,F5,F6 Faces for the hexahedral solid.
3540 # @return New GEOM_Object, containing the created solid.
3542 # @ref tui_building_by_blocks_page "Example 1"
3543 # \n @ref swig_MakeHexa "Example 2"
3544 def MakeHexa(self,F1, F2, F3, F4, F5, F6):
3545 # Example: see GEOM_Spanner.py
3546 anObj = self.BlocksOp.MakeHexa(F1, F2, F3, F4, F5, F6)
3547 RaiseIfFailed("MakeHexa", self.BlocksOp)
3550 ## Create a hexahedral solid between two given faces.
3551 # The missing faces will be built by creating the smallest ones.
3552 # @param F1,F2 Two opposite faces for the hexahedral solid.
3553 # @return New GEOM_Object, containing the created solid.
3555 # @ref tui_building_by_blocks_page "Example 1"
3556 # \n @ref swig_MakeHexa2Faces "Example 2"
3557 def MakeHexa2Faces(self,F1, F2):
3558 # Example: see GEOM_Spanner.py
3559 anObj = self.BlocksOp.MakeHexa2Faces(F1, F2)
3560 RaiseIfFailed("MakeHexa2Faces", self.BlocksOp)
3566 ## @addtogroup l3_blocks_op
3569 ## Get a vertex, found in the given shape by its coordinates.
3570 # @param theShape Block or a compound of blocks.
3571 # @param theX,theY,theZ Coordinates of the sought vertex.
3572 # @param theEpsilon Maximum allowed distance between the resulting
3573 # vertex and point with the given coordinates.
3574 # @return New GEOM_Object, containing the found vertex.
3576 # @ref swig_GetPoint "Example"
3577 def GetPoint(self,theShape, theX, theY, theZ, theEpsilon):
3578 # Example: see GEOM_TestOthers.py
3579 anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
3580 RaiseIfFailed("GetPoint", self.BlocksOp)
3583 ## Get an edge, found in the given shape by two given vertices.
3584 # @param theShape Block or a compound of blocks.
3585 # @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
3586 # @return New GEOM_Object, containing the found edge.
3588 # @ref swig_todo "Example"
3589 def GetEdge(self,theShape, thePoint1, thePoint2):
3590 # Example: see GEOM_Spanner.py
3591 anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
3592 RaiseIfFailed("GetEdge", self.BlocksOp)
3595 ## Find an edge of the given shape, which has minimal distance to the given point.
3596 # @param theShape Block or a compound of blocks.
3597 # @param thePoint Point, close to the desired edge.
3598 # @return New GEOM_Object, containing the found edge.
3600 # @ref swig_GetEdgeNearPoint "Example"
3601 def GetEdgeNearPoint(self,theShape, thePoint):
3602 # Example: see GEOM_TestOthers.py
3603 anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
3604 RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
3607 ## Returns a face, found in the given shape by four given corner vertices.
3608 # @param theShape Block or a compound of blocks.
3609 # @param thePoint1,thePoint2,thePoint3,thePoint4 Points, close to the corners of the desired face.
3610 # @return New GEOM_Object, containing the found face.
3612 # @ref swig_todo "Example"
3613 def GetFaceByPoints(self,theShape, thePoint1, thePoint2, thePoint3, thePoint4):
3614 # Example: see GEOM_Spanner.py
3615 anObj = self.BlocksOp.GetFaceByPoints(theShape, thePoint1, thePoint2, thePoint3, thePoint4)
3616 RaiseIfFailed("GetFaceByPoints", self.BlocksOp)
3619 ## Get a face of block, found in the given shape by two given edges.
3620 # @param theShape Block or a compound of blocks.
3621 # @param theEdge1,theEdge2 Edges, close to the edges of the desired face.
3622 # @return New GEOM_Object, containing the found face.
3624 # @ref swig_todo "Example"
3625 def GetFaceByEdges(self,theShape, theEdge1, theEdge2):
3626 # Example: see GEOM_Spanner.py
3627 anObj = self.BlocksOp.GetFaceByEdges(theShape, theEdge1, theEdge2)
3628 RaiseIfFailed("GetFaceByEdges", self.BlocksOp)
3631 ## Find a face, opposite to the given one in the given block.
3632 # @param theBlock Must be a hexahedral solid.
3633 # @param theFace Face of \a theBlock, opposite to the desired face.
3634 # @return New GEOM_Object, containing the found face.
3636 # @ref swig_GetOppositeFace "Example"
3637 def GetOppositeFace(self,theBlock, theFace):
3638 # Example: see GEOM_Spanner.py
3639 anObj = self.BlocksOp.GetOppositeFace(theBlock, theFace)
3640 RaiseIfFailed("GetOppositeFace", self.BlocksOp)
3643 ## Find a face of the given shape, which has minimal distance to the given point.
3644 # @param theShape Block or a compound of blocks.
3645 # @param thePoint Point, close to the desired face.
3646 # @return New GEOM_Object, containing the found face.
3648 # @ref swig_GetFaceNearPoint "Example"
3649 def GetFaceNearPoint(self,theShape, thePoint):
3650 # Example: see GEOM_Spanner.py
3651 anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
3652 RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
3655 ## Find a face of block, whose outside normale has minimal angle with the given vector.
3656 # @param theBlock Block or a compound of blocks.
3657 # @param theVector Vector, close to the normale of the desired face.
3658 # @return New GEOM_Object, containing the found face.
3660 # @ref swig_todo "Example"
3661 def GetFaceByNormale(self, theBlock, theVector):
3662 # Example: see GEOM_Spanner.py
3663 anObj = self.BlocksOp.GetFaceByNormale(theBlock, theVector)
3664 RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
3667 # end of l3_blocks_op
3670 ## @addtogroup l4_blocks_measure
3673 ## Check, if the compound of blocks is given.
3674 # To be considered as a compound of blocks, the
3675 # given shape must satisfy the following conditions:
3676 # - Each element of the compound should be a Block (6 faces and 12 edges).
3677 # - A connection between two Blocks should be an entire quadrangle face or an entire edge.
3678 # - The compound should be connexe.
3679 # - The glue between two quadrangle faces should be applied.
3680 # @param theCompound The compound to check.
3681 # @return TRUE, if the given shape is a compound of blocks.
3682 # If theCompound is not valid, prints all discovered errors.
3684 # @ref tui_measurement_tools_page "Example 1"
3685 # \n @ref swig_CheckCompoundOfBlocks "Example 2"
3686 def CheckCompoundOfBlocks(self,theCompound):
3687 # Example: see GEOM_Spanner.py
3688 (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
3689 RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
3691 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
3695 ## Remove all seam and degenerated edges from \a theShape.
3696 # Unite faces and edges, sharing one surface. It means that
3697 # this faces must have references to one C++ surface object (handle).
3698 # @param theShape The compound or single solid to remove irregular edges from.
3699 # @param doUnionFaces If True, then unite faces. If False (the default value),
3700 # do not unite faces.
3701 # @return Improved shape.
3703 # @ref swig_RemoveExtraEdges "Example"
3704 def RemoveExtraEdges(self, theShape, doUnionFaces=False):
3705 # Example: see GEOM_TestOthers.py
3706 nbFacesOptimum = -1 # -1 means do not unite faces
3707 if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
3708 anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
3709 RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
3712 ## Check, if the given shape is a blocks compound.
3713 # Fix all detected errors.
3714 # \note Single block can be also fixed by this method.
3715 # @param theShape The compound to check and improve.
3716 # @return Improved compound.
3718 # @ref swig_CheckAndImprove "Example"
3719 def CheckAndImprove(self,theShape):
3720 # Example: see GEOM_TestOthers.py
3721 anObj = self.BlocksOp.CheckAndImprove(theShape)
3722 RaiseIfFailed("CheckAndImprove", self.BlocksOp)
3725 # end of l4_blocks_measure
3728 ## @addtogroup l3_blocks_op
3731 ## Get all the blocks, contained in the given compound.
3732 # @param theCompound The compound to explode.
3733 # @param theMinNbFaces If solid has lower number of faces, it is not a block.
3734 # @param theMaxNbFaces If solid has higher number of faces, it is not a block.
3735 # \note If theMaxNbFaces = 0, the maximum number of faces is not restricted.
3736 # @return List of GEOM_Objects, containing the retrieved blocks.
3738 # @ref tui_explode_on_blocks "Example 1"
3739 # \n @ref swig_MakeBlockExplode "Example 2"
3740 def MakeBlockExplode(self,theCompound, theMinNbFaces, theMaxNbFaces):
3741 # Example: see GEOM_TestOthers.py
3742 theMinNbFaces,theMaxNbFaces,Parameters = ParseParameters(theMinNbFaces,theMaxNbFaces)
3743 aList = self.BlocksOp.ExplodeCompoundOfBlocks(theCompound, theMinNbFaces, theMaxNbFaces)
3744 RaiseIfFailed("ExplodeCompoundOfBlocks", self.BlocksOp)
3746 anObj.SetParameters(Parameters)
3750 ## Find block, containing the given point inside its volume or on boundary.
3751 # @param theCompound Compound, to find block in.
3752 # @param thePoint Point, close to the desired block. If the point lays on
3753 # boundary between some blocks, we return block with nearest center.
3754 # @return New GEOM_Object, containing the found block.
3756 # @ref swig_todo "Example"
3757 def GetBlockNearPoint(self,theCompound, thePoint):
3758 # Example: see GEOM_Spanner.py
3759 anObj = self.BlocksOp.GetBlockNearPoint(theCompound, thePoint)
3760 RaiseIfFailed("GetBlockNearPoint", self.BlocksOp)
3763 ## Find block, containing all the elements, passed as the parts, or maximum quantity of them.
3764 # @param theCompound Compound, to find block in.
3765 # @param theParts List of faces and/or edges and/or vertices to be parts of the found block.
3766 # @return New GEOM_Object, containing the found block.
3768 # @ref swig_GetBlockByParts "Example"
3769 def GetBlockByParts(self,theCompound, theParts):
3770 # Example: see GEOM_TestOthers.py
3771 anObj = self.BlocksOp.GetBlockByParts(theCompound, theParts)
3772 RaiseIfFailed("GetBlockByParts", self.BlocksOp)
3775 ## Return all blocks, containing all the elements, passed as the parts.
3776 # @param theCompound Compound, to find blocks in.
3777 # @param theParts List of faces and/or edges and/or vertices to be parts of the found blocks.
3778 # @return List of GEOM_Objects, containing the found blocks.
3780 # @ref swig_todo "Example"
3781 def GetBlocksByParts(self,theCompound, theParts):
3782 # Example: see GEOM_Spanner.py
3783 aList = self.BlocksOp.GetBlocksByParts(theCompound, theParts)
3784 RaiseIfFailed("GetBlocksByParts", self.BlocksOp)
3787 ## Multi-transformate block and glue the result.
3788 # Transformation is defined so, as to superpose direction faces.
3789 # @param Block Hexahedral solid to be multi-transformed.
3790 # @param DirFace1 ID of First direction face.
3791 # @param DirFace2 ID of Second direction face.
3792 # @param NbTimes Quantity of transformations to be done.
3793 # \note Unique ID of sub-shape can be obtained, using method GetSubShapeID().
3794 # @return New GEOM_Object, containing the result shape.
3796 # @ref tui_multi_transformation "Example"
3797 def MakeMultiTransformation1D(self,Block, DirFace1, DirFace2, NbTimes):
3798 # Example: see GEOM_Spanner.py
3799 DirFace1,DirFace2,NbTimes,Parameters = ParseParameters(DirFace1,DirFace2,NbTimes)
3800 anObj = self.BlocksOp.MakeMultiTransformation1D(Block, DirFace1, DirFace2, NbTimes)
3801 RaiseIfFailed("MakeMultiTransformation1D", self.BlocksOp)
3802 anObj.SetParameters(Parameters)
3805 ## Multi-transformate block and glue the result.
3806 # @param Block Hexahedral solid to be multi-transformed.
3807 # @param DirFace1U,DirFace2U IDs of Direction faces for the first transformation.
3808 # @param DirFace1V,DirFace2V IDs of Direction faces for the second transformation.
3809 # @param NbTimesU,NbTimesV Quantity of transformations to be done.
3810 # @return New GEOM_Object, containing the result shape.
3812 # @ref tui_multi_transformation "Example"
3813 def MakeMultiTransformation2D(self,Block, DirFace1U, DirFace2U, NbTimesU,
3814 DirFace1V, DirFace2V, NbTimesV):
3815 # Example: see GEOM_Spanner.py
3816 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV,Parameters = ParseParameters(
3817 DirFace1U,DirFace2U,NbTimesU,DirFace1V,DirFace2V,NbTimesV)
3818 anObj = self.BlocksOp.MakeMultiTransformation2D(Block, DirFace1U, DirFace2U, NbTimesU,
3819 DirFace1V, DirFace2V, NbTimesV)
3820 RaiseIfFailed("MakeMultiTransformation2D", self.BlocksOp)
3821 anObj.SetParameters(Parameters)
3824 ## Build all possible propagation groups.
3825 # Propagation group is a set of all edges, opposite to one (main)
3826 # edge of this group directly or through other opposite edges.
3827 # Notion of Opposite Edge make sence only on quadrangle face.
3828 # @param theShape Shape to build propagation groups on.
3829 # @return List of GEOM_Objects, each of them is a propagation group.
3831 # @ref swig_Propagate "Example"
3832 def Propagate(self,theShape):
3833 # Example: see GEOM_TestOthers.py
3834 listChains = self.BlocksOp.Propagate(theShape)
3835 RaiseIfFailed("Propagate", self.BlocksOp)
3838 # end of l3_blocks_op
3841 ## @addtogroup l3_groups
3844 ## Creates a new group which will store sub shapes of theMainShape
3845 # @param theMainShape is a GEOM object on which the group is selected
3846 # @param theShapeType defines a shape type of the group
3847 # @return a newly created GEOM group
3849 # @ref tui_working_with_groups_page "Example 1"
3850 # \n @ref swig_CreateGroup "Example 2"
3851 def CreateGroup(self,theMainShape, theShapeType):
3852 # Example: see GEOM_TestOthers.py
3853 anObj = self.GroupOp.CreateGroup(theMainShape, theShapeType)
3854 RaiseIfFailed("CreateGroup", self.GroupOp)
3857 ## Adds a sub object with ID theSubShapeId to the group
3858 # @param theGroup is a GEOM group to which the new sub shape is added
3859 # @param theSubShapeID is a sub shape ID in the main object.
3860 # \note Use method GetSubShapeID() to get an unique ID of the sub shape
3862 # @ref tui_working_with_groups_page "Example"
3863 def AddObject(self,theGroup, theSubShapeID):
3864 # Example: see GEOM_TestOthers.py
3865 self.GroupOp.AddObject(theGroup, theSubShapeID)
3866 RaiseIfFailed("AddObject", self.GroupOp)
3869 ## Removes a sub object with ID \a theSubShapeId from the group
3870 # @param theGroup is a GEOM group from which the new sub shape is removed
3871 # @param theSubShapeID is a sub shape ID in the main object.
3872 # \note Use method GetSubShapeID() to get an unique ID of the sub shape
3874 # @ref tui_working_with_groups_page "Example"
3875 def RemoveObject(self,theGroup, theSubShapeID):
3876 # Example: see GEOM_TestOthers.py
3877 self.GroupOp.RemoveObject(theGroup, theSubShapeID)
3878 RaiseIfFailed("RemoveObject", self.GroupOp)
3881 ## Adds to the group all the given shapes. No errors, if some shapes are alredy included.
3882 # @param theGroup is a GEOM group to which the new sub shapes are added.
3883 # @param theSubShapes is a list of sub shapes to be added.
3885 # @ref tui_working_with_groups_page "Example"
3886 def UnionList (self,theGroup, theSubShapes):
3887 # Example: see GEOM_TestOthers.py
3888 self.GroupOp.UnionList(theGroup, theSubShapes)
3889 RaiseIfFailed("UnionList", self.GroupOp)
3892 ## Works like the above method, but argument
3893 # theSubShapes here is a list of sub-shapes indices
3895 # @ref swig_UnionIDs "Example"
3896 def UnionIDs(self,theGroup, theSubShapes):
3897 # Example: see GEOM_TestOthers.py
3898 self.GroupOp.UnionIDs(theGroup, theSubShapes)
3899 RaiseIfFailed("UnionIDs", self.GroupOp)
3902 ## Removes from the group all the given shapes. No errors, if some shapes are not included.
3903 # @param theGroup is a GEOM group from which the sub-shapes are removed.
3904 # @param theSubShapes is a list of sub-shapes to be removed.
3906 # @ref tui_working_with_groups_page "Example"
3907 def DifferenceList (self,theGroup, theSubShapes):
3908 # Example: see GEOM_TestOthers.py
3909 self.GroupOp.DifferenceList(theGroup, theSubShapes)
3910 RaiseIfFailed("DifferenceList", self.GroupOp)
3913 ## Works like the above method, but argument
3914 # theSubShapes here is a list of sub-shapes indices
3916 # @ref swig_DifferenceIDs "Example"
3917 def DifferenceIDs(self,theGroup, theSubShapes):
3918 # Example: see GEOM_TestOthers.py
3919 self.GroupOp.DifferenceIDs(theGroup, theSubShapes)
3920 RaiseIfFailed("DifferenceIDs", self.GroupOp)
3923 ## Returns a list of sub objects ID stored in the group
3924 # @param theGroup is a GEOM group for which a list of IDs is requested
3926 # @ref swig_GetObjectIDs "Example"
3927 def GetObjectIDs(self,theGroup):
3928 # Example: see GEOM_TestOthers.py
3929 ListIDs = self.GroupOp.GetObjects(theGroup)
3930 RaiseIfFailed("GetObjects", self.GroupOp)
3933 ## Returns a type of sub objects stored in the group
3934 # @param theGroup is a GEOM group which type is returned.
3936 # @ref swig_GetType "Example"
3937 def GetType(self,theGroup):
3938 # Example: see GEOM_TestOthers.py
3939 aType = self.GroupOp.GetType(theGroup)
3940 RaiseIfFailed("GetType", self.GroupOp)
3943 ## Convert a type of geom object from id to string value
3944 # @param theId is a GEOM obect type id.
3946 # @ref swig_GetType "Example"
3947 def ShapeIdToType(self, theId):
4021 return "FREE_BOUNDS"
4029 return "THRUSECTIONS"
4031 return "COMPOUNDFILTER"
4033 return "SHAPES_ON_SHAPE"
4035 return "ELLIPSE_ARC"
4042 return "Shape Id not exist."
4044 ## Returns a main shape associated with the group
4045 # @param theGroup is a GEOM group for which a main shape object is requested
4046 # @return a GEOM object which is a main shape for theGroup
4048 # @ref swig_GetMainShape "Example"
4049 def GetMainShape(self,theGroup):
4050 # Example: see GEOM_TestOthers.py
4051 anObj = self.GroupOp.GetMainShape(theGroup)
4052 RaiseIfFailed("GetMainShape", self.GroupOp)
4055 ## Create group of edges of theShape, whose length is in range [min_length, max_length].
4056 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
4058 # @ref swig_todo "Example"
4059 def GetEdgesByLength (self, theShape, min_length, max_length, include_min = 1, include_max = 1):
4060 edges = self.SubShapeAll(theShape, ShapeType["EDGE"])
4063 Props = self.BasicProperties(edge)
4064 if min_length <= Props[0] and Props[0] <= max_length:
4065 if (not include_min) and (min_length == Props[0]):
4068 if (not include_max) and (Props[0] == max_length):
4071 edges_in_range.append(edge)
4073 if len(edges_in_range) <= 0:
4074 print "No edges found by given criteria"
4077 group_edges = self.CreateGroup(theShape, ShapeType["EDGE"])
4078 self.UnionList(group_edges, edges_in_range)
4082 ## Create group of edges of selected shape, whose length is in range [min_length, max_length].
4083 # If include_min/max == 0, edges with length == min/max_length will not be included in result.
4085 # @ref swig_todo "Example"
4086 def SelectEdges (self, min_length, max_length, include_min = 1, include_max = 1):
4087 nb_selected = sg.SelectedCount()
4089 print "Select a shape before calling this function, please."
4092 print "Only one shape must be selected"
4095 id_shape = sg.getSelected(0)
4096 shape = IDToObject( id_shape )
4098 group_edges = self.GetEdgesByLength(shape, min_length, max_length, include_min, include_max)
4102 if include_min: left_str = " <= "
4103 if include_max: right_str = " <= "
4105 self.addToStudyInFather(shape, group_edges, "Group of edges with " + `min_length`
4106 + left_str + "length" + right_str + `max_length`)
4108 sg.updateObjBrowser(1)
4115 ## @addtogroup l4_advanced
4118 #@@ insert new functions before this line @@#
4120 # end of l4_advanced
4123 ## Create a copy of the given object
4124 # @ingroup l1_geompy_auxiliary
4126 # @ref swig_all_advanced "Example"
4127 def MakeCopy(self,theOriginal):
4128 # Example: see GEOM_TestAll.py
4129 anObj = self.InsertOp.MakeCopy(theOriginal)
4130 RaiseIfFailed("MakeCopy", self.InsertOp)
4133 ## Add Path to load python scripts from
4134 # @ingroup l1_geompy_auxiliary
4135 def addPath(self,Path):
4136 if (sys.path.count(Path) < 1):
4137 sys.path.append(Path)
4141 ## Load marker texture from the file
4142 # @param Path a path to the texture file
4143 # @return unique texture identifier
4144 # @ingroup l1_geompy_auxiliary
4145 def LoadTexture(self, Path):
4146 # Example: see GEOM_TestAll.py
4147 ID = self.InsertOp.LoadTexture(Path)
4148 RaiseIfFailed("LoadTexture", self.InsertOp)
4151 ## Add marker texture. @a Width and @a Height parameters
4152 # specify width and height of the texture in pixels.
4153 # If @a RowData is @c True, @a Texture parameter should represent texture data
4154 # packed into the byte array. If @a RowData is @c False (default), @a Texture
4155 # parameter should be unpacked string, in which '1' symbols represent opaque
4156 # pixels and '0' represent transparent pixels of the texture bitmap.
4158 # @param Width texture width in pixels
4159 # @param Height texture height in pixels
4160 # @param Texture texture data
4161 # @param RowData if @c True, @a Texture data are packed in the byte stream
4162 # @ingroup l1_geompy_auxiliary
4163 def AddTexture(self, Width, Height, Texture, RowData=False):
4164 # Example: see GEOM_TestAll.py
4165 if not RowData: Texture = PackData(Texture)
4166 ID = self.InsertOp.AddTexture(Width, Height, Texture)
4167 RaiseIfFailed("AddTexture", self.InsertOp)
4171 #Register the new proxy for GEOM_Gen
4172 omniORB.registerObjref(GEOM._objref_GEOM_Gen._NP_RepositoryId, geompyDC)