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

◆ polyline()

MAYAFLUX_API std::vector< Kakshya::LineVertex > MayaFlux::Kinesis::polyline ( std::span< const glm::vec2 >  pts,
glm::vec3  color = glm::vec3(1.F),
float  thickness = 1.F 
)

Polyline as a LINE_LIST (open path, 2 * (pts.size() - 1) vertices).

Converts a span of NDC vec2 positions into adjacent LineVertex pairs. Suitable for waveform traces, cable routes, and arbitrary open curves.

Parameters
ptsOrdered path vertices in NDC.
colorUniform line color.
thicknessLine thickness.

Definition at line 286 of file Geometry2D.cpp.

288{
289 if (pts.size() < 2)
290 return {};
291
292 std::vector<Kakshya::LineVertex> out;
293 out.reserve((pts.size() - 1) * 2);
294
295 for (size_t i = 0; i + 1 < pts.size(); ++i) {
296 out.push_back(lvert2(pts[i], color, thickness));
297 out.push_back(lvert2(pts[i + 1], color, thickness));
298 }
299
300 return out;
301}

Referenced by MayaFlux::Portal::Forma::Geometry::stroke_slider().

+ Here is the caller graph for this function: