Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Ellipsoids3D archetype. #6853

Merged
merged 22 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 28 additions & 2 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1177,6 +1177,21 @@ dependencies = [
"wasm-bindgen",
]

[[package]]
name = "const_soft_float"
version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "87ca1caa64ef4ed453e68bb3db612e51cf1b2f5b871337f0fcab1c8f87cc3dff"

[[package]]
name = "constgebra"
version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e1aaf9b65849a68662ac6c0810c8893a765c960b907dd7cfab9c4a50bf764fbc"
dependencies = [
"const_soft_float",
]

[[package]]
name = "convert_case"
version = "0.6.0"
Expand Down Expand Up @@ -2488,6 +2503,16 @@ version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"

[[package]]
name = "hexasphere"
version = "14.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6c64d70ed6295005e2bc5a6f624300cfd6d49908da76b3654c4cbdb1d4222705"
dependencies = [
"constgebra",
"glam",
]

[[package]]
name = "hexf-parse"
version = "0.2.1"
Expand Down Expand Up @@ -4919,6 +4944,7 @@ dependencies = [
"criterion",
"egui",
"glam",
"hexasphere",
"itertools 0.13.0",
"mimalloc",
"nohash-hasher",
Expand Down Expand Up @@ -6411,9 +6437,9 @@ dependencies = [

[[package]]
name = "target-lexicon"
version = "0.12.15"
version = "0.12.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4873307b7c257eddcb50c9bedf158eb669578359fb28428bef438fec8e6ba7c2"
checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f"

[[package]]
name = "tempfile"
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ glam = "0.28"
glob = "0.3"
gltf = "1.1"
half = "2.3.1"
hexasphere = "14.0.0"
image = { version = "0.25", default-features = false }
indent = "0.1"
indexmap = "2.1" # Version chosen to align with other dependencies
Expand Down
1 change: 1 addition & 0 deletions crates/store/re_types/definitions/rerun/archetypes.fbs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ include "./archetypes/boxes3d.fbs";
include "./archetypes/clear.fbs";
include "./archetypes/depth_image.fbs";
include "./archetypes/disconnected_space.fbs";
include "./archetypes/ellipsoids.fbs";
include "./archetypes/image.fbs";
include "./archetypes/line_strips2d.fbs";
include "./archetypes/line_strips3d.fbs";
Expand Down
63 changes: 63 additions & 0 deletions crates/store/re_types/definitions/rerun/archetypes/ellipsoids.fbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
include "fbs/attributes.fbs";
include "rust/attributes.fbs";
include "cpp/attributes.fbs";

include "rerun/datatypes.fbs";
include "rerun/components.fbs";

namespace rerun.archetypes;

// ---

/// 3D ellipsoids or spheres.
///
/// This archetype is for ellipsoids or spheres whose size is a key part of the data
/// (e.g. a bounding sphere).
/// For points whose radii are for the sake of visualization, use `Points3D` instead.
///
/// Currently, ellipsoids are always rendered as wireframes.
/// Opaque and transparent rendering will be supported later.
///
/// \example archetypes/ellipsoid_batch !api title="Batch of ellipsoids"
emilk marked this conversation as resolved.
Show resolved Hide resolved
table Ellipsoids (
"attr.rust.derive": "PartialEq",
"attr.rust.new_pub_crate",
"attr.cpp.no_field_ctors",
"attr.docs.category": "Spatial 3D",
"attr.docs.view_types": "Spatial3DView, Spatial2DView: if logged above active projection"
) {
// --- Required ---

/// For each ellipsoid, half of its size on its three axes.
///
/// If all components are equal, then it is a sphere with that radius.
half_sizes: [rerun.components.HalfSize3D] ("attr.rerun.component_required", order: 1000);
kpreid marked this conversation as resolved.
Show resolved Hide resolved

// --- Recommended ---

/// Optional center positions of the ellipsoids.
///
/// If not specified, the centers will be at (0, 0, 0).
centers: [rerun.components.Position3D] ("attr.rerun.component_recommended", nullable, order: 2000);

/// Optional rotations of the ellipsoids.
///
/// If not specified, the axes of the ellipsoid align with the axes of the coordinate system.
rotations: [rerun.components.Rotation3D] ("attr.rerun.component_recommended", nullable, order: 2100);

/// Optional colors for the ellipsoids.
colors: [rerun.components.Color] ("attr.rerun.component_recommended", nullable, order: 2200);

// --- Optional ---

/// Optional radii for the lines used when the ellipsoid is rendered as a wireframe.
line_radii: [rerun.components.Radius] ("attr.rerun.component_optional", nullable, order: 3000);

/// Optional text labels for the ellipsoids.
labels: [rerun.components.Text] ("attr.rerun.component_optional", nullable, order: 3100);

/// Optional `ClassId`s for the ellipsoids.
///
/// The class ID provides colors and labels if not specified explicitly.
class_ids: [rerun.components.ClassId] ("attr.rerun.component_optional", nullable, order: 3200);
}
1 change: 1 addition & 0 deletions crates/store/re_types/src/archetypes/.gitattributes

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading