| 253 | #ifdef __cplusplus |
| 254 | |
| 255 | inline LNLib::LN_NurbsCurve FromCAPI(LN_NurbsCurve_C c) { |
| 256 | LNLib::LN_NurbsCurve s; |
| 257 | s.Degree = c.degree; |
| 258 | s.KnotVector.assign(c.knot_vector, c.knot_vector + c.knot_vector_count); |
| 259 | s.ControlPoints.resize(c.control_point_count); |
| 260 | for (int i = 0; i < c.control_point_count; ++i) { |
| 261 | XYZW_C cp = c.control_points[i]; |
| 262 | s.ControlPoints[i] = LNLib::XYZW(cp.wx, cp.wy, cp.wz, cp.w); |
| 263 | } |
| 264 | return s; |
| 265 | } |
| 266 | |
| 267 | inline LN_NurbsCurve_C ToCAPI(const LNLib::LN_NurbsCurve& s) { |
| 268 | static thread_local std::vector<double> g_knot_buffer; |