|
OCCT-Light 0.1
C ABI and C++ veneer for multi-language CAD workflows
|
OCCT-Light: 3D curve representation in the topology graph. 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.
Classes | |
| struct | occtl_curve_bspline_create_info |
| struct | occtl_curve_bezier_create_info |
| struct | occtl_curve_offset_create_info |
| struct | occtl_curve_bspline |
| struct | occtl_curve_airfoil_naca4_info |
| struct | occtl_curve_interpolated_info |
| struct | occtl_curve_approximated_info |
| struct | occtl_curve_intersection_point |
Typedefs | |
| typedef struct occtl_curve_bspline_create_info | occtl_curve_bspline_create_info_t |
| typedef struct occtl_curve_bezier_create_info | occtl_curve_bezier_create_info_t |
| typedef struct occtl_curve_offset_create_info | occtl_curve_offset_create_info_t |
| typedef struct occtl_curve_bspline | occtl_curve_bspline_t |
| typedef struct occtl_curve_airfoil_naca4_info | occtl_curve_airfoil_naca4_info_t |
| typedef struct occtl_curve_interpolated_info | occtl_curve_interpolated_info_t |
| typedef struct occtl_curve_approximated_info | occtl_curve_approximated_info_t |
| typedef struct occtl_curve_intersection_point | occtl_curve_intersection_point_t |
OCCT-Light: 3D curve representation in the topology graph.
A curve is stored as an occtl_rep_id_t inside an occtl_graph_t. Every curve function takes a graph pointer and a rep id. The kind is available via occtl_curve_kind for O(1) introspection.
This file covers construction, introspection, data extraction, and parametric evaluation of 3D curve representations.
| typedef struct occtl_curve_airfoil_naca4_info occtl_curve_airfoil_naca4_info_t |
Versioned create-info for a NACA 4-digit airfoil profile curve.
The generated profile lies in the XY plane with the leading edge at (0,0,0) and the chord along +X. Use curve transforms to place or scale it after construction.
| typedef struct occtl_curve_approximated_info occtl_curve_approximated_info_t |
Versioned create-info struct for curve approximation (fitting).
Fits a B-spline curve to the given points within the specified tolerance using OCCT's GeomAPI_PointsToBSpline. The resulting curve does not necessarily pass through the points; it approximates them.
| typedef struct occtl_curve_bezier_create_info occtl_curve_bezier_create_info_t |
Versioned create-info struct for Bezier curve construction.
| typedef struct occtl_curve_bspline_create_info occtl_curve_bspline_create_info_t |
Versioned create-info struct for B-spline curve construction.
Knots are in compact form (distinct values + multiplicities), which is OCCT's canonical representation. Arrays are borrowed for the duration of the occtl_curve_create_bspline call; they are not retained afterwards.
For a non-rational B-spline set weights to NULL. For a rational B-spline (NURBS) provide weights with pole_count entries; all values must be > 0.
| typedef struct occtl_curve_bspline occtl_curve_bspline_t |
Aggregate inspection view of a 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_curve_as_bspline.
Pointers in out borrow from the graph rep and are valid until the rep is removed 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_curve_interpolated_info occtl_curve_interpolated_info_t |
Versioned create-info struct for curve interpolation.
Interpolates a B-spline curve passing through the given points. Uses OCCT's GeomAPI_Interpolate internally, which computes uniform parameters and creates a C2 continuous cubic B-spline.
| typedef struct occtl_curve_intersection_point occtl_curve_intersection_point_t |
Describes a single intersection point between two curves.
| typedef struct occtl_curve_offset_create_info occtl_curve_offset_create_info_t |
Versioned create-info struct for an offset curve.
The constructor makes an internal deep copy of the basis curve.
| void occtl_curve_airfoil_naca4_info_init | ( | occtl_curve_airfoil_naca4_info_t * | info | ) |
Runtime initialiser for occtl_curve_airfoil_naca4_info_t.
| [out] | info | Borrows it. NULL-tolerant; no-op when NULL. |
\par Thread Safety Yes.
| void occtl_curve_approximated_info_init | ( | occtl_curve_approximated_info_t * | info | ) |
Runtime initialiser for occtl_curve_approximated_info_t.
| [out] | info | Borrows it. NULL-tolerant; no-op when NULL. |
\par Thread Safety Yes.
| occtl_status_t occtl_curve_as_bspline | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| occtl_curve_bspline_t * | out | ||
| ) |
Fills a caller-allocated occtl_curve_bspline_t with a complete read-only inspection view of the underlying B-spline curve.
Pointers in out borrow from the graph rep and are valid until the rep is removed from the graph.
| [in] | graph | Owning 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 | Curve is not a B-spline curve. |
\par Thread Safety Yes (read-only).
| occtl_status_t occtl_curve_as_circle | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| occtl_geom_circle_t * | out_circle | ||
| ) |
Extracts circle data from a curve representation.
| [in] | graph | Owning 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 | Curve is not a circle. |
\par Thread Safety Yes.
| occtl_status_t occtl_curve_as_ellipse | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| occtl_geom_ellipse_t * | out_ellipse | ||
| ) |
Extracts ellipse data from a curve representation.
| [in] | graph | Owning 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 | Curve is not an ellipse. |
\par Thread Safety Yes.
| occtl_status_t occtl_curve_as_hyperbola | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| occtl_geom_hyperbola_t * | out_hyperbola | ||
| ) |
Extracts hyperbola data from a curve representation.
| [in] | graph | Owning 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 | Curve is not a hyperbola. |
\par Thread Safety Yes.
| occtl_status_t occtl_curve_as_line | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| occtl_geom_line_t * | out_line | ||
| ) |
Extracts line data from a curve representation.
| [in] | graph | Owning 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 | Curve is not a line. |
\par Thread Safety Yes.
| occtl_status_t occtl_curve_as_offset | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| double * | out_offset, | ||
| occtl_vector3_t * | out_offset_dir | ||
| ) |
Extracts the scalar offset and reference direction of an offset curve.
| [in] | graph | Owning 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. |
| [out] | out_offset_dir | Reference direction (unit length). May be NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL. |
| OCCTL_WRONG_KIND | Curve is not an offset curve. |
\par Thread Safety Yes.
| occtl_status_t occtl_curve_as_parabola | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| occtl_geom_parabola_t * | out_parabola | ||
| ) |
Extracts parabola data from a curve representation.
| [in] | graph | Owning 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 | Curve is not a parabola. |
\par Thread Safety Yes.
| occtl_status_t occtl_curve_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 curve.
The reported u_first / u_last are the parameter bounds the trimmed curve was constructed with (already adjusted for any sense flip at construction time), so reconstructing via occtl_curve_create_trimmed with sense=1 reproduces an equivalent curve.
| [in] | graph | Owning 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 | Curve is not a trimmed curve. |
\par Thread Safety Yes.
| void occtl_curve_bezier_create_info_init | ( | occtl_curve_bezier_create_info_t * | info | ) |
Runtime initialiser for occtl_curve_bezier_create_info_t.
| [out] | info | Borrows it. NULL-tolerant; no-op when NULL. |
\par Thread Safety Yes.
| occtl_status_t occtl_curve_bezier_degree | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| int32_t * | out_degree | ||
| ) |
Returns the polynomial degree of a Bezier curve.
Equivalent to pole_count - 1 but exposed for symmetry with occtl_curve_bspline_degree.
| [in] | graph | Owning graph. Must be non-NULL. |
| [in] | curve_id | Curve to query; kind must be OCCTL_CURVE_KIND_BEZIER. |
| [out] | out_degree | Receives the degree. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_degree is NULL. |
| OCCTL_WRONG_KIND | Curve is not a Bezier curve. |
\par Thread Safety Yes.
| occtl_status_t occtl_curve_bezier_is_rational | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| int32_t * | out_is_rational | ||
| ) |
Returns non-zero if the Bezier curve is rational (has per-pole weights).
| [in] | graph | Owning graph. Must be non-NULL. |
| [in] | curve_id | Curve to query; kind must be OCCTL_CURVE_KIND_BEZIER. |
| [out] | out_is_rational | Receives 1 if rational, 0 otherwise. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_is_rational is NULL. |
| OCCTL_WRONG_KIND | Curve is not a Bezier curve. |
\par Thread Safety Yes.
| occtl_status_t occtl_curve_bezier_pole_count | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| size_t * | out_count | ||
| ) |
Returns the pole count of a Bezier curve.
| [in] | graph | Owning graph. Must be non-NULL. |
| [in] | curve_id | Curve to query; kind must be OCCTL_CURVE_KIND_BEZIER. |
| [out] | out_count | Receives the pole count. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL. |
| OCCTL_WRONG_KIND | Curve is not a Bezier curve. |
\par Thread Safety Yes.
| void occtl_curve_bspline_create_info_init | ( | occtl_curve_bspline_create_info_t * | info | ) |
Runtime initialiser for occtl_curve_bspline_create_info_t.
Sets struct_version and zeroes all other fields. Use instead of the _INIT macro when C macros are not available (e.g. C# P/Invoke).
| [out] | info | Borrows it. NULL-tolerant; no-op when NULL. |
\par Thread Safety Yes.
| occtl_status_t occtl_curve_bspline_degree | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| int32_t * | out_degree | ||
| ) |
Returns the polynomial degree of a B-spline curve.
| [in] | graph | Owning graph. Must be non-NULL. |
| [in] | curve_id | Curve to query; kind must be OCCTL_CURVE_KIND_BSPLINE. |
| [out] | out_degree | Receives the degree. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_degree is NULL. |
| OCCTL_WRONG_KIND | Curve is not a B-spline. |
\par Thread Safety Yes.
| occtl_status_t occtl_curve_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 B-spline curve.
The flat knot sequence repeats each distinct knot value by its multiplicity, which is the form most numerical libraries (NumPy, etc.) expect. The total count equals the sum of multiplicities.
Two-call pattern: same as occtl_curve_bspline_poles.
| [in] | graph | Owning graph. Must be non-NULL. |
| [in] | curve_id | Curve to extract; kind must be OCCTL_CURVE_KIND_BSPLINE. |
| [out] | out_buf | Buffer to receive flat knot values. May be NULL on sizing call. |
| [in] | capacity | Capacity of out_buf in elements. |
| [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 | Curve is not a B-spline. |
| OCCTL_BUFFER_TOO_SMALL | Buffer too small. |
\par Thread Safety Yes.
| void occtl_curve_bspline_init | ( | occtl_curve_bspline_t * | out | ) |
Runtime initialiser for occtl_curve_bspline_t.
Sets struct_version and zeroes all other fields. Use instead of the _INIT macro when C macros are not available (e.g. C# P/Invoke).
| [out] | out | Borrows it. NULL-tolerant; no-op when NULL. |
\par Thread Safety Yes.
| occtl_status_t occtl_curve_bspline_is_rational | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| int32_t * | out_is_rational | ||
| ) |
Returns non-zero if the B-spline curve is rational (has per-pole weights).
| [in] | graph | Owning graph. Must be non-NULL. |
| [in] | curve_id | Curve to query; kind must be OCCTL_CURVE_KIND_BSPLINE. |
| [out] | out_is_rational | Receives 1 if rational, 0 otherwise. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_is_rational is NULL. |
| OCCTL_WRONG_KIND | Curve is not a B-spline. |
\par Thread Safety Yes.
| occtl_status_t occtl_curve_bspline_knot_count | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| size_t * | out_count | ||
| ) |
Returns the knot count (number of distinct knot values) of a B-spline curve.
| [in] | graph | Owning graph. Must be non-NULL. |
| [in] | curve_id | Curve to query; kind must be OCCTL_CURVE_KIND_BSPLINE. |
| [out] | out_count | Receives the knot count. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL. |
| OCCTL_WRONG_KIND | Curve is not a B-spline. |
\par Thread Safety Yes.
| occtl_status_t occtl_curve_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 B-spline curve.
Two-call pattern: same as occtl_curve_bspline_poles.
| [in] | graph | Owning graph. Must be non-NULL. |
| [in] | curve_id | Curve to extract; kind must be OCCTL_CURVE_KIND_BSPLINE. |
| [out] | out_buf | Buffer to receive knot values. May be NULL on sizing call. |
| [in] | capacity | Capacity of out_buf in elements. |
| [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 | Curve is not a B-spline. |
| OCCTL_BUFFER_TOO_SMALL | Buffer too small. |
\par Thread Safety Yes.
| occtl_status_t occtl_curve_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 B-spline curve.
Two-call pattern: same as occtl_curve_bspline_poles.
| [in] | graph | Owning graph. Must be non-NULL. |
| [in] | curve_id | Curve to extract; kind must be OCCTL_CURVE_KIND_BSPLINE. |
| [out] | out_buf | Buffer to receive multiplicity values. May be NULL on sizing call. |
| [in] | capacity | Capacity of out_buf in elements. |
| [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 | Curve is not a B-spline. |
| OCCTL_BUFFER_TOO_SMALL | Buffer too small. |
\par Thread Safety Yes.
| occtl_status_t occtl_curve_bspline_pole_count | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| size_t * | out_count | ||
| ) |
Returns the pole count of a B-spline curve.
| [in] | graph | Owning graph. Must be non-NULL. |
| [in] | curve_id | Curve to query; kind must be OCCTL_CURVE_KIND_BSPLINE. |
| [out] | out_count | Receives the pole count. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL. |
| OCCTL_WRONG_KIND | Curve is not a B-spline. |
\par Thread Safety Yes.
| occtl_status_t occtl_curve_bspline_poles | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| occtl_point3_t * | out_buf, | ||
| size_t | capacity, | ||
| size_t * | out_count | ||
| ) |
Extracts the poles of a B-spline curve into a caller-supplied buffer.
Two-call pattern: call with out_buf == NULL to learn the required count in out_count, allocate, then call again with a buffer of at least that size.
| [in] | graph | Owning graph. Must be non-NULL. |
| [in] | curve_id | Curve to extract; kind must be OCCTL_CURVE_KIND_BSPLINE. |
| [out] | out_buf | Buffer to receive pole data. May be NULL on the sizing call. |
| [in] | capacity | Number of elements out_buf can hold. |
| [out] | out_count | Required count. Must be non-NULL. |
| OCCTL_OK | On success (poles written). |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL. |
| OCCTL_WRONG_KIND | Curve is not a B-spline. |
| OCCTL_BUFFER_TOO_SMALL | out_buf is non-NULL but capacity < *out_count. |
\par Thread Safety Yes.
| occtl_status_t occtl_curve_bspline_poles_view | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| const occtl_point3_t ** | out_data, | ||
| size_t * | out_count | ||
| ) |
Zero-copy view of the poles array of a B-spline curve.
Returns a direct pointer into the OCCT internal storage. Valid only while the graph rep is alive and no mutating call has been made on it.
| [in] | graph | Owning graph. Must be non-NULL. |
| [in] | curve_id | Curve to view; 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 | Curve is not a B-spline. |
\par Thread Safety Yes (read-only).
| occtl_status_t occtl_curve_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 B-spline curve.
Returns OCCTL_WRONG_KIND if the curve is non-rational. Check occtl_curve_bspline_is_rational before calling this function.
Two-call pattern: same as occtl_curve_bspline_poles.
| [in] | graph | Owning graph. Must be non-NULL. |
| [in] | curve_id | Curve to extract; kind must be OCCTL_CURVE_KIND_BSPLINE; curve must be rational. |
| [out] | out_buf | Buffer to receive weight values. May be NULL on sizing call. |
| [in] | capacity | Capacity of out_buf in elements. |
| [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 | Curve is not a B-spline, or B-spline is non-rational. |
| OCCTL_BUFFER_TOO_SMALL | Buffer too small. |
\par Thread Safety Yes.
| occtl_status_t occtl_curve_continuity | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| occtl_geom_continuity_t * | out_continuity | ||
| ) |
Returns the continuity class of the curve.
| [in] | graph | Owning graph. Must be non-NULL. |
| [in] | curve_id | Curve to query. |
| [out] | out_continuity | Receives the continuity class. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_continuity is NULL. |
\par Thread Safety Yes.
| occtl_status_t occtl_curve_create_airfoil_naca4 | ( | occtl_graph_t * | graph, |
| const occtl_curve_airfoil_naca4_info_t * | info, | ||
| occtl_rep_id_t * | out_id | ||
| ) |
Creates a B-spline curve approximating a NACA 4-digit airfoil profile.
The wrapper generates cosine-spaced NACA profile samples and delegates curve fitting to OCCT's GeomAPI_PointsToBSpline. For a standard NACA 2412 profile, set max_camber=0.02, camber_position=0.4, and thickness=0.12.
| [in] | graph | Owning graph. Must be non-NULL. |
| [in] | info | Borrows it. Versioned airfoil parameters; must be non-NULL. |
| [out] | out_id | Receives the new rep id. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph, out_id, or info is NULL, p_next is non-NULL, a 0/1 flag is invalid, or a numeric parameter is outside its valid range. |
| OCCTL_VERSION_MISMATCH | Unsupported struct_version. |
| OCCTL_GEOMETRY_INVALID | OCCT rejected the generated point fit. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_curve_create_approximated | ( | occtl_graph_t * | graph, |
| const occtl_curve_approximated_info_t * | info, | ||
| occtl_rep_id_t * | out_id | ||
| ) |
Fits a B-spline curve to the given points within tolerance.
Uses OCCT's GeomAPI_PointsToBSpline. The resulting curve approximates the points; it does not necessarily pass through them.
| [in] | graph | Owning graph. Must be non-NULL. |
| [in] | info | Versioned create-info. Must be non-NULL. |
| [out] | out_id | Receives the new rep id. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph, out_id, or info is NULL, or required fields are NULL / zero. |
| OCCTL_VERSION_MISMATCH | Unsupported struct_version. |
| OCCTL_GEOMETRY_INVALID | Approximation failed. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_curve_create_arc_of_circle_3pt | ( | occtl_graph_t * | graph, |
| occtl_point3_t | p1, | ||
| occtl_point3_t | p2, | ||
| occtl_point3_t | p3, | ||
| occtl_rep_id_t * | out_id | ||
| ) |
Creates a trimmed circular arc through three 3D points.
The arc runs from p1 through p2 to p3. The three points must not be collinear and must be distinct.
| [in] | graph | Owning graph. Must be non-NULL. |
| [in] | p1 | First point. |
| [in] | p2 | Second point (intermediate). |
| [in] | p3 | Third point. |
| [out] | out_id | Receives the new rep id. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_id is NULL. |
| OCCTL_GEOMETRY_INVALID | The three points are collinear or cannot define a unique circle. |
\par Thread Safety Yes.
| occtl_status_t occtl_curve_create_bezier | ( | occtl_graph_t * | graph, |
| const occtl_curve_bezier_create_info_t * | info, | ||
| occtl_rep_id_t * | out_id | ||
| ) |
Creates a 3D curve representation from a Bezier definition.
| [in] | graph | Owning graph. Must be non-NULL. |
| [in] | info | Versioned create-info. Must be non-NULL. |
| [out] | out_id | Receives the new rep id. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph, out_id, or info is NULL. |
| OCCTL_VERSION_MISMATCH | Unsupported struct_version. |
| OCCTL_GEOMETRY_INVALID | OCCT rejected the pole count or weights. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_curve_create_bspline | ( | occtl_graph_t * | graph, |
| const occtl_curve_bspline_create_info_t * | info, | ||
| occtl_rep_id_t * | out_id | ||
| ) |
Creates a 3D curve representation from a B-spline definition.
| [in] | graph | Owning graph. Must be non-NULL. |
| [in] | info | Versioned create-info struct. Must be non-NULL. Arrays inside are borrowed; they need not remain valid after the call returns. |
| [out] | out_id | Receives the new rep id. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph, out_id, or info is NULL; or required array fields are NULL. |
| OCCTL_VERSION_MISMATCH | info->struct_version is not supported. |
| OCCTL_GEOMETRY_INVALID | OCCT rejected the knot/pole/degree combination. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_curve_create_circle | ( | occtl_graph_t * | graph, |
| occtl_geom_circle_t | circle, | ||
| occtl_rep_id_t * | out_id | ||
| ) |
Creates a 3D curve representation from a circle.
| [in] | graph | Owning graph. Must be non-NULL. |
| [in] | circle | Circle data (frame + radius). radius must be > 0. |
| [out] | out_id | Receives the new rep id. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_id is NULL. |
| OCCTL_GEOMETRY_INVALID | circle.radius is not positive. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_curve_create_ellipse | ( | occtl_graph_t * | graph, |
| occtl_geom_ellipse_t | ellipse, | ||
| occtl_rep_id_t * | out_id | ||
| ) |
Creates a 3D curve representation from an ellipse.
| [in] | graph | Owning graph. Must be non-NULL. |
| [in] | ellipse | Ellipse data. major_radius >= minor_radius > 0. |
| [out] | out_id | Receives the new rep id. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_id is NULL. |
| OCCTL_GEOMETRY_INVALID | Radii are not positive or major < minor. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_curve_create_hyperbola | ( | occtl_graph_t * | graph, |
| occtl_geom_hyperbola_t | hyperbola, | ||
| occtl_rep_id_t * | out_id | ||
| ) |
Creates a 3D curve representation from a hyperbola.
| [in] | graph | Owning graph. Must be non-NULL. |
| [in] | hyperbola | Hyperbola data. Both radii must be > 0. |
| [out] | out_id | Receives the new rep id. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_id is NULL. |
| OCCTL_GEOMETRY_INVALID | A radius is not positive. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_curve_create_interpolated | ( | occtl_graph_t * | graph, |
| const occtl_curve_interpolated_info_t * | info, | ||
| occtl_rep_id_t * | out_id | ||
| ) |
Creates a B-spline curve that interpolates (passes through) the given points.
Uses OCCT's GeomAPI_Interpolate. The resulting curve is always a C2 continuous cubic B-spline. Set is_periodic to make the curve periodic (first and last points must match within tolerance).
| [in] | graph | Owning graph. Must be non-NULL. |
| [in] | info | Versioned create-info. Must be non-NULL. |
| [out] | out_id | Receives the new rep id. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph, out_id, or info is NULL, or required fields are NULL / zero. |
| OCCTL_VERSION_MISMATCH | Unsupported struct_version. |
| OCCTL_GEOMETRY_INVALID | Interpolation failed. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_curve_create_line | ( | occtl_graph_t * | graph, |
| occtl_geom_line_t | line, | ||
| occtl_rep_id_t * | out_id | ||
| ) |
Creates a 3D curve representation from a line.
| [in] | graph | Owning graph. Must be non-NULL. |
| [in] | line | Line data (origin + unit direction). |
| [out] | out_id | Receives the new 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_curve_create_offset | ( | occtl_graph_t * | graph, |
| const occtl_curve_offset_create_info_t * | info, | ||
| occtl_rep_id_t * | out_id | ||
| ) |
Creates an offset 3D curve.
| [in] | graph | Owning graph. Must be non-NULL. |
| [in] | info | Versioned create-info. Must be non-NULL. |
| [out] | out_id | Receives the new rep id. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph, out_id, or info is NULL; or info->basis is invalid. |
| OCCTL_VERSION_MISMATCH | Unsupported struct_version. |
| OCCTL_GEOMETRY_INVALID | offset_dir has zero length. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_curve_create_parabola | ( | occtl_graph_t * | graph, |
| occtl_geom_parabola_t | parabola, | ||
| occtl_rep_id_t * | out_id | ||
| ) |
Creates a 3D curve representation from a parabola.
| [in] | graph | Owning graph. Must be non-NULL. |
| [in] | parabola | Parabola data. focal_length must be > 0. |
| [out] | out_id | Receives the new 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_curve_create_trimmed | ( | occtl_graph_t * | graph, |
| const occtl_curve_trimmed_create_info_t * | info, | ||
| occtl_rep_id_t * | out_id | ||
| ) |
Creates a trimmed 3D curve (bounded section of a basis curve).
| [in] | graph | Owning graph. Must be non-NULL. |
| [in] | info | Versioned create-info. Must be non-NULL. |
| [out] | out_id | Receives the new rep id. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph, out_id, or info is NULL; or info->basis is invalid. |
| OCCTL_VERSION_MISMATCH | Unsupported struct_version. |
| OCCTL_GEOMETRY_INVALID | u_last <= u_first, or OCCT rejected the interval. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_curve_eval_d0 | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| double | u, | ||
| occtl_point3_t * | out_point | ||
| ) |
Evaluates the curve at parameter u.
| [in] | graph | Owning 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 | u is outside the parameter domain. |
\par Thread Safety Only when distinct graph instances are used.
| occtl_status_t occtl_curve_eval_d1 | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| double | u, | ||
| occtl_point3_t * | out_point, | ||
| occtl_vector3_t * | out_d1 | ||
| ) |
Evaluates the curve and its first derivative at u.
| [in] | graph | Owning 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 | u is outside the parameter domain. |
\par Thread Safety Only when distinct graph instances are used.
| occtl_status_t occtl_curve_eval_d2 | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| double | u, | ||
| occtl_point3_t * | out_point, | ||
| occtl_vector3_t * | out_d1, | ||
| occtl_vector3_t * | out_d2 | ||
| ) |
Evaluates point, first, and second derivatives at u.
| [in] | graph | Owning 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 | u is outside the parameter domain. |
\par Thread Safety Only when distinct graph instances are used.
| occtl_status_t occtl_curve_eval_d3 | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| double | u, | ||
| occtl_point3_t * | out_point, | ||
| occtl_vector3_t * | out_d1, | ||
| occtl_vector3_t * | out_d2, | ||
| occtl_vector3_t * | out_d3 | ||
| ) |
Evaluates point and first three derivatives at u.
| [in] | graph | Owning 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 | u is outside the parameter domain. |
\par Thread Safety Only when distinct graph instances are used.
| occtl_status_t occtl_curve_eval_dn | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| double | u, | ||
| int32_t | n, | ||
| occtl_vector3_t * | out_derivative | ||
| ) |
Returns the N-th derivative vector at u.
| [in] | graph | Owning 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 | u is outside the parameter domain. |
\par Thread Safety Only when distinct graph instances are used.
| void occtl_curve_free_bezier_segments | ( | occtl_rep_id_t * | ids | ) |
Frees the array returned by occtl_curve_to_bezier_segments.
NULL-tolerant; passing NULL is a no-op.
| [in] | ids | Owns it. May be NULL. |
\par Thread Safety Yes.
| void occtl_curve_free_intersection_points | ( | occtl_curve_intersection_point_t * | results | ) |
Frees the array returned by occtl_curve_intersect.
NULL-tolerant; passing NULL is a no-op.
| [in] | results | Owns it. May be NULL. |
\par Thread Safety Yes.
| void occtl_curve_interpolated_info_init | ( | occtl_curve_interpolated_info_t * | info | ) |
Runtime initialiser for occtl_curve_interpolated_info_t.
| [out] | info | Borrows it. NULL-tolerant; no-op when NULL. |
\par Thread Safety Yes.
| occtl_status_t occtl_curve_intersect | ( | occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id_a, | ||
| occtl_rep_id_t | curve_id_b, | ||
| const occtl_curve_intersection_point_t ** | out_results, | ||
| size_t * | out_count | ||
| ) |
Finds the closest points between two curves.
Uses OCCT's GeomAPI_ExtremaCurveCurve. Returns all extrema points (minima and maxima of distance) between the two curves. When the curves intersect, the distance is zero and the returned points coincide.
The caller owns the returned array and must free it with occtl_curve_free_intersection_points.
| [in] | graph | Owning graph. Must be non-NULL. |
| [in] | curve_id_a | First curve. |
| [in] | curve_id_b | Second curve. |
| [out] | out_results | Receives a caller-owned array of intersection points. Must be non-NULL. Free with occtl_curve_free_intersection_points. |
| [out] | out_count | Receives the number of intersection points. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph, out_results, or out_count is NULL. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety Yes.
| occtl_status_t occtl_curve_is_closed | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| int32_t * | out_is_closed | ||
| ) |
Returns non-zero if the curve is closed.
A 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 | Owning graph. Must be non-NULL. |
| [in] | curve_id | Curve to query. |
| [out] | out_is_closed | Receives 1 if closed, 0 otherwise. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_is_closed is NULL. |
\par Thread Safety Yes.
| occtl_status_t occtl_curve_is_periodic | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| int32_t * | out_is_periodic | ||
| ) |
Returns non-zero if the curve is periodic.
| [in] | graph | Owning graph. Must be non-NULL. |
| [in] | curve_id | Curve to query. |
| [out] | out_is_periodic | Receives 1 if periodic, 0 otherwise. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_is_periodic is NULL. |
\par Thread Safety Yes.
| occtl_status_t occtl_curve_kind | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| occtl_curve_kind_t * | out_kind | ||
| ) |
Returns the kind of geometry wrapped by a curve representation.
| [in] | graph | Owning graph. Must be non-NULL. |
| [in] | curve_id | Curve to query. |
| [out] | out_kind | Receives the curve kind. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_kind is NULL. |
\par Thread Safety Yes.
| occtl_status_t occtl_curve_length | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| double * | out_length | ||
| ) |
Computes the length of the curve over its full parameter range.
The length is computed by numerical integration using OCCT's GCPnts_AbscissaPoint.
| [in] | graph | Owning 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 Only when distinct graph instances are used.
| void occtl_curve_offset_create_info_init | ( | occtl_curve_offset_create_info_t * | info | ) |
Runtime initialiser for occtl_curve_offset_create_info_t.
| [out] | info | Borrows it. NULL-tolerant; no-op when NULL. |
\par Thread Safety Yes.
| occtl_status_t occtl_curve_parameter_of_point | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| occtl_point3_t | point, | ||
| double * | out_param | ||
| ) |
Returns the parameter on the curve nearest to a given 3D point.
Convenience function equivalent to occtl_curve_project_point with out_distance = NULL.
| [in] | graph | Owning 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 Only when distinct graph instances are used.
| occtl_status_t occtl_curve_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 the curve.
For analytic infinite curves (lines, parabolas, hyperbolas) OCCT returns -Precision::Infinite() and +Precision::Infinite() (numerically -1e100 and +1e100). Bounded analytic curves (full circles, ellipses) return [0, 2pi]. Trimmed and B-spline curves return their explicit range.
| [in] | graph | Owning graph. Must be non-NULL. |
| [in] | curve_id | Curve to query. |
| [out] | out_u_min | First (start) parameter. May be NULL. |
| [out] | out_u_max | Last (end) parameter. May be NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL. |
\par Thread Safety Yes.
| occtl_status_t occtl_curve_project_point | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| occtl_point3_t | point, | ||
| double * | out_param, | ||
| double * | out_distance | ||
| ) |
Projects a 3D point onto the curve and returns the closest parameter.
Uses OCCT's GeomAPI_ProjectPointOnCurve. When multiple solutions exist (e.g. a circle), the closest point is returned.
| [in] | graph | Owning 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 on the curve. 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 Only when distinct graph instances are used.
| occtl_status_t occtl_curve_reverse | ( | occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| occtl_rep_id_t * | out_id | ||
| ) |
Creates a new curve representation that is the reversed copy of curve_id.
The returned rep owns an independent curve whose parameterisation runs in the opposite direction: reversed(u) = curve(u_last - u).
| [in] | graph | Owning graph. Must be non-NULL. |
| [in] | curve_id | Curve to reverse. |
| [out] | out_id | Receives the new 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_curve_rotated | ( | occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| occtl_axis1_placement_t | axis, | ||
| double | angle, | ||
| occtl_rep_id_t * | out_id | ||
| ) |
Creates a new curve representation by rotating curve_id.
Convenience wrapper equivalent to applying a rotation transform.
| [in] | graph | Owning graph. Must be non-NULL. |
| [in] | curve_id | Curve to rotate. |
| [in] | axis | Rotation axis (origin + direction). |
| [in] | angle | Rotation angle in radians. |
| [out] | out_id | Receives the new 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_curve_scaled | ( | occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| occtl_point3_t | origin, | ||
| double | factor, | ||
| occtl_rep_id_t * | out_id | ||
| ) |
Creates a new curve representation by scaling curve_id about origin.
Convenience wrapper equivalent to applying a non-uniform scale transform.
| [in] | graph | Owning 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 | Receives the new 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_curve_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_ids, | ||
| size_t * | out_count | ||
| ) |
Decomposes a curve into adjacent Bezier curve segments.
The implementation delegates conversion and segmentation to OCCT GeomConvert and GeomConvert_BSplineCurveToBezierCurve. Each output entry is a new rep id of kind OCCTL_CURVE_KIND_BEZIER. Free the returned array with occtl_curve_free_bezier_segments.
| [in] | graph | Owning 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_ids | Owns it. Receives an allocated array of rep ids. Must be non-NULL. Free with occtl_curve_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_ids, 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_curve_transformed | ( | occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| occtl_transform_t | transform, | ||
| occtl_rep_id_t * | out_id | ||
| ) |
Creates a new curve representation by applying a 3D transform to curve_id.
The returned rep owns an independent transformed copy.
| [in] | graph | Owning graph. Must be non-NULL. |
| [in] | curve_id | Curve to transform. |
| [in] | transform | Transform to apply. |
| [out] | out_id | Receives the new 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_curve_translated | ( | occtl_graph_t * | graph, |
| occtl_rep_id_t | curve_id, | ||
| occtl_vector3_t | delta, | ||
| occtl_rep_id_t * | out_id | ||
| ) |
Creates a new curve representation by translating curve_id.
Convenience wrapper equivalent to applying a translation transform.
| [in] | graph | Owning graph. Must be non-NULL. |
| [in] | curve_id | Curve to translate. |
| [in] | delta | Translation vector. |
| [out] | out_id | Receives the new 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).