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 6 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
54 changes: 43 additions & 11 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 @@ -2280,6 +2295,12 @@ dependencies = [
"serde",
]

[[package]]
name = "glam"
version = "0.28.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "779ae4bf7e8421cf91c0b3b64e7e8b40b862fba4d393f59150042de7c4965a94"

[[package]]
name = "glob"
version = "0.3.1"
Expand Down Expand Up @@ -2488,6 +2509,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 0.28.0",
]

[[package]]
name = "hexf-parse"
version = "0.2.1"
Expand Down Expand Up @@ -2935,7 +2966,7 @@ version = "0.18.0-alpha.1+dev"
dependencies = [
"anyhow",
"clap",
"glam",
"glam 0.22.0",
kpreid marked this conversation as resolved.
Show resolved Hide resolved
"re_tracing",
"rerun",
]
Expand Down Expand Up @@ -2964,7 +2995,7 @@ version = "0.18.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "92e4daa18df16fd196b955e4bb16574641f39141fb3ea81b493a84b9439d17e6"
dependencies = [
"glam",
"glam 0.22.0",
"num-traits",
"serde",
]
Expand Down Expand Up @@ -3093,7 +3124,7 @@ version = "0.18.0-alpha.1+dev"
dependencies = [
"anyhow",
"clap",
"glam",
"glam 0.22.0",
"rerun",
]

Expand Down Expand Up @@ -3543,7 +3574,7 @@ version = "0.18.0-alpha.1+dev"
dependencies = [
"anyhow",
"clap",
"glam",
"glam 0.22.0",
"prost",
"prost-build",
"protoc-prebuilt",
Expand Down Expand Up @@ -4705,7 +4736,7 @@ dependencies = [
"ecolor",
"enumset",
"getrandom",
"glam",
"glam 0.22.0",
"gltf",
"half 2.3.1",
"itertools 0.13.0",
Expand Down Expand Up @@ -4744,7 +4775,7 @@ dependencies = [
"anyhow",
"bytemuck",
"console_error_panic_hook",
"glam",
"glam 0.22.0",
"image",
"itertools 0.13.0",
"macaw",
Expand Down Expand Up @@ -4918,7 +4949,8 @@ dependencies = [
"bytemuck",
"criterion",
"egui",
"glam",
"glam 0.22.0",
"hexasphere",
"itertools 0.13.0",
"macaw",
"mimalloc",
Expand Down Expand Up @@ -5094,7 +5126,7 @@ dependencies = [
"ecolor",
"egui_plot",
"emath",
"glam",
"glam 0.22.0",
"half 2.3.1",
"image",
"infer",
Expand Down Expand Up @@ -5295,7 +5327,7 @@ dependencies = [
"egui-wgpu",
"egui_extras",
"egui_tiles",
"glam",
"glam 0.22.0",
"half 2.3.1",
"indexmap 2.1.0",
"itertools 0.13.0",
Expand Down Expand Up @@ -5336,7 +5368,7 @@ dependencies = [
"ahash",
"egui",
"egui_tiles",
"glam",
"glam 0.22.0",
"image",
"itertools 0.13.0",
"nohash-hasher",
Expand Down Expand Up @@ -6450,7 +6482,7 @@ version = "0.18.0-alpha.1+dev"
dependencies = [
"anyhow",
"clap",
"glam",
"glam 0.22.0",
"itertools 0.13.0",
"ndarray",
"ndarray-rand",
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ glam = "0.22" # glam update blocked by macaw
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 with half-extents and optional center, rotations, rotations, colors etc.
kpreid marked this conversation as resolved.
Show resolved Hide resolved
///
/// 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 boxes.
kpreid marked this conversation as resolved.
Show resolved Hide resolved
///
/// 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