Version: 6.3.1
Functions

Using measurement tools

All package methods, grouped by their purpose

Functions

def geompy.NumberOfFaces
 Gives quantity of faces in the given shape.
def geompy.NumberOfEdges
 Gives quantity of edges in the given shape.
def geompy.NumberOfSubShapes
 Gives quantity of subshapes of type theShapeType in the given shape.
def geompy.NumberOfSolids
 Gives quantity of solids in the given shape.
def geompy.PointCoordinates
 Get point coordinates.
def geompy.BasicProperties
 Get summarized length of all wires, area of surface and volume of the given shape.
def geompy.BoundingBox
 Get parameters of bounding box of the given shape.
def geompy.Inertia
 Get inertia matrix and moments of inertia of theShape.
def geompy.AreCoordsInside
 Get if coords are included in the shape (ST_IN or ST_ON)
def geompy.MinDistance
 Get minimal distance between the given shapes.
def geompy.MinDistanceComponents
 Get minimal distance between the given shapes.
def geompy.GetAngle
 Get angle between the given shapes in degrees.
def geompy.GetAngleRadians
 Get angle between the given shapes in radians.
def geompy.Tolerance
 Get min and max tolerances of sub-shapes of theShape.
def geompy.WhatIs
 Obtain description of the given shape (number of sub-shapes of each type)
def geompy.NbShapes
 Obtain quantity of shapes of the given type in theShape.
def geompy.ShapeInfo
 Obtain quantity of shapes of each type in theShape.
def geompy.MakeCDG
 Get a point, situated at the centre of mass of theShape.
def geompy.GetVertexByIndex
 Get a vertex subshape by index depended with orientation.
def geompy.GetFirstVertex
 Get the first vertex of wire/edge depended orientation.
def geompy.GetLastVertex
 Get the last vertex of wire/edge depended orientation.
def geompy.GetNormal
 Get a normale to the given face.
def geompy.CheckShape
 Check a topology of the given shape.
def geompy.GetPosition
 Get position (LCS) of theShape.
def geompy.KindOfShape
 Get kind of theShape.

Curve Curvature Measurement

Methods for receiving radius of curvature of curves in the given point
def geompy.CurveCurvatureByParam
 Measure curvature of a curve at a point, set by parameter.
def geompy.CurveCurvatureByPoint

Surface Curvature Measurement

Methods for receiving max and min radius of curvature of surfaces in the given point
def geompy.MaxSurfaceCurvatureByParam
def geompy.MaxSurfaceCurvatureByPoint
def geompy.MinSurfaceCurvatureByParam
def geompy.MinSurfaceCurvatureByPoint

Function Documentation

def geompy.NumberOfFaces (   self,
  theShape 
)
Parameters:
theShapeShape to count faces of.
Returns:
Quantity of faces.

Example

def geompy.NumberOfEdges (   self,
  theShape 
)
Parameters:
theShapeShape to count edges of.
Returns:
Quantity of edges.

Example

def geompy.NumberOfSubShapes (   self,
  theShape,
  theShapeType 
)
Parameters:
theShapeShape to count subshapes of.
theShapeTypeType of subshapes to count.
Returns:
Quantity of subshapes of given type.

Example

def geompy.NumberOfSolids (   self,
  theShape 
)
Parameters:
theShapeShape to count solids in.
Returns:
Quantity of solids.

Example

def geompy.PointCoordinates (   self,
  Point 
)
Returns:
[x, y, z]

Example

def geompy.BasicProperties (   self,
  theShape 
)
Parameters:
theShapeShape to define properties of.
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

def geompy.BoundingBox (   self,
  theShape 
)
Parameters:
theShapeShape to obtain bounding box of.
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

def geompy.Inertia (   self,
  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

def geompy.AreCoordsInside (   self,
  theShape,
  coords,
  tolerance = 1.e-7 
)
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, ...]
def geompy.MinDistance (   self,
  theShape1,
  theShape2 
)
Parameters:
theShape1,theShape2Shapes to find minimal distance between.
Returns:
Value of the minimal distance between the given shapes.

Example

def geompy.MinDistanceComponents (   self,
  theShape1,
  theShape2 
)
Parameters:
theShape1,theShape2Shapes to find minimal distance between.
Returns:
Value of the minimal distance between the given shapes.

Example

def geompy.GetAngle (   self,
  theShape1,
  theShape2 
)
Parameters:
theShape1,theShape2Lines or linear edges to find angle between.
Returns:
Value of the angle between the given shapes in degrees.

Example

def geompy.GetAngleRadians (   self,
  theShape1,
  theShape2 
)
Parameters:
theShape1,theShape2Lines or linear edges to find angle between.
Returns:
Value of the angle between the given shapes in radians.

Example

def geompy.CurveCurvatureByParam (   self,
  theCurve,
  theParam 
)

Example

def geompy.CurveCurvatureByPoint (   self,
  theCurve,
  thePoint 
)

Example

def geompy.MaxSurfaceCurvatureByParam (   self,
  theSurf,
  theUParam,
  theVParam 
)

Example

def geompy.MaxSurfaceCurvatureByPoint (   self,
  theSurf,
  thePoint 
)

Example

def geompy.MinSurfaceCurvatureByParam (   self,
  theSurf,
  theUParam,
  theVParam 
)

Example

def geompy.MinSurfaceCurvatureByPoint (   self,
  theSurf,
  thePoint 
)

Example

def geompy.Tolerance (   self,
  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

def geompy.WhatIs (   self,
  theShape 
)
Parameters:
theShapeShape to be described.
Returns:
Description of the given shape.

Example

def geompy.NbShapes (   self,
  theShape,
  theType 
)

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

Parameters:
theShapeShape to be described.
Returns:
Quantity of shapes of type theType in theShape.

Example

def geompy.ShapeInfo (   self,
  theShape 
)

The theShape is also counted.

Parameters:
theShapeShape to be described.
Returns:
Dictionary of shape types with bound quantities of shapes.

Example

def geompy.MakeCDG (   self,
  theShape 
)
Parameters:
theShapeShape to define centre of mass of.
Returns:
New GEOM_Object, containing the created point.

Example

def geompy.GetVertexByIndex (   self,
  theShape,
  theIndex 
)
Parameters:
theShapeShape to find subshape.
theIndexIndex to find vertex by this index.
Returns:
New GEOM_Object, containing the created vertex.

Example

def geompy.GetFirstVertex (   self,
  theShape 
)
Parameters:
theShapeShape to find first vertex.
Returns:
New GEOM_Object, containing the created vertex.

Example

def geompy.GetLastVertex (   self,
  theShape 
)
Parameters:
theShapeShape to find last vertex.
Returns:
New GEOM_Object, containing the created vertex.

Example

def geompy.GetNormal (   self,
  theFace,
  theOptionalPoint = None 
)

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.
Returns:
New GEOM_Object, containing the created vector.

Example

def geompy.CheckShape (   self,
  theShape,
  theIsCheckGeom = 0 
)
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.
Returns:
TRUE, if the shape "seems to be valid". If theShape is invalid, prints a description of problem.

Example

def geompy.GetPosition (   self,
  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

def geompy.KindOfShape (   self,
  theShape 
)
Parameters:
theShapeShape to get a kind of.
Returns:
Returns a kind of shape in terms of 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. The full list of possible outputs is:
  • geompy.kind.COMPOUND nb_solids nb_faces nb_edges nb_vertices
  • geompy.kind.COMPSOLID nb_solids nb_faces nb_edges nb_vertices
  • geompy.kind.SPHERE xc yc zc R
  • geompy.kind.CYLINDER xb yb zb dx dy dz R H
  • geompy.kind.BOX xc yc zc ax ay az
  • geompy.kind.ROTATED_BOX xc yc zc zx zy zz xx xy xz ax ay az
  • geompy.kind.TORUS xc yc zc dx dy dz R_1 R_2
  • geompy.kind.CONE xb yb zb dx dy dz R_1 R_2 H
  • geompy.kind.POLYHEDRON nb_faces nb_edges nb_vertices
  • geompy.kind.SOLID nb_faces nb_edges nb_vertices
  • geompy.kind.SPHERE2D xc yc zc R
  • geompy.kind.CYLINDER2D xb yb zb dx dy dz R H
  • geompy.kind.TORUS2D xc yc zc dx dy dz R_1 R_2
  • geompy.kind.CONE2D xc yc zc dx dy dz R_1 R_2 H
  • geompy.kind.DISK_CIRCLE xc yc zc dx dy dz R
  • geompy.kind.DISK_ELLIPSE xc yc zc dx dy dz R_1 R_2
  • geompy.kind.POLYGON xo yo zo dx dy dz nb_edges nb_vertices
  • geompy.kind.PLANE xo yo zo dx dy dz
  • geompy.kind.PLANAR xo yo zo dx dy dz nb_edges nb_vertices
  • geompy.kind.FACE nb_edges nb_vertices
  • geompy.kind.CIRCLE xc yc zc dx dy dz R
  • geompy.kind.ARC_CIRCLE xc yc zc dx dy dz R x1 y1 z1 x2 y2 z2
  • geompy.kind.ELLIPSE xc yc zc dx dy dz R_1 R_2
  • geompy.kind.ARC_ELLIPSE xc yc zc dx dy dz R_1 R_2 x1 y1 z1 x2 y2 z2
  • geompy.kind.LINE xo yo zo dx dy dz
  • geompy.kind.SEGMENT x1 y1 z1 x2 y2 z2
  • geompy.kind.EDGE nb_vertices
  • geompy.kind.VERTEX x y z

Example

Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS