X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGEOM_SWIG%2FgeompyDC.py;h=0f570563f7b0d62df73223995b8cd0682beffa88;hb=da9569a4257702366c8a827ee0f7c31594110282;hp=45b71f67432f97b4bd6304551a27c1550b485c4e;hpb=7d33dea1ec0bc454244cb919457a7c5d01083a50;p=modules%2Fgeom.git
diff --git a/src/GEOM_SWIG/geompyDC.py b/src/GEOM_SWIG/geompyDC.py
index 45b71f674..0f570563f 100644
--- a/src/GEOM_SWIG/geompyDC.py
+++ b/src/GEOM_SWIG/geompyDC.py
@@ -1,9 +1,5 @@
-#! /usr/bin/python
# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
-#
-# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
@@ -57,6 +53,7 @@
## @defgroup l4_decompose Decompose objects
## @defgroup l4_access Access to sub-shapes by their unique IDs inside the main shape
## @defgroup l4_obtain Access to subshapes by a criteria
+## @defgroup l4_advanced Advanced objects creation functions
## @}
@@ -94,31 +91,41 @@ ShapeType = {"COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE"
def RaiseIfFailed (Method_name, Operation):
if Operation.IsDone() == 0 and Operation.GetErrorCode() != "NOT_FOUND_ANY":
raise RuntimeError, Method_name + " : " + Operation.GetErrorCode()
-
+
## Return list of variables value from salome notebook
-## @ingroup l1_geompy_auxiliary
+## @ingroup l1_geompy_auxiliary
def ParseParameters(*parameters):
Result = []
- StringResult = ""
+ StringResult = []
for parameter in parameters:
- if isinstance(parameter,str):
- if notebook.isVariable(parameter):
- Result.append(notebook.get(parameter))
- else:
- raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
+ if isinstance(parameter, list):
+ lResults = ParseParameters(*parameter)
+ if len(lResults) > 0:
+ Result.append(lResults[:-1])
+ StringResult += lResults[-1].split(":")
+ pass
+ pass
else:
- Result.append(parameter)
+ if isinstance(parameter,str):
+ if notebook.isVariable(parameter):
+ Result.append(notebook.get(parameter))
+ else:
+ raise RuntimeError, "Variable with name '" + parameter + "' doesn't exist!!!"
+ pass
+ else:
+ Result.append(parameter)
+ pass
+ StringResult.append(str(parameter))
pass
-
- StringResult = StringResult + str(parameter)
- StringResult = StringResult + ":"
pass
- StringResult = StringResult[:len(StringResult)-1]
- Result.append(StringResult)
+ if Result:
+ Result.append(":".join(StringResult))
+ else:
+ Result = ":".join(StringResult)
return Result
-
+
## Return list of variables value from salome notebook
-## @ingroup l1_geompy_auxiliary
+## @ingroup l1_geompy_auxiliary
def ParseList(list):
Result = []
StringResult = ""
@@ -129,15 +136,15 @@ def ParseList(list):
else:
Result.append(str(parameter))
pass
-
+
StringResult = StringResult + str(parameter)
StringResult = StringResult + ":"
pass
StringResult = StringResult[:len(StringResult)-1]
return Result, StringResult
-
+
## Return list of variables value from salome notebook
-## @ingroup l1_geompy_auxiliary
+## @ingroup l1_geompy_auxiliary
def ParseSketcherCommand(command):
Result = ""
StringResult = ""
@@ -169,6 +176,88 @@ def ParseSketcherCommand(command):
Result = Result[:len(Result)-1]
return Result, StringResult
+## Helper function which can be used to pack the passed string to the byte data.
+## Only '1' an '0' symbols are valid for the string. The missing bits are replaced by zeroes.
+## If the string contains invalid symbol (neither '1' nor '0'), the function raises an exception.
+## For example,
+## \code
+## val = PackData("10001110") # val = 0xAE
+## val = PackData("1") # val = 0x80
+## \endcode
+## @param data unpacked data - a string containing '1' and '0' symbols
+## @return data packed to the byte stream
+## @ingroup l1_geompy_auxiliary
+def PackData(data):
+ bytes = len(data)/8
+ if len(data)%8: bytes += 1
+ res = ""
+ for b in range(bytes):
+ d = data[b*8:(b+1)*8]
+ val = 0
+ for i in range(8):
+ val *= 2
+ if i < len(d):
+ if d[i] == "1": val += 1
+ elif d[i] != "0":
+ raise "Invalid symbol %s" % d[i]
+ pass
+ pass
+ res += chr(val)
+ pass
+ return res
+
+## Read bitmap texture from the text file.
+## In that file, any non-zero symbol represents '1' opaque pixel of the bitmap.
+## A zero symbol ('0') represents transparent pixel of the texture bitmap.
+## The function returns width and height of the pixmap in pixels and byte stream representing
+## texture bitmap itself.
+##
+## This function can be used to read the texture to the byte stream in order to pass it to
+## the AddTexture() function of geompy class.
+## For example,
+## \code
+## import geompy
+## geompy.init_geom(salome.myStudy)
+## texture = geompy.readtexture('mytexture.dat')
+## texture = geompy.AddTexture(*texture)
+## obj.SetMarkerTexture(texture)
+## \endcode
+## @param fname texture file name
+## @return sequence of tree values: texture's width, height in pixels and its byte stream
+## @ingroup l1_geompy_auxiliary
+def ReadTexture(fname):
+ try:
+ f = open(fname)
+ lines = [ l.strip() for l in f.readlines()]
+ f.close()
+ maxlen = 0
+ if lines: maxlen = max([len(x) for x in lines])
+ lenbytes = maxlen/8
+ if maxlen%8: lenbytes += 1
+ bytedata=""
+ for line in lines:
+ if len(line)%8:
+ lenline = (len(line)/8+1)*8
+ pass
+ else:
+ lenline = (len(line)/8)*8
+ pass
+ for i in range(lenline/8):
+ byte=""
+ for j in range(8):
+ if i*8+j < len(line) and line[i*8+j] != "0": byte += "1"
+ else: byte += "0"
+ pass
+ bytedata += PackData(byte)
+ pass
+ for i in range(lenline/8, lenbytes):
+ bytedata += PackData("0")
+ pass
+ return lenbytes*8, len(lines), bytedata
+ except:
+ pass
+ return 0, 0, ""
+
## Kinds of shape enumeration
# @ingroup l1_geompy_auxiliary
kind = GEOM.GEOM_IKindOfShape
@@ -180,7 +269,6 @@ class info:
CLOSED = 1
UNCLOSED = 2
-
class geompyDC(GEOM._objref_GEOM_Gen):
def __init__(self):
@@ -201,6 +289,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
self.MeasuOp = None
self.BlocksOp = None
self.GroupOp = None
+ self.AdvOp = None
pass
## @addtogroup l1_geompy_auxiliary
@@ -232,6 +321,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
self.MeasuOp = self.GetIMeasureOperations (self.myStudyId)
self.BlocksOp = self.GetIBlocksOperations (self.myStudyId)
self.GroupOp = self.GetIGroupOperations (self.myStudyId)
+ self.AdvOp = self.GetIAdvancedOperations (self.myStudyId)
pass
## Get name for sub-shape aSubObj of shape aMainObj
@@ -267,7 +357,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
aSObject = self.AddInStudy(self.myStudy, aShape, aName, None)
if doRestoreSubShapes:
self.RestoreSubShapesSO(self.myStudy, aSObject, theArgs,
- theFindMethod, theInheritFirstArg)
+ theFindMethod, theInheritFirstArg, True )
except:
print "addToStudy() failed"
return ""
@@ -307,14 +397,43 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# operations, where only the first argument has to be considered.
# If theObject has only one argument shape, this flag is automatically
# considered as True, not regarding really passed value.
+ # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
+ # and prefix "from_subshapes_of_" to names of partially restored subshapes.
# \return list of published sub-shapes
#
# @ref tui_restore_prs_params "Example"
- def RestoreSubShapes (self, theObject, theArgs=[],
- theFindMethod=GEOM.FSM_GetInPlace, theInheritFirstArg=False):
+ def RestoreSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
+ theInheritFirstArg=False, theAddPrefix=True):
# Example: see GEOM_TestAll.py
return self.RestoreSubShapesO(self.myStudy, theObject, theArgs,
- theFindMethod, theInheritFirstArg)
+ theFindMethod, theInheritFirstArg, theAddPrefix)
+
+ ## Publish sub-shapes, standing for arguments and sub-shapes of arguments
+ # To be used from python scripts out of geompy.addToStudy (non-default usage)
+ # \param theObject published GEOM object, arguments of which will be published
+ # \param theArgs list of GEOM_Object, operation arguments to be published.
+ # If this list is empty, all operation arguments will be published
+ # \param theFindMethod method to search subshapes, corresponding to arguments and
+ # their subshapes. Value from enumeration GEOM::find_shape_method.
+ # \param theInheritFirstArg set properties of the first argument for theObject.
+ # Do not publish subshapes in place of arguments, but only
+ # in place of subshapes of the first argument,
+ # because the whole shape corresponds to the first argument.
+ # Mainly to be used after transformations, but it also can be
+ # usefull after partition with one object shape, and some other
+ # operations, where only the first argument has to be considered.
+ # If theObject has only one argument shape, this flag is automatically
+ # considered as True, not regarding really passed value.
+ # \param theAddPrefix add prefix "from_" to names of restored sub-shapes,
+ # and prefix "from_subshapes_of_" to names of partially restored subshapes.
+ # \return list of published sub-shapes
+ #
+ # @ref tui_restore_prs_params "Example"
+ def RestoreGivenSubShapes (self, theObject, theArgs=[], theFindMethod=GEOM.FSM_GetInPlace,
+ theInheritFirstArg=False, theAddPrefix=True):
+ # Example: see GEOM_TestAll.py
+ return self.RestoreGivenSubShapesO(self.myStudy, theObject, theArgs,
+ theFindMethod, theInheritFirstArg, theAddPrefix)
# end of l3_restore_ss
## @}
@@ -329,7 +448,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @return New GEOM_Object, containing the created point.
#
# @ref tui_creation_point "Example"
- def MakeVertex(self,theX, theY, theZ):
+ def MakeVertex(self, theX, theY, theZ):
# Example: see GEOM_TestAll.py
theX,theY,theZ,Parameters = ParseParameters(theX, theY, theZ)
anObj = self.BasicOp.MakePointXYZ(theX, theY, theZ)
@@ -437,18 +556,18 @@ class geompyDC(GEOM._objref_GEOM_Gen):
anObj = self.BasicOp.MakeTangentOnCurve(theRefCurve, theParameter)
RaiseIfFailed("MakeTangentOnCurve", self.BasicOp)
return anObj
-
+
## Create a tangent plane, corresponding to the given parameter on the given face.
# @param theFace The face for which tangent plane should be built.
# @param theParameterV vertical value of the center point (0.0 - 1.0).
# @param theParameterU horisontal value of the center point (0.0 - 1.0).
- # @param theTrimSize the size of plane.
+ # @param theTrimSize the size of plane.
# @return New GEOM_Object, containing the created tangent.
#
# @ref swig_MakeTangentPlaneOnFace "Example"
- def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize):
- anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
- RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
+ def MakeTangentPlaneOnFace(self, theFace, theParameterU, theParameterV, theTrimSize):
+ anObj = self.BasicOp.MakeTangentPlaneOnFace(theFace, theParameterU, theParameterV, theTrimSize)
+ RaiseIfFailed("MakeTangentPlaneOnFace", self.BasicOp)
return anObj
## Create a vector with the given components.
@@ -560,8 +679,8 @@ class geompyDC(GEOM._objref_GEOM_Gen):
RaiseIfFailed("MakePlaneFace", self.BasicOp)
anObj.SetParameters(Parameters)
return anObj
-
- ## Create a plane, passing through the 2 vectors
+
+ ## Create a plane, passing through the 2 vectors
# with center in a start point of the first vector.
# @param theVec1 Vector, defining center point and plane direction.
# @param theVec2 Vector, defining the plane normal direction.
@@ -576,11 +695,11 @@ class geompyDC(GEOM._objref_GEOM_Gen):
RaiseIfFailed("MakePlane2Vec", self.BasicOp)
anObj.SetParameters(Parameters)
return anObj
-
- ## Create a plane, based on a Local coordinate system.
+
+ ## Create a plane, based on a Local coordinate system.
# @param theLCS coordinate system, defining plane.
# @param theTrimSize Half size of a side of quadrangle face, representing the plane.
- # @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
+ # @param theOrientation OXY, OYZ or OZX orientation - (1, 2 or 3)
# @return New GEOM_Object, containing the created plane.
#
# @ref tui_creation_plane "Example"
@@ -601,33 +720,32 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @ref swig_MakeMarker "Example"
def MakeMarker(self, OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ):
# Example: see GEOM_TestAll.py
- OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
+ OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ, Parameters = ParseParameters(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ);
anObj = self.BasicOp.MakeMarker(OX,OY,OZ, XDX,XDY,XDZ, YDX,YDY,YDZ)
RaiseIfFailed("MakeMarker", self.BasicOp)
anObj.SetParameters(Parameters)
return anObj
- ## Create a local coordinate system.
+ ## Create a local coordinate system from shape.
+ # @param theShape The initial shape to detect the coordinate system.
+ # @return New GEOM_Object, containing the created coordinate system.
+ #
+ # @ref tui_creation_lcs "Example"
+ def MakeMarkerFromShape(self, theShape):
+ anObj = self.BasicOp.MakeMarkerFromShape(theShape)
+ RaiseIfFailed("MakeMarkerFromShape", self.BasicOp)
+ return anObj
+
+ ## Create a local coordinate system from point and two vectors.
# @param theOrigin Point of coordinate system origin.
# @param theXVec Vector of X direction
# @param theYVec Vector of Y direction
# @return New GEOM_Object, containing the created coordinate system.
#
- # @ref swig_MakeMarker "Example"
+ # @ref tui_creation_lcs "Example"
def MakeMarkerPntTwoVec(self, theOrigin, theXVec, theYVec):
- O = self.PointCoordinates( theOrigin )
- OXOY = []
- for vec in [ theXVec, theYVec ]:
- v1, v2 = self.SubShapeAll( vec, ShapeType["VERTEX"] )
- p1 = self.PointCoordinates( v1 )
- p2 = self.PointCoordinates( v2 )
- for i in range( 0, 3 ):
- OXOY.append( p2[i] - p1[i] )
- #
- anObj = self.BasicOp.MakeMarker( O[0], O[1], O[2],
- OXOY[0], OXOY[1], OXOY[2],
- OXOY[3], OXOY[4], OXOY[5], )
- RaiseIfFailed("MakeMarker", self.BasicOp)
+ anObj = self.BasicOp.MakeMarkerPntTwoVec(theOrigin, theXVec, theYVec)
+ RaiseIfFailed("MakeMarkerPntTwoVec", self.BasicOp)
return anObj
# end of l3_basic_go
@@ -662,7 +780,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
anObj = self.CurvesOp.MakeArcCenter(thePnt1, thePnt2, thePnt3, theSense)
RaiseIfFailed("MakeArcCenter", self.CurvesOp)
return anObj
-
+
## Create an arc of ellipse, of center and two points.
# @param theCenter Center of the arc.
# @param thePnt1 defines major radius of the arc by distance from Pnt1 to Pnt2.
@@ -852,17 +970,19 @@ class geompyDC(GEOM._objref_GEOM_Gen):
anObj = self.CurvesOp.MakeSketcherOnPlane(theCommand, theWorkingPlane)
RaiseIfFailed("MakeSketcherOnPlane", self.CurvesOp)
return anObj
-
- ## Create a sketcher wire, following the numerical description,
+
+ ## Create a sketcher wire, following the numerical description,
# passed through theCoordinates argument. \n
- # @param theCoordinates double values, defining points to create a wire,
+ # @param theCoordinates double values, defining points to create a wire,
# passing from it.
# @return New GEOM_Object, containing the created wire.
#
# @ref tui_sketcher_page "Example"
def Make3DSketcher(self, theCoordinates):
+ theCoordinates,Parameters = ParseParameters(theCoordinates)
anObj = self.CurvesOp.Make3DSketcher(theCoordinates)
RaiseIfFailed("Make3DSketcher", self.CurvesOp)
+ anObj.SetParameters(Parameters)
return anObj
# end of l3_sketcher
@@ -909,12 +1029,12 @@ class geompyDC(GEOM._objref_GEOM_Gen):
anObj = self.PrimOp.MakeBoxTwoPnt(thePnt1, thePnt2)
RaiseIfFailed("MakeBoxTwoPnt", self.PrimOp)
return anObj
-
+
## Create a face with specified dimensions along OX-OY coordinate axes,
# with edges, parallel to this coordinate axes.
# @param theH height of Face.
# @param theW width of Face.
- # @param theOrientation orientation belong axis OXY OYZ OZX
+ # @param theOrientation orientation belong axis OXY OYZ OZX
# @return New GEOM_Object, containing the created face.
#
# @ref tui_creation_face "Example"
@@ -929,7 +1049,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
## Create a face from another plane and two sizes,
# vertical size and horisontal size.
# @param theObj Normale vector to the creating face or
- # the face object.
+ # the face object.
# @param theH Height (vertical size).
# @param theW Width (horisontal size).
# @return New GEOM_Object, containing the created face.
@@ -971,7 +1091,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
## Create a disk with specified dimensions along OX-OY coordinate axes.
# @param theR Radius of Face.
- # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
+ # @param theOrientation set the orientation belong axis OXY or OYZ or OZX
# @return New GEOM_Object, containing the created disk.
#
# @ref tui_creation_face "Example"
@@ -1174,8 +1294,8 @@ class geompyDC(GEOM._objref_GEOM_Gen):
RaiseIfFailed("MakePrismVecH2Ways", self.PrimOp)
anObj.SetParameters(Parameters)
return anObj
-
- ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
+
+ ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
# @param theBase Base shape to be extruded.
# @param theDX, theDY, theDZ Directions of extrusion.
# @return New GEOM_Object, containing the created prism.
@@ -1188,8 +1308,8 @@ class geompyDC(GEOM._objref_GEOM_Gen):
RaiseIfFailed("MakePrismDXDYDZ", self.PrimOp)
anObj.SetParameters(Parameters)
return anObj
-
- ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
+
+ ## Create a shape by extrusion of the base shape along the dx, dy, dz direction
# i.e. all the space, transfixed by the base shape during its translation
# along the vector on the given distance in 2 Ways (forward/backward) .
# @param theBase Base shape to be extruded.
@@ -1237,6 +1357,14 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @param theTol2D a 2d tolerance to be reached
# @param theTol3D a 3d tolerance to be reached
# @param theNbIter a number of iteration of approximation algorithm
+ # @param theMethod Kind of method to perform filling operation:
+ # 0 - Default - standard behaviour
+ # 1 - Use edges orientation - orientation of edges are
+ # used: if edge is reversed curve from this edge
+ # is reversed before using in filling algorithm.
+ # 2 - Auto-correct orientation - change orientation
+ # of curves using minimization of sum of distances
+ # between ends points of edges.
# @param isApprox if True, BSpline curves are generated in the process
# of surface construction. By default it is False, that means
# the surface is created using Besier curves. The usage of
@@ -1245,12 +1373,13 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @return New GEOM_Object, containing the created filling surface.
#
# @ref tui_creation_filling "Example"
- def MakeFilling(self, theShape, theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter, isApprox=0):
+ def MakeFilling(self, theShape, theMinDeg, theMaxDeg, theTol2D,
+ theTol3D, theNbIter, theMethod=GEOM.FOM_Default, isApprox=0):
# Example: see GEOM_TestAll.py
- theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg,
- theTol2D, theTol3D, theNbIter)
+ theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
- theTol2D, theTol3D, theNbIter, isApprox)
+ theTol2D, theTol3D, theNbIter,
+ theMethod, isApprox)
RaiseIfFailed("MakeFilling", self.PrimOp)
anObj.SetParameters(Parameters)
return anObj
@@ -1284,7 +1413,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
## Create a shape by extrusion of the profile shape along
# the path shape. The path shape can be a wire or an edge.
- # the several profiles can be specified in the several locations of path.
+ # the several profiles can be specified in the several locations of path.
# @param theSeqBases - list of Bases shape to be extruded.
# @param theLocations - list of locations on the path corresponding
# specified list of the Bases shapes. Number of locations
@@ -1308,7 +1437,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
## Create a shape by extrusion of the profile shape along
# the path shape. The path shape can be a wire or a edge.
- # the several profiles can be specified in the several locations of path.
+ # the several profiles can be specified in the several locations of path.
# @param theSeqBases - list of Bases shape to be extruded. Base shape must be
# shell or face. If number of faces in neighbour sections
# aren't coincided result solid between such sections will
@@ -1694,6 +1823,34 @@ class geompyDC(GEOM._objref_GEOM_Gen):
RaiseIfFailed("GetShapesOnCylinderIDs", self.ShapesOp)
return aList
+ ## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
+ # the specified cylinder by the certain way, defined through \a theState parameter.
+ # @param theShape Shape to find sub-shapes of.
+ # @param theShapeType Type of sub-shapes to be retrieved.
+ # @param theAxis Vector (or line, or linear edge), specifying
+ # axis of the cylinder to find shapes on.
+ # @param thePnt Point specifying location of the bottom of the cylinder.
+ # @param theRadius Radius of the cylinder to find shapes on.
+ # @param theState The state of the subshapes to find. It can be one of
+ # ST_ON, ST_OUT, ST_ONOUT, ST_IN, ST_ONIN.
+ # @return List of all found sub-shapes.
+ #
+ # @ref swig_GetShapesOnCylinderWithLocation "Example"
+ def GetShapesOnCylinderWithLocation(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
+ # Example: see GEOM_TestOthers.py
+ aList = self.ShapesOp.GetShapesOnCylinderWithLocation(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
+ RaiseIfFailed("GetShapesOnCylinderWithLocation", self.ShapesOp)
+ return aList
+
+ ## Works like the above method, but returns list of sub-shapes indices
+ #
+ # @ref swig_GetShapesOnCylinderWithLocationIDs "Example"
+ def GetShapesOnCylinderWithLocationIDs(self, theShape, theShapeType, theAxis, thePnt, theRadius, theState):
+ # Example: see GEOM_TestOthers.py
+ aList = self.ShapesOp.GetShapesOnCylinderWithLocationIDs(theShape, theShapeType, theAxis, thePnt, theRadius, theState)
+ RaiseIfFailed("GetShapesOnCylinderWithLocationIDs", self.ShapesOp)
+ return aList
+
## Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
# the specified sphere by the certain way, defined through \a theState parameter.
# @param theShape Shape to find sub-shapes of.
@@ -1784,7 +1941,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
## Find in \a theShape all sub-shapes of type \a theShapeType,
# situated relatively the specified \a theCheckShape by the
# certain way, defined through \a theState parameter.
- # @param theCheckShape Shape for relative comparing.
+ # @param theCheckShape Shape for relative comparing. It must be a solid.
# @param theShape Shape to find sub-shapes of.
# @param theShapeType Type of sub-shapes to be retrieved.
# @param theState The state of the subshapes to find. It can be one of
@@ -1987,10 +2144,13 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @return New GEOM_Object, containing processed shape.
#
# @ref tui_shape_processing "Example"
- def ProcessShape(self,theShape, theOperators, theParameters, theValues):
+ def ProcessShape(self, theShape, theOperators, theParameters, theValues):
# Example: see GEOM_TestHealing.py
theValues,Parameters = ParseList(theValues)
anObj = self.HealOp.ProcessShape(theShape, theOperators, theParameters, theValues)
+ # To avoid script failure in case of good argument shape
+ if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
+ return theShape
RaiseIfFailed("ProcessShape", self.HealOp)
for string in (theOperators + theParameters):
Parameters = ":" + Parameters
@@ -2106,11 +2266,22 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @return New GEOM_Object, containing processed shape.
#
# @ref swig_todo "Example"
- def ChangeOrientationShellCopy(self,theObject):
+ def ChangeOrientationShellCopy(self, theObject):
anObj = self.HealOp.ChangeOrientationCopy(theObject)
RaiseIfFailed("ChangeOrientationCopy", self.HealOp)
return anObj
+ ## Try to limit tolerance of the given object by value \a theTolerance.
+ # @param theObject Shape to be processed.
+ # @param theTolerance Required tolerance value.
+ # @return New GEOM_Object, containing processed shape.
+ #
+ # @ref tui_limit_tolerance "Example"
+ def LimitTolerance(self, theObject, theTolerance = 1e-07):
+ anObj = self.HealOp.LimitTolerance(theObject, theTolerance)
+ RaiseIfFailed("LimitTolerance", self.HealOp)
+ return anObj
+
## Get a list of wires (wrapped in GEOM_Object-s),
# that constitute a free boundary of the given shape.
# @param theObject Shape to get free boundary of.
@@ -2120,7 +2291,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# theOpenWires: Open wires on the free boundary of the given shape.
#
# @ref tui_measurement_tools_page "Example"
- def GetFreeBoundary(self,theObject):
+ def GetFreeBoundary(self, theObject):
# Example: see GEOM_TestHealing.py
anObj = self.HealOp.GetFreeBoundary(theObject)
RaiseIfFailed("GetFreeBoundary", self.HealOp)
@@ -2244,10 +2415,10 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# in order to avoid possible intersection between shapes from
# this compound.
# @param Limit Type of resulting shapes (corresponding to TopAbs_ShapeEnum).
- # @param KeepNonlimitShapes: if this parameter == 0 - only shapes with
- # type <= Limit are kept in the result,
- # else - shapes with type > Limit are kept
- # also (if they exist)
+ # @param KeepNonlimitShapes: if this parameter == 0, then only shapes of
+ # target type (equal to Limit) are kept in the result,
+ # else standalone shapes of lower dimension
+ # are kept also (if they exist).
#
# After implementation new version of PartitionAlgo (October 2006)
# other parameters are ignored by current functionality. They are kept
@@ -2570,9 +2741,9 @@ class geompyDC(GEOM._objref_GEOM_Gen):
## Modify the Location of the given object by Path,
# @param theObject The object to be displaced.
# @param thePath Wire or Edge along that the object will be translated.
- # @param theDistance progress of Path (0 = start location, 1 = end of path location).
- # @param theCopy is to create a copy objects if true.
- # @param theReverse - 0 for usual direction, 1 to reverse path direction.
+ # @param theDistance progress of Path (0 = start location, 1 = end of path location).
+ # @param theCopy is to create a copy objects if true.
+ # @param theReverse - 0 for usual direction, 1 to reverse path direction.
# @return New GEOM_Object, containing the displaced shape.
#
# @ref tui_modify_location "Example"
@@ -2750,15 +2921,17 @@ class geompyDC(GEOM._objref_GEOM_Gen):
RaiseIfFailed("MakeFilletFacesR1R2", self.LocalOp)
anObj.SetParameters(Parameters)
return anObj
-
- ## Perform a fillet on the specified edges of the given wire shape
- # @param theShape - Wire Shape(with planar edges) to perform fillet on.
+
+ ## Perform a fillet on the specified edges of the given shape
+ # @param theShape - Wire Shape to perform fillet on.
# @param theR - Fillet radius.
# @param theListOfVertexes Global indices of vertexes to perform fillet on.
# \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
+ # \note The list of vertices could be empty,
+ # in this case fillet will done done at all vertices in wire
# @return New GEOM_Object, containing the result shape.
#
- # @ref tui_fillet1d "Example"
+ # @ref tui_fillet2d "Example"
def MakeFillet1D(self,theShape, theR, theListOfVertexes):
# Example: see GEOM_TestAll.py
anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes)
@@ -2779,22 +2952,6 @@ class geompyDC(GEOM._objref_GEOM_Gen):
RaiseIfFailed("MakeFillet2D", self.LocalOp)
return anObj
- ## Perform a fillet on the specified edges of the given shape
- # @param theShape - Wire Shape to perform fillet on.
- # @param theR - Fillet radius.
- # @param theListOfVertexes Global indices of vertexes to perform fillet on.
- # \note Global index of sub-shape can be obtained, using method geompy.GetSubShapeID().
- # \note The list of vertices could be empty,
- # in this case fillet will done done at all vertices in wire
- # @return New GEOM_Object, containing the result shape.
- #
- # @ref tui_fillet2d "Example"
- def MakeFillet1D(self,theShape, theR, theListOfVertexes):
- # Example: see GEOM_TestAll.py
- anObj = self.LocalOp.MakeFillet1D(theShape, theR, theListOfVertexes)
- RaiseIfFailed("MakeFillet1D", self.LocalOp)
- return anObj
-
## Perform a symmetric chamfer on all edges of the given shape.
# @param theShape Shape, to perform chamfer on.
# @param theD Chamfer size along each face.
@@ -3138,6 +3295,41 @@ class geompyDC(GEOM._objref_GEOM_Gen):
RaiseIfFailed("GetCentreOfMass", self.MeasuOp)
return anObj
+ ## Get a vertex subshape by index depended with orientation.
+ # @param theShape Shape to find subshape.
+ # @param theIndex Index to find vertex by this index.
+ # @return New GEOM_Object, containing the created vertex.
+ #
+ # @ref tui_measurement_tools_page "Example"
+ def GetVertexByIndex(self,theShape, theIndex):
+ # Example: see GEOM_TestMeasures.py
+ anObj = self.MeasuOp.GetVertexByIndex(theShape, theIndex)
+ RaiseIfFailed("GetVertexByIndex", self.MeasuOp)
+ return anObj
+
+ ## Get the first vertex of wire/edge depended orientation.
+ # @param theShape Shape to find first vertex.
+ # @return New GEOM_Object, containing the created vertex.
+ #
+ # @ref tui_measurement_tools_page "Example"
+ def GetFirstVertex(self,theShape):
+ # Example: see GEOM_TestMeasures.py
+ anObj = self.GetVertexByIndex(theShape, 0)
+ RaiseIfFailed("GetFirstVertex", self.MeasuOp)
+ return anObj
+
+ ## Get the last vertex of wire/edge depended orientation.
+ # @param theShape Shape to find last vertex.
+ # @return New GEOM_Object, containing the created vertex.
+ #
+ # @ref tui_measurement_tools_page "Example"
+ def GetLastVertex(self,theShape):
+ # Example: see GEOM_TestMeasures.py
+ nb_vert = self.ShapesOp.NumberOfSubShapes(theShape, ShapeType["VERTEX"])
+ anObj = self.GetVertexByIndex(theShape, (nb_vert-1))
+ RaiseIfFailed("GetLastVertex", self.MeasuOp)
+ return anObj
+
## Get a normale to the given face. If the point is not given,
# the normale is calculated at the center of mass.
# @param theFace Face to define normale of.
@@ -3439,19 +3631,31 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @return New GEOM_Object, containing the found vertex.
#
# @ref swig_GetPoint "Example"
- def GetPoint(self,theShape, theX, theY, theZ, theEpsilon):
+ def GetPoint(self, theShape, theX, theY, theZ, theEpsilon):
# Example: see GEOM_TestOthers.py
anObj = self.BlocksOp.GetPoint(theShape, theX, theY, theZ, theEpsilon)
RaiseIfFailed("GetPoint", self.BlocksOp)
return anObj
+ ## Find a vertex of the given shape, which has minimal distance to the given point.
+ # @param theShape Any shape.
+ # @param thePoint Point, close to the desired vertex.
+ # @return New GEOM_Object, containing the found vertex.
+ #
+ # @ref swig_GetVertexNearPoint "Example"
+ def GetVertexNearPoint(self, theShape, thePoint):
+ # Example: see GEOM_TestOthers.py
+ anObj = self.BlocksOp.GetVertexNearPoint(theShape, thePoint)
+ RaiseIfFailed("GetVertexNearPoint", self.BlocksOp)
+ return anObj
+
## Get an edge, found in the given shape by two given vertices.
# @param theShape Block or a compound of blocks.
# @param thePoint1,thePoint2 Points, close to the ends of the desired edge.
# @return New GEOM_Object, containing the found edge.
#
- # @ref swig_todo "Example"
- def GetEdge(self,theShape, thePoint1, thePoint2):
+ # @ref swig_GetEdge "Example"
+ def GetEdge(self, theShape, thePoint1, thePoint2):
# Example: see GEOM_Spanner.py
anObj = self.BlocksOp.GetEdge(theShape, thePoint1, thePoint2)
RaiseIfFailed("GetEdge", self.BlocksOp)
@@ -3463,7 +3667,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @return New GEOM_Object, containing the found edge.
#
# @ref swig_GetEdgeNearPoint "Example"
- def GetEdgeNearPoint(self,theShape, thePoint):
+ def GetEdgeNearPoint(self, theShape, thePoint):
# Example: see GEOM_TestOthers.py
anObj = self.BlocksOp.GetEdgeNearPoint(theShape, thePoint)
RaiseIfFailed("GetEdgeNearPoint", self.BlocksOp)
@@ -3511,7 +3715,7 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# @return New GEOM_Object, containing the found face.
#
# @ref swig_GetFaceNearPoint "Example"
- def GetFaceNearPoint(self,theShape, thePoint):
+ def GetFaceNearPoint(self, theShape, thePoint):
# Example: see GEOM_Spanner.py
anObj = self.BlocksOp.GetFaceNearPoint(theShape, thePoint)
RaiseIfFailed("GetFaceNearPoint", self.BlocksOp)
@@ -3529,6 +3733,23 @@ class geompyDC(GEOM._objref_GEOM_Gen):
RaiseIfFailed("GetFaceByNormale", self.BlocksOp)
return anObj
+ ## Find all subshapes of type \a theShapeType of the given shape,
+ # which have minimal distance to the given point.
+ # @param theShape Any shape.
+ # @param thePoint Point, close to the desired shape.
+ # @param theShapeType Defines what kind of subshapes is searched.
+ # @param theTolerance The tolerance for distances comparison. All shapes
+ # with distances to the given point in interval
+ # [minimal_distance, minimal_distance + theTolerance] will be gathered.
+ # @return New GEOM_Object, containing a group of all found shapes.
+ #
+ # @ref swig_GetShapesNearPoint "Example"
+ def GetShapesNearPoint(self, theShape, thePoint, theShapeType, theTolerance = 1e-07):
+ # Example: see GEOM_TestOthers.py
+ anObj = self.BlocksOp.GetShapesNearPoint(theShape, thePoint, theShapeType, theTolerance)
+ RaiseIfFailed("GetShapesNearPoint", self.BlocksOp)
+ return anObj
+
# end of l3_blocks_op
## @}
@@ -3561,16 +3782,16 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# Unite faces and edges, sharing one surface. It means that
# this faces must have references to one C++ surface object (handle).
# @param theShape The compound or single solid to remove irregular edges from.
- # @param theOptimumNbFaces If more than zero, unite faces only for those solids,
- # that have more than theOptimumNbFaces faces. If zero, unite faces always,
- # regardsless their quantity in the solid. If negative (the default value),
- # do not unite faces at all. For blocks repairing recommended value is 6.
+ # @param doUnionFaces If True, then unite faces. If False (the default value),
+ # do not unite faces.
# @return Improved shape.
#
# @ref swig_RemoveExtraEdges "Example"
- def RemoveExtraEdges(self,theShape,theOptimumNbFaces=-1):
+ def RemoveExtraEdges(self, theShape, doUnionFaces=False):
# Example: see GEOM_TestOthers.py
- anObj = self.BlocksOp.RemoveExtraEdges(theShape,theOptimumNbFaces)
+ nbFacesOptimum = -1 # -1 means do not unite faces
+ if doUnionFaces is True: nbFacesOptimum = 0 # 0 means unite faces
+ anObj = self.BlocksOp.RemoveExtraEdges(theShape, nbFacesOptimum)
RaiseIfFailed("RemoveExtraEdges", self.BlocksOp)
return anObj
@@ -3805,6 +4026,107 @@ class geompyDC(GEOM._objref_GEOM_Gen):
RaiseIfFailed("GetType", self.GroupOp)
return aType
+ ## Convert a type of geom object from id to string value
+ # @param theId is a GEOM obect type id.
+ #
+ # @ref swig_GetType "Example"
+ def ShapeIdToType(self, theId):
+ if theId == 0:
+ return "COPY"
+ if theId == 1:
+ return "IMPORT"
+ if theId == 2:
+ return "POINT"
+ if theId == 3:
+ return "VECTOR"
+ if theId == 4:
+ return "PLANE"
+ if theId == 5:
+ return "LINE"
+ if theId == 6:
+ return "TORUS"
+ if theId == 7:
+ return "BOX"
+ if theId == 8:
+ return "CYLINDER"
+ if theId == 9:
+ return "CONE"
+ if theId == 10:
+ return "SPHERE"
+ if theId == 11:
+ return "PRISM"
+ if theId == 12:
+ return "REVOLUTION"
+ if theId == 13:
+ return "BOOLEAN"
+ if theId == 14:
+ return "PARTITION"
+ if theId == 15:
+ return "POLYLINE"
+ if theId == 16:
+ return "CIRCLE"
+ if theId == 17:
+ return "SPLINE"
+ if theId == 18:
+ return "ELLIPSE"
+ if theId == 19:
+ return "CIRC_ARC"
+ if theId == 20:
+ return "FILLET"
+ if theId == 21:
+ return "CHAMFER"
+ if theId == 22:
+ return "EDGE"
+ if theId == 23:
+ return "WIRE"
+ if theId == 24:
+ return "FACE"
+ if theId == 25:
+ return "SHELL"
+ if theId == 26:
+ return "SOLID"
+ if theId == 27:
+ return "COMPOUND"
+ if theId == 28:
+ return "SUBSHAPE"
+ if theId == 29:
+ return "PIPE"
+ if theId == 30:
+ return "ARCHIMEDE"
+ if theId == 31:
+ return "FILLING"
+ if theId == 32:
+ return "EXPLODE"
+ if theId == 33:
+ return "GLUED"
+ if theId == 34:
+ return "SKETCHER"
+ if theId == 35:
+ return "CDG"
+ if theId == 36:
+ return "FREE_BOUNDS"
+ if theId == 37:
+ return "GROUP"
+ if theId == 38:
+ return "BLOCK"
+ if theId == 39:
+ return "MARKER"
+ if theId == 40:
+ return "THRUSECTIONS"
+ if theId == 41:
+ return "COMPOUNDFILTER"
+ if theId == 42:
+ return "SHAPES_ON_SHAPE"
+ if theId == 43:
+ return "ELLIPSE_ARC"
+ if theId == 44:
+ return "3DSKETCHER"
+ if theId == 45:
+ return "FILLET_2D"
+ if theId == 46:
+ return "FILLET_1D"
+ return "Shape Id not exist."
+
## Returns a main shape associated with the group
# @param theGroup is a GEOM group for which a main shape object is requested
# @return a GEOM object which is a main shape for theGroup
@@ -3876,6 +4198,106 @@ class geompyDC(GEOM._objref_GEOM_Gen):
# end of l3_groups
## @}
+ ## @addtogroup l4_advanced
+ ## @{
+
+ ## Create a T-shape object with specified caracteristics for the main
+ # and the incident pipes (radius, width, half-length).
+ # The extremities of the main pipe are located on junctions points P1 and P2.
+ # The extremity of the incident pipe is located on junction point P3.
+ # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
+ # the main plane of the T-shape is XOY.
+ # @param theR1 Internal radius of main pipe
+ # @param theW1 Width of main pipe
+ # @param theL1 Half-length of main pipe
+ # @param theR2 Internal radius of incident pipe (R2 < R1)
+ # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
+ # @param theL2 Half-length of incident pipe
+ # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
+ # @param theP1 1st junction point of main pipe
+ # @param theP2 2nd junction point of main pipe
+ # @param theP3 Junction point of incident pipe
+ # @return List of GEOM_Objects, containing the created shape and propagation groups.
+ #
+ # @ref tui_creation_pipetshape "Example"
+ def MakePipeTShape(self, theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh=True, theP1=None, theP2=None, theP3=None):
+ theR1, theW1, theL1, theR2, theW2, theL2, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2)
+ if (theP1 and theP2 and theP3):
+ anObj = self.AdvOp.MakePipeTShapeWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh, theP1, theP2, theP3)
+ else:
+ anObj = self.AdvOp.MakePipeTShape(theR1, theW1, theL1, theR2, theW2, theL2, theHexMesh)
+ RaiseIfFailed("MakePipeTShape", self.AdvOp)
+ if Parameters: anObj[0].SetParameters(Parameters)
+ return anObj
+
+ ## Create a T-shape object with chamfer and with specified caracteristics for the main
+ # and the incident pipes (radius, width, half-length). The chamfer is
+ # created on the junction of the pipes.
+ # The extremities of the main pipe are located on junctions points P1 and P2.
+ # The extremity of the incident pipe is located on junction point P3.
+ # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
+ # the main plane of the T-shape is XOY.
+ # @param theR1 Internal radius of main pipe
+ # @param theW1 Width of main pipe
+ # @param theL1 Half-length of main pipe
+ # @param theR2 Internal radius of incident pipe (R2 < R1)
+ # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
+ # @param theL2 Half-length of incident pipe
+ # @param theH Height of the chamfer.
+ # @param theW Width of the chamfer.
+ # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
+ # @param theP1 1st junction point of main pipe
+ # @param theP2 2nd junction point of main pipe
+ # @param theP3 Junction point of incident pipe
+ # @return List of GEOM_Objects, containing the created shape and propagation groups.
+ #
+ # @ref tui_creation_pipetshape "Example"
+ def MakePipeTShapeChamfer(self, theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh=True, theP1=None, theP2=None, theP3=None):
+ theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW)
+ if (theP1 and theP2 and theP3):
+ anObj = self.AdvOp.MakePipeTShapeChamferWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh, theP1, theP2, theP3)
+ else:
+ anObj = self.AdvOp.MakePipeTShapeChamfer(theR1, theW1, theL1, theR2, theW2, theL2, theH, theW, theHexMesh)
+ RaiseIfFailed("MakePipeTShapeChamfer", self.AdvOp)
+ if Parameters: anObj[0].SetParameters(Parameters)
+ return anObj
+
+ ## Create a T-shape object with fillet and with specified caracteristics for the main
+ # and the incident pipes (radius, width, half-length). The fillet is
+ # created on the junction of the pipes.
+ # The extremities of the main pipe are located on junctions points P1 and P2.
+ # The extremity of the incident pipe is located on junction point P3.
+ # If P1, P2 and P3 are not given, the center of the shape is (0,0,0) and
+ # the main plane of the T-shape is XOY.
+ # @param theR1 Internal radius of main pipe
+ # @param theW1 Width of main pipe
+ # @param theL1 Half-length of main pipe
+ # @param theR2 Internal radius of incident pipe (R2 < R1)
+ # @param theW2 Width of incident pipe (R2+W2 < R1+W1)
+ # @param theL2 Half-length of incident pipe
+ # @param theRF Radius of curvature of fillet.
+ # @param theHexMesh Boolean indicating if shape is prepared for hex mesh (default=True)
+ # @param theP1 1st junction point of main pipe
+ # @param theP2 2nd junction point of main pipe
+ # @param theP3 Junction point of incident pipe
+ # @return List of GEOM_Objects, containing the created shape and propagation groups.
+ #
+ # @ref tui_creation_pipetshape "Example"
+ def MakePipeTShapeFillet(self, theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh=True, theP1=None, theP2=None, theP3=None):
+ theR1, theW1, theL1, theR2, theW2, theL2, theRF, Parameters = ParseParameters(theR1, theW1, theL1, theR2, theW2, theL2, theRF)
+ if (theP1 and theP2 and theP3):
+ anObj = self.AdvOp.MakePipeTShapeFilletWithPosition(theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh, theP1, theP2, theP3)
+ else:
+ anObj = self.AdvOp.MakePipeTShapeFillet(theR1, theW1, theL1, theR2, theW2, theL2, theRF, theHexMesh)
+ RaiseIfFailed("MakePipeTShapeFillet", self.AdvOp)
+ if Parameters: anObj[0].SetParameters(Parameters)
+ return anObj
+
+ #@@ insert new functions before this line @@ do not remove this line @@#
+
+ # end of l4_advanced
+ ## @}
+
## Create a copy of the given object
# @ingroup l1_geompy_auxiliary
#
@@ -3891,6 +4313,37 @@ class geompyDC(GEOM._objref_GEOM_Gen):
def addPath(self,Path):
if (sys.path.count(Path) < 1):
sys.path.append(Path)
+ pass
+ pass
+
+ ## Load marker texture from the file
+ # @param Path a path to the texture file
+ # @return unique texture identifier
+ # @ingroup l1_geompy_auxiliary
+ def LoadTexture(self, Path):
+ # Example: see GEOM_TestAll.py
+ ID = self.InsertOp.LoadTexture(Path)
+ RaiseIfFailed("LoadTexture", self.InsertOp)
+ return ID
+
+ ## Add marker texture. @a Width and @a Height parameters
+ # specify width and height of the texture in pixels.
+ # If @a RowData is @c True, @a Texture parameter should represent texture data
+ # packed into the byte array. If @a RowData is @c False (default), @a Texture
+ # parameter should be unpacked string, in which '1' symbols represent opaque
+ # pixels and '0' represent transparent pixels of the texture bitmap.
+ #
+ # @param Width texture width in pixels
+ # @param Height texture height in pixels
+ # @param Texture texture data
+ # @param RowData if @c True, @a Texture data are packed in the byte stream
+ # @ingroup l1_geompy_auxiliary
+ def AddTexture(self, Width, Height, Texture, RowData=False):
+ # Example: see GEOM_TestAll.py
+ if not RowData: Texture = PackData(Texture)
+ ID = self.InsertOp.AddTexture(Width, Height, Texture)
+ RaiseIfFailed("AddTexture", self.InsertOp)
+ return ID
import omniORB
#Register the new proxy for GEOM_Gen