MayaFlux 1.0.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::vec4 color = glm::vec4(1.F),
float thickness = 1.F )
nodiscard

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 347 of file Geometry2D.cpp.

349{
350 if (pts.size() < 2)
351 return {};
352
353 std::vector<Kakshya::LineVertex> out;
354 out.reserve((pts.size() - 1) * 2);
355
356 for (size_t i = 0; i + 1 < pts.size(); ++i) {
357 out.push_back(lvert2(pts[i], color, thickness));
358 out.push_back(lvert2(pts[i + 1], color, thickness));
359 }
360
361 return out;
362}

Referenced by MayaFlux::Portal::Forma::Geometry::handle_path(), and MayaFlux::Portal::Forma::Geometry::stroke_slider().

Here is the caller graph for this function: