MayaFlux 0.5.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ write_curve_segment()

void MayaFlux::Nodes::GpuSync::PathGeneratorNode::write_curve_segment ( const std::vector< LineVertex > &  curve_verts,
size_t  start_idx,
LineVertex dst 
)
private

Evaluate one window and write its vertices.

Parameters
curve_vertsControl point source.
start_idxFirst control point of the window.
dstDestination for vertices_per_window() vertices.

Definition at line 147 of file PathGeneratorNode.cpp.

151{
152 if (start_idx + 3 >= curve_verts.size()) {
153 return;
154 }
155
157
158 for (size_t i = 0; i < 4; ++i) {
159 const auto& pt = curve_verts[start_idx + i].position;
160 m_segment_controls[i * 3 + 0] = pt.x;
161 m_segment_controls[i * 3 + 1] = pt.y;
162 m_segment_controls[i * 3 + 2] = pt.z;
163 }
164
166
167 const std::vector<double>* curve = &m_curve_primary;
168
172 curve = &m_curve_secondary;
173 }
174
175 const auto count = static_cast<size_t>(m_samples_per_segment);
176 if (count < 2) {
177 return;
178 }
179
180 const double* x = curve->data();
181 const double* y = x + count;
182 const double* z = y + count;
183
184 for (size_t i = 0; i < count - 1; ++i) {
185 dst[i * 2].position = {
186 static_cast<float>(x[i]), static_cast<float>(y[i]), static_cast<float>(z[i])
187 };
188 dst[i * 2 + 1].position = {
189 static_cast<float>(x[i + 1]), static_cast<float>(y[i + 1]), static_cast<float>(z[i + 1])
190 };
191 }
192
193 write_segment_attributes(curve_verts, start_idx, dst);
194}
size_t count
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 evaluate_planar(std::span< const double > control_points, size_t dim, Eigen::Index num_samples, std::vector< double > &out)
Evaluate a curve into a coordinate-major buffer.
void configure(InterpolationMode mode, double tension)
Re-resolve the kernel.
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.

References MayaFlux::Kinesis::CurveEvaluator::configure(), count, MayaFlux::Kinesis::CurveEvaluator::evaluate_planar(), m_arc_length_parameterization, m_curve_primary, m_curve_secondary, m_evaluator, m_mode, m_samples_per_segment, m_segment_controls, m_tension, MayaFlux::Kakshya::LineVertex::position, MayaFlux::Kinesis::CurveEvaluator::reparameterize_planar(), and write_segment_attributes().

Referenced by complete(), generate_interpolated_path(), and regenerate_segment_range().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: