239 if (tri.v0 >= nv || tri.v1 >= nv || tri.v2 >= nv)
245 if (std::isnan(v.x) || std::isnan(v.y) || std::isnan(v.z))
247 if (std::isinf(v.x) || std::isinf(v.y) || std::isinf(v.z))
252 if (!
colors.empty() &&
colors.size() != nv)
return false;
256 if (!
uvs.empty() &&
uvs.size() != nv)
return false;
291 min_bound =
Vec3(0.0f);
292 max_bound =
Vec3(0.0f);
298 min_bound = glm::min(min_bound, v);
299 max_bound = glm::max(max_bound, v);
The Image — an RGBA pixel buffer with compositing and I/O operations.
glm::vec3 Vec3
3-component floating-point vector (xyz).
constexpr Color DEFAULT_COLOR
The default mesh color: a neutral light gray (0.7, 0.7, 0.7).
An RGBA color with floating-point components.
int width
Image width in pixels.
A 3D triangle mesh using an indexed face set representation.
bool has_uvs() const
Does the mesh have texture coordinates?
bool is_valid() const
Check whether the mesh is in a valid, renderable state.
bool has_face_colors() const
Does the mesh have per-face colors?
std::vector< Color > face_colors
Per-face RGBA colors.
bool has_transparency
Whether the mesh contains any transparent fragments.
std::vector< Color > colors
Per-vertex RGBA colors.
bool empty() const
Is the mesh empty (no renderable geometry)?
bool has_colors() const
Does the mesh have per-vertex colors?
std::vector< Vec3 > normals
Per-vertex surface normals (unit-length direction vectors).
bool has_normals() const
Does the mesh have per-vertex normals?
void compute_bounding_box(Vec3 &min_bound, Vec3 &max_bound) const
Compute the axis-aligned bounding box (AABB) of the mesh.
std::vector< Vec3 > vertices
3D vertex positions.
Image texture
An optional texture image mapped via UV coordinates.
bool has_texture() const
Does the mesh have a texture image?
std::vector< Vec2 > uvs
Per-vertex texture coordinates (UVs).
std::vector< Triangle > triangles
Triangle index triplets.
Color default_color
Fallback color when no per-vertex or per-face color is set.
Fundamental types used throughout the scimesh rendering engine.