22 const glm::vec3& center,
25 const glm::vec3& normal = glm::vec3(0, 0, 1));
37 const glm::vec3& center,
41 const glm::vec3& normal = glm::vec3(0, 0, 1));
52 const glm::vec3& center,
55 const glm::vec3& normal = glm::vec3(0, 0, 1));
69 const glm::vec3& center,
72 const glm::vec3& normal = glm::vec3(0, 0, 1),
73 float phase_offset = 0.0F);
81 std::vector<glm::vec3>& vertices,
82 const glm::mat4& transform);
92 std::vector<glm::vec3>& vertices,
93 const glm::vec3& axis,
95 const glm::vec3& origin = glm::vec3(0));
103 std::vector<glm::vec3>& vertices,
104 const glm::vec3& displacement);
113 std::vector<glm::vec3>& vertices,
115 const glm::vec3& origin = glm::vec3(0));
124 std::vector<glm::vec3>& vertices,
125 const glm::vec3&
scale,
126 const glm::vec3& origin = glm::vec3(0));
139 const std::vector<Kakshya::LineVertex>& path_vertices,
154 const std::vector<Kakshya::LineVertex>& path_vertices,
155 float tangent_length,
168 const std::vector<Kakshya::LineVertex>& path_vertices,
169 float curvature_scale,
179 const std::function<glm::vec3(
float)>& curve,
192 const std::vector<Kakshya::LineVertex>& path_vertices,
202 std::vector<glm::vec3>& vertices,
203 const glm::vec3& plane_point,
204 const glm::vec3& plane_normal);
215 const std::vector<glm::vec3>& vertices,
216 const glm::vec3& projection_normal = glm::vec3(0, 0, 1));
234 const std::vector<glm::vec3>& positions,
235 const std::vector<glm::vec3>& colors,
236 const std::vector<float>& color_positions = {},
237 float scalar = 1.0F);
243 const std::vector<glm::vec3>& positions,
244 const glm::vec3& color,
245 float scalar = 1.0F);
251 const std::vector<glm::vec3>& positions,
252 const std::vector<glm::vec3>& colors,
253 float scalar = 1.0F);
263 std::array<Kakshya::TextureQuadVertex, 4>
vertices;
278 glm::vec2 position = glm::vec2(0.0F),
279 glm::vec2
scale = glm::vec2(1.0F),
280 float rotation = 0.0F);
291[[nodiscard]] MAYAFLUX_API std::array<Kakshya::Vertex, 4>
filled_rect(
293 glm::vec3 color = glm::vec3(1.F));
303[[nodiscard]] MAYAFLUX_API std::array<Kakshya::TextureQuadVertex, 4>
textured_rect(
317 const glm::vec3& center,
318 const glm::vec3& half,
319 const glm::vec3& color = glm::vec3(1.F));
334 const glm::vec3& center,
335 const glm::vec3& half_extents,
336 uint32_t subdivisions = 1);
352 const glm::vec3& center,
357 const glm::vec3& normal = glm::vec3(0.0F, 1.0F, 0.0F));
376 const std::function<glm::vec3(
float u,
float v)>& fn,
402 std::span<const glm::vec3> path,
403 const std::function<
float(
float t)>& radius_fn,
404 uint32_t radial_segments = 8,
405 bool capped =
false);
425 const std::function<glm::vec2(
float t)>& profile_fn,
426 uint32_t profile_segs,
427 uint32_t radial_segs,
428 float sweep_radians = glm::two_pi<float>());
453 const glm::vec3& bounds_min,
454 const glm::vec3& bounds_max,
458 float iso_level = 0.0F);
std::vector< glm::vec3 > generate_rectangle(const glm::vec3 ¢er, float width, float height, const glm::vec3 &normal)
Generate vertices of an axis-aligned rectangular path.
Kakshya::MeshData generate_revolution(const std::function< glm::vec2(float)> &profile_fn, uint32_t profile_segs, uint32_t radial_segs, float sweep_radians)
void apply_rotation(std::vector< glm::vec3 > &vertices, const glm::vec3 &axis, float angle, const glm::vec3 &origin)
Apply rotation to vertex set around arbitrary axis.
std::vector< Kakshya::Vertex > apply_vertex_colors(const std::vector< glm::vec3 > &positions, const std::vector< glm::vec3 > &colors, float scalar)
Convert positions to LineVertex with per-vertex colors.
void apply_scale(std::vector< glm::vec3 > &vertices, const glm::vec3 &scale, const glm::vec3 &origin)
Apply non-uniform scaling to vertex set.
Kakshya::MeshData generate_parametric_surface(const std::function< glm::vec3(float, float)> &fn, uint32_t u_segs, uint32_t v_segs)
void apply_uniform_scale(std::vector< glm::vec3 > &vertices, float scale, const glm::vec3 &origin)
Apply uniform scaling to vertex set.
Kakshya::MeshData generate_box(const glm::vec3 ¢er, const glm::vec3 &half_extents, uint32_t subdivisions)
Generate a solid box as an indexed TRIANGLE_LIST mesh.
std::vector< glm::vec3 > generate_regular_polygon(const glm::vec3 ¢er, float radius, size_t sides, const glm::vec3 &normal, float phase_offset)
Generate vertices of a regular n-gon.
std::vector< Kakshya::Vertex > apply_color_gradient(const std::vector< glm::vec3 > &positions, const std::vector< glm::vec3 > &colors, const std::vector< float > &color_positions, float scalar)
Apply color interpolation to position vertices.
void apply_transform(std::vector< glm::vec3 > &vertices, const glm::mat4 &transform)
Apply rigid transformation to vertex set.
QuadGeometry generate_quad(glm::vec2 position, glm::vec2 scale, float rotation)
Generate a textured quad centred on the origin.
std::vector< Kakshya::LineVertex > compute_path_tangents(const std::vector< Kakshya::LineVertex > &path_vertices, float tangent_length, size_t stride)
Compute tangent vectors along a piecewise-linear path.
std::vector< glm::vec3 > generate_ellipse(const glm::vec3 ¢er, float semi_major, float semi_minor, size_t segments, const glm::vec3 &normal)
Generate vertices along an elliptical path.
void apply_translation(std::vector< glm::vec3 > &vertices, const glm::vec3 &displacement)
Apply translation to vertex set.
void project_onto_plane(std::vector< glm::vec3 > &vertices, const glm::vec3 &plane_point, const glm::vec3 &plane_normal)
Project vertices onto plane defined by normal.
std::vector< Kakshya::LineVertex > compute_path_curvature(const std::vector< Kakshya::LineVertex > &path_vertices, float curvature_scale, size_t stride)
Compute curvature vectors along a path (2nd derivative approximation)
std::vector< glm::vec3 > compute_convex_hull_2d(const std::vector< glm::vec3 > &vertices, const glm::vec3 &projection_normal)
Compute convex hull of vertex set (2D projection)
MAYAFLUX_API Kakshya::MeshData generate_sdf_mesh(const Kinesis::SpatialField &field, const glm::vec3 &bounds_min, const glm::vec3 &bounds_max, uint32_t res_x, uint32_t res_y, uint32_t res_z, float iso_level=0.0F)
Extract an isosurface from a scalar field using marching cubes.
Kakshya::MeshData generate_grid(const glm::vec3 ¢er, float extent_x, float extent_z, uint32_t cols, uint32_t rows, const glm::vec3 &normal)
Generate a subdivided flat grid in the XZ plane.
std::vector< Kakshya::Vertex > cuboid_wireframe(const glm::vec3 ¢er, const glm::vec3 &half, const glm::vec3 &color)
Generate a cuboid wireframe as LINE_LIST pairs.
std::array< Kakshya::TextureQuadVertex, 4 > textured_rect(Kinesis::AABB2D region)
Generate a UV-mapped TRIANGLE_STRIP quad from an AABB2D.
std::vector< glm::vec3 > generate_circle(const glm::vec3 ¢er, float radius, size_t segments, const glm::vec3 &normal)
Generate vertices along a circular path.
std::vector< Kakshya::LineVertex > compute_path_normals(const std::vector< Kakshya::LineVertex > &path_vertices, float normal_length, size_t stride)
Compute normal vectors along a piecewise-linear path.
Tendency< D, float > scale(const Tendency< D, float > &t, float factor)
Uniform scaling of a scalar-output tendency.
std::vector< Kakshya::LineVertex > reparameterize_by_arc_length(const std::vector< Kakshya::LineVertex > &path_vertices, size_t num_samples)
Resample path vertices for arc-length parameterization.
std::array< Kakshya::Vertex, 4 > filled_rect(Kinesis::AABB2D region, glm::vec3 color)
Generate a filled TRIANGLE_STRIP quad from an AABB2D.
std::vector< glm::vec3 > sample_parametric_curve(const std::function< glm::vec3(float)> &curve, size_t samples)
Sample parametric curve uniformly in parameter space.
std::vector< Kakshya::Vertex > apply_uniform_color(const std::vector< glm::vec3 > &positions, const glm::vec3 &color, float scalar)
Apply uniform color to position vertices.
Kakshya::MeshData generate_tube(std::span< const glm::vec3 > path, const std::function< float(float)> &radius_fn, uint32_t radial_segments, bool capped)
Owning CPU-side representation of a loaded or generated mesh.
Complete description of vertex data layout in a buffer.
Axis-aligned bounding rectangle in a 2D coordinate space.
std::array< Kakshya::TextureQuadVertex, 4 > vertices
Kakshya::VertexLayout layout
Textured quad vertex data together with its semantic layout descriptor.
Typed, composable, stateless callable from domain D to range R.