forked from rerun-io/rerun
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…io#6866) ### What * Part of #6831 * Followed by rerun-io#6892 Starts the process of splitting up `Transform3D` into several components. Far from done overall, but establishes a lot of the new documentation & test patterns for this effort. This PR fully replaces the `TranslationAndMat3x3` variant & datatype and puts `Translation3D` & `TransformMat3x3` into existence and to work. It does not touch on anything directly related to out of tree transforms and does not do away from the `Transform3D` component yet. I added a new component edit/view ui for consistency: <img width="532" alt="image" src="https://github.com/rerun-io/rerun/assets/1220815/1e7122f0-bf27-4f50-bc23-2824c2607ab2"> <img width="552" alt="image" src="https://github.com/rerun-io/rerun/assets/1220815/1b30af25-905f-49ed-952b-961350dfab1f"> Unfortunately, transform hierarchy doesn't get affected by overrides yet (see rerun-io#6743), which is why I had to turn off editing itself for the moment. Also, we don't yet show multiline on hover, so matrix3x3 inspection regressed a little bit for the moment (part of the only partially solved rerun-io#6661) ### Checklist * [x] pass `main` ci checks * [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 the web demo (if applicable): * Using examples from latest `main` build: [rerun.io/viewer](https://rerun.io/viewer/pr/6866?manifest_url=https://app.rerun.io/version/main/examples_manifest.json) * Using full set of examples from `nightly` build: [rerun.io/viewer](https://rerun.io/viewer/pr/6866?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json) * [x] The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG * [x] If applicable, add a new check to the [release checklist](https://github.com/rerun-io/rerun/blob/main/tests/python/release_checklist)! * [x] If have noted any breaking changes to the log API in `CHANGELOG.md` and the migration guide - [PR Build Summary](https://build.rerun.io/pr/6866) - [Recent benchmark results](https://build.rerun.io/graphs/crates.html) - [Wasm size tracking](https://build.rerun.io/graphs/sizes.html) To run all checks from `main`, comment on the PR with `@rerun-bot full-check`.
- Loading branch information
Showing
102 changed files
with
1,984 additions
and
2,030 deletions.
There are no files selected for viewing
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
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
45 changes: 45 additions & 0 deletions
45
crates/store/re_types/definitions/rerun/components/transform_mat3x3.fbs
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,45 @@ | ||
namespace rerun.components; | ||
|
||
/// A 3x3 transformation matrix Matrix. | ||
/// | ||
/// 3x3 matrixes are able to represent any affine transformation in 3D space, | ||
/// i.e. rotation, scaling, shearing, reflection etc. | ||
/// | ||
/// Matrices in Rerun are stored as flat list of coefficients in column-major order: | ||
/// ```text | ||
/// column 0 column 1 column 2 | ||
/// ------------------------------------------------- | ||
/// row 0 | flat_columns[0] flat_columns[3] flat_columns[6] | ||
/// row 1 | flat_columns[1] flat_columns[4] flat_columns[7] | ||
/// row 2 | flat_columns[2] flat_columns[5] flat_columns[8] | ||
/// ``` | ||
/// | ||
/// \py However, construction is done from a list of rows, which follows NumPy's convention: | ||
/// \py ```python | ||
/// \py np.testing.assert_array_equal( | ||
/// \py rr.components.TransformMat3x3([1, 2, 3, 4, 5, 6, 7, 8, 9]).flat_columns, np.array([1, 4, 7, 2, 5, 8, 3, 6, 9], dtype=np.float32) | ||
/// \py ) | ||
/// \py np.testing.assert_array_equal( | ||
/// \py rr.components.TransformMat3x3([[1, 2, 3], [4, 5, 6], [7, 8, 9]]).flat_columns, | ||
/// \py np.array([1, 4, 7, 2, 5, 8, 3, 6, 9], dtype=np.float32), | ||
/// \py ) | ||
/// \py ``` | ||
/// \py If you want to construct a matrix from a list of columns instead, use the named `columns` parameter: | ||
/// \py ```python | ||
/// \py np.testing.assert_array_equal( | ||
/// \py rr.components.TransformMat3x3(columns=[1, 2, 3, 4, 5, 6, 7, 8, 9]).flat_columns, | ||
/// \py np.array([1, 2, 3, 4, 5, 6, 7, 8, 9], dtype=np.float32), | ||
/// \py ) | ||
/// \py np.testing.assert_array_equal( | ||
/// \py rr.components.TransformMat3x3(columns=[[1, 2, 3], [4, 5, 6], [7, 8, 9]]).flat_columns, | ||
/// \py np.array([1, 2, 3, 4, 5, 6, 7, 8, 9], dtype=np.float32), | ||
/// \py ) | ||
/// \py ``` | ||
struct TransformMat3x3 ( | ||
"attr.docs.unreleased", | ||
"attr.rust.derive": "Default, Copy, PartialEq, bytemuck::Pod, bytemuck::Zeroable", | ||
"attr.rust.repr": "transparent" | ||
) { | ||
matrix: rerun.datatypes.Mat3x3 (order: 100); | ||
} | ||
|
10 changes: 10 additions & 0 deletions
10
crates/store/re_types/definitions/rerun/components/translation3d.fbs
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,10 @@ | ||
namespace rerun.components; | ||
|
||
/// A translation vector in 3D space. | ||
struct Translation3D ( | ||
"attr.docs.unreleased", | ||
"attr.rust.derive": "Default, Copy, PartialEq, bytemuck::Pod, bytemuck::Zeroable", | ||
"attr.rust.repr": "transparent" | ||
) { | ||
vector: rerun.datatypes.Vec3D (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
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
34 changes: 0 additions & 34 deletions
34
crates/store/re_types/definitions/rerun/datatypes/translation_and_mat3x3.fbs
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.