OCCT-Light 0.1
C ABI and C++ veneer for multi-language CAD workflows
Loading...
Searching...
No Matches
occtl_curves2d.h File Reference

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"
Include dependency graph for occtl_curves2d.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  occtl_curve2d_circle_tangent_to_two_radius_info
 
struct  occtl_curve2d_blend_arc_info
 
struct  occtl_curve2d_line_tangent_to_two_info
 
struct  occtl_curve2d_line_tangent_through_point_info
 
struct  occtl_curve2d_line_tangent_with_angle_info
 
struct  occtl_curve2d_circle_tangent_to_three_info
 
struct  occtl_curve2d_circle_tangent_fixed_center_info
 
struct  occtl_curve2d_circle_tangent_center_on_curve_info
 
struct  occtl_curve2d_circle_tangent_on_curve_radius_info
 
struct  occtl_curve2d_bspline_create_info
 
struct  occtl_curve2d_bezier_create_info
 
struct  occtl_curve2d_offset_create_info
 
struct  occtl_curve2d_bspline
 

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}
 

Typedefs

typedef struct occtl_curve2d_circle_tangent_to_two_radius_info occtl_curve2d_circle_tangent_to_two_radius_info_t
 
typedef struct occtl_curve2d_blend_arc_info occtl_curve2d_blend_arc_info_t
 
typedef struct occtl_curve2d_line_tangent_to_two_info occtl_curve2d_line_tangent_to_two_info_t
 
typedef struct occtl_curve2d_line_tangent_through_point_info occtl_curve2d_line_tangent_through_point_info_t
 
typedef struct occtl_curve2d_line_tangent_with_angle_info occtl_curve2d_line_tangent_with_angle_info_t
 
typedef struct occtl_curve2d_circle_tangent_to_three_info occtl_curve2d_circle_tangent_to_three_info_t
 
typedef struct occtl_curve2d_circle_tangent_fixed_center_info occtl_curve2d_circle_tangent_fixed_center_info_t
 
typedef struct occtl_curve2d_circle_tangent_center_on_curve_info occtl_curve2d_circle_tangent_center_on_curve_info_t
 
typedef struct occtl_curve2d_circle_tangent_on_curve_radius_info occtl_curve2d_circle_tangent_on_curve_radius_info_t
 
typedef struct occtl_curve2d_bspline_create_info occtl_curve2d_bspline_create_info_t
 
typedef struct occtl_curve2d_bezier_create_info occtl_curve2d_bezier_create_info_t
 
typedef struct occtl_curve2d_offset_create_info occtl_curve2d_offset_create_info_t
 
typedef struct occtl_curve2d_bspline occtl_curve2d_bspline_t
 

Functions

void occtl_curve2d_circle_tangent_to_two_radius_info_init (occtl_curve2d_circle_tangent_to_two_radius_info_t *info)
 
void occtl_curve2d_blend_arc_info_init (occtl_curve2d_blend_arc_info_t *info)
 
void occtl_curve2d_line_tangent_to_two_info_init (occtl_curve2d_line_tangent_to_two_info_t *info)
 
void occtl_curve2d_line_tangent_through_point_info_init (occtl_curve2d_line_tangent_through_point_info_t *info)
 
void occtl_curve2d_line_tangent_with_angle_info_init (occtl_curve2d_line_tangent_with_angle_info_t *info)
 
void occtl_curve2d_circle_tangent_to_three_info_init (occtl_curve2d_circle_tangent_to_three_info_t *info)
 
void occtl_curve2d_circle_tangent_fixed_center_info_init (occtl_curve2d_circle_tangent_fixed_center_info_t *info)
 
void occtl_curve2d_circle_tangent_center_on_curve_info_init (occtl_curve2d_circle_tangent_center_on_curve_info_t *info)
 
void occtl_curve2d_circle_tangent_on_curve_radius_info_init (occtl_curve2d_circle_tangent_on_curve_radius_info_t *info)
 
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)
 
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)
 
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)
 
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)
 
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)
 
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)
 
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)
 
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)
 
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)
 
occtl_status_t occtl_curve2d_create_line (occtl_graph_t *graph, occtl_geom2d_line_t line, occtl_rep_id_t *out_id)
 
occtl_status_t occtl_curve2d_create_circle (occtl_graph_t *graph, occtl_geom2d_circle_t circle, occtl_rep_id_t *out_id)
 
occtl_status_t occtl_curve2d_create_ellipse (occtl_graph_t *graph, occtl_geom2d_ellipse_t ellipse, occtl_rep_id_t *out_id)
 
occtl_status_t occtl_curve2d_create_hyperbola (occtl_graph_t *graph, occtl_geom2d_hyperbola_t hyperbola, occtl_rep_id_t *out_id)
 
occtl_status_t occtl_curve2d_create_parabola (occtl_graph_t *graph, occtl_geom2d_parabola_t parabola, occtl_rep_id_t *out_id)
 
void occtl_curve2d_bspline_create_info_init (occtl_curve2d_bspline_create_info_t *info)
 
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)
 
void occtl_curve2d_bezier_create_info_init (occtl_curve2d_bezier_create_info_t *info)
 
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)
 
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)
 
void occtl_curve2d_offset_create_info_init (occtl_curve2d_offset_create_info_t *info)
 
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)
 
occtl_status_t occtl_curve2d_reverse (occtl_graph_t *graph, occtl_rep_id_t curve_id, occtl_rep_id_t *out_id)
 
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)
 
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)
 
occtl_status_t occtl_curve2d_rotated (occtl_graph_t *graph, occtl_rep_id_t curve_id, double angle, occtl_rep_id_t *out_id)
 
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)
 
occtl_status_t occtl_curve2d_length (const occtl_graph_t *graph, occtl_rep_id_t curve_id, double *out_length)
 
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)
 
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)
 
occtl_status_t occtl_curve2d_kind (const occtl_graph_t *graph, occtl_rep_id_t curve_id, occtl_curve_kind_t *out_kind)
 
occtl_status_t occtl_curve2d_is_periodic (const occtl_graph_t *graph, occtl_rep_id_t curve_id, int32_t *out_is_periodic)
 
occtl_status_t occtl_curve2d_is_closed (const occtl_graph_t *graph, occtl_rep_id_t curve_id, int32_t *out_is_closed)
 
occtl_status_t occtl_curve2d_continuity (occtl_graph_t *graph, occtl_rep_id_t curve_id, occtl_geom_continuity_t *out_continuity)
 
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)
 
occtl_status_t occtl_curve2d_as_line (const occtl_graph_t *graph, occtl_rep_id_t curve_id, occtl_geom2d_line_t *out_line)
 
occtl_status_t occtl_curve2d_as_circle (const occtl_graph_t *graph, occtl_rep_id_t curve_id, occtl_geom2d_circle_t *out_circle)
 
occtl_status_t occtl_curve2d_as_ellipse (const occtl_graph_t *graph, occtl_rep_id_t curve_id, occtl_geom2d_ellipse_t *out_ellipse)
 
occtl_status_t occtl_curve2d_as_hyperbola (occtl_graph_t *graph, occtl_rep_id_t curve_id, occtl_geom2d_hyperbola_t *out_hyperbola)
 
occtl_status_t occtl_curve2d_as_parabola (occtl_graph_t *graph, occtl_rep_id_t curve_id, occtl_geom2d_parabola_t *out_parabola)
 
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)
 
occtl_status_t occtl_curve2d_as_offset (const occtl_graph_t *graph, occtl_rep_id_t curve_id, double *out_offset)
 
occtl_status_t occtl_curve2d_bspline_degree (const occtl_graph_t *graph, occtl_rep_id_t curve_id, int32_t *out_degree)
 
occtl_status_t occtl_curve2d_bspline_pole_count (const occtl_graph_t *graph, occtl_rep_id_t curve_id, size_t *out_count)
 
occtl_status_t occtl_curve2d_bspline_knot_count (const occtl_graph_t *graph, occtl_rep_id_t curve_id, size_t *out_count)
 
occtl_status_t occtl_curve2d_bspline_is_rational (const occtl_graph_t *graph, occtl_rep_id_t curve_id, int32_t *out_is_rational)
 
occtl_status_t occtl_curve2d_bezier_degree (const occtl_graph_t *graph, occtl_rep_id_t curve_id, int32_t *out_degree)
 
occtl_status_t occtl_curve2d_bezier_pole_count (const occtl_graph_t *graph, occtl_rep_id_t curve_id, size_t *out_count)
 
occtl_status_t occtl_curve2d_bezier_is_rational (const occtl_graph_t *graph, occtl_rep_id_t curve_id, int32_t *out_is_rational)
 
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)
 
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)
 
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)
 
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)
 
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)
 
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)
 
void occtl_curve2d_bspline_init (occtl_curve2d_bspline_t *out)
 
occtl_status_t occtl_curve2d_as_bspline (const occtl_graph_t *graph, occtl_rep_id_t curve_id, occtl_curve2d_bspline_t *out)
 
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)
 
void occtl_curve2d_free_bezier_segments (occtl_rep_id_t *ids)
 
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)
 
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)
 
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)
 
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)
 
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)
 

Detailed Description

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.

Macro Definition Documentation

◆ OCCTL_CURVE2D_BLEND_ARC_INFO_INIT

#define OCCTL_CURVE2D_BLEND_ARC_INFO_INIT
Value:
{OCCTL_CURVE2D_BLEND_ARC_INFO_VERSION_1, \
NULL, \
{0}, \
{0}, \
0.0, \
0, \
1.0e-9}
@ OCCTL_GEOM_TANGENCY_UNQUALIFIED
Definition occtl_curves_common.h:69

◆ OCCTL_CURVE2D_CIRCLE_TANGENT_CENTER_ON_CURVE_INFO_INIT

#define OCCTL_CURVE2D_CIRCLE_TANGENT_CENTER_ON_CURVE_INFO_INIT
Value:
{OCCTL_CURVE2D_CIRCLE_TANGENT_CENTER_ON_CURVE_INFO_VERSION_1, \
NULL, \
{0}, \
{0}, \
{0}, \
0.0, \
0.0, \
0.0, \
1.0e-9}

◆ OCCTL_CURVE2D_CIRCLE_TANGENT_FIXED_CENTER_INFO_INIT

#define OCCTL_CURVE2D_CIRCLE_TANGENT_FIXED_CENTER_INFO_INIT
Value:
{OCCTL_CURVE2D_CIRCLE_TANGENT_FIXED_CENTER_INFO_VERSION_1, \
NULL, \
{0}, \
{0.0, 0.0}, \
1.0e-9}

◆ OCCTL_CURVE2D_CIRCLE_TANGENT_ON_CURVE_RADIUS_INFO_INIT

#define OCCTL_CURVE2D_CIRCLE_TANGENT_ON_CURVE_RADIUS_INFO_INIT
Value:
{OCCTL_CURVE2D_CIRCLE_TANGENT_ON_CURVE_RADIUS_INFO_VERSION_1, \
NULL, \
{0}, \
{0}, \
0.0, \
1.0e-9}

◆ OCCTL_CURVE2D_CIRCLE_TANGENT_TO_THREE_INFO_INIT

#define OCCTL_CURVE2D_CIRCLE_TANGENT_TO_THREE_INFO_INIT
Value:
{OCCTL_CURVE2D_CIRCLE_TANGENT_TO_THREE_INFO_VERSION_1, \
NULL, \
{0}, \
{0}, \
{0}, \
0.0, \
0.0, \
0.0, \
1.0e-9}

◆ OCCTL_CURVE2D_CIRCLE_TANGENT_TO_TWO_RADIUS_INFO_INIT

#define OCCTL_CURVE2D_CIRCLE_TANGENT_TO_TWO_RADIUS_INFO_INIT
Value:
{OCCTL_CURVE2D_CIRCLE_TANGENT_TO_TWO_RADIUS_INFO_VERSION_1, \
NULL, \
{0}, \
{0}, \
0.0, \
1.0e-9}

◆ OCCTL_CURVE2D_LINE_TANGENT_THROUGH_POINT_INFO_INIT

#define OCCTL_CURVE2D_LINE_TANGENT_THROUGH_POINT_INFO_INIT
Value:
{OCCTL_CURVE2D_LINE_TANGENT_THROUGH_POINT_INFO_VERSION_1, \
NULL, \
{0}, \
{0.0, 0.0}, \
1.0e-9}

◆ OCCTL_CURVE2D_LINE_TANGENT_TO_TWO_INFO_INIT

#define OCCTL_CURVE2D_LINE_TANGENT_TO_TWO_INFO_INIT
Value:
{OCCTL_CURVE2D_LINE_TANGENT_TO_TWO_INFO_VERSION_1, \
NULL, \
{0}, \
{0}, \
1.0e-9}

◆ OCCTL_CURVE2D_LINE_TANGENT_WITH_ANGLE_INFO_INIT

#define OCCTL_CURVE2D_LINE_TANGENT_WITH_ANGLE_INFO_INIT
Value:
{OCCTL_CURVE2D_LINE_TANGENT_WITH_ANGLE_INFO_VERSION_1, \
NULL, \
{0}, \
{{{0.0, 0.0}, {1.0, 0.0}}}, \
0.0, \
0, \
0.0, \
1.0e-9}

Typedef Documentation

◆ occtl_curve2d_bezier_create_info_t

Versioned create-info struct for 2D Bezier curve construction.

◆ occtl_curve2d_blend_arc_info_t

Versioned create-info for fixed-radius 2D blend arcs tangent to two curves.

◆ occtl_curve2d_bspline_create_info_t

Versioned create-info struct for 2D B-spline curve construction.

Same semantics as occtl_curve_bspline_create_info_t but uses 2D poles.

◆ 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.

◆ occtl_curve2d_circle_tangent_center_on_curve_info_t

Versioned create-info for 2D circles tangent to two curves with center on a curve.

◆ occtl_curve2d_circle_tangent_fixed_center_info_t

Versioned create-info for 2D circles tangent to a curve with fixed center.

◆ 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.

◆ occtl_curve2d_circle_tangent_to_three_info_t

Versioned create-info for 2D circles tangent to three curves.

◆ occtl_curve2d_circle_tangent_to_two_radius_info_t

Versioned create-info for fixed-radius 2D circles tangent to two curves.

◆ occtl_curve2d_line_tangent_through_point_info_t

Versioned create-info for 2D lines tangent to a curve and passing through a point.

◆ occtl_curve2d_line_tangent_to_two_info_t

Versioned create-info for 2D lines tangent to two curves.

◆ 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.

◆ occtl_curve2d_offset_create_info_t

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).

Function Documentation

◆ occtl_curve2d_as_bspline()

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.

Parameters
[in]graphMust be non-NULL.
[in]curve_idCurve to inspect; kind must be OCCTL_CURVE_KIND_BSPLINE.
[in,out]outBorrows 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.
Return values
OCCTL_OKOn success.
OCCTL_INVALID_ARGUMENTgraph or out is NULL.
OCCTL_VERSION_MISMATCHout->struct_version is not supported.
OCCTL_WRONG_KINDRepresentation is not a 2D B-spline curve.

\par Thread Safety Yes (read-only).

See also
occtl_curve2d_bspline_init, occtl_curve2d_bspline_poles_view, occtl_curve2d_bspline_degree, occtl_curve2d_bspline_pole_count

◆ occtl_curve2d_as_circle()

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.

Parameters
[in]graphMust be non-NULL.
[in]curve_idCurve to extract; kind must be OCCTL_CURVE_KIND_CIRCLE.
[out]out_circleBorrows it (caller-allocated slot). Must be non-NULL.
Return values
OCCTL_OKOn success.
OCCTL_INVALID_ARGUMENTgraph or out_circle is NULL.
OCCTL_WRONG_KINDRepresentation is not a circle.

\par Thread Safety Yes (read-only on graph).

See also
occtl_curve2d_kind

◆ occtl_curve2d_as_ellipse()

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.

Parameters
[in]graphMust be non-NULL.
[in]curve_idCurve to extract; kind must be OCCTL_CURVE_KIND_ELLIPSE.
[out]out_ellipseBorrows it (caller-allocated slot). Must be non-NULL.
Return values
OCCTL_OKOn success.
OCCTL_INVALID_ARGUMENTgraph or out_ellipse is NULL.
OCCTL_WRONG_KINDRepresentation is not an ellipse.

\par Thread Safety Yes (read-only on graph).

See also
occtl_curve2d_kind

◆ occtl_curve2d_as_hyperbola()

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.

Parameters
[in]graphMust be non-NULL.
[in]curve_idCurve to extract; kind must be OCCTL_CURVE_KIND_HYPERBOLA.
[out]out_hyperbolaBorrows it (caller-allocated slot). Must be non-NULL.
Return values
OCCTL_OKOn success.
OCCTL_INVALID_ARGUMENTgraph or out_hyperbola is NULL.
OCCTL_WRONG_KINDRepresentation is not a hyperbola.

\par Thread Safety Yes (read-only on graph).

See also
occtl_curve2d_kind

◆ occtl_curve2d_as_line()

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.

Parameters
[in]graphMust be non-NULL.
[in]curve_idCurve to extract; kind must be OCCTL_CURVE_KIND_LINE.
[out]out_lineBorrows it (caller-allocated slot). Must be non-NULL.
Return values
OCCTL_OKOn success.
OCCTL_INVALID_ARGUMENTgraph or out_line is NULL.
OCCTL_WRONG_KINDRepresentation is not a line.

\par Thread Safety Yes (read-only on graph).

See also
occtl_curve2d_kind

◆ occtl_curve2d_as_offset()

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.

Parameters
[in]graphMust be non-NULL.
[in]curve_idCurve to extract; kind must be OCCTL_CURVE_KIND_OFFSET.
[out]out_offsetSigned offset distance. May be NULL.
Return values
OCCTL_OKOn success.
OCCTL_INVALID_ARGUMENTgraph is NULL.
OCCTL_WRONG_KINDRepresentation is not an offset curve.

\par Thread Safety Yes (read-only on graph).

See also
occtl_curve2d_kind

◆ occtl_curve2d_as_parabola()

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.

Parameters
[in]graphMust be non-NULL.
[in]curve_idCurve to extract; kind must be OCCTL_CURVE_KIND_PARABOLA.
[out]out_parabolaBorrows it (caller-allocated slot). Must be non-NULL.
Return values
OCCTL_OKOn success.
OCCTL_INVALID_ARGUMENTgraph or out_parabola is NULL.
OCCTL_WRONG_KINDRepresentation is not a parabola.

\par Thread Safety Yes (read-only on graph).

See also
occtl_curve2d_kind

◆ occtl_curve2d_as_trimmed()

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.

Parameters
[in]graphMust be non-NULL.
[in]curve_idCurve to extract; kind must be OCCTL_CURVE_KIND_TRIMMED.
[out]out_u_firstFirst parameter. May be NULL.
[out]out_u_lastLast parameter. May be NULL.
Return values
OCCTL_OKOn success.
OCCTL_INVALID_ARGUMENTgraph is NULL.
OCCTL_WRONG_KINDRepresentation is not a trimmed curve.

\par Thread Safety Yes (read-only on graph).

See also
occtl_curve2d_kind

◆ occtl_curve2d_bezier_create_info_init()

void occtl_curve2d_bezier_create_info_init ( occtl_curve2d_bezier_create_info_t info)

Runtime initialiser for occtl_curve2d_bezier_create_info_t.

Parameters
[out]infoBorrows it. NULL-tolerant; no-op when NULL.

\par Thread Safety Yes.

See also
occtl_curve2d_create_bezier

◆ occtl_curve2d_bezier_degree()

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.

Parameters
[in]graphMust be non-NULL.
[in]curve_idCurve to query; kind must be OCCTL_CURVE_KIND_BEZIER.
[out]out_degreeBorrows it. Caller-allocated slot. Must be non-NULL.
Return values
OCCTL_OKOn success.
OCCTL_INVALID_ARGUMENTgraph or out_degree is NULL.
OCCTL_WRONG_KINDNot a Bezier curve.

\par Thread Safety Yes (read-only on graph).

◆ occtl_curve2d_bezier_is_rational()

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).

Parameters
[in]graphMust be non-NULL.
[in]curve_idCurve to query; kind must be OCCTL_CURVE_KIND_BEZIER.
[out]out_is_rationalBorrows it. Caller-allocated slot. Must be non-NULL. 1 if rational; 0 if non-rational or not a Bezier curve.
Return values
OCCTL_OKOn success.
OCCTL_INVALID_ARGUMENTgraph or out_is_rational is NULL.
OCCTL_WRONG_KINDNot a Bezier curve.

\par Thread Safety Yes (read-only on graph).

◆ occtl_curve2d_bezier_pole_count()

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.

Parameters
[in]graphMust be non-NULL.
[in]curve_idCurve to query; kind must be OCCTL_CURVE_KIND_BEZIER.
[out]out_countBorrows it. Caller-allocated slot. Must be non-NULL.
Return values
OCCTL_OKOn success.
OCCTL_INVALID_ARGUMENTgraph or out_count is NULL.
OCCTL_WRONG_KINDNot a Bezier curve.

\par Thread Safety Yes (read-only on graph).

◆ occtl_curve2d_blend_arc_info_init()

void occtl_curve2d_blend_arc_info_init ( occtl_curve2d_blend_arc_info_t info)

Runtime initialiser for occtl_curve2d_blend_arc_info_t.

Parameters
[out]infoBorrows it. NULL-tolerant; no-op when NULL.

\par Thread Safety Yes.

See also
occtl_curve2d_create_blend_arc

◆ occtl_curve2d_bspline_create_info_init()

void occtl_curve2d_bspline_create_info_init ( occtl_curve2d_bspline_create_info_t info)

Runtime initialiser for occtl_curve2d_bspline_create_info_t.

Parameters
[out]infoBorrows it. NULL-tolerant; no-op when NULL.

\par Thread Safety Yes.

See also
occtl_curve2d_create_bspline

◆ occtl_curve2d_bspline_degree()

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.

Parameters
[in]graphMust be non-NULL.
[in]curve_idCurve to query; kind should be OCCTL_CURVE_KIND_BSPLINE.
[out]out_degreeBorrows it. Caller-allocated slot. Must be non-NULL.
Return values
OCCTL_OKOn success.
OCCTL_INVALID_ARGUMENTgraph or out_degree is NULL.
OCCTL_WRONG_KINDNot a B-spline.

\par Thread Safety Yes (read-only on graph).

◆ occtl_curve2d_bspline_flat_knots()

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.

Parameters
[in]graphMust be non-NULL.
[in]curve_idCurve to query.
[out]out_bufMay be NULL on sizing call.
[in]capacityElements out_buf can hold.
[out]out_countRequired count. Must be non-NULL.
Return values
OCCTL_OKOn success.
OCCTL_INVALID_ARGUMENTgraph or out_count is NULL.
OCCTL_WRONG_KINDNot a B-spline.
OCCTL_BUFFER_TOO_SMALLBuffer too small.

\par Thread Safety Yes (read-only on graph).

◆ occtl_curve2d_bspline_init()

void occtl_curve2d_bspline_init ( occtl_curve2d_bspline_t out)

Runtime initialiser for occtl_curve2d_bspline_t.

Parameters
[out]outBorrows it. NULL-tolerant; no-op when NULL.

\par Thread Safety Yes.

See also
occtl_curve2d_as_bspline

◆ occtl_curve2d_bspline_is_rational()

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.

Parameters
[in]graphMust be non-NULL.
[in]curve_idCurve to query.
[out]out_is_rationalBorrows it. Caller-allocated slot. Must be non-NULL. 1 if rational; 0 otherwise.
Return values
OCCTL_OKOn success.
OCCTL_INVALID_ARGUMENTgraph or out_is_rational is NULL.
OCCTL_WRONG_KINDNot a B-spline.

\par Thread Safety Yes (read-only on graph).

◆ occtl_curve2d_bspline_knot_count()

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.

Parameters
[in]graphMust be non-NULL.
[in]curve_idCurve to query.
[out]out_countBorrows it. Caller-allocated slot. Must be non-NULL.
Return values
OCCTL_OKOn success.
OCCTL_INVALID_ARGUMENTgraph or out_count is NULL.
OCCTL_WRONG_KINDNot a B-spline.

\par Thread Safety Yes (read-only on graph).

◆ occtl_curve2d_bspline_knots()

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.

Parameters
[in]graphMust be non-NULL.
[in]curve_idCurve to query.
[out]out_bufMay be NULL on sizing call.
[in]capacityElements out_buf can hold.
[out]out_countRequired count. Must be non-NULL.
Return values
OCCTL_OKOn success.
OCCTL_INVALID_ARGUMENTgraph or out_count is NULL.
OCCTL_WRONG_KINDNot a B-spline.
OCCTL_BUFFER_TOO_SMALLBuffer too small.

\par Thread Safety Yes (read-only on graph).

◆ occtl_curve2d_bspline_multiplicities()

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.

Parameters
[in]graphMust be non-NULL.
[in]curve_idCurve to query.
[out]out_bufMay be NULL on sizing call.
[in]capacityElements out_buf can hold.
[out]out_countRequired count. Must be non-NULL.
Return values
OCCTL_OKOn success.
OCCTL_INVALID_ARGUMENTgraph or out_count is NULL.
OCCTL_WRONG_KINDNot a B-spline.
OCCTL_BUFFER_TOO_SMALLBuffer too small.

\par Thread Safety Yes (read-only on graph).

◆ occtl_curve2d_bspline_pole_count()

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.

Parameters
[in]graphMust be non-NULL.
[in]curve_idCurve to query.
[out]out_countBorrows it. Caller-allocated slot. Must be non-NULL.
Return values
OCCTL_OKOn success.
OCCTL_INVALID_ARGUMENTgraph or out_count is NULL.
OCCTL_WRONG_KINDNot a B-spline.

\par Thread Safety Yes (read-only on graph).

◆ occtl_curve2d_bspline_poles()

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.

Parameters
[in]graphMust be non-NULL.
[in]curve_idCurve to query; kind must be OCCTL_CURVE_KIND_BSPLINE.
[out]out_bufMay be NULL on sizing call.
[in]capacityElements out_buf can hold.
[out]out_countRequired count. Must be non-NULL.
Return values
OCCTL_OKOn success.
OCCTL_INVALID_ARGUMENTgraph or out_count is NULL.
OCCTL_WRONG_KINDNot a B-spline.
OCCTL_BUFFER_TOO_SMALLBuffer too small.

\par Thread Safety Yes (read-only on graph).

◆ occtl_curve2d_bspline_poles_view()

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.

Parameters
[in]graphMust be non-NULL.
[in]curve_idCurve to query; kind must be OCCTL_CURVE_KIND_BSPLINE.
[out]out_dataReceives a borrowed pointer to the pole array. Must be non-NULL.
[out]out_countReceives the pole count. Must be non-NULL.
Return values
OCCTL_OKOn success.
OCCTL_INVALID_ARGUMENTgraph, out_data, or out_count is NULL.
OCCTL_WRONG_KINDRepresentation is not a B-spline.

\par Thread Safety Yes (read-only).

◆ occtl_curve2d_bspline_weights()

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.

Parameters
[in]graphMust be non-NULL.
[in]curve_idCurve to query; must be rational.
[out]out_bufMay be NULL on sizing call.
[in]capacityElements out_buf can hold.
[out]out_countRequired count. Must be non-NULL.
Return values
OCCTL_OKOn success.
OCCTL_INVALID_ARGUMENTgraph or out_count is NULL.
OCCTL_WRONG_KINDNot a B-spline or not rational.
OCCTL_BUFFER_TOO_SMALLBuffer too small.

\par Thread Safety Yes (read-only on graph).

◆ occtl_curve2d_circle_tangent_center_on_curve_info_init()

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.

Parameters
[out]infoBorrows it. NULL-tolerant; no-op when NULL.

\par Thread Safety Yes.

See also
occtl_curve2d_create_tangent_circle_center_on_curve

◆ occtl_curve2d_circle_tangent_fixed_center_info_init()

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.

Parameters
[out]infoBorrows it. NULL-tolerant; no-op when NULL.

\par Thread Safety Yes.

See also
occtl_curve2d_create_tangent_circle_fixed_center

◆ occtl_curve2d_circle_tangent_on_curve_radius_info_init()

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.

Parameters
[out]infoBorrows it. NULL-tolerant; no-op when NULL.

\par Thread Safety Yes.

See also
occtl_curve2d_create_tangent_circle_on_curve_radius

◆ occtl_curve2d_circle_tangent_to_three_info_init()

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.

Parameters
[out]infoBorrows it. NULL-tolerant; no-op when NULL.

\par Thread Safety Yes.

See also
occtl_curve2d_create_tangent_circle_to_three

◆ occtl_curve2d_circle_tangent_to_two_radius_info_init()

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.

Parameters
[out]infoBorrows it. NULL-tolerant; no-op when NULL.

\par Thread Safety Yes.

See also
occtl_curve2d_create_tangent_circle_to_two_radius

◆ occtl_curve2d_continuity()

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.

Parameters
[in]graphMust be non-NULL.
[in]curve_idCurve to query.
[out]out_continuityBorrows it. Caller-allocated slot. Must be non-NULL.
Return values
OCCTL_OKOn success.
OCCTL_INVALID_ARGUMENTgraph or out_continuity is NULL.

\par Thread Safety Yes (read-only on graph).

◆ occtl_curve2d_create_bezier()

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.

Parameters
[in]graphMust be non-NULL.
[out]out_idBorrows it. Caller-allocated slot for the curve rep id. Must be non-NULL.
[in]infoVersioned create-info. Must be non-NULL.
Return values
OCCTL_OKOn success.
OCCTL_INVALID_ARGUMENTgraph or out_id or info is NULL.
OCCTL_VERSION_MISMATCHUnsupported struct_version.
OCCTL_GEOMETRY_INVALIDOCCT rejected the definition.
OCCTL_OUT_OF_MEMORYAllocation failed.

\par Thread Safety No (mutates graph).

◆ occtl_curve2d_create_blend_arc()

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.

Parameters
[in]graphMust be non-NULL.
[in]infoBorrows it. Versioned solver inputs; must be non-NULL.
[in]solution_indexZero-based solution index to read when out_id is non-NULL.
[out]out_idBorrows it. Caller-allocated slot for a curve rep id, or NULL for count-only query.
[out]out_countBorrows it. Receives the total solution count; must be non-NULL.
Return values
OCCTL_OKOn success.
OCCTL_INVALID_ARGUMENTgraph 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_MISMATCHUnsupported struct_version.
OCCTL_GEOMETRY_INVALIDOCCT rejected the tangent construction.
OCCTL_NOT_FOUNDout_id is non-NULL and solution_index is outside the available solution range.
OCCTL_OUT_OF_MEMORYAllocation failed.

\par Thread Safety Yes.

See also
occtl_curve2d_blend_arc_info_init

◆ occtl_curve2d_create_bspline()

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.

Parameters
[in]graphMust be non-NULL.
[out]out_idBorrows it. Caller-allocated slot for the curve rep id. Must be non-NULL.
[in]infoVersioned create-info. Must be non-NULL.
Return values
OCCTL_OKOn success.
OCCTL_INVALID_ARGUMENTgraph or out_id or info is NULL.
OCCTL_VERSION_MISMATCHUnsupported struct_version.
OCCTL_GEOMETRY_INVALIDOCCT rejected the definition.
OCCTL_OUT_OF_MEMORYAllocation failed.

\par Thread Safety No (mutates graph).

◆ occtl_curve2d_create_circle()

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.

Parameters
[in]graphMust be non-NULL.
[in]circle2D circle data. radius must be > 0.
[out]out_idBorrows it. Caller-allocated slot for the curve rep id. Must be non-NULL.
Return values
OCCTL_OKOn success.
OCCTL_INVALID_ARGUMENTgraph or out_id is NULL.
OCCTL_GEOMETRY_INVALIDradius is not positive.
OCCTL_OUT_OF_MEMORYAllocation failed.

\par Thread Safety No (mutates graph).

◆ occtl_curve2d_create_ellipse()

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.

Parameters
[in]graphMust be non-NULL.
[in]ellipse2D ellipse data.
[out]out_idBorrows it. Caller-allocated slot for the curve rep id. Must be non-NULL.
Return values
OCCTL_OKOn success.
OCCTL_INVALID_ARGUMENTgraph or out_id is NULL.
OCCTL_GEOMETRY_INVALIDRadii invalid.
OCCTL_OUT_OF_MEMORYAllocation failed.

\par Thread Safety No (mutates graph).

◆ occtl_curve2d_create_hyperbola()

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.

Parameters
[in]graphMust be non-NULL.
[in]hyperbola2D hyperbola data.
[out]out_idBorrows it. Caller-allocated slot for the curve rep id. Must be non-NULL.
Return values
OCCTL_OKOn success.
OCCTL_INVALID_ARGUMENTgraph or out_id is NULL.
OCCTL_GEOMETRY_INVALIDRadii invalid.
OCCTL_OUT_OF_MEMORYAllocation failed.

\par Thread Safety No (mutates graph).

◆ occtl_curve2d_create_line()

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.

Parameters
[in]graphMust be non-NULL.
[in]line2D line data.
[out]out_idBorrows it. Caller-allocated slot for the curve rep id. Must be non-NULL.
Return values
OCCTL_OKOn success.
OCCTL_INVALID_ARGUMENTgraph or out_id is NULL.
OCCTL_OUT_OF_MEMORYAllocation failed.

\par Thread Safety No (mutates graph).

◆ occtl_curve2d_create_offset()

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.

Parameters
[in]graphMust be non-NULL.
[out]out_idBorrows it. Caller-allocated slot for the curve rep id. Must be non-NULL.
[in]infoVersioned create-info. Must be non-NULL.
Return values
OCCTL_OKOn success.
OCCTL_INVALID_ARGUMENTgraph or out_id or info is NULL.
OCCTL_VERSION_MISMATCHUnsupported struct_version.
OCCTL_GEOMETRY_INVALIDOCCT rejected the offset.
OCCTL_OUT_OF_MEMORYAllocation failed.

\par Thread Safety No (mutates graph).

◆ occtl_curve2d_create_parabola()

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.

Parameters
[in]graphMust be non-NULL.
[in]parabola2D parabola data. focal_length must be > 0.
[out]out_idBorrows it. Caller-allocated slot for the curve rep id. Must be non-NULL.
Return values
OCCTL_OKOn success.
OCCTL_INVALID_ARGUMENTgraph or out_id is NULL.
OCCTL_GEOMETRY_INVALIDfocal_length is not positive.
OCCTL_OUT_OF_MEMORYAllocation failed.

\par Thread Safety No (mutates graph).

◆ occtl_curve2d_create_tangent_circle_center_on_curve()

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.

Parameters
[in]graphMust be non-NULL.
[in]infoBorrows it. Versioned solver inputs; must be non-NULL.
[in]solution_indexZero-based solution index to read when out_circle is non-NULL.
[out]out_circleBorrows it. Caller-owned slot, or NULL for count-only query.
[out]out_countBorrows it. Receives the total solution count; must be non-NULL.
Return values
OCCTL_OKOn success.
OCCTL_INVALID_ARGUMENTgraph or info or out_count is NULL, required fields are invalid, or p_next is non-NULL.
OCCTL_VERSION_MISMATCHUnsupported struct_version.
OCCTL_GEOMETRY_INVALIDOCCT rejected the tangent construction.
OCCTL_NOT_FOUNDout_circle is non-NULL and solution_index is outside the available solution range.
OCCTL_OUT_OF_MEMORYAllocation failed.

\par Thread Safety Yes.

See also
occtl_curve2d_create_circle, occtl_curve2d_circle_tangent_center_on_curve_info_init

◆ occtl_curve2d_create_tangent_circle_fixed_center()

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.

Parameters
[in]graphMust be non-NULL.
[in]infoBorrows it. Versioned solver inputs; must be non-NULL.
[in]solution_indexZero-based solution index to read when out_circle is non-NULL.
[out]out_circleBorrows it. Caller-owned slot, or NULL for count-only query.
[out]out_countBorrows it. Receives the total solution count; must be non-NULL.
Return values
OCCTL_OKOn success.
OCCTL_INVALID_ARGUMENTgraph or info or out_count is NULL, required fields are invalid, or p_next is non-NULL.
OCCTL_VERSION_MISMATCHUnsupported struct_version.
OCCTL_GEOMETRY_INVALIDOCCT rejected the tangent construction.
OCCTL_NOT_FOUNDout_circle is non-NULL and solution_index is outside the available solution range.
OCCTL_OUT_OF_MEMORYAllocation failed.

\par Thread Safety Yes.

See also
occtl_curve2d_create_circle, occtl_curve2d_circle_tangent_fixed_center_info_init

◆ occtl_curve2d_create_tangent_circle_on_curve_radius()

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.

Parameters
[in]graphMust be non-NULL.
[in]infoBorrows it. Versioned solver inputs; must be non-NULL.
[in]solution_indexZero-based solution index to read when out_circle is non-NULL.
[out]out_circleBorrows it. Caller-owned slot, or NULL for count-only query.
[out]out_countBorrows it. Receives the total solution count; must be non-NULL.
Return values
OCCTL_OKOn success.
OCCTL_INVALID_ARGUMENTgraph or info or out_count is NULL, required fields are invalid, or p_next is non-NULL, or radius/tolerance is invalid.
OCCTL_VERSION_MISMATCHUnsupported struct_version.
OCCTL_GEOMETRY_INVALIDOCCT rejected the tangent construction.
OCCTL_NOT_FOUNDout_circle is non-NULL and solution_index is outside the available solution range.
OCCTL_OUT_OF_MEMORYAllocation failed.

\par Thread Safety Yes.

See also
occtl_curve2d_create_circle, occtl_curve2d_circle_tangent_on_curve_radius_info_init

◆ occtl_curve2d_create_tangent_circle_to_three()

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.

Parameters
[in]graphMust be non-NULL.
[in]infoBorrows it. Versioned solver inputs; must be non-NULL.
[in]solution_indexZero-based solution index to read when out_circle is non-NULL.
[out]out_circleBorrows it. Caller-owned slot, or NULL for count-only query.
[out]out_countBorrows it. Receives the total solution count; must be non-NULL.
Return values
OCCTL_OKOn success.
OCCTL_INVALID_ARGUMENTgraph or info or out_count is NULL, required fields are invalid, or p_next is non-NULL.
OCCTL_VERSION_MISMATCHUnsupported struct_version.
OCCTL_GEOMETRY_INVALIDOCCT rejected the tangent construction.
OCCTL_NOT_FOUNDout_circle is non-NULL and solution_index is outside the available solution range.
OCCTL_OUT_OF_MEMORYAllocation failed.

\par Thread Safety Yes.

See also
occtl_curve2d_create_circle, occtl_curve2d_circle_tangent_to_three_info_init

◆ occtl_curve2d_create_tangent_circle_to_two_radius()

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.

Parameters
[in]graphMust be non-NULL.
[in]infoBorrows it. Versioned solver inputs; must be non-NULL.
[in]solution_indexZero-based solution index to read when out_circle is non-NULL.
[out]out_circleBorrows it. Caller-owned slot, or NULL for count-only query.
[out]out_countBorrows it. Receives the total solution count; must be non-NULL.
Return values
OCCTL_OKOn success.
OCCTL_INVALID_ARGUMENTgraph or info or out_count is NULL, required fields are invalid, or p_next is non-NULL.
OCCTL_VERSION_MISMATCHUnsupported struct_version.
OCCTL_GEOMETRY_INVALIDOCCT rejected the tangent construction.
OCCTL_NOT_FOUNDout_circle is non-NULL and solution_index is outside the available solution range.
OCCTL_OUT_OF_MEMORYAllocation failed.

\par Thread Safety Yes.

See also
occtl_curve2d_create_circle, occtl_curve2d_circle_tangent_to_two_radius_info_init

◆ occtl_curve2d_create_tangent_line_through_point()

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.

Parameters
[in]graphMust be non-NULL.
[in]infoBorrows it. Versioned solver inputs; must be non-NULL.
[in]solution_indexZero-based solution index to read when out_line is non-NULL.
[out]out_lineBorrows it. Caller-owned slot, or NULL for count-only query.
[out]out_countBorrows it. Receives the total solution count; must be non-NULL.
Return values
OCCTL_OKOn success.
OCCTL_INVALID_ARGUMENTgraph or info or out_count is NULL, required fields are invalid, or p_next is non-NULL.
OCCTL_VERSION_MISMATCHUnsupported struct_version.
OCCTL_GEOMETRY_INVALIDOCCT rejected the tangent construction.
OCCTL_NOT_FOUNDout_line is non-NULL and solution_index is outside the available solution range.
OCCTL_OUT_OF_MEMORYAllocation failed.

\par Thread Safety Yes.

See also
occtl_curve2d_create_line, occtl_curve2d_line_tangent_through_point_info_init

◆ occtl_curve2d_create_tangent_line_to_two()

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.

Parameters
[in]graphMust be non-NULL.
[in]infoBorrows it. Versioned solver inputs; must be non-NULL.
[in]solution_indexZero-based solution index to read when out_line is non-NULL.
[out]out_lineBorrows it. Caller-owned slot, or NULL for count-only query.
[out]out_countBorrows it. Receives the total solution count; must be non-NULL.
Return values
OCCTL_OKOn success.
OCCTL_INVALID_ARGUMENTgraph or info or out_count is NULL, required fields are invalid, or p_next is non-NULL.
OCCTL_VERSION_MISMATCHUnsupported struct_version.
OCCTL_GEOMETRY_INVALIDOCCT rejected the tangent construction.
OCCTL_NOT_FOUNDout_line is non-NULL and solution_index is outside the available solution range.
OCCTL_OUT_OF_MEMORYAllocation failed.

\par Thread Safety Yes.

See also
occtl_curve2d_create_line, occtl_curve2d_line_tangent_to_two_info_init

◆ occtl_curve2d_create_tangent_line_with_angle()

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.

Parameters
[in]graphMust be non-NULL.
[in]infoBorrows it. Versioned solver inputs; must be non-NULL.
[in]solution_indexZero-based solution index to read when out_line is non-NULL.
[out]out_lineBorrows it. Caller-owned slot, or NULL for count-only query.
[out]out_countBorrows it. Receives the total solution count; must be non-NULL.
Return values
OCCTL_OKOn success.
OCCTL_INVALID_ARGUMENTgraph 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_MISMATCHUnsupported struct_version.
OCCTL_GEOMETRY_INVALIDOCCT rejected the tangent construction.
OCCTL_NOT_FOUNDout_line is non-NULL and solution_index is outside the available solution range.
OCCTL_OUT_OF_MEMORYAllocation failed.

\par Thread Safety Yes.

See also
occtl_curve2d_create_line, occtl_curve2d_line_tangent_with_angle_info_init

◆ occtl_curve2d_create_trimmed()

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.

Parameters
[in]graphMust be non-NULL.
[out]out_idBorrows it. Caller-allocated slot for the curve rep id. Must be non-NULL.
[in]infoVersioned create-info. Must be non-NULL.
Return values
OCCTL_OKOn success.
OCCTL_INVALID_ARGUMENTgraph or out_id or info is NULL.
OCCTL_VERSION_MISMATCHUnsupported struct_version.
OCCTL_GEOMETRY_INVALIDInvalid interval.
OCCTL_OUT_OF_MEMORYAllocation failed.

\par Thread Safety No (mutates graph).

◆ occtl_curve2d_eval_d0()

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.

Parameters
[in]graphMust be non-NULL.
[in]curve_idCurve to evaluate.
[in]uParameter value.
[out]out_pointReceives the point on the curve. May be NULL.
Return values
OCCTL_OKOn success.
OCCTL_INVALID_ARGUMENTgraph is NULL.
OCCTL_OUT_OF_RANGEParameter is outside the domain.

\par Thread Safety Yes (read-only on graph).

See also
occtl_curve2d_eval_d1, occtl_curve2d_eval_dn

◆ occtl_curve2d_eval_d1()

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.

Parameters
[in]graphMust be non-NULL.
[in]curve_idCurve to evaluate.
[in]uParameter value.
[out]out_pointReceives the point. May be NULL.
[out]out_d1Receives the first derivative vector. May be NULL.
Return values
OCCTL_OKOn success.
OCCTL_INVALID_ARGUMENTgraph is NULL.
OCCTL_OUT_OF_RANGEParameter is outside the domain.

\par Thread Safety Yes (read-only on graph).

See also
occtl_curve2d_eval_d0, occtl_curve2d_eval_d2

◆ occtl_curve2d_eval_d2()

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.

Parameters
[in]graphMust be non-NULL.
[in]curve_idCurve to evaluate.
[in]uParameter value.
[out]out_pointReceives the point. May be NULL.
[out]out_d1Receives the first derivative vector. May be NULL.
[out]out_d2Receives the second derivative vector. May be NULL.
Return values
OCCTL_OKOn success.
OCCTL_INVALID_ARGUMENTgraph is NULL.
OCCTL_OUT_OF_RANGEParameter is outside the domain.

\par Thread Safety Yes (read-only on graph).

See also
occtl_curve2d_eval_d1, occtl_curve2d_eval_d3

◆ occtl_curve2d_eval_d3()

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.

Parameters
[in]graphMust be non-NULL.
[in]curve_idCurve to evaluate.
[in]uParameter value.
[out]out_pointReceives the point. May be NULL.
[out]out_d1Receives the first derivative vector. May be NULL.
[out]out_d2Receives the second derivative vector. May be NULL.
[out]out_d3Receives the third derivative vector. May be NULL.
Return values
OCCTL_OKOn success.
OCCTL_INVALID_ARGUMENTgraph is NULL.
OCCTL_OUT_OF_RANGEParameter is outside the domain.

\par Thread Safety Yes (read-only on graph).

See also
occtl_curve2d_eval_d2, occtl_curve2d_eval_dn

◆ occtl_curve2d_eval_dn()

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.

Parameters
[in]graphMust be non-NULL.
[in]curve_idCurve to evaluate.
[in]uParameter value.
[in]nDerivative order (0 returns a zero-length vector whose origin is on the curve; 1 returns the first derivative, etc.).
[out]out_derivativeReceives the derivative vector. Must be non-NULL.
Return values
OCCTL_OKOn success.
OCCTL_INVALID_ARGUMENTgraph is NULL.
OCCTL_OUT_OF_RANGEParameter is outside the domain.

\par Thread Safety Yes (read-only on graph).

See also
occtl_curve2d_eval_d0, occtl_curve2d_eval_d3

◆ occtl_curve2d_free_bezier_segments()

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.

Parameters
[in]idsOwns it. May be NULL.

\par Thread Safety Yes.

See also
occtl_curve2d_to_bezier_segments

◆ occtl_curve2d_is_closed()

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.

Parameters
[in]graphMust be non-NULL.
[in]curve_idCurve to query.
[out]out_is_closedBorrows it. Caller-allocated slot. Must be non-NULL. 1 if closed, 0 otherwise.
Return values
OCCTL_OKOn success.
OCCTL_INVALID_ARGUMENTgraph or out_is_closed is NULL.

\par Thread Safety Yes (read-only on graph).

See also
occtl_curve2d_is_periodic

◆ occtl_curve2d_is_periodic()

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.

Parameters
[in]graphMust be non-NULL.
[in]curve_idCurve to query.
[out]out_is_periodicBorrows it. Caller-allocated slot. Must be non-NULL. 1 if periodic, 0 otherwise.
Return values
OCCTL_OKOn success.
OCCTL_INVALID_ARGUMENTgraph or out_is_periodic is NULL.

\par Thread Safety Yes (read-only on graph).

◆ occtl_curve2d_kind()

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.

Parameters
[in]graphMust be non-NULL.
[in]curve_idCurve to query.
[out]out_kindBorrows it. Caller-allocated slot. Must be non-NULL.
Return values
OCCTL_OKOn success.
OCCTL_INVALID_ARGUMENTgraph or out_kind is NULL.

\par Thread Safety Yes (read-only on graph).

See also
occtl_curve2d_as_circle, occtl_curve2d_as_ellipse

◆ occtl_curve2d_length()

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.

Parameters
[in]graphMust be non-NULL.
[in]curve_idCurve to measure.
[out]out_lengthReceives the curve length. Must be non-NULL.
Return values
OCCTL_OKOn success.
OCCTL_INVALID_ARGUMENTgraph or out_length is NULL.

\par Thread Safety Yes (read-only on graph).

◆ occtl_curve2d_line_tangent_through_point_info_init()

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.

Parameters
[out]infoBorrows it. NULL-tolerant; no-op when NULL.

\par Thread Safety Yes.

See also
occtl_curve2d_create_tangent_line_through_point

◆ occtl_curve2d_line_tangent_to_two_info_init()

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.

Parameters
[out]infoBorrows it. NULL-tolerant; no-op when NULL.

\par Thread Safety Yes.

See also
occtl_curve2d_create_tangent_line_to_two

◆ occtl_curve2d_line_tangent_with_angle_info_init()

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.

Parameters
[out]infoBorrows it. NULL-tolerant; no-op when NULL.

\par Thread Safety Yes.

See also
occtl_curve2d_create_tangent_line_with_angle

◆ occtl_curve2d_offset_create_info_init()

void occtl_curve2d_offset_create_info_init ( occtl_curve2d_offset_create_info_t info)

Runtime initialiser for occtl_curve2d_offset_create_info_t.

Parameters
[out]infoBorrows it. NULL-tolerant; no-op when NULL.

\par Thread Safety Yes.

See also
occtl_curve2d_create_offset

◆ occtl_curve2d_parameter_of_point()

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.

Parameters
[in]graphMust be non-NULL.
[in]curve_idCurve to query.
[in]pointPoint to find the parameter for.
[out]out_paramReceives the parameter. Must be non-NULL.
Return values
OCCTL_OKOn success.
OCCTL_INVALID_ARGUMENTgraph or out_param is NULL.

\par Thread Safety Yes (read-only on graph).

◆ occtl_curve2d_parameter_range()

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π].

Parameters
[in]graphMust be non-NULL.
[in]curve_idCurve to query.
[out]out_u_minStart parameter. May be NULL.
[out]out_u_maxEnd parameter. May be NULL.
Return values
OCCTL_OKOn success.
OCCTL_INVALID_ARGUMENTgraph is NULL.

\par Thread Safety Yes (read-only on graph).

◆ occtl_curve2d_project_point()

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.

Parameters
[in]graphMust be non-NULL.
[in]curve_idCurve to project onto.
[in]pointPoint to project.
[out]out_paramReceives the parameter of the closest point. Must be non-NULL.
[out]out_distanceReceives the shortest distance. May be NULL.
Return values
OCCTL_OKOn success.
OCCTL_INVALID_ARGUMENTgraph or out_param is NULL.

\par Thread Safety Yes (read-only on graph).

◆ occtl_curve2d_reverse()

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.

Parameters
[in]graphMust be non-NULL.
[in]curve_idCurve to reverse.
[out]out_idBorrows it. Caller-allocated slot for the reversed curve rep id. Must be non-NULL.
Return values
OCCTL_OKOn success.
OCCTL_INVALID_ARGUMENTgraph or out_id is NULL.
OCCTL_OUT_OF_MEMORYAllocation failed.

\par Thread Safety No (mutates graph).

◆ occtl_curve2d_rotated()

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.

Parameters
[in]graphMust be non-NULL.
[in]curve_idCurve to rotate.
[in]angleRotation angle in radians.
[out]out_idBorrows it. Caller-allocated slot for the rotated curve rep id. Must be non-NULL.
Return values
OCCTL_OKOn success.
OCCTL_INVALID_ARGUMENTgraph or out_id is NULL.
OCCTL_OUT_OF_MEMORYAllocation failed.

\par Thread Safety No (mutates graph).

◆ occtl_curve2d_scaled()

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.

Parameters
[in]graphMust be non-NULL.
[in]curve_idCurve to scale.
[in]originOrigin point for scaling.
[in]factorScale factor; must be non-zero.
[out]out_idBorrows it. Caller-allocated slot for the scaled curve rep id. Must be non-NULL.
Return values
OCCTL_OKOn success.
OCCTL_INVALID_ARGUMENTgraph or out_id is NULL.
OCCTL_GEOMETRY_INVALIDfactor is zero.
OCCTL_OUT_OF_MEMORYAllocation failed.

\par Thread Safety No (mutates graph).

◆ occtl_curve2d_to_bezier_segments()

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.

Parameters
[in]graphMust be non-NULL.
[in]curve_idCurve to decompose.
[in]optionsBorrows it. May be NULL for default full-domain options.
[out]out_segmentsOwns it. Receives a caller-owned array of Bezier curve rep ids. Must be non-NULL. Free with occtl_curve2d_free_bezier_segments.
[out]out_countBorrows it. Receives the number of returned segments. Must be non-NULL.
Return values
OCCTL_OKOn success.
OCCTL_INVALID_ARGUMENTgraph, 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_MISMATCHUnsupported options->struct_version.
OCCTL_GEOMETRY_INVALIDOCCT could not convert or segment the curve.
OCCTL_OUT_OF_MEMORYAllocation failed.

\par Thread Safety Yes.

See also
occtl_curve2d_create_bezier, occtl_curve_bezier_segments_options_init

◆ occtl_curve2d_transformed()

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.

Parameters
[in]graphMust be non-NULL.
[in]curve_idCurve to transform.
[in]translate_xTranslation along X.
[in]translate_yTranslation along Y.
[in]rotate_angleRotation angle in radians.
[in]scale_xScale factor along X.
[in]scale_yScale factor along Y.
[out]out_idBorrows it. Caller-allocated slot for the transformed curve rep id. Must be non-NULL.
Return values
OCCTL_OKOn success.
OCCTL_INVALID_ARGUMENTgraph or out_id is NULL.
OCCTL_OUT_OF_MEMORYAllocation failed.

\par Thread Safety No (mutates graph).

◆ occtl_curve2d_translated()

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.

Parameters
[in]graphMust be non-NULL.
[in]curve_idCurve to translate.
[in]deltaTranslation vector in 2D.
[out]out_idBorrows it. Caller-allocated slot for the translated curve rep id. Must be non-NULL.
Return values
OCCTL_OKOn success.
OCCTL_INVALID_ARGUMENTgraph or out_id is NULL.
OCCTL_OUT_OF_MEMORYAllocation failed.

\par Thread Safety No (mutates graph).