JuliaGeometry / Meshes.jl

Computational geometry in Julia
https://juliageometry.github.io/MeshesDocs/stable
Other
389 stars 84 forks source link

Rotate & color don’t work —— until the mesh is discretized #1025

Closed ChenZhu-Xie closed 2 weeks ago

ChenZhu-Xie commented 2 weeks ago

An occasional off-topic sub-thread in Discourse: There’s a hole in a sphere generated by makie.surface leads to this problem:

this rotates correctly:

using Meshes, Rotations, GLMakie
Ellipsoid((3., 2., 1.), (0., 0., 0.), RotXYZ(π/4, π/5, π/3)) |> viz

but the following doesn't even rotate:

using Meshes, Rotations, GLMakie
Ellipsoid((3., 2., 1.)) |> Rotate(RotXYZ(π/4, π/5, π/3)) |> viz

However with pre-discretized mesh, it works again:

using Meshes, Rotations, GLMakie
discretize(Ellipsoid((3., 2., 1.)), RegularDiscretization(10,10)) |> Rotate(RotXYZ(π/4, π/5, π/3)) |> viz

besides, the kwarg color = 1:nelements(mesh) of the method viz needs discretize(mesh) first too:

using Meshes, Rotations, GLMakie
ellipsoid = Ellipsoid((3., 2., 1.), (0., 0., 0.), RotXYZ(π/4, π/5, π/3))
ellipsoid = discretize(ellipsoid, RegularDiscretization(10,10))
viz(ellipsoid, color = 1:nelements(ellipsoid), showsegments = true)

image

juliohm commented 2 weeks ago

Thank you for reporting @ChenZhu-Xie , we will take a look on Monday.