Version: 8.3.0
Home
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages

Functions

def NumberOfFaces
 Gives quantity of faces in the given shape. More...
 
def NumberOfEdges
 Gives quantity of edges in the given shape. More...
 
def NumberOfSubShapes
 Gives quantity of sub-shapes of type theShapeType in the given shape. More...
 
def NumberOfSolids
 Gives quantity of solids in the given shape. More...
 
def PointCoordinates
 Get point coordinates. More...
 
def VectorCoordinates
 Get vector coordinates. More...
 
def CrossProduct
 Compute cross product. More...
 
def DotProduct
 Compute cross product. More...
 
def BasicProperties
 Get summarized length of all wires, area of surface and volume of the given shape. More...
 
def BoundingBox
 Get parameters of bounding box of the given shape. More...
 
def MakeBoundingBox
 Get bounding box of the given shape. More...
 
def Inertia
 Get inertia matrix and moments of inertia of theShape. More...
 
def AreCoordsInside
 Get if coords are included in the shape (ST_IN or ST_ON) More...
 
def MinDistance
 Get minimal distance between the given shapes. More...
 
def MinDistanceComponents
 Get minimal distance between the given shapes. More...
 
def ClosestPoints
 Get closest points of the given shapes. More...
 
def GetAngle
 Get angle between the given shapes in degrees. More...
 
def GetAngleRadians
 Get angle between the given shapes in radians. More...
 
def GetAngleVectors
 Get angle between the given vectors in degrees. More...
 
def GetAngleRadiansVectors
 The same as GetAngleVectors, but the result is in radians. More...
 
def Tolerance
 Get min and max tolerances of sub-shapes of theShape. More...
 
def WhatIs
 Obtain description of the given shape (number of sub-shapes of each type) More...
 
def NbShapes
 Obtain quantity of shapes of the given type in theShape. More...
 
def ShapeInfo
 Obtain quantity of shapes of each type in theShape. More...
 
def GetCreationInformation
 
def MakeCDG
 Get a point, situated at the centre of mass of theShape. More...
 
def GetVertexByIndex
 Get a vertex sub-shape by index depended with orientation. More...
 
def GetFirstVertex
 Get the first vertex of wire/edge depended orientation. More...
 
def GetLastVertex
 Get the last vertex of wire/edge depended orientation. More...
 
def GetNormal
 Get a normale to the given face. More...
 
def PrintShapeErrors
 Print shape errors obtained from CheckShape. More...
 
def CheckShape
 Check a topology of the given shape. More...
 
def CheckSelfIntersections
 Detect self-intersections in the given shape. More...
 
def CheckSelfIntersectionsFast
 Detect self-intersections of the given shape with algorithm based on mesh intersections. More...
 
def CheckBOPArguments
 Check boolean and partition operations agruments. More...
 
def FastIntersect
 Detect intersections of the given shapes with algorithm based on mesh intersections. More...
 
def GetPosition
 Get position (LCS) of theShape. More...
 
def KindOfShape
 Get kind of theShape. More...
 
def _IsGoodForSolid
 Returns the string that describes if the shell is good for solid. More...
 

Curve Curvature Measurement

Methods for receiving radius of curvature of curves in the given point

def CurveCurvatureByParam
 Measure curvature of a curve at a point, set by parameter. More...
 
def CurveCurvatureByPoint
 Measure curvature of a curve at a point. More...
 

Surface Curvature Measurement

Methods for receiving max and min radius of curvature of surfaces in the given point

def MaxSurfaceCurvatureByParam
 Measure max radius of curvature of surface. More...
 
def MaxSurfaceCurvatureByPoint
 Measure max radius of curvature of surface in the given point. More...
 
def MinSurfaceCurvatureByParam
 Measure min radius of curvature of surface. More...
 
def MinSurfaceCurvatureByPoint
 Measure min radius of curvature of surface in the given point. More...
 

Detailed Description

Function Documentation

def NumberOfFaces (   self,
  theShape 
)

Gives quantity of faces in the given shape.

Parameters
theShapeShape to count faces of.
Returns
Quantity of faces.

Example

References geomBuilder.ManageTransactions(), geomBuilder.RaiseIfFailed(), and geomBuilder.ShapesOp.

def NumberOfEdges (   self,
  theShape 
)

Gives quantity of edges in the given shape.

Parameters
theShapeShape to count edges of.
Returns
Quantity of edges.

Example

References geomBuilder.ManageTransactions(), geomBuilder.RaiseIfFailed(), and geomBuilder.ShapesOp.

def NumberOfSubShapes (   self,
  theShape,
  theShapeType 
)

Gives quantity of sub-shapes of type theShapeType in the given shape.

Parameters
theShapeShape to count sub-shapes of.
theShapeTypeType of sub-shapes to count (see ShapeType())
Returns
Quantity of sub-shapes of given type.

Example

References geomBuilder.ManageTransactions(), geomBuilder.RaiseIfFailed(), and geomBuilder.ShapesOp.

def NumberOfSolids (   self,
  theShape 
)

Gives quantity of solids in the given shape.

Parameters
theShapeShape to count solids in.
Returns
Quantity of solids.

Example

References geomBuilder.ManageTransactions(), geomBuilder.RaiseIfFailed(), geomBuilder.ShapesOp, and geomBuilder.ShapeType.

def PointCoordinates (   self,
  Point 
)

Get point coordinates.

Returns
[x, y, z]

Example

References geomBuilder.MeasuOp, and geomBuilder.RaiseIfFailed().

def VectorCoordinates (   self,
  Vector 
)

Get vector coordinates.

Returns
[x, y, z]

Example

References geomBuilder.GetFirstVertex(), geomBuilder.GetLastVertex(), and geomBuilder.PointCoordinates().

def CrossProduct (   self,
  Vector1,
  Vector2 
)

Compute cross product.

Returns
vector w=u^v

Example

References geomBuilder.MakeVectorDXDYDZ(), and geomBuilder.VectorCoordinates().

def DotProduct (   self,
  Vector1,
  Vector2 
)

Compute cross product.

Returns
dot product p=u.v

Example

References geomBuilder.ManageTransactions(), and geomBuilder.VectorCoordinates().

def BasicProperties (   self,
  theShape,
  theTolerance = 1.e-6 
)

Get summarized length of all wires, area of surface and volume of the given shape.

Parameters
theShapeShape to define properties of.
theTolerancemaximal relative error of area and volume computation.
Returns
[theLength, theSurfArea, theVolume]
theLength: Summarized length of all wires of the given shape.
theSurfArea: Area of surface of the given shape.
theVolume: Volume of the given shape.

Example

References geomBuilder.ManageTransactions(), geomBuilder.MeasuOp, and geomBuilder.RaiseIfFailed().

def BoundingBox (   self,
  theShape,
  precise = False 
)

Get parameters of bounding box of the given shape.

Parameters
theShapeShape to obtain bounding box of.
preciseTRUE for precise computation; FALSE for fast one.
Returns
[Xmin,Xmax, Ymin,Ymax, Zmin,Zmax] Xmin,Xmax: Limits of shape along OX axis. Ymin,Ymax: Limits of shape along OY axis. Zmin,Zmax: Limits of shape along OZ axis.

Example

References geomBuilder.ManageTransactions(), geomBuilder.MeasuOp, and geomBuilder.RaiseIfFailed().

def MakeBoundingBox (   self,
  theShape,
  precise = False,
  theName = None 
)

Get bounding box of the given shape.

Parameters
theShapeShape to obtain bounding box of.
preciseTRUE for precise computation; FALSE for fast one.
theNameObject name; when specified, this parameter is used for result publication in the study. Otherwise, if automatic publication is switched on, default value is used for result name.
Returns
New GEOM.GEOM_Object, containing the created box.

Example

References geomBuilder._autoPublish(), geomBuilder.ManageTransactions(), geomBuilder.MeasuOp, and geomBuilder.RaiseIfFailed().

def Inertia (   self,
  theShape 
)

Get inertia matrix and moments of inertia of theShape.

Parameters
theShapeShape to calculate inertia of.
Returns
[I11,I12,I13, I21,I22,I23, I31,I32,I33, Ix,Iy,Iz] I(1-3)(1-3): Components of the inertia matrix of the given shape. Ix,Iy,Iz: Moments of inertia of the given shape.

Example

References geomBuilder.ManageTransactions(), geomBuilder.MeasuOp, and geomBuilder.RaiseIfFailed().

def AreCoordsInside (   self,
  theShape,
  coords,
  tolerance = 1.e-7 
)

Get if coords are included in the shape (ST_IN or ST_ON)

Parameters
theShapeShape
coordslist of points coordinates [x1, y1, z1, x2, y2, z2, ...]
toleranceto be used (default is 1.0e-7)
Returns
list_of_boolean = [res1, res2, ...]

References geomBuilder.ManageTransactions().

def MinDistance (   self,
  theShape1,
  theShape2 
)

Get minimal distance between the given shapes.

Parameters
theShape1,theShape2Shapes to find minimal distance between.
Returns
Value of the minimal distance between the given shapes.

Example

References geomBuilder.ManageTransactions(), geomBuilder.MeasuOp, and geomBuilder.RaiseIfFailed().

def MinDistanceComponents (   self,
  theShape1,
  theShape2 
)

Get minimal distance between the given shapes.

Parameters
theShape1,theShape2Shapes to find minimal distance between.
Returns
Value of the minimal distance between the given shapes, in form of list [Distance, DX, DY, DZ].

Example

References geomBuilder.ManageTransactions(), geomBuilder.MeasuOp, and geomBuilder.RaiseIfFailed().

def ClosestPoints (   self,
  theShape1,
  theShape2 
)

Get closest points of the given shapes.

Parameters
theShape1,theShape2Shapes to find closest points of.
Returns
The number of found solutions (-1 in case of infinite number of solutions) and a list of (X, Y, Z) coordinates for all couples of points.

Example

References geomBuilder.ManageTransactions(), geomBuilder.MeasuOp, and geomBuilder.RaiseIfFailed().

def GetAngle (   self,
  theShape1,
  theShape2 
)

Get angle between the given shapes in degrees.

Parameters
theShape1,theShape2Lines or linear edges to find angle between.
Note
If both arguments are vectors, the angle is computed in accordance with their orientations, otherwise the minimum angle is computed.
Returns
Value of the angle between the given shapes in degrees.

Example

References geomBuilder.ManageTransactions(), geomBuilder.MeasuOp, and geomBuilder.RaiseIfFailed().

def GetAngleRadians (   self,
  theShape1,
  theShape2 
)

Get angle between the given shapes in radians.

Parameters
theShape1,theShape2Lines or linear edges to find angle between.
Note
If both arguments are vectors, the angle is computed in accordance with their orientations, otherwise the minimum angle is computed.
Returns
Value of the angle between the given shapes in radians.

Example

References geomBuilder.ManageTransactions(), geomBuilder.MeasuOp, and geomBuilder.RaiseIfFailed().

def GetAngleVectors (   self,
  theShape1,
  theShape2,
  theFlag = True 
)

Get angle between the given vectors in degrees.

Parameters
theShape1,theShape2Vectors to find angle between.
theFlagIf True, the normal vector is defined by the two vectors cross, if False, the opposite vector to the normal vector is used.
Returns
Value of the angle between the given vectors in degrees.

Example

References geomBuilder.MeasuOp, and geomBuilder.RaiseIfFailed().

def GetAngleRadiansVectors (   self,
  theShape1,
  theShape2,
  theFlag = True 
)

The same as GetAngleVectors, but the result is in radians.

References geomBuilder.GetAngleVectors(), and geomBuilder.ManageTransactions().

def CurveCurvatureByParam (   self,
  theCurve,
  theParam 
)

Measure curvature of a curve at a point, set by parameter.

Parameters
theCurvea curve.
theParamparameter.
Returns
radius of curvature of theCurve.

Example

References geomBuilder.ManageTransactions(), geomBuilder.MeasuOp, and geomBuilder.RaiseIfFailed().

def CurveCurvatureByPoint (   self,
  theCurve,
  thePoint 
)

Measure curvature of a curve at a point.

Parameters
theCurvea curve.
thePointgiven point.
Returns
radius of curvature of theCurve.

Example

References geomBuilder.ManageTransactions(), geomBuilder.MeasuOp, and geomBuilder.RaiseIfFailed().

def MaxSurfaceCurvatureByParam (   self,
  theSurf,
  theUParam,
  theVParam 
)

Measure max radius of curvature of surface.

Parameters
theSurfthe given surface.
theUParamValue of U-parameter on the referenced surface.
theVParamValue of V-parameter on the referenced surface.
Returns
max radius of curvature of theSurf.

Example

References geomBuilder.ManageTransactions(), geomBuilder.MeasuOp, and geomBuilder.RaiseIfFailed().

def MaxSurfaceCurvatureByPoint (   self,
  theSurf,
  thePoint 
)

Measure max radius of curvature of surface in the given point.

Parameters
theSurfthe given surface.
thePointgiven point.
Returns
max radius of curvature of theSurf.

Example

References geomBuilder.ManageTransactions(), geomBuilder.MeasuOp, and geomBuilder.RaiseIfFailed().

def MinSurfaceCurvatureByParam (   self,
  theSurf,
  theUParam,
  theVParam 
)

Measure min radius of curvature of surface.

Parameters
theSurfthe given surface.
theUParamValue of U-parameter on the referenced surface.
theVParamValue of V-parameter on the referenced surface.
Returns
min radius of curvature of theSurf.

Example

References geomBuilder.ManageTransactions(), geomBuilder.MeasuOp, and geomBuilder.RaiseIfFailed().

def MinSurfaceCurvatureByPoint (   self,
  theSurf,
  thePoint 
)

Measure min radius of curvature of surface in the given point.

Parameters
theSurfthe given surface.
thePointgiven point.
Returns
min radius of curvature of theSurf.

Example

References geomBuilder.ManageTransactions(), geomBuilder.MeasuOp, and geomBuilder.RaiseIfFailed().

def Tolerance (   self,
  theShape 
)

Get min and max tolerances of sub-shapes of theShape.

Parameters
theShapeShape, to get tolerances of.
Returns
[FaceMin,FaceMax, EdgeMin,EdgeMax, VertMin,VertMax]
FaceMin,FaceMax: Min and max tolerances of the faces.
EdgeMin,EdgeMax: Min and max tolerances of the edges.
VertMin,VertMax: Min and max tolerances of the vertices.

Example

References geomBuilder.ManageTransactions(), geomBuilder.MeasuOp, and geomBuilder.RaiseIfFailed().

def WhatIs (   self,
  theShape 
)

Obtain description of the given shape (number of sub-shapes of each type)

Parameters
theShapeShape to be described.
Returns
Description of the given shape.

Example

References geomBuilder.MeasuOp, and geomBuilder.RaiseIfFailed().

def NbShapes (   self,
  theShape,
  theType 
)

Obtain quantity of shapes of the given type in theShape.

If theShape is of type theType, it is also counted.

Parameters
theShapeShape to be described.
theTypethe given ShapeType().
Returns
Quantity of shapes of type theType in theShape.

Example

References geomBuilder.SubShapeAllIDs().

def ShapeInfo (   self,
  theShape 
)

Obtain quantity of shapes of each type in theShape.

The theShape is also counted.

Parameters
theShapeShape to be described.
Returns
Dictionary of ShapeType() with bound quantities of shapes.

Example

References geomBuilder.ShapeType, and geomBuilder.SubShapeAllIDs().

def GetCreationInformation (   self,
  theShape 
)
def MakeCDG (   self,
  theShape,
  theName = None 
)

Get a point, situated at the centre of mass of theShape.

Parameters
theShapeShape to define centre of mass of.
theNameObject name; when specified, this parameter is used for result publication in the study. Otherwise, if automatic publication is switched on, default value is used for result name.
Returns
New GEOM.GEOM_Object, containing the created point.

Example

References geomBuilder._autoPublish(), geomBuilder.ManageTransactions(), geomBuilder.MeasuOp, and geomBuilder.RaiseIfFailed().

def GetVertexByIndex (   self,
  theShape,
  theIndex,
  theName = None 
)

Get a vertex sub-shape by index depended with orientation.

Parameters
theShapeShape to find sub-shape.
theIndexIndex to find vertex by this index (starting from zero)
theNameObject name; when specified, this parameter is used for result publication in the study. Otherwise, if automatic publication is switched on, default value is used for result name.
Returns
New GEOM.GEOM_Object, containing the created vertex.

Example

References geomBuilder._autoPublish(), geomBuilder.MeasuOp, and geomBuilder.RaiseIfFailed().

def GetFirstVertex (   self,
  theShape,
  theName = None 
)

Get the first vertex of wire/edge depended orientation.

Parameters
theShapeShape to find first vertex.
theNameObject name; when specified, this parameter is used for result publication in the study. Otherwise, if automatic publication is switched on, default value is used for result name.
Returns
New GEOM.GEOM_Object, containing the created vertex.

Example

References geomBuilder.GetVertexByIndex().

def GetLastVertex (   self,
  theShape,
  theName = None 
)

Get the last vertex of wire/edge depended orientation.

Parameters
theShapeShape to find last vertex.
theNameObject name; when specified, this parameter is used for result publication in the study. Otherwise, if automatic publication is switched on, default value is used for result name.
Returns
New GEOM.GEOM_Object, containing the created vertex.

Example

References geomBuilder.GetVertexByIndex(), geomBuilder.ManageTransactions(), geomBuilder.NumberOfSubShapes(), and geomBuilder.ShapeType.

def GetNormal (   self,
  theFace,
  theOptionalPoint = None,
  theName = None 
)

Get a normale to the given face.

If the point is not given, the normale is calculated at the center of mass.

Parameters
theFaceFace to define normale of.
theOptionalPointPoint to compute the normale at.
theNameObject name; when specified, this parameter is used for result publication in the study. Otherwise, if automatic publication is switched on, default value is used for result name.
Returns
New GEOM.GEOM_Object, containing the created vector.

Example

References geomBuilder._autoPublish(), geomBuilder.ManageTransactions(), geomBuilder.MeasuOp, and geomBuilder.RaiseIfFailed().

def PrintShapeErrors (   self,
  theShape,
  theShapeErrors,
  theReturnStatus = 0 
)

Print shape errors obtained from CheckShape.

Parameters
theShapeShape that was checked.
theShapeErrorsthe shape errors obtained by CheckShape.
theReturnStatusIf 0 the description of problem is printed. If 1 the description of problem is returned.
Returns
If theReturnStatus is equal to 1 the description is returned. Otherwise doesn't return anything.

Example

References geomBuilder.ManageTransactions().

def CheckShape (   self,
  theShape,
  theIsCheckGeom = 0,
  theReturnStatus = 0 
)

Check a topology of the given shape.

Parameters
theShapeShape to check validity of.
theIsCheckGeomIf FALSE, only the shape's topology will be checked,
if TRUE, the shape's geometry will be checked also.
theReturnStatusIf 0 and if theShape is invalid, a description of problem is printed. If 1 isValid flag and the description of problem is returned. If 2 isValid flag and the list of error data is returned.
Returns
TRUE, if the shape "seems to be valid". If theShape is invalid, prints a description of problem. If theReturnStatus is equal to 1 the description is returned along with IsValid flag. If theReturnStatus is equal to 2 the list of error data is returned along with IsValid flag.

Example

References geomBuilder.ManageTransactions(), geomBuilder.MeasuOp, and geomBuilder.RaiseIfFailed().

def CheckSelfIntersections (   self,
  theShape,
  theCheckLevel = GEOM.SI_ALL 
)

Detect self-intersections in the given shape.

Parameters
theShapeShape to check.
theCheckLevelis the level of self-intersection check. Possible input values are:
  • GEOM.SI_V_V(0) - only V/V interferences
  • GEOM.SI_V_E(1) - V/V and V/E interferences
  • GEOM.SI_E_E(2) - V/V, V/E and E/E interferences
  • GEOM.SI_V_F(3) - V/V, V/E, E/E and V/F interferences
  • GEOM.SI_E_F(4) - V/V, V/E, E/E, V/F and E/F interferences
  • GEOM.SI_ALL(5) - all interferences.
Returns
TRUE, if the shape contains no self-intersections.

Example

References geomBuilder.EnumToLong(), geomBuilder.ManageTransactions(), geomBuilder.MeasuOp, and geomBuilder.RaiseIfFailed().

def CheckSelfIntersectionsFast (   self,
  theShape,
  theDeflection = 0.001,
  theTolerance = 0.0 
)

Detect self-intersections of the given shape with algorithm based on mesh intersections.

Parameters
theShapeShape to check.
theDeflectionLinear deflection coefficient that specifies quality of tesselation:
  • if theDeflection <= 0, default deflection 0.001 is used
theToleranceSpecifies a distance between sub-shapes used for detecting gaps:
  • if theTolerance <= 0, algorithm detects intersections (default behavior)
  • if theTolerance > 0, algorithm detects gaps
Returns
TRUE, if the shape contains no self-intersections.

Example

References geomBuilder.ManageTransactions(), geomBuilder.MeasuOp, and geomBuilder.RaiseIfFailed().

def CheckBOPArguments (   self,
  theShape 
)

Check boolean and partition operations agruments.

Parameters
theShapethe agrument of an operation to be checked
Returns
TRUE if the agrument is valid for a boolean or partition operation; FALSE otherwise.

References geomBuilder.ManageTransactions().

def FastIntersect (   self,
  theShape1,
  theShape2,
  theTolerance = 0.0,
  theDeflection = 0.001 
)

Detect intersections of the given shapes with algorithm based on mesh intersections.

Parameters
theShape1First source object
theShape2Second source object
theToleranceSpecifies a distance between shapes used for detecting gaps:
  • if theTolerance <= 0, algorithm detects intersections (default behavior)
  • if theTolerance > 0, algorithm detects gaps
theDeflectionLinear deflection coefficient that specifies quality of tesselation:
  • if theDeflection <= 0, default deflection 0.001 is used
Returns
TRUE, if there are intersections (gaps) between source shapes
List of sub-shapes IDs from 1st shape that localize intersection.
List of sub-shapes IDs from 2nd shape that localize intersection.

Example

References geomBuilder.ManageTransactions(), geomBuilder.MeasuOp, and geomBuilder.RaiseIfFailed().

def GetPosition (   self,
  theShape 
)

Get position (LCS) of theShape.

Origin of the LCS is situated at the shape's center of mass. Axes of the LCS are obtained from shape's location or, if the shape is a planar face, from position of its plane.

Parameters
theShapeShape to calculate position of.
Returns
[Ox,Oy,Oz, Zx,Zy,Zz, Xx,Xy,Xz]. Ox,Oy,Oz: Coordinates of shape's LCS origin. Zx,Zy,Zz: Coordinates of shape's LCS normal(main) direction. Xx,Xy,Xz: Coordinates of shape's LCS X direction.

Example

References geomBuilder.ManageTransactions(), geomBuilder.MeasuOp, and geomBuilder.RaiseIfFailed().

def KindOfShape (   self,
  theShape 
)

Get kind of theShape.

Parameters
theShapeShape to get a kind of.
Returns
Returns a kind of shape in terms of GEOM.GEOM_IKindOfShape.shape_kind enumeration and a list of parameters, describing the shape.
Note
Concrete meaning of each value, returned via theIntegers or theDoubles list depends on the kind() of the shape.

Example

References geomBuilder.ManageTransactions(), geomBuilder.MeasuOp, and geomBuilder.RaiseIfFailed().

def _IsGoodForSolid (   self,
  theShell 
)
private

Returns the string that describes if the shell is good for solid.

This is a support method for MakeSolid.

Parameters
theShellthe shell to be checked.
Returns
Returns a string that describes the shell validity for solid construction.

References geomBuilder.ManageTransactions().