Skip to content

Includes code for doing batched transforms in both directions#1025

Merged
kushalkolar merged 7 commits intondwidgetfrom
update_coord_transforms
Apr 9, 2026
Merged

Includes code for doing batched transforms in both directions#1025
kushalkolar merged 7 commits intondwidgetfrom
update_coord_transforms

Conversation

@apasarkar
Copy link
Copy Markdown
Collaborator

This PR allows you to do batched coordinate transforms. You have a graphic, the graphic has data points stored in model space. You want to transform all of those model points to world space (or go from world space to model space). Easy to batch/vectorize this via pylinalg but the fpl functions didn't allow for this.

You can do this now:

my_data = graphic.data[:] # Let's say this is shape (100, 3)
world_coords = graphic.map_model_to_world(my_data) 

graphic.map_world_to_model also supports this now

Comment thread fastplotlib/graphics/_base.py Outdated
Comment thread fastplotlib/graphics/_base.py Outdated
Comment thread fastplotlib/graphics/_base.py Outdated
Comment thread fastplotlib/graphics/_base.py Outdated
Comment thread fastplotlib/graphics/_base.py Outdated
Comment thread fastplotlib/graphics/_base.py Outdated
Comment thread fastplotlib/graphics/_base.py Outdated
Comment thread fastplotlib/graphics/_base.py Outdated
Comment thread fastplotlib/graphics/_base.py Outdated
Comment thread fastplotlib/graphics/_base.py Outdated
@kushalkolar kushalkolar merged commit bbd03f6 into ndwidget Apr 9, 2026
@kushalkolar kushalkolar deleted the update_coord_transforms branch April 9, 2026 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants