|
OCCT-Light 0.1
C ABI and C++ veneer for multi-language CAD workflows
|
OCCT-Light: 2D curve (pcurve) API on BRepGraph. More...
#include <stddef.h>#include <stdint.h>#include "occtl_core.h"#include "occtl_curves_common.h"#include "occtl_geom.h"

Go to the source code of this file.
Macros | |
| #define | OCCTL_CURVE2D_CIRCLE_TANGENT_TO_TWO_RADIUS_INFO_VERSION_1 1u |
| #define | OCCTL_CURVE2D_CIRCLE_TANGENT_TO_TWO_RADIUS_INFO_INIT |
| #define | OCCTL_CURVE2D_BLEND_ARC_INFO_VERSION_1 1u |
| #define | OCCTL_CURVE2D_BLEND_ARC_INFO_INIT |
| #define | OCCTL_CURVE2D_LINE_TANGENT_TO_TWO_INFO_VERSION_1 1u |
| #define | OCCTL_CURVE2D_LINE_TANGENT_TO_TWO_INFO_INIT |
| #define | OCCTL_CURVE2D_LINE_TANGENT_THROUGH_POINT_INFO_VERSION_1 1u |
| #define | OCCTL_CURVE2D_LINE_TANGENT_THROUGH_POINT_INFO_INIT |
| #define | OCCTL_CURVE2D_LINE_TANGENT_WITH_ANGLE_INFO_VERSION_1 1u |
| #define | OCCTL_CURVE2D_LINE_TANGENT_WITH_ANGLE_INFO_INIT |
| #define | OCCTL_CURVE2D_CIRCLE_TANGENT_TO_THREE_INFO_VERSION_1 1u |
| #define | OCCTL_CURVE2D_CIRCLE_TANGENT_TO_THREE_INFO_INIT |
| #define | OCCTL_CURVE2D_CIRCLE_TANGENT_FIXED_CENTER_INFO_VERSION_1 1u |
| #define | OCCTL_CURVE2D_CIRCLE_TANGENT_FIXED_CENTER_INFO_INIT |
| #define | OCCTL_CURVE2D_CIRCLE_TANGENT_CENTER_ON_CURVE_INFO_VERSION_1 1u |
| #define | OCCTL_CURVE2D_CIRCLE_TANGENT_CENTER_ON_CURVE_INFO_INIT |
| #define | OCCTL_CURVE2D_CIRCLE_TANGENT_ON_CURVE_RADIUS_INFO_VERSION_1 1u |
| #define | OCCTL_CURVE2D_CIRCLE_TANGENT_ON_CURVE_RADIUS_INFO_INIT |
| #define | OCCTL_CURVE2D_BSPLINE_CREATE_INFO_VERSION_1 1u |
| #define | OCCTL_CURVE2D_BSPLINE_CREATE_INFO_INIT {OCCTL_CURVE2D_BSPLINE_CREATE_INFO_VERSION_1, NULL, NULL, 0, NULL, NULL, NULL, 0, 0, 0} |
| #define | OCCTL_CURVE2D_BEZIER_CREATE_INFO_VERSION_1 1u |
| #define | OCCTL_CURVE2D_BEZIER_CREATE_INFO_INIT {OCCTL_CURVE2D_BEZIER_CREATE_INFO_VERSION_1, NULL, NULL, 0, NULL} |
| #define | OCCTL_CURVE2D_OFFSET_CREATE_INFO_VERSION_1 1u |
| #define | OCCTL_CURVE2D_OFFSET_CREATE_INFO_INIT {OCCTL_CURVE2D_OFFSET_CREATE_INFO_VERSION_1, NULL, {0}, 0.0} |
| #define | OCCTL_CURVE2D_BSPLINE_VERSION_1 1u |
| #define | OCCTL_CURVE2D_BSPLINE_INIT {OCCTL_CURVE2D_BSPLINE_VERSION_1, NULL, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL} |
OCCT-Light: 2D curve (pcurve) API on BRepGraph.
2D curves are stored as graph representations (occtl_rep_id_t with kind OCCTL_REP_KIND_CURVE2D) on nodes of an occtl_graph_t. Every function in this header takes a graph pointer as its first parameter and identifies curves by representation ID.
Kept in its own header so topology consumers that need only pcurves can include this without dragging in the 3D curve API.
| #define OCCTL_CURVE2D_BLEND_ARC_INFO_INIT |
| #define OCCTL_CURVE2D_CIRCLE_TANGENT_CENTER_ON_CURVE_INFO_INIT |
| #define OCCTL_CURVE2D_CIRCLE_TANGENT_FIXED_CENTER_INFO_INIT |
| #define OCCTL_CURVE2D_CIRCLE_TANGENT_ON_CURVE_RADIUS_INFO_INIT |
| #define OCCTL_CURVE2D_CIRCLE_TANGENT_TO_THREE_INFO_INIT |
| #define OCCTL_CURVE2D_CIRCLE_TANGENT_TO_TWO_RADIUS_INFO_INIT |
| #define OCCTL_CURVE2D_LINE_TANGENT_THROUGH_POINT_INFO_INIT |
| #define OCCTL_CURVE2D_LINE_TANGENT_TO_TWO_INFO_INIT |
| #define OCCTL_CURVE2D_LINE_TANGENT_WITH_ANGLE_INFO_INIT |
Versioned create-info struct for 2D Bezier curve construction.
| typedef struct occtl_curve2d_blend_arc_info occtl_curve2d_blend_arc_info_t |
Versioned create-info for fixed-radius 2D blend arcs tangent to two curves.
Versioned create-info struct for 2D B-spline curve construction.
Same semantics as occtl_curve_bspline_create_info_t but uses 2D poles.
| typedef struct occtl_curve2d_bspline occtl_curve2d_bspline_t |
Aggregate inspection view of a 2D B-spline curve.
Read-only snapshot of every field a caller typically needs in the same pass: scalars (degree, periodicity, continuity, counts) plus borrowed pointers into the underlying OCCT storage for poles, weights, distinct knots, multiplicities, and the expanded flat knot sequence. One call replaces ~10 atomized accessors; pair with occtl_curve2d_as_bspline.
Pointers in out borrow from the underlying curve and are valid until the representation is freed from the graph.
The caller declares the layout version they understand in struct_version before the call; the library fills only fields up to that version. The weights pointer is set to NULL when is_rational is 0.
| typedef struct occtl_curve2d_circle_tangent_center_on_curve_info occtl_curve2d_circle_tangent_center_on_curve_info_t |
Versioned create-info for 2D circles tangent to two curves with center on a curve.
| typedef struct occtl_curve2d_circle_tangent_fixed_center_info occtl_curve2d_circle_tangent_fixed_center_info_t |
Versioned create-info for 2D circles tangent to a curve with fixed center.
| typedef struct occtl_curve2d_circle_tangent_on_curve_radius_info occtl_curve2d_circle_tangent_on_curve_radius_info_t |
Versioned create-info for fixed-radius 2D circles tangent to a curve with centers constrained to a second curve.
| typedef struct occtl_curve2d_circle_tangent_to_three_info occtl_curve2d_circle_tangent_to_three_info_t |
Versioned create-info for 2D circles tangent to three curves.
| typedef struct occtl_curve2d_circle_tangent_to_two_radius_info occtl_curve2d_circle_tangent_to_two_radius_info_t |
Versioned create-info for fixed-radius 2D circles tangent to two curves.
| typedef struct occtl_curve2d_line_tangent_through_point_info occtl_curve2d_line_tangent_through_point_info_t |
Versioned create-info for 2D lines tangent to a curve and passing through a point.
Versioned create-info for 2D lines tangent to two curves.
| typedef struct occtl_curve2d_line_tangent_with_angle_info occtl_curve2d_line_tangent_with_angle_info_t |
Versioned create-info for 2D lines tangent to a curve at a fixed angle to a line.
Versioned create-info for a 2D offset curve.
2D offset curves are always perpendicular to the basis curve in the parametric plane; only a scalar offset is needed (no direction).
| occtl_status_t occtl_curve2d_as_bspline | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| occtl_curve2d_bspline_t * | out | ||
| ) |
Fills a caller-allocated occtl_curve2d_bspline_t with a complete read-only inspection view of the underlying 2D B-spline curve.
Pointers in out borrow from the underlying curve and are valid until the representation is freed from the graph.
| [in] | graph | Must be non-NULL. |
| [in] | curve_id | Curve to inspect; kind must be OCCTL_CURVE_KIND_BSPLINE. |
| [in,out] | out | Borrows it. Caller-allocated; must be non-NULL. The caller sets struct_version on entry; the library fills the remaining fields on success and leaves them unchanged on failure. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out is NULL. |
| OCCTL_VERSION_MISMATCH | out->struct_version is not supported. |
| OCCTL_WRONG_KIND | Representation is not a 2D B-spline curve. |
\par Thread Safety Yes (read-only).
| occtl_status_t occtl_curve2d_as_circle | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| occtl_geom2d_circle_t * | out_circle | ||
| ) |
Extracts circle data from a 2D curve representation.
| [in] | graph | Must be non-NULL. |
| [in] | curve_id | Curve to extract; kind must be OCCTL_CURVE_KIND_CIRCLE. |
| [out] | out_circle | Borrows it (caller-allocated slot). Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_circle is NULL. |
| OCCTL_WRONG_KIND | Representation is not a circle. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_curve2d_as_ellipse | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| occtl_geom2d_ellipse_t * | out_ellipse | ||
| ) |
Extracts ellipse data from a 2D curve representation.
| [in] | graph | Must be non-NULL. |
| [in] | curve_id | Curve to extract; kind must be OCCTL_CURVE_KIND_ELLIPSE. |
| [out] | out_ellipse | Borrows it (caller-allocated slot). Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_ellipse is NULL. |
| OCCTL_WRONG_KIND | Representation is not an ellipse. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_curve2d_as_hyperbola | ( | occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| occtl_geom2d_hyperbola_t * | out_hyperbola | ||
| ) |
Extracts hyperbola data from a 2D curve representation.
| [in] | graph | Must be non-NULL. |
| [in] | curve_id | Curve to extract; kind must be OCCTL_CURVE_KIND_HYPERBOLA. |
| [out] | out_hyperbola | Borrows it (caller-allocated slot). Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_hyperbola is NULL. |
| OCCTL_WRONG_KIND | Representation is not a hyperbola. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_curve2d_as_line | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| occtl_geom2d_line_t * | out_line | ||
| ) |
Extracts line data from a 2D curve representation.
| [in] | graph | Must be non-NULL. |
| [in] | curve_id | Curve to extract; kind must be OCCTL_CURVE_KIND_LINE. |
| [out] | out_line | Borrows it (caller-allocated slot). Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_line is NULL. |
| OCCTL_WRONG_KIND | Representation is not a line. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_curve2d_as_offset | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| double * | out_offset | ||
| ) |
Extracts the scalar offset of a 2D offset curve.
| [in] | graph | Must be non-NULL. |
| [in] | curve_id | Curve to extract; kind must be OCCTL_CURVE_KIND_OFFSET. |
| [out] | out_offset | Signed offset distance. May be NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL. |
| OCCTL_WRONG_KIND | Representation is not an offset curve. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_curve2d_as_parabola | ( | occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| occtl_geom2d_parabola_t * | out_parabola | ||
| ) |
Extracts parabola data from a 2D curve representation.
| [in] | graph | Must be non-NULL. |
| [in] | curve_id | Curve to extract; kind must be OCCTL_CURVE_KIND_PARABOLA. |
| [out] | out_parabola | Borrows it (caller-allocated slot). Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_parabola is NULL. |
| OCCTL_WRONG_KIND | Representation is not a parabola. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_curve2d_as_trimmed | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| double * | out_u_first, | ||
| double * | out_u_last | ||
| ) |
Extracts the parameter bounds of a trimmed 2D curve.
| [in] | graph | Must be non-NULL. |
| [in] | curve_id | Curve to extract; kind must be OCCTL_CURVE_KIND_TRIMMED. |
| [out] | out_u_first | First parameter. May be NULL. |
| [out] | out_u_last | Last parameter. May be NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL. |
| OCCTL_WRONG_KIND | Representation is not a trimmed curve. |
\par Thread Safety Yes (read-only on graph).
| void occtl_curve2d_bezier_create_info_init | ( | occtl_curve2d_bezier_create_info_t * | info | ) |
Runtime initialiser for occtl_curve2d_bezier_create_info_t.
| [out] | info | Borrows it. NULL-tolerant; no-op when NULL. |
\par Thread Safety Yes.
| occtl_status_t occtl_curve2d_bezier_degree | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| int32_t * | out_degree | ||
| ) |
Returns the polynomial degree of a 2D Bezier curve.
Equivalent to pole_count - 1 but exposed for symmetry with occtl_curve2d_bspline_degree.
| [in] | graph | Must be non-NULL. |
| [in] | curve_id | Curve to query; kind must be OCCTL_CURVE_KIND_BEZIER. |
| [out] | out_degree | Borrows it. Caller-allocated slot. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_degree is NULL. |
| OCCTL_WRONG_KIND | Not a Bezier curve. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_curve2d_bezier_is_rational | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| int32_t * | out_is_rational | ||
| ) |
Returns non-zero if the 2D Bezier curve is rational (has per-pole weights).
| [in] | graph | Must be non-NULL. |
| [in] | curve_id | Curve to query; kind must be OCCTL_CURVE_KIND_BEZIER. |
| [out] | out_is_rational | Borrows it. Caller-allocated slot. Must be non-NULL. 1 if rational; 0 if non-rational or not a Bezier curve. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_is_rational is NULL. |
| OCCTL_WRONG_KIND | Not a Bezier curve. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_curve2d_bezier_pole_count | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| size_t * | out_count | ||
| ) |
Returns the pole count of a 2D Bezier curve.
| [in] | graph | Must be non-NULL. |
| [in] | curve_id | Curve to query; kind must be OCCTL_CURVE_KIND_BEZIER. |
| [out] | out_count | Borrows it. Caller-allocated slot. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL. |
| OCCTL_WRONG_KIND | Not a Bezier curve. |
\par Thread Safety Yes (read-only on graph).
| void occtl_curve2d_blend_arc_info_init | ( | occtl_curve2d_blend_arc_info_t * | info | ) |
Runtime initialiser for occtl_curve2d_blend_arc_info_t.
| [out] | info | Borrows it. NULL-tolerant; no-op when NULL. |
\par Thread Safety Yes.
| void occtl_curve2d_bspline_create_info_init | ( | occtl_curve2d_bspline_create_info_t * | info | ) |
Runtime initialiser for occtl_curve2d_bspline_create_info_t.
| [out] | info | Borrows it. NULL-tolerant; no-op when NULL. |
\par Thread Safety Yes.
| occtl_status_t occtl_curve2d_bspline_degree | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| int32_t * | out_degree | ||
| ) |
Returns the polynomial degree of a 2D B-spline curve.
| [in] | graph | Must be non-NULL. |
| [in] | curve_id | Curve to query; kind should be OCCTL_CURVE_KIND_BSPLINE. |
| [out] | out_degree | Borrows it. Caller-allocated slot. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_degree is NULL. |
| OCCTL_WRONG_KIND | Not a B-spline. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_curve2d_bspline_flat_knots | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| double * | out_buf, | ||
| size_t | capacity, | ||
| size_t * | out_count | ||
| ) |
Extracts the expanded (flat) knot sequence of a 2D B-spline curve. Two-call pattern.
| [in] | graph | Must be non-NULL. |
| [in] | curve_id | Curve to query. |
| [out] | out_buf | May be NULL on sizing call. |
| [in] | capacity | Elements out_buf can hold. |
| [out] | out_count | Required count. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL. |
| OCCTL_WRONG_KIND | Not a B-spline. |
| OCCTL_BUFFER_TOO_SMALL | Buffer too small. |
\par Thread Safety Yes (read-only on graph).
| void occtl_curve2d_bspline_init | ( | occtl_curve2d_bspline_t * | out | ) |
Runtime initialiser for occtl_curve2d_bspline_t.
| [out] | out | Borrows it. NULL-tolerant; no-op when NULL. |
\par Thread Safety Yes.
| occtl_status_t occtl_curve2d_bspline_is_rational | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| int32_t * | out_is_rational | ||
| ) |
Returns non-zero if the 2D B-spline curve is rational.
| [in] | graph | Must be non-NULL. |
| [in] | curve_id | Curve to query. |
| [out] | out_is_rational | Borrows it. Caller-allocated slot. Must be non-NULL. 1 if rational; 0 otherwise. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_is_rational is NULL. |
| OCCTL_WRONG_KIND | Not a B-spline. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_curve2d_bspline_knot_count | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| size_t * | out_count | ||
| ) |
Returns the knot count of a 2D B-spline curve.
| [in] | graph | Must be non-NULL. |
| [in] | curve_id | Curve to query. |
| [out] | out_count | Borrows it. Caller-allocated slot. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL. |
| OCCTL_WRONG_KIND | Not a B-spline. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_curve2d_bspline_knots | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| double * | out_buf, | ||
| size_t | capacity, | ||
| size_t * | out_count | ||
| ) |
Extracts the distinct knot values of a 2D B-spline curve. Two-call pattern.
| [in] | graph | Must be non-NULL. |
| [in] | curve_id | Curve to query. |
| [out] | out_buf | May be NULL on sizing call. |
| [in] | capacity | Elements out_buf can hold. |
| [out] | out_count | Required count. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL. |
| OCCTL_WRONG_KIND | Not a B-spline. |
| OCCTL_BUFFER_TOO_SMALL | Buffer too small. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_curve2d_bspline_multiplicities | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| int32_t * | out_buf, | ||
| size_t | capacity, | ||
| size_t * | out_count | ||
| ) |
Extracts the knot multiplicities of a 2D B-spline curve. Two-call pattern.
| [in] | graph | Must be non-NULL. |
| [in] | curve_id | Curve to query. |
| [out] | out_buf | May be NULL on sizing call. |
| [in] | capacity | Elements out_buf can hold. |
| [out] | out_count | Required count. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL. |
| OCCTL_WRONG_KIND | Not a B-spline. |
| OCCTL_BUFFER_TOO_SMALL | Buffer too small. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_curve2d_bspline_pole_count | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| size_t * | out_count | ||
| ) |
Returns the pole count of a 2D B-spline curve.
| [in] | graph | Must be non-NULL. |
| [in] | curve_id | Curve to query. |
| [out] | out_count | Borrows it. Caller-allocated slot. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL. |
| OCCTL_WRONG_KIND | Not a B-spline. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_curve2d_bspline_poles | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| occtl_point2_t * | out_buf, | ||
| size_t | capacity, | ||
| size_t * | out_count | ||
| ) |
Extracts the poles of a 2D B-spline curve. Two-call pattern.
| [in] | graph | Must be non-NULL. |
| [in] | curve_id | Curve to query; kind must be OCCTL_CURVE_KIND_BSPLINE. |
| [out] | out_buf | May be NULL on sizing call. |
| [in] | capacity | Elements out_buf can hold. |
| [out] | out_count | Required count. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL. |
| OCCTL_WRONG_KIND | Not a B-spline. |
| OCCTL_BUFFER_TOO_SMALL | Buffer too small. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_curve2d_bspline_poles_view | ( | occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| const occtl_point2_t ** | out_data, | ||
| size_t * | out_count | ||
| ) |
Zero-copy view of the poles array of a 2D B-spline curve.
Returns a direct pointer into the OCCT internal storage. Valid only while the underlying curve is alive and no mutating call has been made on it.
| [in] | graph | Must be non-NULL. |
| [in] | curve_id | Curve to query; kind must be OCCTL_CURVE_KIND_BSPLINE. |
| [out] | out_data | Receives a borrowed pointer to the pole array. Must be non-NULL. |
| [out] | out_count | Receives the pole count. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph, out_data, or out_count is NULL. |
| OCCTL_WRONG_KIND | Representation is not a B-spline. |
\par Thread Safety Yes (read-only).
| occtl_status_t occtl_curve2d_bspline_weights | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| double * | out_buf, | ||
| size_t | capacity, | ||
| size_t * | out_count | ||
| ) |
Extracts the per-pole weights of a rational 2D B-spline curve. Two-call pattern.
| [in] | graph | Must be non-NULL. |
| [in] | curve_id | Curve to query; must be rational. |
| [out] | out_buf | May be NULL on sizing call. |
| [in] | capacity | Elements out_buf can hold. |
| [out] | out_count | Required count. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL. |
| OCCTL_WRONG_KIND | Not a B-spline or not rational. |
| OCCTL_BUFFER_TOO_SMALL | Buffer too small. |
\par Thread Safety Yes (read-only on graph).
| void occtl_curve2d_circle_tangent_center_on_curve_info_init | ( | occtl_curve2d_circle_tangent_center_on_curve_info_t * | info | ) |
Runtime initialiser for occtl_curve2d_circle_tangent_center_on_curve_info_t.
| [out] | info | Borrows it. NULL-tolerant; no-op when NULL. |
\par Thread Safety Yes.
| void occtl_curve2d_circle_tangent_fixed_center_info_init | ( | occtl_curve2d_circle_tangent_fixed_center_info_t * | info | ) |
Runtime initialiser for occtl_curve2d_circle_tangent_fixed_center_info_t.
| [out] | info | Borrows it. NULL-tolerant; no-op when NULL. |
\par Thread Safety Yes.
| void occtl_curve2d_circle_tangent_on_curve_radius_info_init | ( | occtl_curve2d_circle_tangent_on_curve_radius_info_t * | info | ) |
Runtime initialiser for occtl_curve2d_circle_tangent_on_curve_radius_info_t.
| [out] | info | Borrows it. NULL-tolerant; no-op when NULL. |
\par Thread Safety Yes.
| void occtl_curve2d_circle_tangent_to_three_info_init | ( | occtl_curve2d_circle_tangent_to_three_info_t * | info | ) |
Runtime initialiser for occtl_curve2d_circle_tangent_to_three_info_t.
| [out] | info | Borrows it. NULL-tolerant; no-op when NULL. |
\par Thread Safety Yes.
| void occtl_curve2d_circle_tangent_to_two_radius_info_init | ( | occtl_curve2d_circle_tangent_to_two_radius_info_t * | info | ) |
Runtime initialiser for occtl_curve2d_circle_tangent_to_two_radius_info_t.
| [out] | info | Borrows it. NULL-tolerant; no-op when NULL. |
\par Thread Safety Yes.
| occtl_status_t occtl_curve2d_continuity | ( | occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| occtl_geom_continuity_t * | out_continuity | ||
| ) |
Returns the continuity class of the 2D curve.
| [in] | graph | Must be non-NULL. |
| [in] | curve_id | Curve to query. |
| [out] | out_continuity | Borrows it. Caller-allocated slot. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_continuity is NULL. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_curve2d_create_bezier | ( | occtl_graph_t * | graph, |
| const occtl_curve2d_bezier_create_info_t * | info, | ||
| occtl_rep_id_t * | out_id | ||
| ) |
Creates a 2D curve representation from a Bezier definition.
| [in] | graph | Must be non-NULL. |
| [out] | out_id | Borrows it. Caller-allocated slot for the curve rep id. Must be non-NULL. |
| [in] | info | Versioned create-info. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_id or info is NULL. |
| OCCTL_VERSION_MISMATCH | Unsupported struct_version. |
| OCCTL_GEOMETRY_INVALID | OCCT rejected the definition. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_curve2d_create_blend_arc | ( | occtl_graph_t * | graph, |
| const occtl_curve2d_blend_arc_info_t * | info, | ||
| size_t | solution_index, | ||
| occtl_rep_id_t * | out_id, | ||
| size_t * | out_count | ||
| ) |
Computes fixed-radius 2D blend arcs tangent to two input 2D curves.
The results are returned one at a time by zero-based solution index. Pass out_id as NULL to read only the solution count, then request each solution by index. Each returned curve is a trimmed 2D circle spanning the OCCT-computed tangency points.
| [in] | graph | Must be non-NULL. |
| [in] | info | Borrows it. Versioned solver inputs; must be non-NULL. |
| [in] | solution_index | Zero-based solution index to read when out_id is non-NULL. |
| [out] | out_id | Borrows it. Caller-allocated slot for a curve rep id, or NULL for count-only query. |
| [out] | out_count | Borrows it. Receives the total solution count; must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or info or out_count is NULL, required fields are invalid, p_next is non-NULL, or the 0/1 flag is invalid. |
| OCCTL_VERSION_MISMATCH | Unsupported struct_version. |
| OCCTL_GEOMETRY_INVALID | OCCT rejected the tangent construction. |
| OCCTL_NOT_FOUND | out_id is non-NULL and solution_index is outside the available solution range. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety Yes.
| occtl_status_t occtl_curve2d_create_bspline | ( | occtl_graph_t * | graph, |
| const occtl_curve2d_bspline_create_info_t * | info, | ||
| occtl_rep_id_t * | out_id | ||
| ) |
Creates a 2D curve representation from a B-spline definition.
| [in] | graph | Must be non-NULL. |
| [out] | out_id | Borrows it. Caller-allocated slot for the curve rep id. Must be non-NULL. |
| [in] | info | Versioned create-info. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_id or info is NULL. |
| OCCTL_VERSION_MISMATCH | Unsupported struct_version. |
| OCCTL_GEOMETRY_INVALID | OCCT rejected the definition. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_curve2d_create_circle | ( | occtl_graph_t * | graph, |
| occtl_geom2d_circle_t | circle, | ||
| occtl_rep_id_t * | out_id | ||
| ) |
Creates a 2D curve representation from a circle.
| [in] | graph | Must be non-NULL. |
| [in] | circle | 2D circle data. radius must be > 0. |
| [out] | out_id | Borrows it. Caller-allocated slot for the curve rep id. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_id is NULL. |
| OCCTL_GEOMETRY_INVALID | radius is not positive. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_curve2d_create_ellipse | ( | occtl_graph_t * | graph, |
| occtl_geom2d_ellipse_t | ellipse, | ||
| occtl_rep_id_t * | out_id | ||
| ) |
Creates a 2D curve representation from an ellipse.
| [in] | graph | Must be non-NULL. |
| [in] | ellipse | 2D ellipse data. |
| [out] | out_id | Borrows it. Caller-allocated slot for the curve rep id. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_id is NULL. |
| OCCTL_GEOMETRY_INVALID | Radii invalid. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_curve2d_create_hyperbola | ( | occtl_graph_t * | graph, |
| occtl_geom2d_hyperbola_t | hyperbola, | ||
| occtl_rep_id_t * | out_id | ||
| ) |
Creates a 2D curve representation from a hyperbola.
| [in] | graph | Must be non-NULL. |
| [in] | hyperbola | 2D hyperbola data. |
| [out] | out_id | Borrows it. Caller-allocated slot for the curve rep id. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_id is NULL. |
| OCCTL_GEOMETRY_INVALID | Radii invalid. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_curve2d_create_line | ( | occtl_graph_t * | graph, |
| occtl_geom2d_line_t | line, | ||
| occtl_rep_id_t * | out_id | ||
| ) |
Creates a 2D curve representation from a line.
| [in] | graph | Must be non-NULL. |
| [in] | line | 2D line data. |
| [out] | out_id | Borrows it. Caller-allocated slot for the curve rep id. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_id is NULL. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_curve2d_create_offset | ( | occtl_graph_t * | graph, |
| const occtl_curve2d_offset_create_info_t * | info, | ||
| occtl_rep_id_t * | out_id | ||
| ) |
Creates an offset 2D curve representation.
| [in] | graph | Must be non-NULL. |
| [out] | out_id | Borrows it. Caller-allocated slot for the curve rep id. Must be non-NULL. |
| [in] | info | Versioned create-info. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_id or info is NULL. |
| OCCTL_VERSION_MISMATCH | Unsupported struct_version. |
| OCCTL_GEOMETRY_INVALID | OCCT rejected the offset. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_curve2d_create_parabola | ( | occtl_graph_t * | graph, |
| occtl_geom2d_parabola_t | parabola, | ||
| occtl_rep_id_t * | out_id | ||
| ) |
Creates a 2D curve representation from a parabola.
| [in] | graph | Must be non-NULL. |
| [in] | parabola | 2D parabola data. focal_length must be > 0. |
| [out] | out_id | Borrows it. Caller-allocated slot for the curve rep id. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_id is NULL. |
| OCCTL_GEOMETRY_INVALID | focal_length is not positive. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_curve2d_create_tangent_circle_center_on_curve | ( | occtl_graph_t * | graph, |
| const occtl_curve2d_circle_tangent_center_on_curve_info_t * | info, | ||
| size_t | solution_index, | ||
| occtl_geom2d_circle_t * | out_circle, | ||
| size_t * | out_count | ||
| ) |
Computes all 2D circles tangent to two curves with centers constrained to a curve.
The results are returned one at a time by zero-based solution index. Pass out_circle as NULL to read only the solution count, then request each solution by index.
| [in] | graph | Must be non-NULL. |
| [in] | info | Borrows it. Versioned solver inputs; must be non-NULL. |
| [in] | solution_index | Zero-based solution index to read when out_circle is non-NULL. |
| [out] | out_circle | Borrows it. Caller-owned slot, or NULL for count-only query. |
| [out] | out_count | Borrows it. Receives the total solution count; must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or info or out_count is NULL, required fields are invalid, or p_next is non-NULL. |
| OCCTL_VERSION_MISMATCH | Unsupported struct_version. |
| OCCTL_GEOMETRY_INVALID | OCCT rejected the tangent construction. |
| OCCTL_NOT_FOUND | out_circle is non-NULL and solution_index is outside the available solution range. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety Yes.
| occtl_status_t occtl_curve2d_create_tangent_circle_fixed_center | ( | occtl_graph_t * | graph, |
| const occtl_curve2d_circle_tangent_fixed_center_info_t * | info, | ||
| size_t | solution_index, | ||
| occtl_geom2d_circle_t * | out_circle, | ||
| size_t * | out_count | ||
| ) |
Computes all 2D circles tangent to a curve with a fixed center point.
The results are returned one at a time by zero-based solution index. Pass out_circle as NULL to read only the solution count, then request each solution by index.
| [in] | graph | Must be non-NULL. |
| [in] | info | Borrows it. Versioned solver inputs; must be non-NULL. |
| [in] | solution_index | Zero-based solution index to read when out_circle is non-NULL. |
| [out] | out_circle | Borrows it. Caller-owned slot, or NULL for count-only query. |
| [out] | out_count | Borrows it. Receives the total solution count; must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or info or out_count is NULL, required fields are invalid, or p_next is non-NULL. |
| OCCTL_VERSION_MISMATCH | Unsupported struct_version. |
| OCCTL_GEOMETRY_INVALID | OCCT rejected the tangent construction. |
| OCCTL_NOT_FOUND | out_circle is non-NULL and solution_index is outside the available solution range. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety Yes.
| occtl_status_t occtl_curve2d_create_tangent_circle_on_curve_radius | ( | occtl_graph_t * | graph, |
| const occtl_curve2d_circle_tangent_on_curve_radius_info_t * | info, | ||
| size_t | solution_index, | ||
| occtl_geom2d_circle_t * | out_circle, | ||
| size_t * | out_count | ||
| ) |
Computes fixed-radius 2D circles tangent to one curve with centers constrained to another curve.
The results are returned one at a time by zero-based solution index. Pass out_circle as NULL to read only the solution count, then request each solution by index.
| [in] | graph | Must be non-NULL. |
| [in] | info | Borrows it. Versioned solver inputs; must be non-NULL. |
| [in] | solution_index | Zero-based solution index to read when out_circle is non-NULL. |
| [out] | out_circle | Borrows it. Caller-owned slot, or NULL for count-only query. |
| [out] | out_count | Borrows it. Receives the total solution count; must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or info or out_count is NULL, required fields are invalid, or p_next is non-NULL, or radius/tolerance is invalid. |
| OCCTL_VERSION_MISMATCH | Unsupported struct_version. |
| OCCTL_GEOMETRY_INVALID | OCCT rejected the tangent construction. |
| OCCTL_NOT_FOUND | out_circle is non-NULL and solution_index is outside the available solution range. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety Yes.
| occtl_status_t occtl_curve2d_create_tangent_circle_to_three | ( | occtl_graph_t * | graph, |
| const occtl_curve2d_circle_tangent_to_three_info_t * | info, | ||
| size_t | solution_index, | ||
| occtl_geom2d_circle_t * | out_circle, | ||
| size_t * | out_count | ||
| ) |
Computes all 2D circles tangent to three input 2D curves.
The results are returned one at a time by zero-based solution index. Pass out_circle as NULL to read only the solution count, then request each solution by index.
| [in] | graph | Must be non-NULL. |
| [in] | info | Borrows it. Versioned solver inputs; must be non-NULL. |
| [in] | solution_index | Zero-based solution index to read when out_circle is non-NULL. |
| [out] | out_circle | Borrows it. Caller-owned slot, or NULL for count-only query. |
| [out] | out_count | Borrows it. Receives the total solution count; must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or info or out_count is NULL, required fields are invalid, or p_next is non-NULL. |
| OCCTL_VERSION_MISMATCH | Unsupported struct_version. |
| OCCTL_GEOMETRY_INVALID | OCCT rejected the tangent construction. |
| OCCTL_NOT_FOUND | out_circle is non-NULL and solution_index is outside the available solution range. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety Yes.
| occtl_status_t occtl_curve2d_create_tangent_circle_to_two_radius | ( | occtl_graph_t * | graph, |
| const occtl_curve2d_circle_tangent_to_two_radius_info_t * | info, | ||
| size_t | solution_index, | ||
| occtl_geom2d_circle_t * | out_circle, | ||
| size_t * | out_count | ||
| ) |
Computes all fixed-radius 2D circles tangent to two input 2D curves.
The results are returned one at a time by zero-based solution index. Pass out_circle as NULL to read only the solution count, then request each solution by index.
| [in] | graph | Must be non-NULL. |
| [in] | info | Borrows it. Versioned solver inputs; must be non-NULL. |
| [in] | solution_index | Zero-based solution index to read when out_circle is non-NULL. |
| [out] | out_circle | Borrows it. Caller-owned slot, or NULL for count-only query. |
| [out] | out_count | Borrows it. Receives the total solution count; must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or info or out_count is NULL, required fields are invalid, or p_next is non-NULL. |
| OCCTL_VERSION_MISMATCH | Unsupported struct_version. |
| OCCTL_GEOMETRY_INVALID | OCCT rejected the tangent construction. |
| OCCTL_NOT_FOUND | out_circle is non-NULL and solution_index is outside the available solution range. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety Yes.
| occtl_status_t occtl_curve2d_create_tangent_line_through_point | ( | occtl_graph_t * | graph, |
| const occtl_curve2d_line_tangent_through_point_info_t * | info, | ||
| size_t | solution_index, | ||
| occtl_geom2d_line_t * | out_line, | ||
| size_t * | out_count | ||
| ) |
Computes all 2D lines tangent to a curve and passing through a point.
The results are returned one at a time by zero-based solution index. Pass out_line as NULL to read only the solution count, then request each solution by index.
| [in] | graph | Must be non-NULL. |
| [in] | info | Borrows it. Versioned solver inputs; must be non-NULL. |
| [in] | solution_index | Zero-based solution index to read when out_line is non-NULL. |
| [out] | out_line | Borrows it. Caller-owned slot, or NULL for count-only query. |
| [out] | out_count | Borrows it. Receives the total solution count; must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or info or out_count is NULL, required fields are invalid, or p_next is non-NULL. |
| OCCTL_VERSION_MISMATCH | Unsupported struct_version. |
| OCCTL_GEOMETRY_INVALID | OCCT rejected the tangent construction. |
| OCCTL_NOT_FOUND | out_line is non-NULL and solution_index is outside the available solution range. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety Yes.
| occtl_status_t occtl_curve2d_create_tangent_line_to_two | ( | occtl_graph_t * | graph, |
| const occtl_curve2d_line_tangent_to_two_info_t * | info, | ||
| size_t | solution_index, | ||
| occtl_geom2d_line_t * | out_line, | ||
| size_t * | out_count | ||
| ) |
Computes all 2D lines tangent to two input 2D curves.
The results are returned one at a time by zero-based solution index. Pass out_line as NULL to read only the solution count, then request each solution by index.
| [in] | graph | Must be non-NULL. |
| [in] | info | Borrows it. Versioned solver inputs; must be non-NULL. |
| [in] | solution_index | Zero-based solution index to read when out_line is non-NULL. |
| [out] | out_line | Borrows it. Caller-owned slot, or NULL for count-only query. |
| [out] | out_count | Borrows it. Receives the total solution count; must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or info or out_count is NULL, required fields are invalid, or p_next is non-NULL. |
| OCCTL_VERSION_MISMATCH | Unsupported struct_version. |
| OCCTL_GEOMETRY_INVALID | OCCT rejected the tangent construction. |
| OCCTL_NOT_FOUND | out_line is non-NULL and solution_index is outside the available solution range. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety Yes.
| occtl_status_t occtl_curve2d_create_tangent_line_with_angle | ( | occtl_graph_t * | graph, |
| const occtl_curve2d_line_tangent_with_angle_info_t * | info, | ||
| size_t | solution_index, | ||
| occtl_geom2d_line_t * | out_line, | ||
| size_t * | out_count | ||
| ) |
Computes all 2D lines tangent to a curve at a fixed angle to a reference line.
The results are returned one at a time by zero-based solution index. Pass out_line as NULL to read only the solution count, then request each solution by index.
| [in] | graph | Must be non-NULL. |
| [in] | info | Borrows it. Versioned solver inputs; must be non-NULL. |
| [in] | solution_index | Zero-based solution index to read when out_line is non-NULL. |
| [out] | out_line | Borrows it. Caller-owned slot, or NULL for count-only query. |
| [out] | out_count | Borrows it. Receives the total solution count; must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or info or out_count is NULL, required fields are invalid, p_next is non-NULL, or the 0/1 flag is invalid. |
| OCCTL_VERSION_MISMATCH | Unsupported struct_version. |
| OCCTL_GEOMETRY_INVALID | OCCT rejected the tangent construction. |
| OCCTL_NOT_FOUND | out_line is non-NULL and solution_index is outside the available solution range. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety Yes.
| occtl_status_t occtl_curve2d_create_trimmed | ( | occtl_graph_t * | graph, |
| const occtl_curve_trimmed_create_info_t * | info, | ||
| occtl_rep_id_t * | out_id | ||
| ) |
Creates a trimmed 2D curve representation.
| [in] | graph | Must be non-NULL. |
| [out] | out_id | Borrows it. Caller-allocated slot for the curve rep id. Must be non-NULL. |
| [in] | info | Versioned create-info. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_id or info is NULL. |
| OCCTL_VERSION_MISMATCH | Unsupported struct_version. |
| OCCTL_GEOMETRY_INVALID | Invalid interval. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_curve2d_eval_d0 | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| double | u, | ||
| occtl_point2_t * | out_point | ||
| ) |
Evaluates the 2D curve at parameter u.
| [in] | graph | Must be non-NULL. |
| [in] | curve_id | Curve to evaluate. |
| [in] | u | Parameter value. |
| [out] | out_point | Receives the point on the curve. May be NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL. |
| OCCTL_OUT_OF_RANGE | Parameter is outside the domain. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_curve2d_eval_d1 | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| double | u, | ||
| occtl_point2_t * | out_point, | ||
| occtl_vector2_t * | out_d1 | ||
| ) |
Evaluates the 2D curve and its first derivative at u.
| [in] | graph | Must be non-NULL. |
| [in] | curve_id | Curve to evaluate. |
| [in] | u | Parameter value. |
| [out] | out_point | Receives the point. May be NULL. |
| [out] | out_d1 | Receives the first derivative vector. May be NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL. |
| OCCTL_OUT_OF_RANGE | Parameter is outside the domain. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_curve2d_eval_d2 | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| double | u, | ||
| occtl_point2_t * | out_point, | ||
| occtl_vector2_t * | out_d1, | ||
| occtl_vector2_t * | out_d2 | ||
| ) |
Evaluates point, first, and second derivatives at u.
| [in] | graph | Must be non-NULL. |
| [in] | curve_id | Curve to evaluate. |
| [in] | u | Parameter value. |
| [out] | out_point | Receives the point. May be NULL. |
| [out] | out_d1 | Receives the first derivative vector. May be NULL. |
| [out] | out_d2 | Receives the second derivative vector. May be NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL. |
| OCCTL_OUT_OF_RANGE | Parameter is outside the domain. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_curve2d_eval_d3 | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| double | u, | ||
| occtl_point2_t * | out_point, | ||
| occtl_vector2_t * | out_d1, | ||
| occtl_vector2_t * | out_d2, | ||
| occtl_vector2_t * | out_d3 | ||
| ) |
Evaluates point and first three derivatives at u.
| [in] | graph | Must be non-NULL. |
| [in] | curve_id | Curve to evaluate. |
| [in] | u | Parameter value. |
| [out] | out_point | Receives the point. May be NULL. |
| [out] | out_d1 | Receives the first derivative vector. May be NULL. |
| [out] | out_d2 | Receives the second derivative vector. May be NULL. |
| [out] | out_d3 | Receives the third derivative vector. May be NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL. |
| OCCTL_OUT_OF_RANGE | Parameter is outside the domain. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_curve2d_eval_dn | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| double | u, | ||
| int32_t | n, | ||
| occtl_vector2_t * | out_derivative | ||
| ) |
Returns the N-th derivative vector of the 2D curve at u.
| [in] | graph | Must be non-NULL. |
| [in] | curve_id | Curve to evaluate. |
| [in] | u | Parameter value. |
| [in] | n | Derivative order (0 returns a zero-length vector whose origin is on the curve; 1 returns the first derivative, etc.). |
| [out] | out_derivative | Receives the derivative vector. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL. |
| OCCTL_OUT_OF_RANGE | Parameter is outside the domain. |
\par Thread Safety Yes (read-only on graph).
| void occtl_curve2d_free_bezier_segments | ( | occtl_rep_id_t * | ids | ) |
Frees the array returned by occtl_curve2d_to_bezier_segments.
NULL-tolerant; passing NULL is a no-op.
| [in] | ids | Owns it. May be NULL. |
\par Thread Safety Yes.
| occtl_status_t occtl_curve2d_is_closed | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| int32_t * | out_is_closed | ||
| ) |
Returns non-zero if the 2D curve is closed.
A 2D curve is closed when its start and end points coincide within OCCT's confusion tolerance. Periodic curves are always closed; the converse does not hold.
| [in] | graph | Must be non-NULL. |
| [in] | curve_id | Curve to query. |
| [out] | out_is_closed | Borrows it. Caller-allocated slot. Must be non-NULL. 1 if closed, 0 otherwise. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_is_closed is NULL. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_curve2d_is_periodic | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| int32_t * | out_is_periodic | ||
| ) |
Returns non-zero if the 2D curve is periodic.
| [in] | graph | Must be non-NULL. |
| [in] | curve_id | Curve to query. |
| [out] | out_is_periodic | Borrows it. Caller-allocated slot. Must be non-NULL. 1 if periodic, 0 otherwise. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_is_periodic is NULL. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_curve2d_kind | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| occtl_curve_kind_t * | out_kind | ||
| ) |
Returns the kind of geometry of a 2D curve representation.
| [in] | graph | Must be non-NULL. |
| [in] | curve_id | Curve to query. |
| [out] | out_kind | Borrows it. Caller-allocated slot. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_kind is NULL. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_curve2d_length | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| double * | out_length | ||
| ) |
Computes the length of the 2D curve over its full parameter range.
| [in] | graph | Must be non-NULL. |
| [in] | curve_id | Curve to measure. |
| [out] | out_length | Receives the curve length. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_length is NULL. |
\par Thread Safety Yes (read-only on graph).
| void occtl_curve2d_line_tangent_through_point_info_init | ( | occtl_curve2d_line_tangent_through_point_info_t * | info | ) |
Runtime initialiser for occtl_curve2d_line_tangent_through_point_info_t.
| [out] | info | Borrows it. NULL-tolerant; no-op when NULL. |
\par Thread Safety Yes.
| void occtl_curve2d_line_tangent_to_two_info_init | ( | occtl_curve2d_line_tangent_to_two_info_t * | info | ) |
Runtime initialiser for occtl_curve2d_line_tangent_to_two_info_t.
| [out] | info | Borrows it. NULL-tolerant; no-op when NULL. |
\par Thread Safety Yes.
| void occtl_curve2d_line_tangent_with_angle_info_init | ( | occtl_curve2d_line_tangent_with_angle_info_t * | info | ) |
Runtime initialiser for occtl_curve2d_line_tangent_with_angle_info_t.
| [out] | info | Borrows it. NULL-tolerant; no-op when NULL. |
\par Thread Safety Yes.
| void occtl_curve2d_offset_create_info_init | ( | occtl_curve2d_offset_create_info_t * | info | ) |
Runtime initialiser for occtl_curve2d_offset_create_info_t.
| [out] | info | Borrows it. NULL-tolerant; no-op when NULL. |
\par Thread Safety Yes.
| occtl_status_t occtl_curve2d_parameter_of_point | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| occtl_point2_t | point, | ||
| double * | out_param | ||
| ) |
Returns the parameter on the 2D curve nearest to a given point.
Convenience function equivalent to occtl_curve2d_project_point with out_distance = NULL.
| [in] | graph | Must be non-NULL. |
| [in] | curve_id | Curve to query. |
| [in] | point | Point to find the parameter for. |
| [out] | out_param | Receives the parameter. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_param is NULL. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_curve2d_parameter_range | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| double * | out_u_min, | ||
| double * | out_u_max | ||
| ) |
Returns the parameter range of a 2D curve.
For analytic infinite curves (lines, parabolas, hyperbolas) OCCT returns -Precision::Infinite() and +Precision::Infinite() (numerically -1e100 and +1e100). Bounded analytic curves (circles, ellipses) return [0, 2π].
| [in] | graph | Must be non-NULL. |
| [in] | curve_id | Curve to query. |
| [out] | out_u_min | Start parameter. May be NULL. |
| [out] | out_u_max | End parameter. May be NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_curve2d_project_point | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| occtl_point2_t | point, | ||
| double * | out_param, | ||
| double * | out_distance | ||
| ) |
Projects a 2D point onto the curve and returns the closest parameter.
| [in] | graph | Must be non-NULL. |
| [in] | curve_id | Curve to project onto. |
| [in] | point | Point to project. |
| [out] | out_param | Receives the parameter of the closest point. Must be non-NULL. |
| [out] | out_distance | Receives the shortest distance. May be NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_param is NULL. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_curve2d_reverse | ( | occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| occtl_rep_id_t * | out_id | ||
| ) |
Creates a new 2D curve representation that is the reversed copy of curve_id.
The returned rep owns an independent curve whose parameterisation runs in the opposite direction.
| [in] | graph | Must be non-NULL. |
| [in] | curve_id | Curve to reverse. |
| [out] | out_id | Borrows it. Caller-allocated slot for the reversed curve rep id. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_id is NULL. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_curve2d_rotated | ( | occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| double | angle, | ||
| occtl_rep_id_t * | out_id | ||
| ) |
Creates a new 2D curve representation by rotating curve_id about the origin.
| [in] | graph | Must be non-NULL. |
| [in] | curve_id | Curve to rotate. |
| [in] | angle | Rotation angle in radians. |
| [out] | out_id | Borrows it. Caller-allocated slot for the rotated curve rep id. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_id is NULL. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_curve2d_scaled | ( | occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| occtl_point2_t | origin, | ||
| double | factor, | ||
| occtl_rep_id_t * | out_id | ||
| ) |
Creates a new 2D curve representation by scaling curve_id about origin.
| [in] | graph | Must be non-NULL. |
| [in] | curve_id | Curve to scale. |
| [in] | origin | Origin point for scaling. |
| [in] | factor | Scale factor; must be non-zero. |
| [out] | out_id | Borrows it. Caller-allocated slot for the scaled curve rep id. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_id is NULL. |
| OCCTL_GEOMETRY_INVALID | factor is zero. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_curve2d_to_bezier_segments | ( | occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| const occtl_curve_bezier_segments_options_t * | options, | ||
| occtl_rep_id_t ** | out_segments, | ||
| size_t * | out_count | ||
| ) |
Decomposes a 2D curve into adjacent Bezier curve segments.
The implementation delegates conversion and segmentation to OCCT Geom2dConvert and Geom2dConvert_BSplineCurveToBezierCurve. Each output entry is a new bezier curve rep id. Free the returned array with occtl_curve2d_free_bezier_segments.
| [in] | graph | Must be non-NULL. |
| [in] | curve_id | Curve to decompose. |
| [in] | options | Borrows it. May be NULL for default full-domain options. |
| [out] | out_segments | Owns it. Receives a caller-owned array of Bezier curve rep ids. Must be non-NULL. Free with occtl_curve2d_free_bezier_segments. |
| [out] | out_count | Borrows it. Receives the number of returned segments. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph, out_segments, or out_count is NULL; p_next is non-NULL; a 0/1 flag is invalid; range/tolerance values are invalid. |
| OCCTL_VERSION_MISMATCH | Unsupported options->struct_version. |
| OCCTL_GEOMETRY_INVALID | OCCT could not convert or segment the curve. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety Yes.
| occtl_status_t occtl_curve2d_transformed | ( | occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| double | translate_x, | ||
| double | translate_y, | ||
| double | rotate_angle, | ||
| double | scale_x, | ||
| double | scale_y, | ||
| occtl_rep_id_t * | out_id | ||
| ) |
Creates a new 2D curve representation by applying a 2D transform to curve_id.
The transform is applied in the 2D parametric plane via gp_Trsf2d.
| [in] | graph | Must be non-NULL. |
| [in] | curve_id | Curve to transform. |
| [in] | translate_x | Translation along X. |
| [in] | translate_y | Translation along Y. |
| [in] | rotate_angle | Rotation angle in radians. |
| [in] | scale_x | Scale factor along X. |
| [in] | scale_y | Scale factor along Y. |
| [out] | out_id | Borrows it. Caller-allocated slot for the transformed curve rep id. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_id is NULL. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_curve2d_translated | ( | occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| occtl_vector2_t | delta, | ||
| occtl_rep_id_t * | out_id | ||
| ) |
Creates a new 2D curve representation by translating curve_id.
| [in] | graph | Must be non-NULL. |
| [in] | curve_id | Curve to translate. |
| [in] | delta | Translation vector in 2D. |
| [out] | out_id | Borrows it. Caller-allocated slot for the translated curve rep id. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_id is NULL. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph).