-
-
Notifications
You must be signed in to change notification settings - Fork 328
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
Use DelaunayTriangulation.jl for tricontourf #2896
Conversation
Not sure I understand the |
Another thought: Is there anyway to somehow allow a user to do something like
where function Makie.convert_arguments(::Type{<:Tricontourf}, tri::T, z::AbstractVector{<:Real}) where {T <: DelTri.Triangulation}
triangles = DelTri.get_triangles(tri)
n = DelTri.num_points(tri)
x = zeros(Float32, n)
y = zeros(Float32, n)
for i in DelTri.each_point_index(tri)
p = DelTri.get_point(tri, i)
x[i] = DelTri.getx(p)
y[i] = DelTri.gety(p)
end
return (x, y, z), triangles # < - Pass triangle to attributes?
end but I'm not sure there's a way to pass the triangles into the |
Should work now with my changes to DelaunayTriangulation.jl. Works locally for me at least. |
You can return the following from convert: PlotSpec{Tricontourf}(x, y, z; triangles = triangles) |
We can also make it the other way around such that the triangulation argument is the default form and the others dispatch to it. |
@jkrumbiegel: You mean having the main function be
? Would that be breaking with the existing |
No because all other methods of tricontourf would redirect to this one. If this bundles all the information needed it seems sensible to make it central. |
Of course - makes sense. I've made that change now, all seems to work on my machine. I don't know how to test the doc deployment locally though, but running the examples seems fine. |
I've approved the workflows, you will see whether the docs worked here. Although the preview feature won't work for a non-member-PR. If you wanted to, you could download the artifact containing the website build and look at that locally using LiveServer.jl or python |
Thanks @jkrumbiegel. How do I add the reference tests for this? It's not clear to me how to actually upload an image for it. |
You cannot, only admins can add the images. You can add the |
Makes sense - no wonder I couldn't find the instructions for uploading :). I think these should be good. |
Did I mess something up with the reference tests for GLMakie? Or are new images just processed and uploaded differently with GLMakie than with the other backends? |
No, for some reason part of the ci routine that posts a message that there are missing refimages doesn't work anymore for external people, maybe that was changed for security reasons, not sure. |
Do we still need the MiniQHull dependency after this pr? As far as I can tell it was only used in |
Yes, we should be able to remove it |
Indeed, didn't seem to be used anywhere else. Removed. |
Is there anything else to be done here? |
I don't think so, we were just pretty swamped. It's still on my to-do list :) |
I think this is good to go. I'll let CI run through once more, then update reference images, and run again. |
Thank you @DanielVandH! |
Great, thanks @jkrumbiegel! |
Description
As discussed with @jkrumbiegel on Slack, this changes the triangulation package from MiniQHull to my DelaunayTriangulation.jl, enabling support for constrained triangulations. There should be no difference in the existing visualisations. As an example, here's a plot of a constrained triangulation that wouldn't be possible previously.
Just as a comparison with results on Master to demonstrate that there is no difference, here are two plots. The first is the new version (with the third plot now being constructed directly with a constrained triangulation rather than manually defining the triangles), and the second is on master.
There is a slight difference in the third plot as there are cocircular points, meaning the triangulation is not unique - but they are both technically correct.
Type of change
Checklist
I'm not sure about how to go about adding the reference images, so any suggestions there would be helpful. I also wanted to add a test for
compute_triangulation
, but it wasn't being tested anywhere previously so I wasn't sure a good place for it.