-
-
Notifications
You must be signed in to change notification settings - Fork 313
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
Fix transformation handling in DataInspector #3002
Conversation
Compile Times benchmarkNote, that these numbers may fluctuate on the CI servers, so take them with a grain of salt. All benchmark results are based on the mean time and negative percent mean faster than the base branch. Note, that GLMakie + WGLMakie run on an emulated GPU, so the runtime benchmark is much slower. Results are from running: using_time = @ctime using Backend
# Compile time
create_time = @ctime fig = scatter(1:4; color=1:4, colormap=:turbo, markersize=20, visible=true)
display_time = @ctime Makie.colorbuffer(display(fig))
# Runtime
create_time = @benchmark fig = scatter(1:4; color=1:4, colormap=:turbo, markersize=20, visible=true)
display_time = @benchmark Makie.colorbuffer(display(fig))
|
Should we export the |
Small example for using GLMakie, FileIO
m = FileIO.load(Makie.assetpath("brain.stl"))
N = length(Makie.coordinates(m))
f, a, p = mesh(m, color = 1:N, colormap = :viridis)
ls = Observable([Point3f(NaN), Point3f(NaN)])
p = Observable(Point3f(NaN))
scatterlines!(a, ls, color = [:red, :orange], depth_shift = -1f-3)
scatter!(a, p, color = :black, depth_shift = -1f-3)
on(events(a).keyboardbutton) do e
if e.key == Keyboard.space && e.action == Keyboard.release
ray = Makie.ray_at_cursor(a)
plot, idx, pos = Makie.ray_assisted_pick(a)
p[] = pos
ls[] = [pos - 100 * ray.direction, pos + 200 * ray.direction]
# ls[] = [ray.origin, pos + 200 * ray.direction]
# ls[] = [ray.origin, ray.origin + 500 * ray.direction]
end
end
f This picks where you cursor is when you press |
I added some tests for the ray intersections. I might try to add some more for the |
bbox = boundingbox(plot) | ||
# Manual boundingbox including transfunc | ||
bbox = let | ||
points = point_iterator(plot) |
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 think we also defined this in GeoMakie, maybe time to give this its own function!
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.
else | ||
tt.text[] = color2text(name, x, y, z) | ||
i, j, z = _pixelated_getindex(plot[1][], plot[2][], plot[3][], pos, edge_based) |
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.
nearest_getindex? Also why the _
?
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 tend to add a _
prefix to functions that seem very specific/internal to me. For this and _interpolated_getindex
I thought they don't really make sense outside the specific context of show_data
/DataInspector
Description
Fixes #2662
Working with translation via model matrix / translate!:
Working with transform_func (halfing each coordinates):
boundingbox()
ignoring transform_func)arrows (tooltip content wrong, but arrows transform weirdly anyway so I'm skipping this)Note that this pulls changes relevant to DataInspector from #2746 and makes some further changes, so there will be conflicts there. (One thing being the transform application being moved to
get_position
.)Since this pulls changes from #2746 these also apply here:
Type of change
Checklist