410{
412
414 for (size_t i = 0; i < num_points; ++i) {
418 }
419
420 const size_t num_segments = num_points - 1;
421 const auto total_samples = static_cast<Eigen::Index>(
423
426
428
433 }
434
435 const auto count =
static_cast<size_t>(total_samples);
437 return;
438 }
439
441
442 const double* x = curve->data();
443 const double* y = x +
count;
444 const double* z = y +
count;
445
448 }
449
451 const double* ty = tx +
count;
452 const double* tz = ty +
count;
453
454 const auto sample = [&](size_t s) {
455 return glm::vec3 {
456 static_cast<float>(x[s]), static_cast<float>(y[s]), static_cast<float>(z[s])
457 };
458 };
459
460 const auto tangent = [&](
size_t s) {
461 return glm::vec3 {
462 static_cast<float>(tx[s]), static_cast<float>(ty[s]), static_cast<float>(tz[s])
463 };
464 };
465
466 for (
size_t i = 0; i + 1 <
count; ++i) {
469 m_vertices[i * 2 + 1].position = sample(i + 1);
471 }
472
474}
std::vector< glm::vec2 > * points
void evaluate_planar(std::span< const double > control_points, size_t dim, Eigen::Index num_samples, std::vector< double > &out, std::vector< double > &tangents)
Evaluate a curve into coordinate-major position and tangent buffers.
void reparameterize_planar(std::span< const double > points, size_t dim, Eigen::Index point_count, Eigen::Index num_samples, std::vector< double > &out)
Resample a polyline to uniform arc length, coordinate-major.
void configure(InterpolationMode mode, double tension)
Re-resolve the kernel.
std::vector< LineVertex > m_vertices
Kinesis::CurveEvaluator m_evaluator
std::vector< double > m_curve_primary
std::vector< double > m_control_scratch
std::vector< double > m_curve_secondary
void write_path_attributes(std::span< const LineVertex > points, size_t num_points)
Write colour and thickness for the interpolated path.
size_t m_samples_per_segment
Controls smoothness vs performance.
bool m_use_arc_length_reparameterization
Optional constant-speed.
Kinesis::InterpolationMode m_path_interpolation_mode
std::vector< double > m_curve_tangents
void central_difference_tangents(std::span< const double > points, size_t dim, size_t count, std::vector< double > &tangents)
Tangents of a sampled curve by finite difference, coordinate-major.