6. ccPrimitives

Primitives regroups all the geometric generators provided by CloudCompare: ccBox, ccCone, ccCylinder, ccPlane, ccQuadric, ccSphere, ccTorus, ccDish.

The primitives are derived from a generic primitive ccGenericPrimitive.

Rotation Translation matrix can be applied at construction time or after.

6.1. Box

class cloudComPy.ccBox

Bases: ccGenericPrimitive, ccMesh

Box dimensions axis along each dimension are defined in a single 3D vector.

A box is in fact composed of 6 planes (ccPlane).

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: _cloudComPy.ccBox, arg0: QString) -> None

Simplified ccBox constructor, creates a box with null dimensions. (Not for a standard usage).

  1. __init__(self: _cloudComPy.ccBox, dims: Vector3Tpl<T>, transMat: _cloudComPy.ccGLMatrix = None, name: QString = ‘Box’) -> None

ccBox Constructor

Parameters:
  • dims (tuple) – box dimensions

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

  • name (str,optional) – name, default ‘Box’

getDimensions(self: _cloudComPy.ccBox) Vector3Tpl<T>

Get the box dimensions.

Returns:

the box dimensions

Return type:

tuple dimensions

setDimensions(self: _cloudComPy.ccBox, arg0: Vector3Tpl<T>) None

Set or update the box dimensions.

Parameters:

dims (tuple) – box dimensions

6.2. Cone

class cloudComPy.ccCone

Bases: ccGenericPrimitive, ccMesh

Cone axis corresponds to the ‘Z’ dimension by default.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: _cloudComPy.ccCone, arg0: QString) -> None

Simplified ccCone constructor, creates a cone with null dimensions. (Not for a standard usage).

  1. __init__(self: _cloudComPy.ccCone, bottomRadius: float, topRadius: float, height: float, xOff: float = 0, xOff: float = 0, transMat: _cloudComPy.ccGLMatrix = None, name: QString = ‘Cone’, precision: int = 24, uniqueID: int = 4294967295) -> None

ccCone constructor.

Parameters:
  • bottomRadius (float) – cone bottom radius

  • topRadius (float) – cone top radius

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

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

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

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

  • name (str,optional) – name, default ‘Cone’

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

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

getBottomCenter(self: _cloudComPy.ccCone) Vector3Tpl<T>

Returns axis bottom end point after applying transformation.

Returns:

axis bottom end point after applying transformation

Return type:

CCVector3

getBottomRadius(self: _cloudComPy.ccCone) float

Returns bottom radius.

Returns:

bottom radius

Return type:

double

getHeight(self: _cloudComPy.ccCone) float

Returns Height.

Returns:

Height

Return type:

double

getLargeCenter(self: _cloudComPy.ccCone) Vector3Tpl<T>

Returns cone axis end point associated with whichever radii is larger.

Returns:

cone axis end point associated with whichever radii is larger

Return type:

CCVector3

getLargeRadius(self: _cloudComPy.ccCone) float

Returns whichever cone radii is larger.

Returns:

whichever cone radii is larger

Return type:

double

getSmallCenter(self: _cloudComPy.ccCone) Vector3Tpl<T>

Returns cone axis end point associated with whichever radii is smaller.

Returns:

cone axis end point associated with whichever radii is smaller

Return type:

CCVector3

getSmallRadius(self: _cloudComPy.ccCone) float

Returns whichever cone radii is smaller.

Returns:

whichever cone radii is smaller

Return type:

double

getTopCenter(self: _cloudComPy.ccCone) Vector3Tpl<T>

Returns axis top end point after applying transformation.

Returns:

axis top end point after applying transformation

Return type:

CCVector3

getTopRadius(self: _cloudComPy.ccCone) float

Returns top radius.

Returns:

top radius

Return type:

double

setBottomRadius(self: _cloudComPy.ccCone, arg0: float) None

Set or update bottom radius.

Parameters:

radius (double) – new bottom radius value

setHeight(self: _cloudComPy.ccCone, arg0: float) None

Set or update height value

Parameters:

height (double) – new height value

setTopRadius(self: _cloudComPy.ccCone, arg0: float) None

Set or update top radius.

Parameters:

radius (double) – new top radius value

6.3. Cylinder

class cloudComPy.ccCylinder

Bases: ccCone

Cylinder axis corresponds to the ‘Z’ dimension.

Internally represented by a cone with the same top and bottom radius.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: _cloudComPy.ccCylinder, arg0: QString) -> None

Simplified ccCylinder constructor, with null dimensions. (Not for a standard usage).

  1. __init__(self: _cloudComPy.ccCylinder, radius: float, height: float, transMat: _cloudComPy.ccGLMatrix = None, name: QString = ‘Cylinder’, precision: int = 24, uniqueID: int = 4294967295) -> None

ccCylinder constructor

Parameters:
  • radius (float) – cylinder radius

  • height (float) – cylinder height (transformation should point to the axis center)

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

  • name (str,optional) – name, default ‘Cylinder’

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

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

setRadius(self: _cloudComPy.ccCylinder, arg0: float) None

Set or update radius.

Parameters:

radius (double) – new radius value

6.4. Plane

class cloudComPy.ccPlane

Bases: ccGenericPrimitive, ccMesh

Default plane normal corresponds to ‘Z’ dimension. a ccPlane is defined with widths along ‘X’ and ‘Y’ dimensions.

See __init__ methods below for constructors.

static Fit(arg0: _cloudComPy.GenericIndexedCloudPersist) _cloudComPy.ccPlane

Fits a plane primitive on a cloud.

The cloud can be either a pointCloud or a Polyline.

Parameters:

cloud (GenericIndexedCloudPersist) – input cloud

Returns:

plane primitive (if successful)

Return type:

ccPlane

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: _cloudComPy.ccPlane, arg0: QString) -> None

Simplified ccPlane constructor, with null dimensions. (Not for a standard usage).

  1. __init__(self: _cloudComPy.ccPlane, xWidth: float, yWidth: float, transMat: _cloudComPy.ccGLMatrix = None, name: QString = ‘Plane’) -> None

ccPlane constructor

Parameters:
  • xWidth (float) – plane width along ‘X’ dimension

  • yWidth (float) – plane width along ‘Y’ dimension

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

  • name (str,optional) – name, default ‘Plane’

getCenter(self: _cloudComPy.ccPlane) Vector3Tpl<T>

Returns the center of the plane.

Returns:

plane center

Return type:

CCVector3

getEquation(self: _cloudComPy.ccPlane) list[float]

Returns the equation of the plane.

Returns:

Plane equation : [a, b, c, d] as ax+by+cz=d

Return type:

tuple

getNormal(self: _cloudComPy.ccPlane) Vector3Tpl<T>

Returns the normal of the plane.

Returns:

plane normal

Return type:

CCVector3

setXWidth(self: _cloudComPy.ccPlane, arg0: float, arg1: bool) None

Set or update plane width along ‘X’ dimension.

Parameters:

xWidth (float) – plane width along ‘X’ dimension

setYWidth(self: _cloudComPy.ccPlane, arg0: float, arg1: bool) None

Set or update plane width along ‘Y’ dimension.

Parameters:

yWidth (float) – plane width along ‘Y’ dimension

6.5. Quadric

class cloudComPy.ccQuadric

Bases: ccGenericPrimitive, ccMesh

Quadric orthogonal dimension is ‘Z’ by default.

__init__(self: _cloudComPy.ccQuadric, minCorner: Vector2Tpl<T>, maxCorner: Vector2Tpl<T>, eqv: list[float], dims: Tuple3Tpl<T> = (0, 1, 2), transMat: _cloudComPy.ccGLMatrix = None, name: QString = 'Quadric', precision: int = 24) None

ccQuadric constructor

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

  • maxCorner (tuple) – max corner of the ‘representation’ base area

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

  • dims (tuple,optional) – (default 0) dimension indexes

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

  • name (str,optional) – optional name, default ‘Quadric’

  • precision (int,optional) – optional drawing precision, default 24

6.6. Sphere

class cloudComPy.ccSphere

Bases: ccGenericPrimitive, ccMesh

Sphere primitive, mainly defined by its radius and drawing precision.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: _cloudComPy.ccSphere, arg0: QString) -> None

Simplified ccSphere constructor with null radius. (Not for a standard usage).

  1. __init__(self: _cloudComPy.ccSphere, radius: float, transMat: _cloudComPy.ccGLMatrix = None, name: QString = ‘Sphere’, precision: int = 24, uniqueID: int = 4294967295) -> None

ccSphere constructor

Parameters:
  • radius (float) – sphere radius.

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

  • name (str,optional) – optional name, default ‘Sphere’

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

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

getRadius(self: _cloudComPy.ccSphere) float

Get the sphere radius.

Returns:

radius

Return type:

float

setRadius(self: _cloudComPy.ccSphere, arg0: float) None

Set the sphere radius.

Parameters:

radius (float) – sphere radius.

6.7. Torus

class cloudComPy.ccTorus

Bases: ccGenericPrimitive, ccMesh

Torus is defined in the XY plane by default. Its section can be rectangular or round.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: _cloudComPy.ccTorus, arg0: QString) -> None

Simplified ccTorus constructor with null dimensions. (Not for a standard usage).

  1. __init__(self: _cloudComPy.ccTorus, insideRadius: float, outsideRadius: float, angle_rad: float = 6.283185307179586, rectangularSection: bool = False, rectSectionHeight: float = 0, transMat: _cloudComPy.ccGLMatrix = None, name: QString = ‘Torus’, precision: int = 24, uniqueID: int = 4294967295) -> None

ccTorus constructor

Parameters:
  • insideRadius (float) – inside radius

  • outsideRadius (float) – outside radius

  • angle (float,optional) – rad (default 2*pi) subtended angle (in radians)

  • rectangularSection (bool,optional) – (default False) whether section is rectangular or round

  • rectSectionHeight (float,optional) – section height (if rectangular torus)

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

  • name (str,optional) – name, default ‘Torus’

  • precision (int,optional) – drawing precision (main loop angular step = 360/(4*precision), circular section angular step = 360/precision), default 24

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

6.8. Dish

class cloudComPy.ccDish

Bases: ccGenericPrimitive, ccMesh

Either a section of a sphere, or half of an ellipsoid!

The origin of the Dish is at the centre of the base, and the Z-axis lies along the normal to the base.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: _cloudComPy.ccDish, arg0: QString) -> None

Simplified ccDish constructor with null dimensions. (Not for a standard usage).

  1. __init__(self: _cloudComPy.ccDish, radius: float, height: float, radius2: float = 0, transMat: _cloudComPy.ccGLMatrix = None, name: QString = ‘Dish’, precision: int = 24) -> None

ccDish constructor

Parameters:
  • radius (float) – base radius

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

  • radius2 (float,optional) – (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 (ccGLMatrix,optional) – (default 0) 3D transformation (can be set afterwards with ccDrawableObject::setGLTransformation)

  • name (str,optional) – name, default ‘Dish’

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

6.9. Generic primitive

class cloudComPy.ccGenericPrimitive

Bases: pybind11_object

__init__(self: _cloudComPy.ccGenericPrimitive, name: QString = '', transMat: _cloudComPy.ccGLMatrix = None, uniqueID: int = 4294967295) None
getTransformation(self: _cloudComPy.ccGenericPrimitive) _cloudComPy.ccGLMatrix

Returns transformation matrix.

Returns:

transformation matrix

Return type:

ccGLMatrix

getTypeName(self: _cloudComPy.ccGenericPrimitive) QString

Returns type name (sphere, cylinder, etc.)

Returns:

type name

Return type:

str

7. transformations

7.1. Rotation Translation Matrix

class cloudComPy.ccGLMatrix

Bases: ccGLMatrixTpl_float

A 4x4 ‘transformation’ matrix (column major order), simple precision (float).

Transformation (M) is composed by a rotation (R) and a translation (T): M*X = R*X + T. See OpenGL transformations.

Available operators: += -= *= *

See __init__ methods below for constructors.

static FromQuaternionAndTranslation(quaternion: list[float], depl: Vector3Tpl<T> = (0.0, 0.0, 0.0)) _cloudComPy.ccGLMatrix

Generates a transformation from a quaternion and an optional translation.

A normalized quaternion such as |q| = sqrt(q1*q1 + q2*q2 + q3*q3 + q4*q4) = 1, can also be expressed as: q = {cos(θ/2), ux*sin(θ/2), uy*sin(θ/2), uz*sin(θ/2)} where (ux, uy, uz) represent the components of a unit vector u, and θ is an angle. The quaternion defines a rotation around the vector u, of angle θ. Here, if q is not normalized, q is divided by its euclidian norm |q|.

Parameters:
  • quaternion (list[float]) – a quaternion formed from 4 floats.

  • depl (CCVector3,optional) – an optional translation.

Returns:

transformation matrix

Return type:

ccGLMatrix

FromToRotation(self: Vector3Tpl<T>, arg0: Vector3Tpl<T>) _cloudComPy.ccGLMatrix

Creates a transformation matrix that rotates a vector to another.

Adapted from “Efficiently Building a Matrix to Rotate One Vector to Another” By Tomas Möller, John Hughes, Journal of Graphics Tools, 4(4):1-4, 1999

Parameters:
  • from (tuple) – normalized non-zero source vector

  • to (tuple) – normalized non-zero destination vector

Returns:

transformation matrix

Return type:

ccGLMatrix

FromViewDirAndUpDir(self: Vector3Tpl<T>, arg0: Vector3Tpl<T>) _cloudComPy.ccGLMatrix

Generates a ‘viewing’ matrix from a looking vector and a ‘up’ direction.

warning No translation is applied (pure rotation matrix).

Parameters:
  • forward (tuple) – forward ‘view’ vector

  • up (tuple) – up vector

Returns:

rotation matrix

Return type:

ccGLMatrix

Interpolate(self: float, arg0: _cloudComPy.ccGLMatrixTpl_float, arg1: _cloudComPy.ccGLMatrixTpl_float) _cloudComPy.ccGLMatrix

Interpolates two matrices at relative position ‘coef’

Parameters:
  • coef (float) – interpolation position (should be between 0 and 1).

  • glMat1 (ccGLMatrix) – ‘left’ matrix

  • glMat2 (ccGLMatrix) – ‘right’ matrix

Returns:

interpolated matrix

Return type:

ccGLMatrix

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: _cloudComPy.ccGLMatrix) -> None

Default constructor (no parameter) gives identity.

  1. __init__(self: _cloudComPy.ccGLMatrix, arg0: _cloudComPy.ccGLMatrixTpl_float) -> None

Default constructor (no parameter) gives identity.

  1. __init__(self: _cloudComPy.ccGLMatrix, arg0: Vector3Tpl<T>, arg1: Vector3Tpl<T>, arg2: Vector3Tpl<T>, arg3: Vector3Tpl<T>) -> None

Alternate constructor

Parameters:
  • X (tuple) – 3 first elements of the 1st column (last one is 0)

  • Y (tuple) – 3 first elements of the 2nd column (last one is 0)

  • Z (tuple) – 3 first elements of the 3rd column (last one is 0)

  • Tr (tuple) – 3 first elements of the last column (last one is 1)

  1. __init__(self: _cloudComPy.ccGLMatrix, arg0: list[float]) -> None

Alternate constructor

Parameters:

data (list) – 16 elements of the 4x4 matrix, stored in column major order (see data())

clearTranslation(self: _cloudComPy.ccGLMatrixTpl_float) None

Clears translation.

Translation is set to (0,0,0).

data(self: _cloudComPy.ccGLMatrixTpl_float) list[float]

Returns internal data of the ccGLMatrix

Returns:

one dim. data array of 16 float in the order col. 1, col. 2, col. 3, col. 4

Return type:

tuple

static fromDouble(arg0: ccGLMatrixTpl<double>) ccGLMatrix

Converts a ccGLMatrixd (double precision) in a ccGLMatrix (simple precision).

Parameters:

dblmat (ccGLMatrix_double) – double precision ccGLMatrix

Returns:

simple precision ccGLMatrix

Return type:

ccGLMatrix

static fromString(arg0: QString) _cloudComPy.ccGLMatrixTpl_float

Static method returning a ccGLMatrix from the string version of the transformer coefficients.

If the creation does not succeed, returns identity transformation.

Parameters:

matText (string) – string version of the transformer coefficients.

Returns:

ccGLMatrix transformation

Return type:

ccGLMatrix

getColumn(self: _cloudComPy.ccGLMatrixTpl_float, arg0: int) list[float]

Returns a column of the transformation, given its index.

Parameters:

index (int) – column index (between 0 and 3)

Returns:

column

Return type:

tuple

getParameters1(self: _cloudComPy.ccGLMatrixTpl_float) _cloudComPy.ccGLMatrixParams1_float

Returns equivalent parameters: a rotation axis, an angle and a translation.

Returns:

equivalent parameters structure

Return type:

ccGLMatrixParams1_float or ccGLMatrixParams1_double

getParameters2(self: _cloudComPy.ccGLMatrixTpl_float) _cloudComPy.ccGLMatrixParams2_float

Returns equivalent parameters: 3 rotation angles and a translation.

Returns:

equivalent parameters structure

Return type:

ccGLMatrixParams2_float or ccGLMatrixParams2_double

initFromParameters(*args, **kwargs)

Overloaded function.

  1. initFromParameters(self: _cloudComPy.ccGLMatrixTpl_float, arg0: float, arg1: Vector3Tpl<T>, arg2: Vector3Tpl<T>) -> None

Inits transformation from a rotation axis, an angle and a translation.

Parameters:
  • alpha_rad (float) – rotation angle (in radians)

  • axis3D (tuple) – rotation axis

  • t3D (tuple) – translation (x, y, z)

  1. initFromParameters(self: _cloudComPy.ccGLMatrixTpl_float, arg0: float, arg1: float, arg2: float, arg3: Vector3Tpl<T>) -> None

Inits transformation from 3 rotation angles and a translation.

See Euler angles (Tait-Bryan Z1Y2X3)

Parameters:
  • phi_rad (float) – Phi angle (in radians)

  • theta_rad (float) – Theta angle (in radians)

  • psi_rad (float) – Psi angle (in radians)

  • t3D (tuple) – translation (x, y, z)

inverse(self: _cloudComPy.ccGLMatrixTpl_float) _cloudComPy.ccGLMatrix

Returns inverse transformation.

Returns:

inverse transformation matrix

Return type:

ccGLMatrix

invert(self: _cloudComPy.ccGLMatrixTpl_float) None

Inverts transformation (in place).

toQuaternion(self: _cloudComPy.ccGLMatrixTpl_float) list[float]

Generates the quaternion corresponding to the rotation part of the transformation.

A normalized quaternion such as |q| = sqrt(q1*q1 + q2*q2 + q3*q3 + q4*q4) = 1, can also be expressed as: q = {cos(θ/2), ux*sin(θ/2), uy*sin(θ/2), uz*sin(θ/2)} where (ux, uy, uz) represent the components of a unit vector u, and θ is an angle. The quaternion defines a rotation around the vector u, of angle θ.

Returns:

the normalized rotation quaternion

Return type:

list of 4 double

toString(self: _cloudComPy.ccGLMatrixTpl_float) QString

String version of the transformer coefficients

Returns:

String version of the transformer coefficients

Return type:

string

transpose(self: _cloudComPy.ccGLMatrixTpl_float) None

Transposes matrix (in place)

transposed(self: _cloudComPy.ccGLMatrixTpl_float) _cloudComPy.ccGLMatrix

Returns transposed matrix.

Returns:

transposed matrix

Return type:

ccGLMatrix

xRotation(self: _cloudComPy.ccGLMatrixTpl_float) _cloudComPy.ccGLMatrix

Returns the rotation component around X only.

Returns:

rotation matrix

Return type:

ccGLMatrix

yRotation(self: _cloudComPy.ccGLMatrixTpl_float) _cloudComPy.ccGLMatrix

Returns the rotation component around Y only.

Returns:

rotation matrix

Return type:

ccGLMatrix

zRotation(self: _cloudComPy.ccGLMatrixTpl_float) _cloudComPy.ccGLMatrix

Returns the rotation component around Z only.

Returns:

rotation matrix

Return type:

ccGLMatrix

class cloudComPy.ccGLMatrixd

Bases: ccGLMatrixTpl_double

A 4x4 ‘transformation’ matrix (column major order), double precision (double).

Transformation (M) is composed by a rotation (R) and a translation (T): M*X = R*X + T. See OpenGL transformations.

Available operators: += -= *= *

See __init__ methods below for constructors.

static FromQuaternionAndTranslation(quaternion: list[float], depl: Vector3Tpl<T> = (0.0, 0.0, 0.0)) _cloudComPy.ccGLMatrixd

Generates a transformation from a quaternion and an optional translation.

A normalized quaternion such as |q| = sqrt(q1*q1 + q2*q2 + q3*q3 + q4*q4) = 1, can also be expressed as: q = {cos(θ/2), ux*sin(θ/2), uy*sin(θ/2), uz*sin(θ/2)} where (ux, uy, uz) represent the components of a unit vector u, and θ is an angle. The quaternion defines a rotation around the vector u, of angle θ. Here, if q is not normalized, q is divided by its euclidian norm |q|.

Parameters:
  • quaternion (list[float]) – a quaternion formed from 4 floats.

  • depl (CCVector3,optional) – an optional translation.

Returns:

transformation matrix

Return type:

ccGLMatrix

FromToRotation(self: Vector3Tpl<T>, arg0: Vector3Tpl<T>) _cloudComPy.ccGLMatrixd

Creates a transformation matrix that rotates a vector to another.

Adapted from “Efficiently Building a Matrix to Rotate One Vector to Another” By Tomas Möller, John Hughes, Journal of Graphics Tools, 4(4):1-4, 1999

Parameters:
  • from (tuple) – normalized non-zero source vector

  • to (tuple) – normalized non-zero destination vector

Returns:

transformation matrix

Return type:

ccGLMatrix

FromViewDirAndUpDir(self: Vector3Tpl<T>, arg0: Vector3Tpl<T>) _cloudComPy.ccGLMatrixd

Generates a ‘viewing’ matrix from a looking vector and a ‘up’ direction.

warning No translation is applied (pure rotation matrix).

Parameters:
  • forward (tuple) – forward ‘view’ vector

  • up (tuple) – up vector

Returns:

rotation matrix

Return type:

ccGLMatrix

Interpolate(self: float, arg0: _cloudComPy.ccGLMatrixTpl_double, arg1: _cloudComPy.ccGLMatrixTpl_double) _cloudComPy.ccGLMatrixd

Interpolates two matrices at relative position ‘coef’

Parameters:
  • coef (float) – interpolation position (should be between 0 and 1).

  • glMat1 (ccGLMatrix) – ‘left’ matrix

  • glMat2 (ccGLMatrix) – ‘right’ matrix

Returns:

interpolated matrix

Return type:

ccGLMatrix

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: _cloudComPy.ccGLMatrixd) -> None

Default constructor (no parameter) gives identity.

  1. __init__(self: _cloudComPy.ccGLMatrixd, arg0: _cloudComPy.ccGLMatrixTpl_double) -> None

Default constructor (no parameter) gives identity.

  1. __init__(self: _cloudComPy.ccGLMatrixd, arg0: Vector3Tpl<T>, arg1: Vector3Tpl<T>, arg2: Vector3Tpl<T>, arg3: Vector3Tpl<T>) -> None

Alternate constructor

Parameters:
  • X (tuple) – 3 first elements of the 1st column (last one is 0)

  • Y (tuple) – 3 first elements of the 2nd column (last one is 0)

  • Z (tuple) – 3 first elements of the 3rd column (last one is 0)

  • Tr (tuple) – 3 first elements of the last column (last one is 1)

  1. __init__(self: _cloudComPy.ccGLMatrixd, arg0: list[float]) -> None

Alternate constructor

Parameters:

data (list) – 16 elements of the 4x4 matrix, stored in column major order (see data())

clearTranslation(self: _cloudComPy.ccGLMatrixTpl_double) None

Clears translation.

Translation is set to (0,0,0).

data(self: _cloudComPy.ccGLMatrixTpl_double) list[float]

Returns internal data of the ccGLMatrix

Returns:

one dim. data array of 16 float in the order col. 1, col. 2, col. 3, col. 4

Return type:

tuple

static fromString(arg0: QString) _cloudComPy.ccGLMatrixTpl_double

Static method returning a ccGLMatrix from the string version of the transformer coefficients.

If the creation does not succeed, returns identity transformation.

Parameters:

matText (string) – string version of the transformer coefficients.

Returns:

ccGLMatrix transformation

Return type:

ccGLMatrix

getColumn(self: _cloudComPy.ccGLMatrixTpl_double, arg0: int) list[float]

Returns a column of the transformation, given its index.

Parameters:

index (int) – column index (between 0 and 3)

Returns:

column

Return type:

tuple

getParameters1(self: _cloudComPy.ccGLMatrixTpl_double) _cloudComPy.ccGLMatrixParams1_double

Returns equivalent parameters: a rotation axis, an angle and a translation.

Returns:

equivalent parameters structure

Return type:

ccGLMatrixParams1_float or ccGLMatrixParams1_double

getParameters2(self: _cloudComPy.ccGLMatrixTpl_double) _cloudComPy.ccGLMatrixParams2_double

Returns equivalent parameters: 3 rotation angles and a translation.

Returns:

equivalent parameters structure

Return type:

ccGLMatrixParams2_float or ccGLMatrixParams2_double

initFromParameters(*args, **kwargs)

Overloaded function.

  1. initFromParameters(self: _cloudComPy.ccGLMatrixTpl_double, arg0: float, arg1: Vector3Tpl<T>, arg2: Vector3Tpl<T>) -> None

Inits transformation from a rotation axis, an angle and a translation.

Parameters:
  • alpha_rad (float) – rotation angle (in radians)

  • axis3D (tuple) – rotation axis

  • t3D (tuple) – translation (x, y, z)

  1. initFromParameters(self: _cloudComPy.ccGLMatrixTpl_double, arg0: float, arg1: float, arg2: float, arg3: Vector3Tpl<T>) -> None

Inits transformation from 3 rotation angles and a translation.

See Euler angles (Tait-Bryan Z1Y2X3)

Parameters:
  • phi_rad (float) – Phi angle (in radians)

  • theta_rad (float) – Theta angle (in radians)

  • psi_rad (float) – Psi angle (in radians)

  • t3D (tuple) – translation (x, y, z)

inverse(self: _cloudComPy.ccGLMatrixTpl_double) _cloudComPy.ccGLMatrixd

Returns inverse transformation.

Returns:

inverse transformation matrix

Return type:

ccGLMatrix

invert(self: _cloudComPy.ccGLMatrixTpl_double) None

Inverts transformation (in place).

toQuaternion(self: _cloudComPy.ccGLMatrixTpl_double) list[float]

Generates the quaternion corresponding to the rotation part of the transformation.

A normalized quaternion such as |q| = sqrt(q1*q1 + q2*q2 + q3*q3 + q4*q4) = 1, can also be expressed as: q = {cos(θ/2), ux*sin(θ/2), uy*sin(θ/2), uz*sin(θ/2)} where (ux, uy, uz) represent the components of a unit vector u, and θ is an angle. The quaternion defines a rotation around the vector u, of angle θ.

Returns:

the normalized rotation quaternion

Return type:

list of 4 double

toString(self: _cloudComPy.ccGLMatrixTpl_double) QString

String version of the transformer coefficients

Returns:

String version of the transformer coefficients

Return type:

string

transpose(self: _cloudComPy.ccGLMatrixTpl_double) None

Transposes matrix (in place)

transposed(self: _cloudComPy.ccGLMatrixTpl_double) _cloudComPy.ccGLMatrixd

Returns transposed matrix.

Returns:

transposed matrix

Return type:

ccGLMatrix

xRotation(self: _cloudComPy.ccGLMatrixTpl_double) _cloudComPy.ccGLMatrixd

Returns the rotation component around X only.

Returns:

rotation matrix

Return type:

ccGLMatrix

yRotation(self: _cloudComPy.ccGLMatrixTpl_double) _cloudComPy.ccGLMatrixd

Returns the rotation component around Y only.

Returns:

rotation matrix

Return type:

ccGLMatrix

zRotation(self: _cloudComPy.ccGLMatrixTpl_double) _cloudComPy.ccGLMatrixd

Returns the rotation component around Z only.

Returns:

rotation matrix

Return type:

ccGLMatrix

class cloudComPy.ccGLMatrixParams1_float

Bases: pybind11_object

Equivalent parameters of a ccGLMatrix transformation: a rotation axis, an angle and a translation.

Variables:
  • alpha_rad (float) – rotation angle in radians (in [0;pi])

  • axis3D (tuple) – unit rotation axis

  • t3D (tuple) – translation

__init__(*args, **kwargs)
property alpha_rad
property axis3D
property t3D
class cloudComPy.ccGLMatrixParams2_float

Bases: pybind11_object

Equivalent parameters of a ccGLMatrix transformation: 3 rotation angles and a translation.

See Euler angles (Tait-Bryan Z1Y2X3)

Variables:
  • phi_rad (float) – Phi angle (in radians)

  • theta_rad (float) – Theta angle (in radians)

  • psi_rad (float) – Psi angle (in radians)

  • t3D (tuple) – translation

__init__(*args, **kwargs)
property phi_rad
property psi_rad
property t3D
property theta_rad
class cloudComPy.ccGLMatrixParams1_double

Bases: pybind11_object

Equivalent parameters of a ccGLMatrix transformation: a rotation axis, an angle and a translation.

Variables:
  • alpha_rad (float) – rotation angle in radians (in [0;pi])

  • axis3D (tuple) – unit rotation axis

  • t3D (tuple) – translation

__init__(*args, **kwargs)
property alpha_rad
property axis3D
property t3D
class cloudComPy.ccGLMatrixParams2_double

Bases: pybind11_object

Equivalent parameters of a ccGLMatrix transformation: 3 rotation angles and a translation.

See Euler angles (Tait-Bryan Z1Y2X3)

Variables:
  • phi_rad (float) – Phi angle (in radians)

  • theta_rad (float) – Theta angle (in radians)

  • psi_rad (float) – Psi angle (in radians)

  • t3D (tuple) – translation

__init__(*args, **kwargs)
property phi_rad
property psi_rad
property t3D
property theta_rad