igl.cycodebase¶
Python API reference for igl.cycodebase.
box_cubic¶
Compute the min/max box corners tightly containing a cubic Bézier curve.
Parameters
C— 4 by dim matrix of control points defining the cubic Bézier curve
Returns
- Tuple (B1, B2) where B1 1 by dim min corner of the bounding box B2 1 by dim max corner of the bounding box
Compute bounding boxes for a collection of indexed cubic Bézier curves.
Parameters
P— #P by dim matrix of control point locationsC— #C by 4 matrix of indices into P defining the cubics
Returns
- Tuple (B1, B2) where B1 #C by dim matrix of min corners of the bounding boxes B2 #C by dim matrix of max corners of the bounding boxes
point_cubic_squared_distance¶
point_cubic_squared_distance(Q: float64[m, n], C: float64[m, n]) -> tuple[float64[m], float64[m], float64[m, n]]
Squared distance from each query point to a cubic Bézier curve.
Parameters
Q— #Q by dim matrix of query pointsC— 4 by dim matrix of control points for the cubic Bézier curve
Returns
- Tuple (sqrD, S, K) where sqrD #Q vector of smallest squared distances S #Q vector of parameters of the closest points on the curve K #Q by dim matrix of closest points on the curve
point_spline_squared_distance¶
point_spline_squared_distance(Q: float64[m, n], P: float64[m, n], C: int64[m, n]) -> tuple[float64[m], int64[m], float64[m], float64[m, n]]
Squared distance from each query point to a spline of cubic Bézier curves.
Parameters
Q— #Q by dim matrix of query pointsP— #P by dim matrix of spline control pointsC— #C by 4 matrix of indices into P defining the cubic Bézier curves
Returns
- Tuple (sqrD, I, S, K) where sqrD #Q vector of smallest squared distances I #Q vector of indices of the closest cubic (row of C) S #Q vector of parameters of the closest points on that cubic K #Q by dim matrix of closest points on the spline
roots¶
Find the real roots of a polynomial within an interval [xmin, xmax].
Parameters
coef— #coef list of monomial coefficients (low to high order); the polynomial degree is len(coef)-1xmin— lower bound of the search intervalxmax— upper bound of the search interval
Returns
- Tuple (n, R) where n number of roots found in [xmin, xmax] R degree-length vector whose first n entries are the roots (ascending); the remaining entries are NaN
spline_eytzinger_aabb¶
spline_eytzinger_aabb(P: float64[m, n], C: int64[m, n]) -> tuple[float64[m, n], float64[m, n], int64[m]]
Compute an Eytzinger-layout AABB tree for a spline of cubic Bézier curves.
Parameters
P— #P by dim matrix of spline control pointsC— #C by 4 matrix of indices into P defining the cubic Bézier curves
Returns
- Tuple (B1, B2, leaf) where B1 #B by dim matrix of AABB min box corners B2 #B by dim matrix of AABB max box corners leaf #B vector of AABB leaf node indices/flags