Created
May 14, 2025 11:02
-
-
Save jkrumbiegel/43b13df88023ff71c19849c52ba03308 to your computer and use it in GitHub Desktop.
inner poly rect box stroke Makie
This file contains hidden or 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
r1 = Rect2f((10, 20), (5, 8)) | |
r2 = Rect2f((20, 30), (5, 8)) | |
f, ax, _ = poly(r1) | |
linewidth = Observable(20) | |
r2_pixel = lift(ax.scene.camera.projectionview, ax.scene.viewport, linewidth) do _, _, lw | |
mi, ma = extrema(r2) | |
_mi = Makie.project(ax.scene, mi) .+ 0.5lw | |
_ma = Makie.project(ax.scene, ma) .- 0.5lw | |
Rect2f(_mi, _ma - _mi) | |
end | |
lines!(ax, r2; linewidth) | |
lines!(ax, r2_pixel; linewidth, space = :pixel, alpha = 0.8) | |
f |
Author
jkrumbiegel
commented
May 14, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment