scimesh 0.3.2
Headless CPU-only 3D software renderer for scientific mesh visualization
Loading...
Searching...
No Matches
primitives.h File Reference

Procedural geometry generators. More...

#include <scimesh/mesh.h>
Include dependency graph for primitives.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  scimesh
 

Functions

Mesh scimesh::generate_sphere (const Vec3 &center, float radius, int segments, const Color &color)
 Generate a UV-sphere (latitude/longitude tessellation).
 
Mesh scimesh::generate_cylinder (const Vec3 &start, const Vec3 &end, float radius, int segments, const Color &color)
 Generate a cylinder between two endpoints.
 
Mesh scimesh::generate_cone (const Vec3 &base, const Vec3 &tip, float radius, int segments, const Color &color)
 Generate a cone from a base circle to a tip point.
 
Mesh scimesh::generate_arrow (const Vec3 &from, const Vec3 &to, float shaft_radius, float head_radius, float head_length, int segments, const Color &color)
 Generate a 3D arrow from from to to.
 
void scimesh::merge_mesh (Mesh &dst, const Mesh &src)
 Merge one mesh into another (append geometry).
 
Mesh scimesh::generate_cuboid (const Vec3 &center, const Vec3 &half_extents, const Color &color)
 Generate an axis-aligned cuboid (rectangular box).
 
Mesh scimesh::generate_pyramid (const Vec3 &base_center, const Vec3 &apex, float half_width, const Color &color)
 Generate a square-based pyramid.
 
Mesh scimesh::generate_tetrahedron (const Vec3 &p0, const Vec3 &p1, const Vec3 &p2, const Vec3 &p3, const Color &color)
 Generate a tetrahedron (triangular pyramid) from four points.
 
Mesh scimesh::generate_torus (const Vec3 &center, float major_radius, float minor_radius, int major_segments, int minor_segments, const Color &color)
 Generate a torus (donut shape).
 
Mesh scimesh::generate_plane (const Vec3 &center, const Vec3 &normal, float half_size_x, float half_size_y, const Color &color)
 Generate a flat rectangular plane.
 
Mesh scimesh::generate_multi_spheres (const std::vector< Vec3 > &centers, const std::vector< float > &radii, const std::vector< Color > &colors, int segments=16)
 Generate multiple spheres in a single mesh (efficient batching).
 
Mesh scimesh::generate_multi_cylinders (const std::vector< Vec3 > &starts, const std::vector< Vec3 > &ends, const std::vector< float > &radii, const std::vector< Color > &colors, int segments=12)
 Generate multiple cylinders in a single mesh (efficient batching).
 

Detailed Description

Procedural geometry generators.

This file provides functions to create common 3D shapes (spheres, cubes, cylinders, arrows, etc.) without needing to load a mesh file. These are great for prototyping, creating coordinate axes, or adding simple annotations to scenes.

Definition in file primitives.h.