-
Notifications
You must be signed in to change notification settings - Fork 113
Update Frame, Transformation
#357
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
Conversation
… with local\global_coordinates
…compas-dev/compas into update-frame-and-transformation
tomvanmele
left a comment
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.
nice! we just need to work on the naming conventions here and there in my opinion...
|
|
||
| ### Added | ||
|
|
||
| - Added `matrix_change_basis`, `Transformation.change_basis` |
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.
should this not be matrix_from_basis_change or something like that?
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.
better would be change_of_basis_matrix but that does not follow the other naming.
or matrix_to_change_basis?
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.
ha no, sorry, i misunderstood the point of the function...
| """Represents another frame in the local coordinate system in the world | ||
| coordinate system. | ||
| @staticmethod | ||
| def local_to_local_coords(frame1, frame2, object_in_frame1): |
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.
same as with global (and also applies everywhere) should local not be frame?
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.
Agree to the global to world. But with I am not sure with the frame to local.
While it works well with the function-based version (world_to_frame_coords(frame, point) or world_to_frame(frame, point)), the oo-version does not look so nice: frame.to_frame(point) or frame.to_frame_coords(point). There I would prefer keeping the frame.local_coords(point).
Some options:
| oo | function |
|---|---|
frame.local_coords(point), frame.world_coords(point), frame.to_local(point), frame.to_world(point), |
world_to_local(frame, point), world_to_local_coords(frame, point), local_to_world_coords(frame, point), local_to_world(frame, point) |
frame.to_frame(point), frame.to_world(point), frame.to_frame_coords(point), frame.to_world_coords(point) |
world_to_frame(frame, point), world_to_frame_coords(frame, point), frame_to_world_coords(frame, point), frame_to_world(frame, point) |
Frame.local_to_local_coords(f1, f2, point), Frame.frame_to_frame_coords(f1, f2, point) |
local_to_local_coords(f1, f2, point), frame_to_frame_coords(f1, f2, point) |
more opinons, ideas, .. are welcome ;)
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 prefer local much more than frame (frame is very ambiguous imo).
I like the option with to_ prefixes.
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.
alright, local it is.
to_ versions +1
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.
ok, thank you! implemented changes
| return multiply_matrices(T2, matrix_inverse(T1)) | ||
|
|
||
|
|
||
| def matrix_change_basis(frame_from, frame_to): |
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.
how is this different than frame_to_frame?
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.
the frame_to_frame transformation from frame f1 to frame f2 allows to transform geometry from f1 into f2, i.e. the orientation of the object in regards to the respective frame stays the same.
The change_basis transformation from frame f1 to frame f2 allows to represent geometry of frame f1 in frame f2 (not transforming the geometry )
so they are used for different purposes...
|
@gonzalocasas merge? |
This PR adds several features and suggests some little modifications. Fixes #335.
Checkout Changelog for a complete list of additions and changes.
Comes with 2 incompatible API changes:
origin, uvwofglobal_coords_numpyandlocal_coords_numpytoframeFrame.represent_point/vector/frame_in_global_coordinatesandFrame.represent_point/vector/frame_in_local_coordinatestoFrame.local_coordsandFrame.global_coordsWhat type of change is this?
Checklist
CHANGELOG.mdfile in theUnreleasedsection under the most fitting heading:Added,Changed,Removed.invoke test).compas.datastructures.Mesh.