Primitives

ccGenericPrimitive

class pycc.ccGenericPrimitive

Bases: ccMesh

clone(self: pycc.ccGenericPrimitive) QString
getDrawingPrecision(self: pycc.ccGenericPrimitive) int
getTransformation(self: pycc.ccGenericPrimitive) pycc.ccGLMatrix
getTypeName(self: pycc.ccGenericPrimitive) QString
hasDrawingPrecision(self: pycc.ccGenericPrimitive) bool
setColor(self: pycc.ccGenericPrimitive, col: pycc.Rgb) None
setDrawingPrecision(self: pycc.ccGenericPrimitive, steps: int) bool

ccSphere

class pycc.ccSphere

Bases: ccGenericPrimitive

Parameters:
  • radius (PointCoordinateType) – radius of the sphere

  • transMat (, optional) – optional 3D transformation (can be set afterwards with ccDrawableObject::setGLTransformation)

  • name (str, default: Sphere) – name of the sphere object

  • precision (int, default: 24) – drawing precision (angular step = 360/precision)

  • uniqueID (int, optional) – unique ID (handle with care)

Example

sphere = pycc.ccSphere(3.0)
sphere2 = pycc.ccSphere(5.0, name="Sphere2")
getRadius(self: pycc.ccSphere) float
setRadius(self: pycc.ccSphere, radius: float) None

ccPlane

class pycc.ccPlane

Bases: ccGenericPrimitive, ccPlanarEntityInterface

Parameters:
  • xWidth (PointCoordinateType) –

  • yWidth (PointCoordinateType) –

  • transMat (, optional) – optional 3D transformation (can be set afterwards with ccDrawableObject::setGLTransformation)

  • name (str, default: Sphere) – name of the sphere object

  • uniqueID (int, optional) – unique ID (handle with care)

Example

>>> import pycc
>>> plane = pycc.ccPlane(10.0, 5.0)
>>> plane.getXWidth()
10.0
>>> plane.getYWidth()
5.0
>>> plane.setXWidth(15.0)
>>> plane.setYWidth(12.5)
>>> plane.getXWidth()
15.0
>>> plane.getYWidth()
12.5
static Fit(cloud: cccorelib.GenericIndexedCloudPersist, rms: float) pycc.ccPlane
flip(self: pycc.ccPlane) None
getCenter(self: pycc.ccPlane) cccorelib.CCVector3
getEquation(self: pycc.ccPlane) tuple
getXWidth(self: pycc.ccPlane) float
getYWidth(self: pycc.ccPlane) float
setXWidth(self: pycc.ccPlane, w: float, autoUpdate: bool = True) None
setYWidth(self: pycc.ccPlane, h: float, autoUpdate: bool = True) None

ccTorus

class pycc.ccTorus

Bases: ccGenericPrimitive

Parameters:
  • insideRadius (PointCoordinateType) –

  • outsideRadius (PointCoordinateType) –

  • angleRad (float) – subtended angle (in radians)

  • rectangularSection (bool) – whether section is rectangular or round

  • rectSectionHeight (PointCoordinateType) – section height (if rectangular torus)

  • transMat (, optional) – optional 3D transformation (can be set afterwards with ccDrawableObject::setGLTransformation)

  • name (str, default: Sphere) – name of the sphere object

  • precision (int, default: 24) – drawing precision (angular step = 360/precision)

  • uniqueID (int, optional) – unique ID (handle with care)

Example

torus = pycc.ccTorus(5.0, 10.0)

ccBox

class pycc.ccBox

Bases: ccGenericPrimitive

Parameters:
  • insideRadius (cccorelib.CCVector3) – box dimensions

  • transMat (, optional) – optional 3D transformation (can be set afterwards with ccDrawableObject::setGLTransformation)

  • name (str, default: Sphere) – name of the sphere object

Example

>>> import pycc
>>> import cccorelib
>>> box = pycc.ccBox(cccorelib.CCVector3(5.0, 10.0, 4.0))
getDimensions(self: pycc.ccBox) cccorelib.CCVector3
setDimensions(self: pycc.ccBox, dims: cccorelib.CCVector3) None

ccDish

class pycc.ccDish

Bases: ccGenericPrimitive

Parameters:
  • radius (PointCoordinateType) – base radius

  • height (PointCoordinateType) – maximum height of dished surface above base

  • radius2 (PointCoordinateType, default = 0) –

    If radius2 is zero, dish is drawn as a section of sphere.

    If radius2 is >0, dish is defined as half of an ellipsoid.

  • transMat (, optional) – optional 3D transformation (can be set afterwards with ccDrawableObject::setGLTransformation)

  • name (str, default: Sphere) – name of the sphere object

Example

dish = pycc.ccDish(1.0, 4.0)

ccCone

class pycc.ccCone

Bases: ccGenericPrimitive

Parameters:
  • bottomRadius (PointCoordinateType) –

  • topRadius (PointCoordinateType) –

  • height (PointCoordinateType) – cone height (transformation should point to the axis center)

  • xOff (PointCoordinateType, default = 0) – displacement of axes along X-axis (Snout mode)

  • yOff (PointCoordinateType, default = 0) – displacement of axes along Y-axis (Snout mode)

  • transMat (, optional) – optional 3D transformation (can be set afterwards with ccDrawableObject::setGLTransformation)

  • name (str, default: Sphere) – name of the sphere object

  • precision (int, default: 24) – drawing precision (angular step = 360/precision)

  • uniqueID (int, optional) – unique ID (handle with care)

Example

cone = pycc.ccCone(10.0, 5.0, 20.0)
getBottomCenter(self: pycc.ccCone) cccorelib.CCVector3
getBottomRadius(self: pycc.ccCone) float
getHeight(self: pycc.ccCone) float
getLargeCenter(self: pycc.ccCone) cccorelib.CCVector3
getLargeRadius(self: pycc.ccCone) float
getSmallCenter(self: pycc.ccCone) cccorelib.CCVector3
getSmallRadius(self: pycc.ccCone) float
getTopCenter(self: pycc.ccCone) cccorelib.CCVector3
getTopRadius(self: pycc.ccCone) float
isSnoutMode(self: pycc.ccCone) bool
setBottomRadius(self: pycc.ccCone, radius: float) None
setHeight(self: pycc.ccCone, height: float) None
setTopRadius(self: pycc.ccCone, radius: float) None

ccCylinder

class pycc.ccCylinder

Bases: ccCone

Parameters:
  • radius (PointCoordinateType) –

  • height (PointCoordinateType) –

  • transMat (, optional) – optional 3D transformation (can be set afterwards with ccDrawableObject::setGLTransformation)

  • name (str, default: Sphere) – name of the sphere object

  • precision (int, default: 24) – drawing precision (angular step = 360/precision)

  • uniqueID (int, optional) – unique ID (handle with care)

Example

cylinder = pycc.ccCylinder(3.0, 10.0)
cylinder2 = pycc.ccCylinder(radius=5.0, height=50, name="Cylinder2")
getRadius(self: pycc.ccCylinder) float
setRadius(self: pycc.ccCylinder, radius: float) None

ccQuadric

class pycc.ccQuadric

Bases: ccGenericPrimitive

Parameters:
  • minCorner (cccorelib.CCVector2) – min corner of the ‘representation’ base area

  • maxCorner (cccorelib.CCVector2) – max corner of the ‘representation’ base area

  • eq (list of PointCoordinateType) – equation coefficients ( Z = a + b.X + c.Y + d.X^2 + e.X.Y + f.Y^2) 6 coefficients

  • dims (list of int, optional) – optional dimension indexes

  • transMat (, optional) – optional 3D transformation (can be set afterwards with ccDrawableObject::setGLTransformation)

  • name (str, default: Sphere) – name of the sphere object

Example

quadric = pycc.ccQuadric(
    cccorelib.CCVector2(5.0, 10.0),
    cccorelib.CCVector2(10.0, 20.0),
    [1.0, 2.0, 3.0, 4.0, 5.0, 6.0]
)
static Fit(arg0: cccorelib.GenericIndexedCloudPersist) float
getEquationCoefs(self: pycc.ccQuadric) float
getEquationDims(self: pycc.ccQuadric) cccorelib.Tuple3ub
getEquationString(self: pycc.ccQuadric) QString
getMaxCorner(self: pycc.ccQuadric) cccorelib.CCVector2
getMinCorner(self: pycc.ccQuadric) cccorelib.CCVector2
projectOnQuadric(self: pycc.ccQuadric, P: cccorelib.CCVector3, Q: cccorelib.CCVector3) float
property DEFAULT_DRAWING_PRECISION