Calculate various bounding box metrics from a list of points, such as min, max, midpoint, radius and size.
Returns a new BBox object with all points from the passed object.
Parameters: | selOnly (bool) – use selected points only instead of all points. |
---|---|
Raises ValueError: | |
if the object has no points. |
Returns a new BBox object with all points from a list added.
Elements of lst must be of type c4d.Vector.
Raises ValueError: | |
---|---|
if the list is empty. |
Returns a new BBox object with all points from the passed polygon.
Add metrics from point p.
Add metrics from a list of points.
Return max bounds vector.
Return min bounds vector.
Return midpoint vector.
Return radius vector.
Return size vector.
Represents a plane defined by positional offset and normal direction.
Sets the normal of the plane to newN.
Sets the positional offset of the plane to newPos.
Given distance d return a string indicating the residence of the point that correlates to the given distance.
Used together with PointResidence():
SideAsString(PointResidence(self, p))
Returns: | either front, back or onplane |
---|
Define the resident direction of a point with respect to the plane.
The point can be either in front of the plane (+1), on the plane (0) or at the back of the plane (-1).
Calculate distance from a point p to the plane.
Parameters: | signed (bool) – set to True if you want the signed distance. |
---|
A signed distance can be useful to determine if the point is located in the half space from the backside of the plane or in the half space on the front.
Calculate intersection point with a line starting at position p and pointing in the direction d.
Parameters: | d (c4d.Vector) – direction of the line. If None, the normal of the plane will be used instead. |
---|---|
Returns: | c4d.Vector representing the intersection point, or None if an intersection isn’t possible (parallel directions). |
Same as c4d.utils.FloatTolerantCompare just a shorter function name.
abs() each component vector of matrix m.
Convert each component of vector v to degrees.
Convert each component of vector v to radians.
Calculate the average of a list of vectors.
Return min component of a vector using abs(x) < abs(y) comparisons.
Return max component of a vector using abs(x) > abs(y) comparisons.
Interpolate linearily between a list of vectors, such that the resulting vector points to the weighted midpoint in the vector space defined by the boundaries max X to min X and max Y to min Y.
Parameters: | t (float) – the weighting coefficient. |
---|---|
Returns: | None if len(lst) is 0 or if the angle between the two max/min vectors is greater than 180 degrees. |
Linear interpolation between 2 vectors.
Same as c4d.utils.VectorMix.
Normalized linear interpolation between 2 vectors.
Spherical linear interpolation between 2 vectors.
Builds a new orthonormal basis from a direction and (optionally) an offset vector using John F. Hughes and Thomas Möller’s method.
If off is None, off will default to a zero vector.
Builds a new orthonormal basis from a direction and (optionally) an offset vector using base aligned cross products.
If off is None, off will default to a zero vector.
Parameters: | base (str) – the base component ‘v’ represents. Must be one of x, y, z, -x, -y, -z |
---|
Builds a new orthonormal basis from 2 direction and (optionally) an offset vector using cross products.
Parameters: | base (str) – the base component ‘v’ represents. |
---|
Multiply a matrix with a vector representing a point.
Same as c4d.Matrix.Mul(v).
Multiply a matrix with a vector representing a direction.
Same as c4d.Matrix.MulV(v)
Determinant of an n x n matrix.
m can be of type c4d.Matrix when n = 3 or list<list> when n = 3 or n = 4 .
Transpose matrix e in row-major format to column-major.
e can be of type list<list> structure or c4d.Matrix.
Convert a list of 3 or 4 c4d.Vector to c4d.Matrix.
Convert a list<list> structure, representing a list of list of coordinate values to a c4d.Matrix.
See MatrixToListList() to find out which list corresponds to which matrix component.
Convert a c4d.Matrix to a list<list> structure.
The structure layout is generally in row-major format, and the ordering the same as the order required for constructing a c4d.Matrix by hand:
[[off.x, off.y, off.z],
[v1.x, v1.y, v1.z],
[v2.x, v2.y, v2.z],
[v3.x, v3.y, v3.z]]
Calculate unit normal of a planar surface.
Raises ValueError: | |
---|---|
if magnitude <= 0.0 |
Returns True if the point p is inside the triangle given by points a, b, and c.
Given a list of vectors check if they all share the same coordinates in at least 2 dimensions.
Returns: | True if all the vectors in the list are co-linear. |
---|
Uses float tolerant component comparison to check if v is a zero vector.
Computes the smallest distance between two 3D lines.
Returns: | tuple of two c4d.Vectors which are the points on each of the two input lines that, when connected, form a segment which represents the shortest distance between the two lines. |
---|
Wraps an angle theta in range -pi..pi by adding the correct multiple of 2 pi.