Rerun C++ SDK
Loading...
Searching...
No Matches
rerun::archetypes::Mesh3D Struct Reference

Archetype: A 3D triangle mesh as specified by its per-mesh and per-vertex properties. More...

#include <rerun/archetypes/mesh3d.hpp>

Public Types

using IndicatorComponent = components::IndicatorComponent< IndicatorComponentName >
 Indicator component, used to identify the archetype when converting to a list of components.
 

Public Member Functions

 Mesh3D (Mesh3D &&other)=default
 
 Mesh3D (Collection< rerun::components::Position3D > _vertex_positions)
 
Mesh3D with_mesh_properties (rerun::components::MeshProperties _mesh_properties) &&
 Optional properties for the mesh as a whole (including indexed drawing).
 
Mesh3D with_vertex_normals (Collection< rerun::components::Vector3D > _vertex_normals) &&
 An optional normal for each vertex.
 
Mesh3D with_vertex_colors (Collection< rerun::components::Color > _vertex_colors) &&
 An optional color for each vertex.
 
Mesh3D with_mesh_material (rerun::components::Material _mesh_material) &&
 Optional material properties for the mesh as a whole.
 
Mesh3D with_class_ids (Collection< rerun::components::ClassId > _class_ids) &&
 Optional class Ids for the vertices.
 
Mesh3D with_instance_keys (Collection< rerun::components::InstanceKey > _instance_keys) &&
 Unique identifiers for each individual vertex in the mesh.
 
size_t num_instances () const
 Returns the number of primary instances of this archetype.
 

Public Attributes

Collection< rerun::components::Position3Dvertex_positions
 The positions of each vertex.
 
std::optional< rerun::components::MeshPropertiesmesh_properties
 Optional properties for the mesh as a whole (including indexed drawing).
 
std::optional< Collection< rerun::components::Vector3D > > vertex_normals
 An optional normal for each vertex.
 
std::optional< Collection< rerun::components::Color > > vertex_colors
 An optional color for each vertex.
 
std::optional< rerun::components::Materialmesh_material
 Optional material properties for the mesh as a whole.
 
std::optional< Collection< rerun::components::ClassId > > class_ids
 Optional class Ids for the vertices.
 
std::optional< Collection< rerun::components::InstanceKey > > instance_keys
 Unique identifiers for each individual vertex in the mesh.
 

Static Public Attributes

static constexpr const char IndicatorComponentName [] = "rerun.components.Mesh3DIndicator"
 

Detailed Description

Archetype: A 3D triangle mesh as specified by its per-mesh and per-vertex properties.

Example

Simple indexed 3D mesh

image

#include <rerun.hpp>
#include <vector>
int main() {
const auto rec = rerun::RecordingStream("rerun_example_mesh3d_indexed");
rec.spawn().exit_on_failure();
{0.0f, 1.0f, 0.0f},
{1.0f, 0.0f, 0.0f},
{0.0f, 0.0f, 0.0f},
};
{0, 0, 255},
{0, 255, 0},
{255, 0, 0},
};
const std::vector<uint32_t> indices = {2, 1, 0};
rec.log(
"triangle",
.with_vertex_normals({{0.0, 0.0, 1.0}})
.with_mesh_properties(rerun::components::MeshProperties::from_triangle_indices(indices))
.with_mesh_material(rerun::components::Material::from_albedo_factor(0xCC00CCFF))
);
}
A RecordingStream handles everything related to logging data into Rerun.
Definition recording_stream.hpp:57
Archetype: A 3D triangle mesh as specified by its per-mesh and per-vertex properties.
Definition mesh3d.hpp:63
Collection< rerun::components::Position3D > vertex_positions
The positions of each vertex.
Definition mesh3d.hpp:67
Mesh3D with_mesh_material(rerun::components::Material _mesh_material) &&
Optional material properties for the mesh as a whole.
Definition mesh3d.hpp:128
Mesh3D with_vertex_colors(Collection< rerun::components::Color > _vertex_colors) &&
An optional color for each vertex.
Definition mesh3d.hpp:121
std::optional< Collection< rerun::components::Color > > vertex_colors
An optional color for each vertex.
Definition mesh3d.hpp:78
Mesh3D with_mesh_properties(rerun::components::MeshProperties _mesh_properties) &&
Optional properties for the mesh as a whole (including indexed drawing).
Definition mesh3d.hpp:105
Mesh3D with_vertex_normals(Collection< rerun::components::Vector3D > _vertex_normals) &&
An optional normal for each vertex.
Definition mesh3d.hpp:114
Component: An RGBA color with unmultiplied/separate alpha, in sRGB gamma space with linear alpha.
Definition color.hpp:28
Component: A position in 3D space.
Definition position3d.hpp:21

Member Function Documentation

◆ with_vertex_normals()

Mesh3D rerun::archetypes::Mesh3D::with_vertex_normals ( Collection< rerun::components::Vector3D _vertex_normals) &&
inline

An optional normal for each vertex.

If specified, this must have as many elements as vertex_positions.

◆ with_class_ids()

Mesh3D rerun::archetypes::Mesh3D::with_class_ids ( Collection< rerun::components::ClassId _class_ids) &&
inline

Optional class Ids for the vertices.

The class ID provides colors and labels if not specified explicitly.

Member Data Documentation

◆ vertex_positions

Collection<rerun::components::Position3D> rerun::archetypes::Mesh3D::vertex_positions

The positions of each vertex.

If no indices are specified, then each triplet of positions is interpreted as a triangle.

◆ vertex_normals

std::optional<Collection<rerun::components::Vector3D> > rerun::archetypes::Mesh3D::vertex_normals

An optional normal for each vertex.

If specified, this must have as many elements as vertex_positions.

◆ class_ids

std::optional<Collection<rerun::components::ClassId> > rerun::archetypes::Mesh3D::class_ids

Optional class Ids for the vertices.

The class ID provides colors and labels if not specified explicitly.


The documentation for this struct was generated from the following file: