OCCT-Light 0.1
C ABI and C++ veneer for multi-language CAD workflows
Loading...
Searching...
No Matches
curves.hpp
Go to the documentation of this file.
1// Copyright (c) 2026 Capgemini Engineering Research and Development.
2//
3// This file is part of OCCT-Light software library.
4//
5// This library is free software; you can redistribute it and/or modify it under
6// the terms of the GNU Affero General Public License version 3 as published
7// by the Free Software Foundation, with an option to use any later version.
8// Consult the file LICENSE_AGPL_30.txt included in OCCT-Light distribution
9// for complete text of the license and disclaimer of any warranty.
10//
11// Alternatively, this file may be used under the terms of a commercial
12// license or contractual agreement.
13//
14// SPDX-License-Identifier: AGPL-3.0-or-later
15
25#ifndef OCCTL_HPP_CURVES_HPP
26#define OCCTL_HPP_CURVES_HPP
27
28#include <occtl/occtl_curves.h>
29
30#include <occtl-hpp/core.hpp>
31#include <occtl-hpp/geom.hpp>
32
33#include <cstdint>
34#include <cstdlib>
35#include <tuple>
36#include <utility>
37#include <vector>
38
39#if defined(__cpp_lib_span) && __cpp_lib_span >= 202002L
40 #include <span>
41 #define OCCTL_HPP_HAS_SPAN 1
42#else
43 #define OCCTL_HPP_HAS_SPAN 0
44#endif
45
46namespace occtl
47{
48
53class Curve
54{
55public:
57 Curve(occtl_graph_t* theGraph = nullptr, occtl_rep_id_t theId = occtl_rep_id_t{0}) noexcept
58 : myGraph(theGraph),
59 myId(theId)
60 {
61 }
62
64 explicit operator bool() const noexcept { return myGraph != nullptr && myId.bits != 0; }
65
67 occtl_graph_t* graph() const noexcept { return myGraph; }
68
70 occtl_rep_id_t id() const noexcept { return myId; }
71
75 {
76 occtl_rep_id_t aId{};
77 check(::occtl_curve_reverse(myGraph, myId, &aId));
78 return Curve(myGraph, aId);
79 }
80
83 Curve transformed(const Transform& theTrsf) const
84 {
85 occtl_rep_id_t aId{};
86 check(::occtl_curve_transformed(myGraph, myId, theTrsf.c_type(), &aId));
87 return Curve(myGraph, aId);
88 }
89
92 Curve translated(const Vector3& theDelta) const
93 {
94 occtl_rep_id_t aId{};
95 check(::occtl_curve_translated(myGraph, myId, theDelta.c_type(), &aId));
96 return Curve(myGraph, aId);
97 }
98
101 Curve rotated(const Axis1Placement& theAxis, double theAngle) const
102 {
103 occtl_rep_id_t aId{};
104 check(::occtl_curve_rotated(myGraph, myId, theAxis.c_type(), theAngle, &aId));
105 return Curve(myGraph, aId);
106 }
107
110 Curve scaled(const Point3& theOrigin, double theFactor) const
111 {
112 occtl_rep_id_t aId{};
113 check(::occtl_curve_scaled(myGraph, myId, theOrigin.c_type(), theFactor, &aId));
114 return Curve(myGraph, aId);
115 }
116
119 double length() const
120 {
121 double aLen = 0.0;
122 check(::occtl_curve_length(myGraph, myId, &aLen));
123 return aLen;
124 }
125
129 std::pair<double, double> project_point(const Point3& thePoint) const
130 {
131 double aParam = 0.0;
132 double aDist = 0.0;
133 check(::occtl_curve_project_point(myGraph, myId, thePoint.c_type(), &aParam, &aDist));
134 return {aParam, aDist};
135 }
136
139 double parameter_of_point(const Point3& thePoint) const
140 {
141 double aParam = 0.0;
142 check(::occtl_curve_parameter_of_point(myGraph, myId, thePoint.c_type(), &aParam));
143 return aParam;
144 }
145
149 {
150 occtl_curve_kind_t aKind{};
151 check(::occtl_curve_kind(myGraph, myId, &aKind));
152 return aKind;
153 }
154
157 int32_t is_periodic() const
158 {
159 int32_t aVal = 0;
160 check(::occtl_curve_is_periodic(myGraph, myId, &aVal));
161 return aVal;
162 }
163
166 int32_t is_closed() const
167 {
168 int32_t aVal = 0;
169 check(::occtl_curve_is_closed(myGraph, myId, &aVal));
170 return aVal;
171 }
172
176 {
178 check(::occtl_curve_continuity(myGraph, myId, &aCont));
179 return aCont;
180 }
181
184 void parameter_range(double& theUMin, double& theUMax) const
185 {
186 check(::occtl_curve_parameter_range(myGraph, myId, &theUMin, &theUMax));
187 }
188
192 {
193 occtl_geom_line_t aOut{};
194 check(::occtl_curve_as_line(myGraph, myId, &aOut));
195 return aOut;
196 }
197
201 {
202 occtl_geom_circle_t aOut{};
203 check(::occtl_curve_as_circle(myGraph, myId, &aOut));
204 return aOut;
205 }
206
210 {
212 check(::occtl_curve_as_ellipse(myGraph, myId, &aOut));
213 return aOut;
214 }
215
219 {
221 check(::occtl_curve_as_hyperbola(myGraph, myId, &aOut));
222 return aOut;
223 }
224
228 {
230 check(::occtl_curve_as_parabola(myGraph, myId, &aOut));
231 return aOut;
232 }
233
234 struct TrimmedView;
235 struct OffsetView;
236 struct BSplineView;
237
240 inline TrimmedView as_trimmed() const;
241
244 inline OffsetView as_offset() const;
245
253 inline BSplineView as_bspline() const;
254
257 int32_t bspline_degree() const
258 {
259 int32_t aVal = 0;
260 check(::occtl_curve_bspline_degree(myGraph, myId, &aVal));
261 return aVal;
262 }
263
266 size_t bspline_pole_count() const
267 {
268 size_t aVal = 0;
269 check(::occtl_curve_bspline_pole_count(myGraph, myId, &aVal));
270 return aVal;
271 }
272
275 size_t bspline_knot_count() const
276 {
277 size_t aVal = 0;
278 check(::occtl_curve_bspline_knot_count(myGraph, myId, &aVal));
279 return aVal;
280 }
281
284 int32_t bspline_is_rational() const
285 {
286 int32_t aVal = 0;
287 check(::occtl_curve_bspline_is_rational(myGraph, myId, &aVal));
288 return aVal;
289 }
290
293 int32_t bezier_degree() const
294 {
295 int32_t aVal = 0;
296 check(::occtl_curve_bezier_degree(myGraph, myId, &aVal));
297 return aVal;
298 }
299
302 size_t bezier_pole_count() const
303 {
304 size_t aVal = 0;
305 check(::occtl_curve_bezier_pole_count(myGraph, myId, &aVal));
306 return aVal;
307 }
308
311 int32_t bezier_is_rational() const
312 {
313 int32_t aVal = 0;
314 check(::occtl_curve_bezier_is_rational(myGraph, myId, &aVal));
315 return aVal;
316 }
317
320 std::vector<occtl_point3_t> bspline_poles() const
321 {
322 size_t aNb = 0;
323 check(::occtl_curve_bspline_poles(myGraph, myId, nullptr, 0, &aNb));
324 std::vector<occtl_point3_t> aVec(aNb);
325 check(::occtl_curve_bspline_poles(myGraph, myId, aVec.data(), aNb, &aNb));
326 return aVec;
327 }
328
331 std::vector<double> bspline_knots() const
332 {
333 size_t aNb = 0;
334 check(::occtl_curve_bspline_knots(myGraph, myId, nullptr, 0, &aNb));
335 std::vector<double> aVec(aNb);
336 check(::occtl_curve_bspline_knots(myGraph, myId, aVec.data(), aNb, &aNb));
337 return aVec;
338 }
339
342 std::vector<int32_t> bspline_multiplicities() const
343 {
344 size_t aNb = 0;
345 check(::occtl_curve_bspline_multiplicities(myGraph, myId, nullptr, 0, &aNb));
346 std::vector<int32_t> aVec(aNb);
347 check(::occtl_curve_bspline_multiplicities(myGraph, myId, aVec.data(), aNb, &aNb));
348 return aVec;
349 }
350
353 std::vector<double> bspline_weights() const
354 {
355 size_t aNb = 0;
356 check(::occtl_curve_bspline_weights(myGraph, myId, nullptr, 0, &aNb));
357 std::vector<double> aVec(aNb);
358 check(::occtl_curve_bspline_weights(myGraph, myId, aVec.data(), aNb, &aNb));
359 return aVec;
360 }
361
364 std::vector<double> bspline_flat_knots() const
365 {
366 size_t aNb = 0;
367 check(::occtl_curve_bspline_flat_knots(myGraph, myId, nullptr, 0, &aNb));
368 std::vector<double> aVec(aNb);
369 check(::occtl_curve_bspline_flat_knots(myGraph, myId, aVec.data(), aNb, &aNb));
370 return aVec;
371 }
372
377 const occtl_point3_t* bspline_poles_view(size_t& theCount) const
378 {
379 const occtl_point3_t* aData = nullptr;
380 check(::occtl_curve_bspline_poles_view(myGraph, myId, &aData, &theCount));
381 return aData;
382 }
383
387 {
388 occtl_rep_id_t aId{};
389 check(::occtl_curve_create_line(graph, theLine, &aId));
390 return Curve(graph, aId);
391 }
392
396 {
397 occtl_rep_id_t aId{};
398 check(::occtl_curve_create_circle(graph, theCircle, &aId));
399 return Curve(graph, aId);
400 }
401
405 {
406 occtl_rep_id_t aId{};
407 check(::occtl_curve_create_ellipse(graph, theEllipse, &aId));
408 return Curve(graph, aId);
409 }
410
414 {
415 occtl_rep_id_t aId{};
416 check(::occtl_curve_create_hyperbola(graph, theHyperbola, &aId));
417 return Curve(graph, aId);
418 }
419
423 {
424 occtl_rep_id_t aId{};
425 check(::occtl_curve_create_parabola(graph, theParabola, &aId));
426 return Curve(graph, aId);
427 }
428
432 {
433 occtl_rep_id_t aId{};
434 check(::occtl_curve_create_bspline(graph, &theInfo, &aId));
435 return Curve(graph, aId);
436 }
437
441 {
442 occtl_rep_id_t aId{};
443 check(::occtl_curve_create_bezier(graph, &theInfo, &aId));
444 return Curve(graph, aId);
445 }
446
450 {
451 occtl_rep_id_t aId{};
452 check(::occtl_curve_create_trimmed(graph, &theInfo, &aId));
453 return Curve(graph, aId);
454 }
455
459 {
460 occtl_rep_id_t aId{};
461 check(::occtl_curve_create_offset(graph, &theInfo, &aId));
462 return Curve(graph, aId);
463 }
464
468 const occtl_curve_interpolated_info_t& theInfo)
469 {
470 occtl_rep_id_t aId{};
472 return Curve(graph, aId);
473 }
474
478 const occtl_curve_approximated_info_t& theInfo)
479 {
480 occtl_rep_id_t aId{};
482 return Curve(graph, aId);
483 }
484
489 {
490 occtl_rep_id_t aId{};
492 return Curve(graph, aId);
493 }
494
495 struct IntersectionPoint;
496 std::vector<IntersectionPoint> intersect_with(const Curve& theOther) const;
497
500 occtl_point3_t eval_d0(const double theU) const
501 {
502 occtl_point3_t aP{};
503 check(::occtl_curve_eval_d0(myGraph, myId, theU, &aP));
504 return aP;
505 }
506
509 std::pair<occtl_point3_t, occtl_vector3_t> eval_d1(const double theU) const
510 {
511 occtl_point3_t aP{};
512 occtl_vector3_t aD1{};
513 check(::occtl_curve_eval_d1(myGraph, myId, theU, &aP, &aD1));
514 return {aP, aD1};
515 }
516
519 std::tuple<occtl_point3_t, occtl_vector3_t, occtl_vector3_t> eval_d2(const double theU) const
520 {
521 occtl_point3_t aP{};
522 occtl_vector3_t aD1{}, aD2{};
523 check(::occtl_curve_eval_d2(myGraph, myId, theU, &aP, &aD1, &aD2));
524 return {aP, aD1, aD2};
525 }
526
529 std::tuple<occtl_point3_t, occtl_vector3_t, occtl_vector3_t, occtl_vector3_t> eval_d3(
530 const double theU) const
531 {
532 occtl_point3_t aP{};
533 occtl_vector3_t aD1{}, aD2{}, aD3{};
534 check(::occtl_curve_eval_d3(myGraph, myId, theU, &aP, &aD1, &aD2, &aD3));
535 return {aP, aD1, aD2, aD3};
536 }
537
540 occtl_vector3_t eval_dn(const double theU, const int32_t theN) const
541 {
542 occtl_vector3_t aDN{};
543 check(::occtl_curve_eval_dn(myGraph, myId, theU, theN, &aDN));
544 return aDN;
545 }
546
547private:
548 occtl_graph_t* myGraph;
549 occtl_rep_id_t myId;
550};
551
553{
554 double u_first;
555 double u_last;
556};
557
559{
560 double offset;
561 occtl_vector3_t offset_dir;
562};
563
571
573{
574 double aU0 = 0.0;
575 double aU1 = 0.0;
576 check(::occtl_curve_as_trimmed(myGraph, myId, &aU0, &aU1));
577 return {aU0, aU1};
578}
579
581{
582 double aOff = 0.0;
583 occtl_vector3_t aDir{};
584 check(::occtl_curve_as_offset(myGraph, myId, &aOff, &aDir));
585 return {aOff, aDir};
586}
587
595{
597
598 int32_t degree() const noexcept { return raw.degree; }
599
600 bool is_rational() const noexcept { return raw.is_rational != 0; }
601
602 bool is_periodic() const noexcept { return raw.is_periodic != 0; }
603
604 bool is_closed() const noexcept { return raw.is_closed != 0; }
605
606 occtl_geom_continuity_t continuity() const noexcept
607 {
608 return static_cast<occtl_geom_continuity_t>(raw.continuity);
609 }
610
611 size_t pole_count() const noexcept { return raw.pole_count; }
612
613 size_t knot_count() const noexcept { return raw.knot_count; }
614
615 size_t flat_knot_count() const noexcept { return raw.flat_knot_count; }
616
617#if OCCTL_HPP_HAS_SPAN
618 std::span<const occtl_point3_t> poles() const noexcept { return {raw.poles, raw.pole_count}; }
619
620 std::span<const double> weights() const noexcept
621 {
622 return raw.weights ? std::span<const double>{raw.weights, raw.pole_count}
623 : std::span<const double>{};
624 }
625
626 std::span<const double> knots() const noexcept { return {raw.knots, raw.knot_count}; }
627
628 std::span<const int32_t> multiplicities() const noexcept
629 {
630 return {raw.multiplicities, raw.knot_count};
631 }
632
633 std::span<const double> flat_knots() const noexcept
634 {
635 return {raw.flat_knots, raw.flat_knot_count};
636 }
637#else
638 const occtl_point3_t* poles() const noexcept { return raw.poles; }
639
640 const double* weights() const noexcept { return raw.weights; }
641
642 const double* knots() const noexcept { return raw.knots; }
643
644 const int32_t* multiplicities() const noexcept { return raw.multiplicities; }
645
646 const double* flat_knots() const noexcept { return raw.flat_knots; }
647#endif
648};
649
651{
652 BSplineView aView{};
653 aView.raw = OCCTL_CURVE_BSPLINE_INIT;
654 check(::occtl_curve_as_bspline(myGraph, myId, &aView.raw));
655 return aView;
656}
657
658inline std::vector<Curve::IntersectionPoint> Curve::intersect_with(const Curve& theOther) const
659{
660 const occtl_curve_intersection_point_t* aRaw = nullptr;
661 size_t aNb = 0;
662 check(::occtl_curve_intersect(myGraph, myId, theOther.myId, &aRaw, &aNb));
663 std::vector<IntersectionPoint> aResult(aNb);
664 for (size_t anI = 0; anI < aNb; ++anI)
665 {
666 aResult[anI] = {aRaw[anI].point, aRaw[anI].param_a, aRaw[anI].param_b};
667 }
668 std::free(const_cast<occtl_curve_intersection_point_t*>(aRaw));
669 return aResult;
670}
671
672} // namespace occtl
673
674#endif // OCCTL_HPP_CURVES_HPP
Non-owning reference to a 3D geometric curve stored in a graph.
Definition curves.hpp:54
static Curve from_circle(occtl_graph_t *graph, const occtl_geom_circle_t &theCircle)
Constructs a curve from a circle.
Definition curves.hpp:395
std::tuple< occtl_point3_t, occtl_vector3_t, occtl_vector3_t > eval_d2(const double theU) const
Evaluates point, first, and second derivatives at theU.
Definition curves.hpp:519
std::pair< occtl_point3_t, occtl_vector3_t > eval_d1(const double theU) const
Evaluates point and first derivative at theU.
Definition curves.hpp:509
int32_t bspline_is_rational() const
Returns 1 when the B-spline is rational (NURBS), 0 otherwise.
Definition curves.hpp:284
int32_t bezier_is_rational() const
Returns 1 when the Bezier curve is rational, 0 otherwise.
Definition curves.hpp:311
std::vector< double > bspline_flat_knots() const
Copies the expanded (flat) knot sequence into a vector.
Definition curves.hpp:364
occtl_rep_id_t id() const noexcept
Returns the representation id.
Definition curves.hpp:70
Curve transformed(const Transform &theTrsf) const
Returns a transformed copy of this curve stored in the same graph.
Definition curves.hpp:83
occtl_geom_continuity_t continuity() const
Returns the geometric continuity class.
Definition curves.hpp:175
static Curve from_offset(occtl_graph_t *graph, const occtl_curve_offset_create_info_t &theInfo)
Constructs an offset curve.
Definition curves.hpp:458
std::vector< int32_t > bspline_multiplicities() const
Copies all knot multiplicities into a std::vector<int32_t>.
Definition curves.hpp:342
int32_t is_periodic() const
Returns 1 when the curve is periodic, 0 otherwise.
Definition curves.hpp:157
static Curve from_approximation(occtl_graph_t *graph, const occtl_curve_approximated_info_t &theInfo)
Constructs a curve by approximating the given points.
Definition curves.hpp:477
std::pair< double, double > project_point(const Point3 &thePoint) const
Projects a point onto the curve.
Definition curves.hpp:129
const occtl_point3_t * bspline_poles_view(size_t &theCount) const
Returns a zero-copy view of the poles array.
Definition curves.hpp:377
static Curve from_line(occtl_graph_t *graph, const occtl_geom_line_t &theLine)
Constructs a curve from a line.
Definition curves.hpp:386
static Curve from_hyperbola(occtl_graph_t *graph, const occtl_geom_hyperbola_t &theHyperbola)
Constructs a curve from a hyperbola.
Definition curves.hpp:413
size_t bspline_knot_count() const
Returns the number of distinct knot values.
Definition curves.hpp:275
int32_t is_closed() const
Returns 1 when the curve is closed, 0 otherwise.
Definition curves.hpp:166
occtl_geom_circle_t as_circle() const
Extracts the underlying circle.
Definition curves.hpp:200
size_t bezier_pole_count() const
Returns the number of Bezier poles.
Definition curves.hpp:302
std::tuple< occtl_point3_t, occtl_vector3_t, occtl_vector3_t, occtl_vector3_t > eval_d3(const double theU) const
Evaluates point, first, second, and third derivatives at theU.
Definition curves.hpp:529
static Curve from_bezier(occtl_graph_t *graph, const occtl_curve_bezier_create_info_t &theInfo)
Constructs a Bezier curve from the given create info.
Definition curves.hpp:440
static Curve from_interpolation(occtl_graph_t *graph, const occtl_curve_interpolated_info_t &theInfo)
Constructs a curve by interpolating through the given points.
Definition curves.hpp:467
occtl_geom_parabola_t as_parabola() const
Extracts the underlying parabola.
Definition curves.hpp:227
Curve reversed() const
Returns a reversed copy of this curve stored in the same graph.
Definition curves.hpp:74
static Curve from_bspline(occtl_graph_t *graph, const occtl_curve_bspline_create_info_t &theInfo)
Constructs a B-spline curve from the given create info.
Definition curves.hpp:431
TrimmedView as_trimmed() const
Extracts the parameter bounds from a trimmed curve.
Definition curves.hpp:572
double length() const
Returns the curve length over its full parameter range.
Definition curves.hpp:119
std::vector< occtl_point3_t > bspline_poles() const
Copies all poles into a std::vector<occtl_point3_t>.
Definition curves.hpp:320
Curve scaled(const Point3 &theOrigin, double theFactor) const
Returns a scaled copy of this curve stored in the same graph.
Definition curves.hpp:110
void parameter_range(double &theUMin, double &theUMax) const
Returns the parameter range [u_min, u_max] via out-parameters.
Definition curves.hpp:184
occtl_geom_line_t as_line() const
Extracts the underlying line.
Definition curves.hpp:191
occtl_vector3_t eval_dn(const double theU, const int32_t theN) const
Returns the N-th derivative vector at theU.
Definition curves.hpp:540
static Curve from_trimmed(occtl_graph_t *graph, const occtl_curve_trimmed_create_info_t &theInfo)
Constructs a trimmed curve.
Definition curves.hpp:449
BSplineView as_bspline() const
Returns a §10.5 aggregate inspection view of a B-spline curve.
Definition curves.hpp:650
occtl_geom_ellipse_t as_ellipse() const
Extracts the underlying ellipse.
Definition curves.hpp:209
occtl_graph_t * graph() const noexcept
Borrows it — returns the graph pointer.
Definition curves.hpp:67
Curve translated(const Vector3 &theDelta) const
Returns a translated copy of this curve stored in the same graph.
Definition curves.hpp:92
OffsetView as_offset() const
Extracts the scalar offset and reference direction of an offset curve.
Definition curves.hpp:580
int32_t bezier_degree() const
Returns the Bezier polynomial degree.
Definition curves.hpp:293
size_t bspline_pole_count() const
Returns the number of poles.
Definition curves.hpp:266
static Curve from_parabola(occtl_graph_t *graph, const occtl_geom_parabola_t &theParabola)
Constructs a curve from a parabola.
Definition curves.hpp:422
static Curve from_ellipse(occtl_graph_t *graph, const occtl_geom_ellipse_t &theEllipse)
Constructs a curve from an ellipse.
Definition curves.hpp:404
occtl_curve_kind_t kind() const
Returns the kind of geometry.
Definition curves.hpp:148
static Curve from_airfoil_naca4(occtl_graph_t *graph, const occtl_curve_airfoil_naca4_info_t &theInfo)
Constructs a NACA 4-digit airfoil profile as a B-spline curve.
Definition curves.hpp:487
Curve(occtl_graph_t *theGraph=nullptr, occtl_rep_id_t theId=occtl_rep_id_t{0}) noexcept
Constructs a null reference (no graph, invalid id).
Definition curves.hpp:57
Curve rotated(const Axis1Placement &theAxis, double theAngle) const
Returns a rotated copy of this curve stored in the same graph.
Definition curves.hpp:101
occtl_point3_t eval_d0(const double theU) const
Evaluates the curve point at parameter theU.
Definition curves.hpp:500
int32_t bspline_degree() const
Returns the polynomial degree.
Definition curves.hpp:257
occtl_geom_hyperbola_t as_hyperbola() const
Extracts the underlying hyperbola.
Definition curves.hpp:218
std::vector< double > bspline_knots() const
Copies all distinct knot values into a std::vector<double>.
Definition curves.hpp:331
double parameter_of_point(const Point3 &thePoint) const
Returns the parameter on the curve nearest to a given point.
Definition curves.hpp:139
std::vector< double > bspline_weights() const
Copies all weights into a std::vector<double>.
Definition curves.hpp:353
C++ veneer for the core module.
void check(const ::occtl_status_t theStatus)
Throw on non-OK; otherwise a no-op.
Definition core.hpp:85
C++ veneer for the geom module.
OCCT-Light: 3D curve representation in the topology graph.
occtl_status_t occtl_curve_reverse(occtl_graph_t *graph, occtl_rep_id_t curve_id, occtl_rep_id_t *out_id)
occtl_status_t occtl_curve_bspline_pole_count(const occtl_graph_t *graph, occtl_rep_id_t curve_id, size_t *out_count)
occtl_status_t occtl_curve_create_ellipse(occtl_graph_t *graph, occtl_geom_ellipse_t ellipse, occtl_rep_id_t *out_id)
occtl_status_t occtl_curve_length(const occtl_graph_t *graph, occtl_rep_id_t curve_id, double *out_length)
occtl_status_t occtl_curve_create_trimmed(occtl_graph_t *graph, const occtl_curve_trimmed_create_info_t *info, occtl_rep_id_t *out_id)
occtl_status_t occtl_curve_rotated(occtl_graph_t *graph, occtl_rep_id_t curve_id, occtl_axis1_placement_t axis, double angle, occtl_rep_id_t *out_id)
occtl_status_t occtl_curve_as_offset(const occtl_graph_t *graph, occtl_rep_id_t curve_id, double *out_offset, occtl_vector3_t *out_offset_dir)
occtl_status_t occtl_curve_as_trimmed(const occtl_graph_t *graph, occtl_rep_id_t curve_id, double *out_u_first, double *out_u_last)
occtl_status_t occtl_curve_translated(occtl_graph_t *graph, occtl_rep_id_t curve_id, occtl_vector3_t delta, occtl_rep_id_t *out_id)
occtl_status_t occtl_curve_bspline_poles(const occtl_graph_t *graph, occtl_rep_id_t curve_id, occtl_point3_t *out_buf, size_t capacity, size_t *out_count)
occtl_status_t occtl_curve_project_point(const occtl_graph_t *graph, occtl_rep_id_t curve_id, occtl_point3_t point, double *out_param, double *out_distance)
occtl_status_t occtl_curve_bspline_degree(const occtl_graph_t *graph, occtl_rep_id_t curve_id, int32_t *out_degree)
occtl_status_t occtl_curve_bspline_is_rational(const occtl_graph_t *graph, occtl_rep_id_t curve_id, int32_t *out_is_rational)
occtl_status_t occtl_curve_is_periodic(const occtl_graph_t *graph, occtl_rep_id_t curve_id, int32_t *out_is_periodic)
occtl_status_t occtl_curve_as_parabola(const occtl_graph_t *graph, occtl_rep_id_t curve_id, occtl_geom_parabola_t *out_parabola)
occtl_status_t occtl_curve_eval_d0(const occtl_graph_t *graph, occtl_rep_id_t curve_id, double u, occtl_point3_t *out_point)
occtl_status_t occtl_curve_continuity(const occtl_graph_t *graph, occtl_rep_id_t curve_id, occtl_geom_continuity_t *out_continuity)
occtl_status_t occtl_curve_bspline_knots(const occtl_graph_t *graph, occtl_rep_id_t curve_id, double *out_buf, size_t capacity, size_t *out_count)
occtl_status_t occtl_curve_parameter_of_point(const occtl_graph_t *graph, occtl_rep_id_t curve_id, occtl_point3_t point, double *out_param)
occtl_status_t occtl_curve_create_hyperbola(occtl_graph_t *graph, occtl_geom_hyperbola_t hyperbola, occtl_rep_id_t *out_id)
occtl_status_t occtl_curve_create_approximated(occtl_graph_t *graph, const occtl_curve_approximated_info_t *info, occtl_rep_id_t *out_id)
occtl_status_t occtl_curve_bezier_degree(const occtl_graph_t *graph, occtl_rep_id_t curve_id, int32_t *out_degree)
occtl_status_t occtl_curve_as_line(const occtl_graph_t *graph, occtl_rep_id_t curve_id, occtl_geom_line_t *out_line)
occtl_status_t occtl_curve_eval_d2(const occtl_graph_t *graph, occtl_rep_id_t curve_id, double u, occtl_point3_t *out_point, occtl_vector3_t *out_d1, occtl_vector3_t *out_d2)
occtl_status_t occtl_curve_create_bezier(occtl_graph_t *graph, const occtl_curve_bezier_create_info_t *info, occtl_rep_id_t *out_id)
occtl_status_t occtl_curve_eval_d1(const occtl_graph_t *graph, occtl_rep_id_t curve_id, double u, occtl_point3_t *out_point, occtl_vector3_t *out_d1)
occtl_status_t occtl_curve_create_airfoil_naca4(occtl_graph_t *graph, const occtl_curve_airfoil_naca4_info_t *info, occtl_rep_id_t *out_id)
occtl_status_t occtl_curve_as_circle(const occtl_graph_t *graph, occtl_rep_id_t curve_id, occtl_geom_circle_t *out_circle)
occtl_status_t occtl_curve_eval_dn(const occtl_graph_t *graph, occtl_rep_id_t curve_id, double u, int32_t n, occtl_vector3_t *out_derivative)
occtl_status_t occtl_curve_parameter_range(const occtl_graph_t *graph, occtl_rep_id_t curve_id, double *out_u_min, double *out_u_max)
occtl_status_t occtl_curve_bspline_multiplicities(const occtl_graph_t *graph, occtl_rep_id_t curve_id, int32_t *out_buf, size_t capacity, size_t *out_count)
occtl_status_t occtl_curve_eval_d3(const occtl_graph_t *graph, occtl_rep_id_t curve_id, double u, occtl_point3_t *out_point, occtl_vector3_t *out_d1, occtl_vector3_t *out_d2, occtl_vector3_t *out_d3)
occtl_status_t occtl_curve_create_interpolated(occtl_graph_t *graph, const occtl_curve_interpolated_info_t *info, occtl_rep_id_t *out_id)
occtl_status_t occtl_curve_as_hyperbola(const occtl_graph_t *graph, occtl_rep_id_t curve_id, occtl_geom_hyperbola_t *out_hyperbola)
occtl_status_t occtl_curve_bspline_flat_knots(const occtl_graph_t *graph, occtl_rep_id_t curve_id, double *out_buf, size_t capacity, size_t *out_count)
occtl_status_t occtl_curve_transformed(occtl_graph_t *graph, occtl_rep_id_t curve_id, occtl_transform_t transform, occtl_rep_id_t *out_id)
occtl_status_t occtl_curve_scaled(occtl_graph_t *graph, occtl_rep_id_t curve_id, occtl_point3_t origin, double factor, occtl_rep_id_t *out_id)
occtl_status_t occtl_curve_is_closed(const occtl_graph_t *graph, occtl_rep_id_t curve_id, int32_t *out_is_closed)
occtl_status_t occtl_curve_bspline_weights(const occtl_graph_t *graph, occtl_rep_id_t curve_id, double *out_buf, size_t capacity, size_t *out_count)
occtl_status_t occtl_curve_bezier_pole_count(const occtl_graph_t *graph, occtl_rep_id_t curve_id, size_t *out_count)
occtl_status_t occtl_curve_intersect(occtl_graph_t *graph, occtl_rep_id_t curve_id_a, occtl_rep_id_t curve_id_b, const occtl_curve_intersection_point_t **out_results, size_t *out_count)
occtl_status_t occtl_curve_bezier_is_rational(const occtl_graph_t *graph, occtl_rep_id_t curve_id, int32_t *out_is_rational)
occtl_status_t occtl_curve_create_bspline(occtl_graph_t *graph, const occtl_curve_bspline_create_info_t *info, occtl_rep_id_t *out_id)
occtl_status_t occtl_curve_bspline_knot_count(const occtl_graph_t *graph, occtl_rep_id_t curve_id, size_t *out_count)
occtl_status_t occtl_curve_as_bspline(const occtl_graph_t *graph, occtl_rep_id_t curve_id, occtl_curve_bspline_t *out)
occtl_status_t occtl_curve_bspline_poles_view(const occtl_graph_t *graph, occtl_rep_id_t curve_id, const occtl_point3_t **out_data, size_t *out_count)
occtl_status_t occtl_curve_as_ellipse(const occtl_graph_t *graph, occtl_rep_id_t curve_id, occtl_geom_ellipse_t *out_ellipse)
occtl_status_t occtl_curve_create_circle(occtl_graph_t *graph, occtl_geom_circle_t circle, occtl_rep_id_t *out_id)
occtl_status_t occtl_curve_create_parabola(occtl_graph_t *graph, occtl_geom_parabola_t parabola, occtl_rep_id_t *out_id)
occtl_status_t occtl_curve_create_line(occtl_graph_t *graph, occtl_geom_line_t line, occtl_rep_id_t *out_id)
occtl_status_t occtl_curve_create_offset(occtl_graph_t *graph, const occtl_curve_offset_create_info_t *info, occtl_rep_id_t *out_id)
occtl_curve_kind
Definition occtl_curves_common.h:45
enum occtl_curve_kind occtl_curve_kind_t
enum occtl_geom_continuity occtl_geom_continuity_t
struct occtl_graph occtl_graph_t
Definition occtl_topo_types.h:152
Directed line in 3D (origin + unit direction). Mirrors occtl_axis1_placement_t.
Definition geom.hpp:365
const occtl_axis1_placement_t & c_type() const noexcept
Borrows-it view of the underlying C value type.
Definition geom.hpp:379
Aggregate inspection view of a B-spline curve (§10.5).
Definition curves.hpp:595
A single intersection point between two curves.
Definition curves.hpp:566
double param_b
Parameter on the second curve.
Definition curves.hpp:569
double param_a
Parameter on the first curve.
Definition curves.hpp:568
occtl_point3_t point
Intersection point in 3D.
Definition curves.hpp:567
Definition curves.hpp:559
Definition curves.hpp:553
3D point value type. Mirrors occtl_point3_t with STL-flavoured access.
Definition geom.hpp:82
const occtl_point3_t & c_type() const noexcept
Borrows-it view of the underlying C value type, for direct ABI calls.
Definition geom.hpp:102
3-by-4 affine transform value type. Mirrors occtl_transform_t.
Definition geom.hpp:442
const occtl_transform_t & c_type() const noexcept
Borrows-it view of the underlying C value type.
Definition geom.hpp:495
3D free-vector value type. Mirrors occtl_vector3_t.
Definition geom.hpp:184
const occtl_vector3_t & c_type() const noexcept
Borrows-it view of the underlying C value type.
Definition geom.hpp:204
Definition occtl_geom.h:111
Definition occtl_curves.h:1289
Definition occtl_curves.h:1444
Definition occtl_curves.h:221
Definition occtl_curves.h:159
Definition occtl_curves.h:1088
int32_t is_rational
Definition occtl_curves.h:1093
const int32_t * multiplicities
Definition occtl_curves.h:1109
size_t pole_count
Definition occtl_curves.h:1097
size_t knot_count
Definition occtl_curves.h:1098
const double * weights
Definition occtl_curves.h:1106
const double * knots
Definition occtl_curves.h:1108
int32_t is_periodic
Definition occtl_curves.h:1094
const double * flat_knots
Definition occtl_curves.h:1110
size_t flat_knot_count
Definition occtl_curves.h:1099
int32_t degree
Definition occtl_curves.h:1092
int32_t continuity
Definition occtl_curves.h:1096
int32_t is_closed
Definition occtl_curves.h:1095
const occtl_point3_t * poles
Definition occtl_curves.h:1105
Definition occtl_curves.h:1385
Definition occtl_curves.h:1548
double param_a
Definition occtl_curves.h:1550
occtl_point3_t point
Definition occtl_curves.h:1549
double param_b
Definition occtl_curves.h:1551
Definition occtl_curves.h:294
Definition occtl_curves_common.h:86
Definition occtl_geom.h:820
Definition occtl_geom.h:832
Definition occtl_geom.h:845
Definition occtl_geom.h:857
Definition occtl_geom.h:76
Definition occtl_core.h:251
uint64_t bits
Definition occtl_core.h:252
Definition occtl_geom.h:84