Open asinghvi17 opened 2 months ago
3d points could also be projected to the best fit plane, meshed, and then plotted. There are some linear algebra based solutions available from StackExchange
Isn't that part of the point of poly
? To simplify things to 2D?
Also what should rand(Point3f, 10)
even generate? These points don't lie on a plane, so they don't form a poylgon. We could do what earcut does
Note that Earcut is a 2D triangulation algorithm, and handles 3D data as if it was projected onto the XY plane (with Z component ignored).
but that means throwing away data the user gave us which I don't like.
For me this still doesn't make sense, I think polygons only exist in 2d and the others are simply transformations into 3d. But then they should be plotted as such.
It's pretty convenient to define tilted/transformed polygons in 3D before plotting. Maybe rand(Point3f, 10)
is a bad example but we can at least assume the user wants something reasonable.
Even an area light in e.g. RPRMakie might be defined this way in 3D (maybe as a rectangle with some rotation applied, or similar).
]activate --temp; add Makie
)MWE:
There is a method https://github.com/MakieOrg/Makie.jl/blob/c4e3b7b7271322330e2b4db424a5e096e5e9acf2/src/basic_recipes/poly.jl#L104-L111
which could be extended to 3d points. This worked in v0.20.