-
Notifications
You must be signed in to change notification settings - Fork 373
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce roundtrip-able
Points3D
archetype (py + rs) (#2774)
**Commit by commit!** What the title says. This is a pre-requisite to push `Points{2|3}D` all the way, because we don't really have any sort of tests in place for the legacy Point2D stuff, on the other hand nearly everything makes use of the old `Point3D`. ### What ### Checklist * [x] I have read and agree to [Contributor Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and the [Code of Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md) * [x] I've included a screenshot or gif (if applicable) * [x] I have tested [demo.rerun.io](https://demo.rerun.io/pr/2774) (if applicable) - [PR Build Summary](https://build.rerun.io/pr/2774) - [Docs preview](https://rerun.io/preview/pr%3Acmc%2Fpoints3d_arch/docs) - [Examples preview](https://rerun.io/preview/pr%3Acmc%2Fpoints3d_arch/examples)
- Loading branch information
Showing
52 changed files
with
2,298 additions
and
25 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
include "fbs/attributes.fbs"; | ||
|
||
include "rerun/datatypes.fbs"; | ||
include "rerun/components.fbs"; | ||
|
||
namespace rerun.archetypes; | ||
|
||
// --- | ||
|
||
/// A 3D point cloud with positions and optional colors, radii, labels, etc. | ||
/// | ||
/// \py Example | ||
/// \py ------- | ||
/// \py | ||
/// \py ```python | ||
/// \py \include:../../../../../docs/code-examples/point3d_simple_v2.py | ||
/// \py ``` | ||
/// | ||
/// \rs ## Example | ||
/// \rs | ||
/// \rs ```ignore | ||
/// \rs \include:../../../../../docs/code-examples/point3d_simple_v2.rs | ||
/// \rs ``` | ||
table Points3D ( | ||
"attr.rust.derive": "PartialEq", | ||
order: 100 | ||
) { | ||
// --- Required --- | ||
|
||
/// All the actual 3D points that make up the point cloud. | ||
points: [rerun.components.Point3D] ("attr.rerun.component_required", order: 1000); | ||
|
||
// --- Recommended --- | ||
|
||
/// Optional radii for the points, effectively turning them into circles. | ||
radii: [rerun.components.Radius] ("attr.rerun.component_recommended", nullable, order: 2000); | ||
|
||
/// Optional colors for the points. | ||
/// | ||
/// \python The colors are interpreted as RGB or RGBA in sRGB gamma-space, | ||
/// \python As either 0-1 floats or 0-255 integers, with separate alpha. | ||
colors: [rerun.components.Color] ("attr.rerun.component_recommended", nullable, order: 2100); | ||
|
||
// --- Optional --- | ||
|
||
/// Optional text labels for the points. | ||
labels: [rerun.components.Label] ("attr.rerun.component_optional", nullable, order: 3000); | ||
|
||
/// An optional floating point value that specifies the 3D drawing order. | ||
/// Objects with higher values are drawn on top of those with lower values. | ||
/// | ||
/// The default for 3D points is 30.0. | ||
draw_order: rerun.components.DrawOrder ("attr.rerun.component_optional", nullable, order: 3100); | ||
|
||
/// Optional class Ids for the points. | ||
/// | ||
/// The class ID provides colors and labels if not specified explicitly. | ||
class_ids: [rerun.components.ClassId] ("attr.rerun.component_optional", nullable, order: 3200); | ||
|
||
/// Optional keypoint IDs for the points, identifying them within a class. | ||
/// | ||
/// If keypoint IDs are passed in but no class IDs were specified, the class ID will | ||
/// default to 0. | ||
/// This is useful to identify points within a single classification (which is identified | ||
/// with `class_id`). | ||
/// E.g. the classification might be 'Person' and the keypoints refer to joints on a | ||
/// detected skeleton. | ||
keypoint_ids: [rerun.components.KeypointId] ("attr.rerun.component_optional", nullable, order: 3300); | ||
|
||
/// Unique identifiers for each individual point in the batch. | ||
instance_keys: [rerun.components.InstanceKey] ("attr.rerun.component_optional", nullable, order: 3400); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
include "arrow/attributes.fbs"; | ||
include "python/attributes.fbs"; | ||
include "rust/attributes.fbs"; | ||
|
||
include "rerun/datatypes.fbs"; | ||
include "rerun/attributes.fbs"; | ||
|
||
namespace rerun.components; | ||
|
||
// --- | ||
|
||
/// A point in 3D space. | ||
struct Point3D ( | ||
"attr.python.aliases": "npt.NDArray[np.float32], Sequence[float], Tuple[float, float, float]", | ||
"attr.python.array_aliases": "npt.NDArray[np.float32], Sequence[float]", | ||
"attr.rerun.legacy_fqname": "rerun.point3d", | ||
"attr.rust.derive": "Default, Copy, PartialEq, PartialOrd", | ||
order: 100 | ||
) { | ||
xy: rerun.datatypes.Point3D (order: 100); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
include "arrow/attributes.fbs"; | ||
include "python/attributes.fbs"; | ||
include "fbs/attributes.fbs"; | ||
include "rust/attributes.fbs"; | ||
|
||
namespace rerun.datatypes; | ||
|
||
// --- | ||
|
||
/// A point in 3D space. | ||
struct Point3D ( | ||
"attr.python.aliases": "Sequence[float]", | ||
"attr.python.array_aliases": "npt.NDArray[Any], Sequence[npt.NDArray[Any]], Sequence[Tuple[float, float]], Sequence[float]", | ||
"attr.rust.derive": "Default, Copy, PartialEq, PartialOrd", | ||
order: 100 | ||
) { | ||
x: float (order: 100); | ||
y: float (order: 200); | ||
z: float (order: 300); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# This is a sha256 hash for all direct and indirect dependencies of this crate's build script. | ||
# It can be safely removed at anytime to force the build script to run again. | ||
# Check out build.rs to see how it's computed. | ||
94f7feacba1a7d75fee69d10294c77e2f4539106e4906f3d58a5db776e11c4be | ||
173356986894caad5a2b01f9b985726839309968b8466a9f1e19401efe546b87 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.