intersection/clipping not working properly in the 2D case
Closed this issue · 3 comments
CNOT commented
I reported this earlier in issue #728 , however as it seems to be a distinct problem I'm opening a new issue for it. Here's a MWE showing the problem:
using Meshes
using CairoMakie
cg = Meshes.CartesianGrid((0.0, 0.0), (2.0, 1.0), (0.1, 0.1))
ps = Meshes.Point2[(0.0, 0.0), (1.0, 0.5), (1.0, 1.0), (2.0, 0.0)]
pol = Meshes.PolyArea(ps)
viz(pol,showfacets = true)
for i in faces(cg, 2)
cl = i ∩ pol # Same thing happens with clip(i,pol, SutherlandHodgman())
if cl != nothing
viz!(i,showfacets = true, alpha = 0.5, facetcolor = :red)
end
end
Makie.current_figure()
juliohm commented
The issue was fixed, and a patch release is on its way:
The Sutherland-Hodgman algorithm assumes a convex clipping geometry. We have to flip the order of arguments when the clipping geometry is not convex. A more performant and general solution requires an alternative clipping algorithm (e.g. Weiler-Atherton) as discussed in #578
CNOT commented
Great! Is there an expected timeline for the preferred clipping algorithms?
juliohm commented
We are busy working on the new coordinate system infrastructure. No
deadlines for clipping. Contributions are welcome.
Em seg., 4 de mar. de 2024 16:36, Ali Hamed Moosavian <
***@***.***> escreveu:
… Great! Is there an expected timeline for the preferred clipping algorithms?
—
Reply to this email directly, view it on GitHub
<#790 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAZQW3LVBVDS7IHHCUXXEODYWTEKZAVCNFSM6AAAAABEDPEY42VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNZXGMZDANRTGM>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>