-
Notifications
You must be signed in to change notification settings - Fork 366
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
New transform components: Translation3D
& TransformMat3x3
#6866
Merged
Wumpf
merged 27 commits into
main
from
andreas/translation-and-transformmat3-components
Jul 16, 2024
+1,984
−2,030
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
d88e1d5
new Translation3D & TransformMat3x3 components
Wumpf 0375c20
add new translation & mat3x3 to transform3d archetype
Wumpf ca34b5b
Remote `transform` argument from Python's `Transform3D`, make unit te…
Wumpf 444828d
start changelog & migration guide on transforms
Wumpf 7007109
Transform context takes new TransformMat3x3 and Translation into account
Wumpf 8f0460d
Adjust C++ constructors to use new translation & mat3x3 types, overha…
Wumpf b7ac362
fix C++ typos
Wumpf 8015515
fix transform3d roundtrip tests
Wumpf 9b87634
Remove `TranslationAndMat3x3` datatype/enum variant
Wumpf 9816281
new component ui for the new transform and matrix components
Wumpf 40a9622
remove Transform3D::IDENTITY from c++ and Rust as it stops making sen…
Wumpf 7100140
add test for snippets included in transform_mat3x3
Wumpf 146808b
fix missing unreleased attributes
Wumpf 146ee98
fix missing IDENTITY removal
Wumpf 105375c
fix gcc issues
Wumpf 11fe2d1
more gcc fixing
Wumpf 35bae82
fix C++ doc strings
Wumpf 9d311ea
fix broken python import
Wumpf 6a1aef2
Merge branch 'main' into andreas/translation-and-transformmat3-compon…
Wumpf 21ff988
Merge remote-tracking branch 'origin/main' into andreas/translation-a…
Wumpf ab8d847
rust warning fixes following merge
Wumpf 2dd00d9
Fix python examples
Wumpf 681b386
Fix python lints in transform test
Wumpf bc4490b
py-fmt
Wumpf 8b7d2a1
Merge remote-tracking branch 'origin/main' into andreas/translation-a…
Wumpf f5418ee
remove debug prints
Wumpf fe140e2
fix rust transform3d test
Wumpf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are more and more establishing an alternative pattern of elsewhere of "if X is set, then Y and Z are ignored, with a warning". I still wonder if this might be the better thing to do with mat4x4 and mat3x3+transform.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not a bad point, but the exclusion sets are arguably more complicated than including everything 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with this. The new design is conceptually very simple: we have a bunch of different transform components, and we have a well-defined order in which they are applied.