Evaluate one window and write its vertices.
109{
110 if (start_idx + 3 >= curve_verts.size()) {
111 return;
112 }
113
115
116 for (size_t i = 0; i < 4; ++i) {
117 const auto& pt = curve_verts[start_idx + i].position;
121 }
122
125
127
132 }
133
136 return;
137 }
138
139 const double* x = curve->data();
140 const double* y = x +
count;
141 const double* z = y +
count;
142
145 }
146
148 const double* ty = tx +
count;
149 const double* tz = ty +
count;
150
151 const auto sample = [&](size_t s) {
152 return glm::vec3 {
153 static_cast<float>(x[s]), static_cast<float>(y[s]), static_cast<float>(z[s])
154 };
155 };
156
157 const auto tangent = [&](
size_t s) {
158 return glm::vec3 {
159 static_cast<float>(tx[s]), static_cast<float>(ty[s]), static_cast<float>(tz[s])
160 };
161 };
162
163 for (
size_t i = 0; i <
count - 1; ++i) {
164 dst[i * 2].position = sample(i);
166 dst[i * 2 + 1].position = sample(i + 1);
168 }
169
171}
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::array< double, 12 > m_segment_controls
Kinesis::CurveEvaluator m_evaluator
Kinesis::InterpolationMode m_mode
std::vector< double > m_curve_tangents
std::vector< double > m_curve_secondary
Eigen::Index m_samples_per_segment
bool m_arc_length_parameterization
void write_segment_attributes(const std::vector< LineVertex > &curve_verts, size_t start_idx, LineVertex *dst) const
Write colour and thickness for one window, leaving positions intact.
std::vector< double > m_curve_primary
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.