|
OCCT-Light 0.1
C ABI and C++ veneer for multi-language CAD workflows
|
OCCT-Light: surface geometry via graph + rep_id. More...


Go to the source code of this file.
Classes | |
| struct | occtl_surface_revolution_create_info |
| struct | occtl_surface_extrusion_create_info |
| struct | occtl_surface_rectangular_trimmed_create_info |
| struct | occtl_surface_offset_create_info |
| struct | occtl_surface_bspline_create_info |
| struct | occtl_surface_bezier_create_info |
| struct | occtl_surface_bspline |
| struct | occtl_surface_interpolated_info |
| struct | occtl_surface_approximated_info |
| struct | occtl_surface_point_grid_create_info |
| struct | occtl_surface_boundary_curves_create_info |
| struct | occtl_surface_gordon_create_info |
| struct | occtl_surface_curve_grid_create_info |
Macros | |
| #define | OCCTL_SURFACE_REVOLUTION_CREATE_INFO_VERSION_1 1u |
| #define | OCCTL_SURFACE_REVOLUTION_CREATE_INFO_INIT |
| #define | OCCTL_SURFACE_EXTRUSION_CREATE_INFO_VERSION_1 1u |
| #define | OCCTL_SURFACE_EXTRUSION_CREATE_INFO_INIT {OCCTL_SURFACE_EXTRUSION_CREATE_INFO_VERSION_1, NULL, OCCTL_REP_ID_INVALID, {0.0, 0.0, 1.0}} |
| #define | OCCTL_SURFACE_RECTANGULAR_TRIMMED_CREATE_INFO_VERSION_1 1u |
| #define | OCCTL_SURFACE_RECTANGULAR_TRIMMED_CREATE_INFO_INIT |
| #define | OCCTL_SURFACE_OFFSET_CREATE_INFO_VERSION_1 1u |
| #define | OCCTL_SURFACE_OFFSET_CREATE_INFO_INIT {OCCTL_SURFACE_OFFSET_CREATE_INFO_VERSION_1, NULL, OCCTL_REP_ID_INVALID, 0.0} |
| #define | OCCTL_SURFACE_BSPLINE_CREATE_INFO_VERSION_1 1u |
| #define | OCCTL_SURFACE_BSPLINE_CREATE_INFO_INIT |
| #define | OCCTL_SURFACE_BEZIER_CREATE_INFO_VERSION_1 1u |
| #define | OCCTL_SURFACE_BEZIER_CREATE_INFO_INIT {OCCTL_SURFACE_BEZIER_CREATE_INFO_VERSION_1, NULL, NULL, 0, 0, NULL} |
| #define | OCCTL_SURFACE_BSPLINE_VERSION_1 1u |
| #define | OCCTL_SURFACE_BSPLINE_INIT |
| #define | OCCTL_SURFACE_INTERPOLATED_INFO_VERSION_1 1u |
| #define | OCCTL_SURFACE_INTERPOLATED_INFO_INIT {OCCTL_SURFACE_INTERPOLATED_INFO_VERSION_1, NULL, NULL, 0, 0, 0} |
| #define | OCCTL_SURFACE_APPROXIMATED_INFO_VERSION_1 1u |
| #define | OCCTL_SURFACE_APPROXIMATED_INFO_INIT {OCCTL_SURFACE_APPROXIMATED_INFO_VERSION_1, NULL, NULL, 0, 0, 1, 3, 1e-3} |
| #define | OCCTL_SURFACE_POINT_GRID_CREATE_INFO_VERSION_1 1u |
| #define | OCCTL_SURFACE_POINT_GRID_CREATE_INFO_INIT |
| #define | OCCTL_SURFACE_BOUNDARY_CURVES_CREATE_INFO_VERSION_1 1u |
| #define | OCCTL_SURFACE_BOUNDARY_CURVES_CREATE_INFO_INIT |
| #define | OCCTL_SURFACE_GORDON_CREATE_INFO_VERSION_1 1u |
| #define | OCCTL_SURFACE_GORDON_CREATE_INFO_INIT {OCCTL_SURFACE_GORDON_CREATE_INFO_VERSION_1, NULL, NULL, 0, NULL, 0, 1.0e-7, 0} |
| #define | OCCTL_SURFACE_CURVE_GRID_CREATE_INFO_VERSION_1 1u |
| #define | OCCTL_SURFACE_CURVE_GRID_CREATE_INFO_INIT {OCCTL_SURFACE_CURVE_GRID_CREATE_INFO_VERSION_1, NULL, NULL, 0, NULL, 0, 1.0e-7, 0} |
Enumerations | |
| enum | occtl_surface_kind { OCCTL_SURFACE_KIND_PLANE = 0 , OCCTL_SURFACE_KIND_CYLINDRICAL = 1 , OCCTL_SURFACE_KIND_CONICAL = 2 , OCCTL_SURFACE_KIND_SPHERICAL = 3 , OCCTL_SURFACE_KIND_TOROIDAL = 4 , OCCTL_SURFACE_KIND_BSPLINE = 5 , OCCTL_SURFACE_KIND_BEZIER = 6 , OCCTL_SURFACE_KIND_REVOLUTION = 7 , OCCTL_SURFACE_KIND_EXTRUSION = 8 , OCCTL_SURFACE_KIND_RECTANGULAR_TRIMMED , OCCTL_SURFACE_KIND_OFFSET = 10 , OCCTL_SURFACE_KIND_UNDEFINED = 11 , OCCTL_SURFACE_KIND_RESERVED_FUTURE = 0x7fffffff } |
| enum | occtl_surface_point_grid_mode { OCCTL_SURFACE_POINT_GRID_MODE_APPROXIMATE = 0 , OCCTL_SURFACE_POINT_GRID_MODE_INTERPOLATE = 1 , OCCTL_SURFACE_POINT_GRID_MODE_RESERVED_FUTURE = 0x7fffffff } |
| enum | occtl_surface_filling_style { OCCTL_SURFACE_FILLING_STRETCH = 0 , OCCTL_SURFACE_FILLING_COONS = 1 , OCCTL_SURFACE_FILLING_CURVED = 2 , OCCTL_SURFACE_FILLING_RESERVED_FUTURE = 0x7fffffff } |
OCCT-Light: surface geometry via graph + rep_id.
Surface geometry is accessed and created through the BRepGraph topology DAG using occtl_rep_id_t identifiers. Every surface function takes an occtl_graph_t* as the first argument followed by the surface's rep id.
Constructors and query functions write output rep ids into caller-provided slots. The caller passes the graph that owns the surface representation; all rep ids are scoped to that graph instance.
| #define OCCTL_SURFACE_BOUNDARY_CURVES_CREATE_INFO_INIT |
| #define OCCTL_SURFACE_BSPLINE_CREATE_INFO_INIT |
| #define OCCTL_SURFACE_BSPLINE_INIT |
| #define OCCTL_SURFACE_POINT_GRID_CREATE_INFO_INIT |
| #define OCCTL_SURFACE_RECTANGULAR_TRIMMED_CREATE_INFO_INIT |
| #define OCCTL_SURFACE_REVOLUTION_CREATE_INFO_INIT |
| typedef struct occtl_surface_approximated_info occtl_surface_approximated_info_t |
Versioned create-info struct for surface approximation.
Fits a B-spline surface to the given point grid within tolerance using OCCT's GeomAPI_PointsToBSplineSurface.
Versioned create-info struct for Bezier surface construction.
Poles are stored row-major: index = u * v_pole_count + v.
| typedef struct occtl_surface_boundary_curves_create_info occtl_surface_boundary_curves_create_info_t |
Versioned create-info struct for a B-spline surface from boundary curves.
Builds a filled B-spline surface from two, three, or four contiguous boundary curves. Input curves are specified as rep ids in the graph.
Versioned create-info struct for B-spline surface construction.
Poles are stored row-major: index = u * v_pole_count + v. U and V knot sequences are each in compact form (distinct + multiplicities).
| typedef struct occtl_surface_bspline occtl_surface_bspline_t |
Aggregate inspection view of a B-spline surface.
Read-only snapshot of every field a caller typically needs in the same pass: scalars (U/V degree, periodicity, rational flag, per-direction counts) plus borrowed pointers into the underlying OCCT storage for the pole grid, weight grid, distinct U/V knots, U/V multiplicities, and the expanded U/V flat knot sequences. One call replaces ~16 atomized accessors; pair with occtl_surface_as_bspline.
Pointers in out borrow from the surface rep and are valid while the rep exists in the graph.
The pole and weight grids are stored row-major with U as the major (slow-varying) axis: element (u_index, v_index) is at poles[u_index * v_pole_count + v_index]. This layout matches occtl_surface_bspline_create_info_t so values flow round-trip without reshuffling.
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.
Versioned create-info struct for curve-grid surface construction.
Builds a B-spline surface from an intersecting grid of U-direction and V-direction curves. This is a binding-friendly semantic wrapper over OCCT's Gordon surface construction.
Versioned create-info for a surface of linear extrusion.
The profile curve is swept along direction to form the surface.
| typedef enum occtl_surface_filling_style occtl_surface_filling_style_t |
Filling style for occtl_surface_create_from_boundary_curves.
Versioned create-info struct for Gordon surface construction.
Builds a B-spline surface interpolating a network of profile and guide curves. Profiles and guides are specified as rep id arrays; each array must contain at least two valid entries.
| typedef struct occtl_surface_interpolated_info occtl_surface_interpolated_info_t |
Versioned create-info struct for surface interpolation.
Interpolates a B-spline surface passing through the given grid of points. Points are stored row-major: index = u * v_point_count + v. Uses OCCT's GeomAPI_PointsToBSplineSurface internally with uniform parameters.
| typedef enum occtl_surface_kind occtl_surface_kind_t |
Discriminates the underlying geometry of a surface rep.
Versioned create-info for an offset surface.
Versioned create-info struct for point-grid surface construction.
Builds a B-spline surface from a row-major point grid. Approximation mode uses degree range and tolerance. Interpolation mode uses only the point grid and U periodic flag.
Selects the OCCT point-grid fitting algorithm.
| typedef struct occtl_surface_rectangular_trimmed_create_info occtl_surface_rectangular_trimmed_create_info_t |
Versioned create-info for a rectangular-trimmed surface.
Trims the basis surface to the parametric box [u_first, u_last] x [v_first, v_last]. When trim_u is non-zero the trim is applied in U; when trim_v is non-zero it is applied in V.
Versioned create-info for a surface of revolution.
The profile curve is rotated 2pi around axis to form the surface. The basis must be a valid curve rep id in the graph.
Filling style for occtl_surface_create_from_boundary_curves.
| Enumerator | |
|---|---|
| OCCTL_SURFACE_FILLING_STRETCH | Flattest OCCT filling style. |
| OCCTL_SURFACE_FILLING_COONS | Coons-style rounded patch. |
| OCCTL_SURFACE_FILLING_CURVED | Most rounded OCCT filling style. |
| enum occtl_surface_kind |
Discriminates the underlying geometry of a surface rep.
| void occtl_surface_approximated_info_init | ( | occtl_surface_approximated_info_t * | info | ) |
Runtime initialiser for occtl_surface_approximated_info_t.
| [out] | info | Borrows it. NULL-tolerant; no-op when NULL. |
\par Thread Safety Yes.
| occtl_status_t occtl_surface_area | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | surface_id, | ||
| double * | out_area | ||
| ) |
Computes the surface area over the full bounded UV parameter domain.
Unbounded surfaces, such as an infinite plane, cannot produce a finite area.
| [in] | graph | Graph containing the surface. Must be non-NULL. |
| [in] | surface_id | Surface rep id. Must be valid. |
| [out] | out_area | Receives the surface area. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_area is NULL, or surface_id is invalid. |
| OCCTL_GEOMETRY_INVALID | The surface is invalid or unbounded. |
\par Thread Safety Yes.
| occtl_status_t occtl_surface_as_bspline | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | surface_id, | ||
| occtl_surface_bspline_t * | out | ||
| ) |
Fills a caller-allocated occtl_surface_bspline_t with a complete read-only inspection view of the underlying B-spline surface.
Pointers in out borrow from the surface rep and are valid while the rep exists in the graph.
| [in] | graph | Graph containing the surface. Must be non-NULL. |
| [in] | surface_id | Surface rep id. Must be valid; kind must be OCCTL_SURFACE_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, or surface_id is invalid. |
| OCCTL_VERSION_MISMATCH | out->struct_version is not supported. |
| OCCTL_WRONG_KIND | Surface is not a B-spline surface. |
\par Thread Safety Yes (read-only).
| occtl_status_t occtl_surface_as_cone | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | surface_id, | ||
| occtl_geom_conical_surface_t * | out_cone | ||
| ) |
Extracts conical surface data.
| [in] | graph | Graph containing the surface. Must be non-NULL. |
| [in] | surface_id | Surface rep id. Must be valid; kind must be OCCTL_SURFACE_KIND_CONICAL. |
| [out] | out_cone | Borrows it (caller-allocated slot). Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_cone is NULL, or surface_id is invalid. |
| OCCTL_WRONG_KIND | Surface is not a conical surface. |
\par Thread Safety Yes.
| occtl_status_t occtl_surface_as_cylinder | ( | occtl_graph_t * | graph, |
| occtl_rep_id_t | surface_id, | ||
| occtl_geom_cylindrical_surface_t * | out_cylinder | ||
| ) |
Extracts cylindrical surface data.
| [in] | graph | Graph containing the surface. Must be non-NULL. |
| [in] | surface_id | Surface rep id. Must be valid; kind must be OCCTL_SURFACE_KIND_CYLINDRICAL. |
| [out] | out_cylinder | Borrows it (caller-allocated slot). Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_cylinder is NULL, or surface_id is invalid. |
| OCCTL_WRONG_KIND | Surface is not a cylindrical surface. |
\par Thread Safety Yes.
| occtl_status_t occtl_surface_as_extrusion | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | surface_id, | ||
| occtl_vector3_t * | out_direction | ||
| ) |
Extracts the direction of a surface of linear extrusion.
| [in] | graph | Graph containing the surface. Must be non-NULL. |
| [in] | surface_id | Surface rep id. Must be valid; kind must be OCCTL_SURFACE_KIND_EXTRUSION. |
| [out] | out_direction | Extrusion direction. May be NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL or surface_id is invalid. |
| OCCTL_WRONG_KIND | Surface is not a surface of linear extrusion. |
\par Thread Safety Yes.
| occtl_status_t occtl_surface_as_offset | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | surface_id, | ||
| double * | out_offset | ||
| ) |
Extracts the signed offset distance of an offset surface.
| [in] | graph | Graph containing the surface. Must be non-NULL. |
| [in] | surface_id | Surface rep id. Must be valid; kind must be OCCTL_SURFACE_KIND_OFFSET. |
| [out] | out_offset | Signed offset distance. May be NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL or surface_id is invalid. |
| OCCTL_WRONG_KIND | Surface is not an offset surface. |
\par Thread Safety Yes.
| occtl_status_t occtl_surface_as_plane | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | surface_id, | ||
| occtl_geom_plane_t * | out_plane | ||
| ) |
Extracts plane data from a surface rep.
| [in] | graph | Graph containing the surface. Must be non-NULL. |
| [in] | surface_id | Surface rep id. Must be valid; kind must be OCCTL_SURFACE_KIND_PLANE. |
| [out] | out_plane | Borrows it (caller-allocated slot). Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_plane is NULL, or surface_id is invalid. |
| OCCTL_WRONG_KIND | Surface is not a plane. |
\par Thread Safety Yes.
| occtl_status_t occtl_surface_as_rectangular_trimmed | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | surface_id, | ||
| double * | out_u_first, | ||
| double * | out_u_last, | ||
| double * | out_v_first, | ||
| double * | out_v_last | ||
| ) |
Extracts the parametric trim bounds of a rectangular-trimmed surface.
| [in] | graph | Graph containing the surface. Must be non-NULL. |
| [in] | surface_id | Surface rep id. Must be valid; kind must be OCCTL_SURFACE_KIND_RECTANGULAR_TRIMMED. |
| [out] | out_u_first | First U trim bound. May be NULL. |
| [out] | out_u_last | Last U trim bound. May be NULL. |
| [out] | out_v_first | First V trim bound. May be NULL. |
| [out] | out_v_last | Last V trim bound. May be NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL or surface_id is invalid. |
| OCCTL_WRONG_KIND | Surface is not a rectangular-trimmed surface. |
\par Thread Safety Yes.
| occtl_status_t occtl_surface_as_revolution | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | surface_id, | ||
| occtl_axis1_placement_t * | out_axis | ||
| ) |
Extracts the rotation axis of a surface of revolution.
| [in] | graph | Graph containing the surface. Must be non-NULL. |
| [in] | surface_id | Surface rep id. Must be valid; kind must be OCCTL_SURFACE_KIND_REVOLUTION. |
| [out] | out_axis | Rotation axis. May be NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL or surface_id is invalid. |
| OCCTL_WRONG_KIND | Surface is not a surface of revolution. |
\par Thread Safety Yes.
| occtl_status_t occtl_surface_as_sphere | ( | occtl_graph_t * | graph, |
| occtl_rep_id_t | surface_id, | ||
| occtl_geom_spherical_surface_t * | out_sphere | ||
| ) |
Extracts spherical surface data.
| [in] | graph | Graph containing the surface. Must be non-NULL. |
| [in] | surface_id | Surface rep id. Must be valid; kind must be OCCTL_SURFACE_KIND_SPHERICAL. |
| [out] | out_sphere | Borrows it (caller-allocated slot). Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_sphere is NULL, or surface_id is invalid. |
| OCCTL_WRONG_KIND | Surface is not a spherical surface. |
\par Thread Safety Yes.
| occtl_status_t occtl_surface_as_torus | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | surface_id, | ||
| occtl_geom_toroidal_surface_t * | out_torus | ||
| ) |
Extracts toroidal surface data.
| [in] | graph | Graph containing the surface. Must be non-NULL. |
| [in] | surface_id | Surface rep id. Must be valid; kind must be OCCTL_SURFACE_KIND_TOROIDAL. |
| [out] | out_torus | Borrows it (caller-allocated slot). Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_torus is NULL, or surface_id is invalid. |
| OCCTL_WRONG_KIND | Surface is not a toroidal surface. |
\par Thread Safety Yes.
| void occtl_surface_bezier_create_info_init | ( | occtl_surface_bezier_create_info_t * | info | ) |
Runtime initialiser for occtl_surface_bezier_create_info_t.
| [out] | info | Borrows it. NULL-tolerant; no-op when NULL. |
\par Thread Safety Yes.
| occtl_status_t occtl_surface_bezier_is_rational | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | surface_id, | ||
| int32_t * | out_is_rational | ||
| ) |
Returns non-zero if the Bezier surface is rational (in U or V).
| [in] | graph | Graph containing the surface. Must be non-NULL. |
| [in] | surface_id | Surface rep id. Must be valid. |
| [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, or surface_id is invalid. |
| OCCTL_WRONG_KIND | Surface is not a Bezier. |
\par Thread Safety Yes.
| occtl_status_t occtl_surface_bezier_u_degree | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | surface_id, | ||
| int32_t * | out_degree | ||
| ) |
Returns the U degree of a Bezier surface.
| [in] | graph | Graph containing the surface. Must be non-NULL. |
| [in] | surface_id | Surface rep id. Must be valid. |
| [out] | out_degree | Receives the U degree. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_degree is NULL, or surface_id is invalid. |
| OCCTL_WRONG_KIND | Surface is not a Bezier. |
\par Thread Safety Yes.
| occtl_status_t occtl_surface_bezier_u_pole_count | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | surface_id, | ||
| size_t * | out_count | ||
| ) |
Returns the number of poles in the U direction of a Bezier surface.
| [in] | graph | Graph containing the surface. Must be non-NULL. |
| [in] | surface_id | Surface rep id. Must be valid. |
| [out] | out_count | Receives the U pole count. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL, or surface_id is invalid. |
| OCCTL_WRONG_KIND | Surface is not a Bezier. |
\par Thread Safety Yes.
| occtl_status_t occtl_surface_bezier_v_degree | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | surface_id, | ||
| int32_t * | out_degree | ||
| ) |
Returns the V degree of a Bezier surface.
| [in] | graph | Graph containing the surface. Must be non-NULL. |
| [in] | surface_id | Surface rep id. Must be valid. |
| [out] | out_degree | Receives the V degree. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_degree is NULL, or surface_id is invalid. |
| OCCTL_WRONG_KIND | Surface is not a Bezier. |
\par Thread Safety Yes.
| occtl_status_t occtl_surface_bezier_v_pole_count | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | surface_id, | ||
| size_t * | out_count | ||
| ) |
Returns the number of poles in the V direction of a Bezier surface.
| [in] | graph | Graph containing the surface. Must be non-NULL. |
| [in] | surface_id | Surface rep id. Must be valid. |
| [out] | out_count | Receives the V pole count. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL, or surface_id is invalid. |
| OCCTL_WRONG_KIND | Surface is not a Bezier. |
\par Thread Safety Yes.
| void occtl_surface_boundary_curves_create_info_init | ( | occtl_surface_boundary_curves_create_info_t * | info | ) |
Runtime initialiser for occtl_surface_boundary_curves_create_info_t.
| [out] | info | Borrows it. NULL-tolerant; no-op when NULL. |
\par Thread Safety Yes.
| void occtl_surface_bspline_create_info_init | ( | occtl_surface_bspline_create_info_t * | info | ) |
Runtime initialiser for occtl_surface_bspline_create_info_t.
| [out] | info | Borrows it. NULL-tolerant; no-op when NULL. |
\par Thread Safety Yes.
| void occtl_surface_bspline_init | ( | occtl_surface_bspline_t * | out | ) |
Runtime initialiser for occtl_surface_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_surface_bspline_is_rational | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | surface_id, | ||
| int32_t * | out_is_rational | ||
| ) |
Returns non-zero if the B-spline surface is rational.
| [in] | graph | Graph containing the surface. Must be non-NULL. |
| [in] | surface_id | Surface rep id. Must be valid. |
| [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, or surface_id is invalid. |
| OCCTL_WRONG_KIND | Surface is not a B-spline. |
\par Thread Safety Yes.
| occtl_status_t occtl_surface_bspline_poles | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | surface_id, | ||
| occtl_point3_t * | out_buf, | ||
| size_t | capacity, | ||
| size_t * | out_count | ||
| ) |
Extracts the poles of a B-spline surface. Two-call pattern.
Poles are returned row-major: index = u * v_pole_count + v.
| [in] | graph | Graph containing the surface. Must be non-NULL. |
| [in] | surface_id | Surface rep id. Must be valid; kind must be OCCTL_SURFACE_KIND_BSPLINE. |
| [out] | out_buf | May be NULL on sizing call. |
| [in] | capacity | Elements out_buf can hold. |
| [out] | out_count | Required count (= u_pole_count * v_pole_count). Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL, or surface_id is invalid. |
| OCCTL_WRONG_KIND | Not a B-spline. |
| OCCTL_BUFFER_TOO_SMALL | Buffer too small. |
\par Thread Safety Yes.
| occtl_status_t occtl_surface_bspline_poles_view | ( | occtl_graph_t * | graph, |
| occtl_rep_id_t | surface_id, | ||
| const occtl_point3_t ** | out_data, | ||
| size_t * | out_u_count, | ||
| size_t * | out_v_count | ||
| ) |
Zero-copy view of the poles array of a B-spline surface.
Returns a direct pointer into the OCCT internal storage and the U / V pole counts. Layout is row-major: index = u * v_pole_count + v. Valid only while the surface rep is alive in the graph and no mutating call has been made on it.
| [in] | graph | Graph containing the surface. Must be non-NULL. |
| [in] | surface_id | Surface rep id. Must be valid; kind must be OCCTL_SURFACE_KIND_BSPLINE. |
| [out] | out_data | Receives a borrowed pointer to the pole array. Must be non-NULL. |
| [out] | out_u_count | Receives the number of poles in U. Must be non-NULL. |
| [out] | out_v_count | Receives the number of poles in V. Must be non-NULL. |
| OCCTL_OK | |
| OCCTL_INVALID_ARGUMENT | Any out-pointer is NULL, or surface_id is invalid. |
| OCCTL_WRONG_KIND | Surface is not a B-spline. |
| OCCTL_INTERNAL | OCCT's internal pole array is not contiguous row-major (does not occur with current OCCT; reported defensively if a future OCCT version changes the layout). |
\par Thread Safety Yes (read-only).
| occtl_status_t occtl_surface_bspline_u_degree | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | surface_id, | ||
| int32_t * | out_degree | ||
| ) |
Returns the U degree of a B-spline surface.
| [in] | graph | Graph containing the surface. Must be non-NULL. |
| [in] | surface_id | Surface rep id. Must be valid. |
| [out] | out_degree | Receives the U degree. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_degree is NULL, or surface_id is invalid. |
| OCCTL_WRONG_KIND | Surface is not a B-spline. |
\par Thread Safety Yes.
| occtl_status_t occtl_surface_bspline_u_flat_knots | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | surface_id, | ||
| double * | out_buf, | ||
| size_t | capacity, | ||
| size_t * | out_count | ||
| ) |
Extracts the expanded (flat) U knot sequence of a B-spline surface. Two-call pattern.
The flat sequence repeats each distinct knot value by its multiplicity. Its length equals sum(u_multiplicities), which is the standard B-spline knot vector consumed by most numerical libraries.
| [in] | graph | Graph containing the surface. Must be non-NULL. |
| [in] | surface_id | Surface rep id. Must be valid; kind must be OCCTL_SURFACE_KIND_BSPLINE. |
| [out] | out_buf | May be NULL on the sizing call. |
| [in] | capacity | Number of double elements out_buf can hold. |
| [out] | out_count | Receives the required count. Must be non-NULL. |
| OCCTL_OK | On success (including the sizing call). |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL, or surface_id is invalid. |
| OCCTL_WRONG_KIND | Handle is not a B-spline. |
| OCCTL_BUFFER_TOO_SMALL | capacity is smaller than *out_count. |
\par Thread Safety Yes.
| occtl_status_t occtl_surface_bspline_u_knot_count | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | surface_id, | ||
| size_t * | out_count | ||
| ) |
Returns the number of distinct U knot values of a B-spline surface.
| [in] | graph | Graph containing the surface. Must be non-NULL. |
| [in] | surface_id | Surface rep id. Must be valid. |
| [out] | out_count | Receives the U knot count. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL, or surface_id is invalid. |
| OCCTL_WRONG_KIND | Surface is not a B-spline. |
\par Thread Safety Yes.
| occtl_status_t occtl_surface_bspline_u_knots | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | surface_id, | ||
| double * | out_buf, | ||
| size_t | capacity, | ||
| size_t * | out_count | ||
| ) |
Extracts the distinct U knot values of a B-spline surface. Two-call pattern.
| [in] | graph | Graph containing the surface. Must be non-NULL. |
| [in] | surface_id | Surface rep id. Must be valid. |
| [out] | out_buf | May be NULL on sizing call. |
| [in] | capacity | Elements out_buf can hold. |
| [out] | out_count | Required count. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL, or surface_id is invalid. |
| OCCTL_WRONG_KIND | Not a B-spline. |
| OCCTL_BUFFER_TOO_SMALL | Buffer too small. |
\par Thread Safety Yes.
| occtl_status_t occtl_surface_bspline_u_multiplicities | ( | occtl_graph_t * | graph, |
| occtl_rep_id_t | surface_id, | ||
| int32_t * | out_buf, | ||
| size_t | capacity, | ||
| size_t * | out_count | ||
| ) |
Extracts the U knot multiplicities of a B-spline surface. Two-call pattern.
| [in] | graph | Graph containing the surface. Must be non-NULL. |
| [in] | surface_id | Surface rep id. Must be valid. |
| [out] | out_buf | May be NULL on sizing call. |
| [in] | capacity | Elements out_buf can hold. |
| [out] | out_count | Required count. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL, or surface_id is invalid. |
| OCCTL_WRONG_KIND | Not a B-spline. |
| OCCTL_BUFFER_TOO_SMALL | Buffer too small. |
\par Thread Safety Yes.
| occtl_status_t occtl_surface_bspline_u_pole_count | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | surface_id, | ||
| size_t * | out_count | ||
| ) |
Returns the number of poles in the U direction of a B-spline surface.
| [in] | graph | Graph containing the surface. Must be non-NULL. |
| [in] | surface_id | Surface rep id. Must be valid. |
| [out] | out_count | Receives the U pole count. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL, or surface_id is invalid. |
| OCCTL_WRONG_KIND | Surface is not a B-spline. |
\par Thread Safety Yes.
| occtl_status_t occtl_surface_bspline_v_degree | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | surface_id, | ||
| int32_t * | out_degree | ||
| ) |
Returns the V degree of a B-spline surface.
| [in] | graph | Graph containing the surface. Must be non-NULL. |
| [in] | surface_id | Surface rep id. Must be valid. |
| [out] | out_degree | Receives the V degree. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_degree is NULL, or surface_id is invalid. |
| OCCTL_WRONG_KIND | Surface is not a B-spline. |
\par Thread Safety Yes.
| occtl_status_t occtl_surface_bspline_v_flat_knots | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | surface_id, | ||
| double * | out_buf, | ||
| size_t | capacity, | ||
| size_t * | out_count | ||
| ) |
Extracts the expanded (flat) V knot sequence of a B-spline surface. Two-call pattern.
The flat sequence repeats each distinct knot value by its multiplicity. Its length equals sum(v_multiplicities), which is the standard B-spline knot vector consumed by most numerical libraries.
| [in] | graph | Graph containing the surface. Must be non-NULL. |
| [in] | surface_id | Surface rep id. Must be valid; kind must be OCCTL_SURFACE_KIND_BSPLINE. |
| [out] | out_buf | May be NULL on the sizing call. |
| [in] | capacity | Number of double elements out_buf can hold. |
| [out] | out_count | Receives the required count. Must be non-NULL. |
| OCCTL_OK | On success (including the sizing call). |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL, or surface_id is invalid. |
| OCCTL_WRONG_KIND | Handle is not a B-spline. |
| OCCTL_BUFFER_TOO_SMALL | capacity is smaller than *out_count. |
\par Thread Safety Yes.
| occtl_status_t occtl_surface_bspline_v_knot_count | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | surface_id, | ||
| size_t * | out_count | ||
| ) |
Returns the number of distinct V knot values of a B-spline surface.
| [in] | graph | Graph containing the surface. Must be non-NULL. |
| [in] | surface_id | Surface rep id. Must be valid. |
| [out] | out_count | Receives the V knot count. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL, or surface_id is invalid. |
| OCCTL_WRONG_KIND | Surface is not a B-spline. |
\par Thread Safety Yes.
| occtl_status_t occtl_surface_bspline_v_knots | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | surface_id, | ||
| double * | out_buf, | ||
| size_t | capacity, | ||
| size_t * | out_count | ||
| ) |
Extracts the distinct V knot values of a B-spline surface. Two-call pattern.
| [in] | graph | Graph containing the surface. Must be non-NULL. |
| [in] | surface_id | Surface rep id. Must be valid. |
| [out] | out_buf | May be NULL on sizing call. |
| [in] | capacity | Elements out_buf can hold. |
| [out] | out_count | Required count. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL, or surface_id is invalid. |
| OCCTL_WRONG_KIND | Not a B-spline. |
| OCCTL_BUFFER_TOO_SMALL | Buffer too small. |
\par Thread Safety Yes.
| occtl_status_t occtl_surface_bspline_v_multiplicities | ( | occtl_graph_t * | graph, |
| occtl_rep_id_t | surface_id, | ||
| int32_t * | out_buf, | ||
| size_t | capacity, | ||
| size_t * | out_count | ||
| ) |
Extracts the V knot multiplicities of a B-spline surface. Two-call pattern.
| [in] | graph | Graph containing the surface. Must be non-NULL. |
| [in] | surface_id | Surface rep id. Must be valid. |
| [out] | out_buf | May be NULL on sizing call. |
| [in] | capacity | Elements out_buf can hold. |
| [out] | out_count | Required count. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL, or surface_id is invalid. |
| OCCTL_WRONG_KIND | Not a B-spline. |
| OCCTL_BUFFER_TOO_SMALL | Buffer too small. |
\par Thread Safety Yes.
| occtl_status_t occtl_surface_bspline_v_pole_count | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | surface_id, | ||
| size_t * | out_count | ||
| ) |
Returns the number of poles in the V direction of a B-spline surface.
| [in] | graph | Graph containing the surface. Must be non-NULL. |
| [in] | surface_id | Surface rep id. Must be valid. |
| [out] | out_count | Receives the V pole count. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL, or surface_id is invalid. |
| OCCTL_WRONG_KIND | Surface is not a B-spline. |
\par Thread Safety Yes.
| occtl_status_t occtl_surface_bspline_weights | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | surface_id, | ||
| double * | out_buf, | ||
| size_t | capacity, | ||
| size_t * | out_count | ||
| ) |
Extracts the per-pole weights of a rational B-spline surface. Two-call pattern.
Layout matches the poles array: row-major index = u * v_pole_count + v.
| [in] | graph | Graph containing the surface. Must be non-NULL. |
| [in] | surface_id | Surface rep id. Must be valid. |
| [out] | out_buf | Output buffer, or NULL for sizing. |
| [in] | capacity | Capacity of out_buf in doubles. |
| [out] | out_count | Required/filled double count. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL, or surface_id is invalid. |
| OCCTL_WRONG_KIND | Not a B-spline or surface is non-rational. |
| OCCTL_BUFFER_TOO_SMALL | Buffer too small. |
\par Thread Safety Yes.
| occtl_status_t occtl_surface_continuity | ( | occtl_graph_t * | graph, |
| occtl_rep_id_t | surface_id, | ||
| occtl_geom_continuity_t * | out_continuity | ||
| ) |
Returns the continuity class of the surface.
| [in] | graph | Graph containing the surface. Must be non-NULL. |
| [in] | surface_id | Surface rep id. Must be valid. |
| [out] | out_continuity | Receives the continuity class. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_continuity is NULL, or surface_id is invalid. |
\par Thread Safety Yes.
| occtl_status_t occtl_surface_create_approximated | ( | occtl_graph_t * | graph, |
| const occtl_surface_approximated_info_t * | info, | ||
| occtl_rep_id_t * | out_id | ||
| ) |
Fits a B-spline surface rep to the given point grid within tolerance.
Uses OCCT's GeomAPI_PointsToBSplineSurface (approximation mode).
| [in] | graph | Graph that will own the rep. Must be non-NULL. |
| [in] | info | Versioned create-info. Must be non-NULL. |
| [out] | out_id | Receives the rep id. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph, out_id, or info is NULL, required fields are NULL / too small, degree range is invalid, or tolerance is negative. |
| 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_surface_create_bezier | ( | occtl_graph_t * | graph, |
| occtl_rep_id_t * | out_id, | ||
| const occtl_surface_bezier_create_info_t * | info | ||
| ) |
Creates a Bezier surface rep in the graph.
| [in] | graph | Graph that will own the rep. Must be non-NULL. |
| [out] | out_id | Receives the rep id. Must be non-NULL. |
| [in] | info | Borrows it. Versioned create-info. 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 definition. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_surface_create_bezier_grid | ( | occtl_graph_t * | graph, |
| occtl_rep_id_t * | out_id, | ||
| const occtl_surface_bezier_create_info_t * | info | ||
| ) |
Creates a Bezier surface from a row-major pole grid.
This is the grid-facing alias for occtl_surface_create_bezier. It uses the same create-info struct: poles are laid out as u * v_pole_count + v, and weights may be NULL for a non-rational Bezier surface.
| [in] | graph | Graph that will own the rep. Must be non-NULL. |
| [out] | out_id | Receives the rep id. Must be non-NULL. |
| [in] | info | Borrows it. Versioned create-info. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph, out_id, or info is NULL, or the pole grid is invalid. |
| OCCTL_VERSION_MISMATCH | Unsupported struct_version. |
| OCCTL_GEOMETRY_INVALID | OCCT rejected the definition. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_surface_create_bspline | ( | occtl_graph_t * | graph, |
| occtl_rep_id_t * | out_id, | ||
| const occtl_surface_bspline_create_info_t * | info | ||
| ) |
Creates a B-spline surface rep in the graph.
| [in] | graph | Graph that will own the rep. Must be non-NULL. |
| [out] | out_id | Receives the rep id. Must be non-NULL. |
| [in] | info | Versioned create-info. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph, out_id, or info is NULL, required arrays are NULL, or periodic flags are not 0/1. |
| OCCTL_VERSION_MISMATCH | Unsupported struct_version. |
| OCCTL_GEOMETRY_INVALID | OCCT rejected the definition. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_surface_create_cone | ( | occtl_graph_t * | graph, |
| occtl_rep_id_t * | out_id, | ||
| occtl_geom_conical_surface_t | cone | ||
| ) |
Creates a conical surface rep in the graph.
| [in] | graph | Graph that will own the rep. Must be non-NULL. |
| [out] | out_id | Receives the rep id of the new surface. Must be non-NULL. |
| [in] | cone | Cone data. semi_angle must be in (0, pi/2). |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_id is NULL. |
| OCCTL_GEOMETRY_INVALID | Invalid semi_angle. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_surface_create_cylinder | ( | occtl_graph_t * | graph, |
| occtl_rep_id_t * | out_id, | ||
| occtl_geom_cylindrical_surface_t | cylinder | ||
| ) |
Creates a cylindrical surface rep in the graph.
| [in] | graph | Graph that will own the rep. Must be non-NULL. |
| [out] | out_id | Receives the rep id of the new surface. Must be non-NULL. |
| [in] | cylinder | Cylinder data. radius must be > 0. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_id is NULL. |
| OCCTL_GEOMETRY_INVALID | radius is not positive. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_surface_create_extrusion | ( | occtl_graph_t * | graph, |
| occtl_rep_id_t * | out_id, | ||
| const occtl_surface_extrusion_create_info_t * | info | ||
| ) |
Creates a surface of linear extrusion rep in the graph.
| [in] | graph | Graph that will own the rep. Must be non-NULL. |
| [out] | out_id | Receives the rep id. Must be non-NULL. |
| [in] | info | Versioned create-info. Must be non-NULL. The basis must be a valid curve rep id. |
| 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 | direction has zero length. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_surface_create_from_boundary_curves | ( | occtl_graph_t * | graph, |
| occtl_rep_id_t * | out_id, | ||
| const occtl_surface_boundary_curves_create_info_t * | info | ||
| ) |
Creates a B-spline surface rep from contiguous boundary curves.
Uses OCCT's GeomFill_BSplineCurves. The input curves must form a compatible boundary loop or strip accepted by OCCT.
| [in] | graph | Graph that will own the rep. Must be non-NULL. |
| [out] | out_id | Receives the rep id. Must be non-NULL. |
| [in] | info | Borrows it. Must be non-NULL with a recognised struct_version. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph, out_id, or info is NULL, p_next is non-NULL, curves is NULL, curve_count is not 2, 3, or 4, an array entry is invalid, or style is unknown. |
| OCCTL_VERSION_MISMATCH | struct_version is unrecognised. |
| OCCTL_GEOMETRY_INVALID | OCCT rejected the boundary curves. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_surface_create_from_curve_grid | ( | occtl_graph_t * | graph, |
| occtl_rep_id_t * | out_id, | ||
| const occtl_surface_curve_grid_create_info_t * | info | ||
| ) |
Creates a B-spline surface rep from an intersecting U/V curve grid.
Uses OCCT's GeomFill_Gordon. The input curves must form a compatible network where each U-direction curve intersects each V-direction curve.
| [in] | graph | Graph that will own the rep. Must be non-NULL. |
| [out] | out_id | Receives the rep id. Must be non-NULL. |
| [in] | info | Borrows it. Must be non-NULL with a recognised struct_version. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph, out_id, or info is NULL, p_next is non-NULL, a curve array is NULL / too small, an array entry is invalid, tolerance is non-positive, or parallel is not 0/1. |
| OCCTL_VERSION_MISMATCH | struct_version is unrecognised. |
| OCCTL_GEOMETRY_INVALID | OCCT rejected the curve network. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_surface_create_from_point_grid | ( | occtl_graph_t * | graph, |
| occtl_rep_id_t * | out_id, | ||
| const occtl_surface_point_grid_create_info_t * | info | ||
| ) |
Creates a B-spline surface rep from a row-major point grid.
This is the broad point-grid constructor. It delegates to OCCT's GeomAPI_PointsToBSplineSurface in approximation or interpolation mode.
| [in] | graph | Graph that will own the rep. Must be non-NULL. |
| [out] | out_id | Receives the rep id. Must be non-NULL. |
| [in] | info | Borrows it. Must be non-NULL with a recognised struct_version. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph, out_id, or info is NULL, p_next is non-NULL, the point grid is NULL / too small, the mode is unknown, degree range is invalid, or tolerance is negative. |
| OCCTL_VERSION_MISMATCH | struct_version is unrecognised. |
| OCCTL_GEOMETRY_INVALID | OCCT rejected the point grid. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_surface_create_gordon | ( | occtl_graph_t * | graph, |
| occtl_rep_id_t * | out_id, | ||
| const occtl_surface_gordon_create_info_t * | info | ||
| ) |
Creates a Gordon B-spline surface rep from a profile/guide curve network.
Uses OCCT's GeomFill_Gordon. The input curves must form a compatible intersecting network; non-rational curve networks are the OCCT-supported target for this constructor.
| [in] | graph | Graph that will own the rep. Must be non-NULL. |
| [out] | out_id | Receives the rep id. Must be non-NULL. |
| [in] | info | Borrows it. Must be non-NULL with a recognised struct_version. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph, out_id, or info is NULL, p_next is non-NULL, a curve array is NULL / too small, an array entry is invalid, tolerance is non-positive, or parallel is not 0/1. |
| OCCTL_VERSION_MISMATCH | struct_version is unrecognised. |
| OCCTL_GEOMETRY_INVALID | OCCT rejected the curve network. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_surface_create_interpolated | ( | occtl_graph_t * | graph, |
| const occtl_surface_interpolated_info_t * | info, | ||
| occtl_rep_id_t * | out_id | ||
| ) |
Creates a B-spline surface rep that interpolates (passes through) the given point grid.
Uses OCCT's GeomAPI_PointsToBSplineSurface with uniform parameters. When is_u_periodic is set, the surface is made periodic in U.
| [in] | graph | Graph that will own the rep. Must be non-NULL. |
| [in] | info | Versioned create-info. Must be non-NULL. |
| [out] | out_id | Receives the rep id. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph, out_id, or info is NULL, required fields are NULL / too small, or is_u_periodic is not 0/1. |
| 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_surface_create_offset | ( | occtl_graph_t * | graph, |
| occtl_rep_id_t * | out_id, | ||
| const occtl_surface_offset_create_info_t * | info | ||
| ) |
Creates an offset surface rep in the graph.
| [in] | graph | Graph that will own the rep. Must be non-NULL. |
| [out] | out_id | Receives the rep id. Must be non-NULL. |
| [in] | info | Borrows it. Versioned create-info. 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 | Basis surface is invalid for offsetting. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_surface_create_plane | ( | occtl_graph_t * | graph, |
| occtl_rep_id_t * | out_id, | ||
| occtl_geom_plane_t | plane | ||
| ) |
Creates a plane surface rep in the graph.
| [in] | graph | Graph that will own the rep. Must be non-NULL. |
| [out] | out_id | Receives the rep id of the new surface. Must be non-NULL. |
| [in] | plane | Plane data. |
| 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_surface_create_rectangular_trimmed | ( | occtl_graph_t * | graph, |
| occtl_rep_id_t * | out_id, | ||
| const occtl_surface_rectangular_trimmed_create_info_t * | info | ||
| ) |
Creates a rectangular-trimmed surface rep in the graph.
| [in] | graph | Graph that will own the rep. Must be non-NULL. |
| [out] | out_id | Receives the rep id. Must be non-NULL. |
| [in] | info | Borrows it. Versioned create-info. 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 | Basis surface or trim parameters are invalid. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_surface_create_revolution | ( | occtl_graph_t * | graph, |
| occtl_rep_id_t * | out_id, | ||
| const occtl_surface_revolution_create_info_t * | info | ||
| ) |
Creates a surface of revolution rep in the graph.
| [in] | graph | Graph that will own the rep. Must be non-NULL. |
| [out] | out_id | Receives the rep id. Must be non-NULL. |
| [in] | info | Versioned create-info. Must be non-NULL. The basis must be a valid curve rep id. |
| 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 | OCCT rejected the parameters. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_surface_create_sphere | ( | occtl_graph_t * | graph, |
| occtl_rep_id_t * | out_id, | ||
| occtl_geom_spherical_surface_t | sphere | ||
| ) |
Creates a spherical surface rep in the graph.
| [in] | graph | Graph that will own the rep. Must be non-NULL. |
| [out] | out_id | Receives the rep id of the new surface. Must be non-NULL. |
| [in] | sphere | Sphere data. radius must be > 0. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_id is NULL. |
| OCCTL_GEOMETRY_INVALID | radius is not positive. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_surface_create_torus | ( | occtl_graph_t * | graph, |
| occtl_rep_id_t * | out_id, | ||
| occtl_geom_toroidal_surface_t | torus | ||
| ) |
Creates a toroidal surface rep in the graph.
| [in] | graph | Graph that will own the rep. Must be non-NULL. |
| [out] | out_id | Receives the rep id of the new surface. Must be non-NULL. |
| [in] | torus | Torus data. Both radii must be > 0 and major > minor. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_id is NULL. |
| OCCTL_GEOMETRY_INVALID | Invalid radii. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph).
| void occtl_surface_curve_grid_create_info_init | ( | occtl_surface_curve_grid_create_info_t * | info | ) |
Runtime initialiser for occtl_surface_curve_grid_create_info_t.
| [out] | info | Borrows it. NULL-tolerant; no-op when NULL. |
\par Thread Safety Yes.
| occtl_status_t occtl_surface_eval_d0 | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | surface_id, | ||
| double | u, | ||
| double | v, | ||
| occtl_point3_t * | out_point | ||
| ) |
Evaluates the surface at (u, v).
| [in] | graph | Graph containing the surface. Must be non-NULL. |
| [in] | surface_id | Surface rep id. Must be valid. |
| [in] | u | U parameter. |
| [in] | v | V parameter. |
| [out] | out_point | Receives the point on the surface. May be NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL or surface_id is invalid. |
| OCCTL_OUT_OF_RANGE | (u, v) is outside the parameter domain. |
\par Thread Safety Yes.
| occtl_status_t occtl_surface_eval_d1 | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | surface_id, | ||
| double | u, | ||
| double | v, | ||
| occtl_point3_t * | out_point, | ||
| occtl_vector3_t * | out_d1u, | ||
| occtl_vector3_t * | out_d1v | ||
| ) |
Evaluates the surface and its first-order partial derivatives at (u, v).
| [in] | graph | Graph containing the surface. Must be non-NULL. |
| [in] | surface_id | Surface rep id. Must be valid. |
| [in] | u | U parameter. |
| [in] | v | V parameter. |
| [out] | out_point | Receives the point. May be NULL. |
| [out] | out_d1u | Receives dS/du. May be NULL. |
| [out] | out_d1v | Receives dS/dv. May be NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL or surface_id is invalid. |
| OCCTL_OUT_OF_RANGE | Parameter is outside the domain. |
\par Thread Safety Yes.
| occtl_status_t occtl_surface_eval_d2 | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | surface_id, | ||
| double | u, | ||
| double | v, | ||
| occtl_point3_t * | out_point, | ||
| occtl_vector3_t * | out_d1u, | ||
| occtl_vector3_t * | out_d1v, | ||
| occtl_vector3_t * | out_d2u, | ||
| occtl_vector3_t * | out_d2v, | ||
| occtl_vector3_t * | out_d2uv | ||
| ) |
Evaluates the surface and its first- and second-order partial derivatives at (u, v).
| [in] | graph | Graph containing the surface. Must be non-NULL. |
| [in] | surface_id | Surface rep id. Must be valid. |
| [in] | u | U parameter. |
| [in] | v | V parameter. |
| [out] | out_point | Receives the point. May be NULL. |
| [out] | out_d1u | Receives dS/du. May be NULL. |
| [out] | out_d1v | Receives dS/dv. May be NULL. |
| [out] | out_d2u | Receives d2S/du2. May be NULL. |
| [out] | out_d2v | Receives d2S/dv2. May be NULL. |
| [out] | out_d2uv | Receives d2S/dudv. May be NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL or surface_id is invalid. |
| OCCTL_OUT_OF_RANGE | Parameter is outside the domain. |
\par Thread Safety Yes.
| occtl_status_t occtl_surface_eval_d3 | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | surface_id, | ||
| double | u, | ||
| double | v, | ||
| occtl_point3_t * | out_point, | ||
| occtl_vector3_t * | out_d1u, | ||
| occtl_vector3_t * | out_d1v, | ||
| occtl_vector3_t * | out_d2u, | ||
| occtl_vector3_t * | out_d2v, | ||
| occtl_vector3_t * | out_d2uv, | ||
| occtl_vector3_t * | out_d3u, | ||
| occtl_vector3_t * | out_d3v, | ||
| occtl_vector3_t * | out_d3uuv, | ||
| occtl_vector3_t * | out_d3uvv | ||
| ) |
Evaluates the surface and its first-, second-, and third-order partial derivatives at (u, v).
| [in] | graph | Graph containing the surface. Must be non-NULL. |
| [in] | surface_id | Surface rep id. Must be valid. |
| [in] | u | U parameter. |
| [in] | v | V parameter. |
| [out] | out_point | Receives the point. May be NULL. |
| [out] | out_d1u | Receives dS/du. May be NULL. |
| [out] | out_d1v | Receives dS/dv. May be NULL. |
| [out] | out_d2u | Receives d2S/du2. May be NULL. |
| [out] | out_d2v | Receives d2S/dv2. May be NULL. |
| [out] | out_d2uv | Receives d2S/dudv. May be NULL. |
| [out] | out_d3u | Receives d3S/du3. May be NULL. |
| [out] | out_d3v | Receives d3S/dv3. May be NULL. |
| [out] | out_d3uuv | Receives d3S/du2dv. May be NULL. |
| [out] | out_d3uvv | Receives d3S/dudv2. May be NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL or surface_id is invalid. |
| OCCTL_OUT_OF_RANGE | Parameter is outside the domain. |
\par Thread Safety Yes.
| occtl_status_t occtl_surface_eval_dn | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | surface_id, | ||
| double | u, | ||
| double | v, | ||
| int32_t | nu, | ||
| int32_t | nv, | ||
| occtl_vector3_t * | out_derivative | ||
| ) |
Returns a partial derivative vector at (u, v).
| [in] | graph | Graph containing the surface. Must be non-NULL. |
| [in] | surface_id | Surface rep id. Must be valid. |
| [in] | u | U parameter. |
| [in] | v | V parameter. |
| [in] | nu | Derivative order in U (>= 0). |
| [in] | nv | Derivative order in V (>= 0). |
| [out] | out_derivative | Receives d^(nu+nv)S / du^nu dv^nv. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_derivative is NULL, or surface_id is invalid. |
| OCCTL_OUT_OF_RANGE | Parameter is outside the domain. |
\par Thread Safety Yes.
| void occtl_surface_extrusion_create_info_init | ( | occtl_surface_extrusion_create_info_t * | info | ) |
Runtime initialiser for occtl_surface_extrusion_create_info_t.
| [out] | info | Borrows it. NULL-tolerant; no-op when NULL. |
\par Thread Safety Yes.
| void occtl_surface_gordon_create_info_init | ( | occtl_surface_gordon_create_info_t * | info | ) |
Runtime initialiser for occtl_surface_gordon_create_info_t.
| [out] | info | Borrows it. NULL-tolerant; no-op when NULL. |
\par Thread Safety Yes.
| void occtl_surface_interpolated_info_init | ( | occtl_surface_interpolated_info_t * | info | ) |
Runtime initialiser for occtl_surface_interpolated_info_t.
| [out] | info | Borrows it. NULL-tolerant; no-op when NULL. |
\par Thread Safety Yes.
| occtl_status_t occtl_surface_intersect_curve | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | surface_id, | ||
| occtl_rep_id_t | curve_id, | ||
| occtl_point3_t * | out_buf, | ||
| size_t | capacity, | ||
| size_t * | out_count | ||
| ) |
Computes intersection points between a curve rep and a surface rep.
Uses OCCT's GeomAPI_IntCS. Output uses the two-call buffer pattern: call with out_buf == NULL to learn the required count, allocate, then call again with a buffer of at least that size.
| [in] | graph | Graph containing both reps. Must be non-NULL. |
| [in] | curve_id | Curve rep id. Must be valid. |
| [in] | surface_id | Surface rep id. Must be valid. |
| [out] | out_buf | Buffer to receive intersection points. May be NULL on sizing call. |
| [in] | capacity | Number of elements out_buf can hold. |
| [out] | out_count | Receives the number of intersection points. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph, out_count is NULL, or a rep id is invalid. |
| OCCTL_BUFFER_TOO_SMALL | capacity < *out_count. |
\par Thread Safety Yes.
| occtl_status_t occtl_surface_is_closed | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | surface_id, | ||
| int32_t * | out_is_closed | ||
| ) |
Returns non-zero if the surface is closed in both U and V directions.
Convenience over separate U and V closed checks. A surface is closed when IsUClosed() and IsVClosed() are both true.
| [in] | graph | Graph containing the surface. Must be non-NULL. |
| [in] | surface_id | Surface rep id. Must be valid. |
| [out] | out_is_closed | Receives 1 if closed in both U and V, 0 otherwise. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_is_closed is NULL, or surface_id is invalid. |
\par Thread Safety Yes.
| occtl_status_t occtl_surface_is_periodic | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | surface_id, | ||
| int32_t * | out_is_periodic | ||
| ) |
Returns non-zero if the surface is periodic in either U or V direction.
Convenience over separate U and V periodic checks. A surface is periodic when IsUPeriodic() or IsVPeriodic() is true.
| [in] | graph | Graph containing the surface. Must be non-NULL. |
| [in] | surface_id | Surface rep id. Must be valid. |
| [out] | out_is_periodic | Receives 1 if periodic in either U or V, 0 otherwise. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_is_periodic is NULL, or surface_id is invalid. |
\par Thread Safety Yes.
| occtl_status_t occtl_surface_is_u_periodic | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | surface_id, | ||
| int32_t * | out_is_periodic | ||
| ) |
Returns non-zero if the surface is periodic in the U direction.
| [in] | graph | Graph containing the surface. Must be non-NULL. |
| [in] | surface_id | Surface rep id. Must be valid. |
| [out] | out_is_periodic | Receives 1 if U-periodic, 0 otherwise. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_is_periodic is NULL, or surface_id is invalid. |
\par Thread Safety Yes.
| occtl_status_t occtl_surface_is_v_periodic | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | surface_id, | ||
| int32_t * | out_is_periodic | ||
| ) |
Returns non-zero if the surface is periodic in the V direction.
| [in] | graph | Graph containing the surface. Must be non-NULL. |
| [in] | surface_id | Surface rep id. Must be valid. |
| [out] | out_is_periodic | Receives 1 if V-periodic, 0 otherwise. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_is_periodic is NULL, or surface_id is invalid. |
\par Thread Safety Yes.
| occtl_status_t occtl_surface_kind | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | surface_id, | ||
| occtl_surface_kind_t * | out_kind | ||
| ) |
Returns the kind of geometry of a surface rep.
| [in] | graph | Graph containing the surface. Must be non-NULL. |
| [in] | surface_id | Surface rep id. Must be valid. |
| [out] | out_kind | Receives the surface kind. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_kind is NULL, or surface_id is invalid. |
\par Thread Safety Yes.
| void occtl_surface_offset_create_info_init | ( | occtl_surface_offset_create_info_t * | info | ) |
Runtime initialiser for occtl_surface_offset_create_info_t.
Sets all fields to OCCTL_SURFACE_OFFSET_CREATE_INFO_INIT.
| [out] | info | Borrows it. NULL-tolerant; no-op when NULL. |
\par Thread Safety Yes.
| occtl_status_t occtl_surface_parameter_range | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | surface_id, | ||
| double * | out_u_min, | ||
| double * | out_u_max, | ||
| double * | out_v_min, | ||
| double * | out_v_max | ||
| ) |
Returns the parameter range of the surface.
| [in] | graph | Graph containing the surface. Must be non-NULL. |
| [in] | surface_id | Surface rep id. Must be valid. |
| [out] | out_u_min | Start U parameter. May be NULL. |
| [out] | out_u_max | End U parameter. May be NULL. |
| [out] | out_v_min | Start V parameter. May be NULL. |
| [out] | out_v_max | End V parameter. May be NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL or surface_id is invalid. |
\par Thread Safety Yes.
| void occtl_surface_point_grid_create_info_init | ( | occtl_surface_point_grid_create_info_t * | info | ) |
Runtime initialiser for occtl_surface_point_grid_create_info_t.
| [out] | info | Borrows it. NULL-tolerant; no-op when NULL. |
\par Thread Safety Yes.
| occtl_status_t occtl_surface_project_point | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | surface_id, | ||
| occtl_point3_t | point, | ||
| double * | out_u, | ||
| double * | out_v, | ||
| double * | out_distance | ||
| ) |
Projects a 3D point onto the surface and returns the closest UV coordinates.
Uses OCCT's GeomAPI_ProjectPointOnSurf.
| [in] | graph | Graph containing the surface. Must be non-NULL. |
| [in] | surface_id | Surface rep id. Must be valid. |
| [in] | point | Point to project. |
| [out] | out_u | Receives the U parameter of the closest point. Must be non-NULL. |
| [out] | out_v | Receives the V parameter of the closest point. Must be non-NULL. |
| [out] | out_distance | Receives the shortest distance. May be NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph, out_u, or out_v is NULL, or surface_id is invalid. |
\par Thread Safety Yes.
| void occtl_surface_rectangular_trimmed_create_info_init | ( | occtl_surface_rectangular_trimmed_create_info_t * | info | ) |
Runtime initialiser for occtl_surface_rectangular_trimmed_create_info_t.
Sets all fields to OCCTL_SURFACE_RECTANGULAR_TRIMMED_CREATE_INFO_INIT.
| [out] | info | Borrows it. NULL-tolerant; no-op when NULL. |
\par Thread Safety Yes.
| occtl_status_t occtl_surface_reverse | ( | occtl_graph_t * | graph, |
| occtl_rep_id_t | surface_id, | ||
| occtl_rep_id_t * | out_id | ||
| ) |
Creates a new surface rep that is the U-reversed copy of surface_id.
| [in] | graph | Graph that owns both surfaces. Must be non-NULL. |
| [in] | surface_id | Surface rep id. Must be valid. |
| [out] | out_id | Receives the rep id of the reversed surface. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_id is NULL, or surface_id is invalid. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph).
| void occtl_surface_revolution_create_info_init | ( | occtl_surface_revolution_create_info_t * | info | ) |
Runtime initialiser for occtl_surface_revolution_create_info_t.
| [out] | info | Borrows it. NULL-tolerant; no-op when NULL. |
\par Thread Safety Yes.
| occtl_status_t occtl_surface_rotated | ( | occtl_graph_t * | graph, |
| occtl_rep_id_t | surface_id, | ||
| occtl_axis1_placement_t | axis, | ||
| double | angle, | ||
| occtl_rep_id_t * | out_id | ||
| ) |
Creates a new surface rep by rotating surface_id.
| [in] | graph | Graph that will own the new rep. Must be non-NULL. |
| [in] | surface_id | Surface rep id. Must be valid. |
| [in] | axis | Rotation axis. |
| [in] | angle | Rotation angle in radians. |
| [out] | out_id | Receives the rep id of the rotated surface. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_id is NULL, or surface_id is invalid. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_surface_scaled | ( | occtl_graph_t * | graph, |
| occtl_rep_id_t | surface_id, | ||
| occtl_point3_t | origin, | ||
| double | factor, | ||
| occtl_rep_id_t * | out_id | ||
| ) |
Creates a new surface rep by scaling surface_id about origin.
| [in] | graph | Graph that will own the new rep. Must be non-NULL. |
| [in] | surface_id | Surface rep id. Must be valid. |
| [in] | origin | Origin point for scaling. |
| [in] | factor | Scale factor; must be non-zero. |
| [out] | out_id | Receives the rep id of the scaled surface. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_id is NULL, or surface_id is invalid. |
| OCCTL_GEOMETRY_INVALID | factor is zero. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_surface_surface_intersect | ( | occtl_graph_t * | graph, |
| occtl_rep_id_t | surface_a, | ||
| occtl_rep_id_t | surface_b, | ||
| double | tolerance, | ||
| occtl_rep_id_t ** | out_ids, | ||
| size_t * | out_count | ||
| ) |
Computes intersection curves between two surfaces.
Uses OCCT's GeomAPI_IntSS. Returns an array of intersection rep ids. The array itself is allocated by the function; the caller must free it with free().
| [in] | graph | Graph containing both surfaces. Must be non-NULL. |
| [in] | surface_a | First surface rep id. Must be valid. |
| [in] | surface_b | Second surface rep id. Must be valid. |
| [in] | tolerance | Intersection tolerance in 3D. |
| [out] | out_ids | Receives a caller-owned array of curve rep ids. Must be non-NULL. Free with free(). |
| [out] | out_count | Receives the number of intersection curves. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph, out_ids, or out_count is NULL, or a surface rep id is invalid. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety Yes.
| occtl_status_t occtl_surface_transformed | ( | occtl_graph_t * | graph, |
| occtl_rep_id_t | surface_id, | ||
| occtl_transform_t | transform, | ||
| occtl_rep_id_t * | out_id | ||
| ) |
Creates a new surface rep by applying a 3D transform to surface_id.
| [in] | graph | Graph that will own the new rep. Must be non-NULL. |
| [in] | surface_id | Source surface rep id. Must be valid. |
| [in] | transform | Transform to apply. |
| [out] | out_id | Receives the rep id of the transformed surface. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_id is NULL, or surface_id is invalid. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_surface_translated | ( | occtl_graph_t * | graph, |
| occtl_rep_id_t | surface_id, | ||
| occtl_vector3_t | delta, | ||
| occtl_rep_id_t * | out_id | ||
| ) |
Creates a new surface rep by translating surface_id.
| [in] | graph | Graph that will own the new rep. Must be non-NULL. |
| [in] | surface_id | Surface rep id. Must be valid. |
| [in] | delta | Translation vector. |
| [out] | out_id | Receives the rep id of the translated surface. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_id is NULL, or surface_id is invalid. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_surface_uv_of_point | ( | const occtl_graph_t * | graph, |
| occtl_rep_id_t | surface_id, | ||
| occtl_point3_t | point, | ||
| double * | out_u, | ||
| double * | out_v | ||
| ) |
Returns the UV coordinates on the surface nearest to a given 3D point.
Convenience function equivalent to occtl_surface_project_point with out_distance = NULL.
| [in] | graph | Graph containing the surface. Must be non-NULL. |
| [in] | surface_id | Surface rep id. Must be valid. |
| [in] | point | Point to find UV for. |
| [out] | out_u | Receives the U parameter. Must be non-NULL. |
| [out] | out_v | Receives the V parameter. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph, out_u, or out_v is NULL, or surface_id is invalid. |
\par Thread Safety Yes.