-
-
Notifications
You must be signed in to change notification settings - Fork 323
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
Some triangles are not rendered #3561
Comments
@tpgillam @SimonDanisch I can confirm this bug still persists. I got a bit further in diagnosing it. It does not seem to matter if the Triangle type is: using GeometryBasics
using GLMakie
t_ok = Triangle(Point3(0, 0, 0), Point3(1, 0, 3), Point3(0, 3, 2))
t_bad = Triangle(Point3(1.0, 0.0, -1.0), Point3(-1.0, 0.0, 3.0), Point3(0.0, 3.0, 2.0))
F = [TriangleFace{Int64}(1, 2, 3)]
V = Point3{Float64}[[1.0,0.0,-1.0],[-1.0,0.0,-3.0],[0.0,3.0,2.0]]
M = GeometryBasics.Mesh(V,F)
## Visualization
fig = Figure(size=(1600,800))
ax1 = Axis3(fig[1, 1], aspect = :data, xlabel = "X", ylabel = "Y", zlabel = "Z", title = "t_ok as Triangle with mesh")
mesh!(ax1,t_ok, linewidth = 5, color = :blue, shading=FastShading)
ax2 = Axis3(fig[1, 2], aspect = :data, xlabel = "X", ylabel = "Y", zlabel = "Z", title = "t_bad as Triangle with mesh")
mesh!(ax2,t_bad, linewidth = 5, color = :blue, shading=FastShading)
ax3 = Axis3(fig[2, 1], aspect = :data, xlabel = "X", ylabel = "Y", zlabel = "Z", title = "t_bad as Mesh with mesh")
mesh!(ax3,M, color = :blue, shading=FastShading)
ax4 = Axis3(fig[2, 2], aspect = :data, xlabel = "X", ylabel = "Y", zlabel = "Z", title = "t_bad as Mesh with poly")
poly!(ax4,M, strokecolor=:red, strokewidth = 2, color = :blue, shading=FastShading)
fig |
]activate --temp; add Makie
)Various platform info:
Certain triangles - depending on the vertex ordering - are not visible when plotted with
GLMakie.mesh
.For example, if the following is run interactively:
Then a blue triangle is shown, as expected.
But if instead
mesh(t_bad)
is called, then no triangle is visible.I think it's something to do with vertex ordering, because:
then shows the expected triangle.
Tracing through what is happening inside the
mesh
call, the eventual problem seems to be that the following call todecompose
inGeometryBasics
return any faces (the first step at extracting the points works fine, though):I'm not sure if the "bug" is in GLMakie for not re-ordering the vertices before calling the
decompose
function, hence I'm filing it here rather than in GeometryBasics -- apologies if this is incorrect.The text was updated successfully, but these errors were encountered: