Geometry Computations#

Ellipse#

colour.geometry

ellipse_coefficients_canonical_form(coefficients)

Compute canonical form ellipse coefficients from the specified general form ellipse coefficients.

ellipse_coefficients_general_form(coefficients)

Compute general form ellipse coefficients from the specified canonical form ellipse coefficients.

ellipse_fitting(a[, method])

Compute the coefficients of the implicit second-order polynomial/quadratic curve that fits the specified point array \(a\).

ELLIPSE_FITTING_METHODS

Supported ellipse fitting methods.

point_at_angle_on_ellipse(phi, coefficients)

Compute the coordinates of the point at angle \(\phi\) in degrees on the ellipse with the specified canonical form coefficients.

Ancillary Objects

colour.geometry

ellipse_fitting_Halir1998(a)

Compute the coefficients of the implicit second-order polynomial/quadratic curve that fits the specified point array \(a\) using the Halir and Flusser (1998) method.

Intersection#

colour.geometry

extend_line_segment(a, b[, distance])

Extend the line segment defined by point arrays \(a\) and \(b\) by the specified distance and generate the new end point.

intersect_line_segments(l_1, l_2)

Compute \(l_1\) line segments intersections with \(l_2\) line segments.

intersect_ray_circle_2d(ray_origin, ...)

Compute the intersection distance of 2D ray(s) with a circle centred at the origin.

Ancillary Objects

colour.geometry

LineSegmentsIntersections_Specification(xy, ...)

Define the specification for intersection of line segments \(l_1\) and \(l_2\) returned by the colour.algebra.intersect_line_segments() definition.

Primitives#

colour

primitive([method])

Generate a geometry primitive.

PRIMITIVE_METHODS

Supported geometry primitive generation methods.

Ancillary Objects

colour.geometry

MAPPING_PLANE_TO_AXIS

Mapping from coordinate planes to their perpendicular axes.

primitive_cube([width, height, depth, ...])

Generate vertices and indexes for a filled and outlined cube primitive.

primitive_grid([width, height, ...])

Generate vertices and indexes for a filled and outlined grid primitive.

Primitive Vertices#

colour

primitive_vertices([method])

Generate vertices of a geometry primitive.

PRIMITIVE_VERTICES_METHODS

Supported methods for generating vertices of geometry primitives.

colour.geometry

primitive_vertices_cube_mpl([width, height, ...])

Generate vertices of a cube primitive made of grid primitives for use with Matplotlib mpl_toolkits.mplot3d.art3d.Poly3DCollection class.

primitive_vertices_grid_mpl([width, height, ...])

Generate vertices for a grid primitive composed of quadrilateral primitives for use with Matplotlib mpl_toolkits.mplot3d.art3d.Poly3DCollection class.

primitive_vertices_quad_mpl([width, height, ...])

Generate vertices of a quad primitive for use with Matplotlib mpl_toolkits.mplot3d.art3d.Poly3DCollection class.

primitive_vertices_sphere([radius, ...])

Generate vertices of a latitude-longitude sphere primitive.

Hull Section#

colour.geometry

hull_section(hull[, axis, origin, normalise])

Compute the hull section for the specified axis at the specified origin.