coords#
A structured collection of 3D coordinates.
The coords module defines the Coords class, which is the basic
data structure in HelloTriangle to store the coordinates of points in a 3D space.
This module implements a data class for storing large sets of 3D coordinates
and provides an extensive set of methods for transforming these coordinates.
Most of HelloTriangle’s classes which represent geometry (e.g. Mesh,
use a Coords object to store their coordinates.
While the user will mostly use the higher level classes, there might occasionally
be a good reason to use the Coords class directly as well.
Constructor#
A structured collection of points in a 3D cartesian space. |
Property methods#
Return the coordinates of the points as a NumPy ndarray. |
|
Return the X-coordinates of all points. |
|
Returns the Y-coordinates of all points. |
|
Returns the Z-coordinates of all points. |
|
Return the X- and Y-coordinates of all points. |
|
Return the Y- and Z-coordinates of all points. |
|
Return the X- and Z-coordinates of all points. |
Coords information#
Return the points shape of the |
|
Return the total number of points in the |
|
Return the total number of points in the |
|
Return the bounding box of a set of points. |
|
Return a bounding box point of a |
|
Return all the corners of the bounding box of a |
|
Return the bounding boxes of all subsets of points in the |
|
Return the center of the |
|
Returns a (weighted) average of the |
|
Return the centroid of the |
|
Return the bounding box sizes of the |
|
Return the maximum size of a |
|
Return the diagonal size of the bounding box of the |
|
Return the radius of the bounding sphere of the |
|
Returns the central coordinate system of the |
|
Returns the extreme distances from the plane p,n. |
|
Returns extremal planes in the direction n. |
|
Returns the width of a |
Affine transformations#
Return a scaled copy of the |
|
Return a copy of the |
|
Return a translated copy of the |
|
Return a centered copy of the |
|
Align a |
|
Return a copy rotated over angle around axis. |
|
Return a copy rotated over angle around the X-axis. |
|
Return a copy rotated over angle around the Y-axis. |
|
Return a copy rotated over angle around the Z-axis. |
|
Return a copy skewed in the direction of a global axis. |
|
Reflect the coordinates across a mirror plane. |
|
Perform a general affine transformation. |
|
Express the coordinates in another coordinate system. |
|
Transform the coordinates from another CoordSys to global axes. |
|
Perform a coordinate system transformation on the |
|
Position a |
Non-affine transformations#
Convert from cylindrical to cartesian coordinates. |
|
Convert cylindrical coordinates to Cartesian with advanced, angle-dependent scaling. |
|
Converts from cartesian to cylindrical coordinates. |
|
Convert from spherical to cartesian coordinates. |
|
Perform a superspherical transformation. |
|
Converts from cartesian to spherical coordinates. |
|
Perform a spiral transformation. |
|
Transform sectors of a regular polygon into circular sectors. |
|
Create a 1-, 2-, or 3-dimensional bump in a |
|
Create a flare at the end of a |
|
Map a |
|
Add random noise to a |
Coords generation#
Distance#
Returns the distance of all points to the point p. |
|
Returns the distance of all points to the line (p,n). |
|
Return the distance of all points from the plane (p,n). |
Projection#
Inertia#
Axes manipulation#
Copy the coordinates along the axes j to the axes i. |
|
Permute the coordinate axes. |
|
Swap two coordinate axes. |
|
Roll the coordinate axes over the given amount. |
Other#
Set the coordinates from those in the given array. |
|
Return a string with the formatted points of a |
|
Return the |
|
Returns the point closest to a given point p. |
|
Flag points having coordinates between min and max. |
|
Sort points in the specified order of their coordinates. |
|
Create a grid of equally sized boxes spanning the |
|
Find (almost) coinciding points and return a compressed set. |
|
Returns the unique points after fusing. |
|
Find (almost) identical nodes and adjust them to be identical. |
|
Match points in another |
|
Find out which points are also in another Coords object. |