You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Where use is made of normal_mesh. However this function does not correctly obtain the triangles.
Below is my first attempt at fixing this, i.e. to get the tetrahedra and then to create a face based mesh representation to correctly visualise the tetrahedral mesh.
functiontetgen2facemesh(result)
E =faces(result) # Called "faces" but these are tetrahedral elements really
V =coordinates(result)
F =Vector{TriangleFace{Int64}}(undef,length(E)*4)
for q =eachindex(E)
e = E[q]
qf =1+ (q-1)*4
F[qf] =TriangleFace{Int64}(e[1],e[2],e[3])
F[qf+1] =TriangleFace{Int64}(e[1],e[2],e[4])
F[qf+2] =TriangleFace{Int64}(e[2],e[3],e[4])
F[qf+3] =TriangleFace{Int64}(e[3],e[1],e[4])
endreturn GeometryBasics.Mesh(V,F)
end
M =tetgen2facemesh(result)
# N,VN=meshnormal(M)#Visualize mesh
GLMakie.activate!(inline=false) # To avoid plotting in plotpane as per: https://github.com/MakieOrg/Makie.jl/issues/2956
fig =Figure()
ax1=Axis3(fig[1, 1], aspect =:data, xlabel ="X", ylabel ="Y", zlabel ="Z", title ="Using normal_mesh")
mesh!(ax1,normal_mesh(result),color=:blue, transparency=false, overdraw=false,shading = FastShading)
wireframe!(result, linewidth=5, color=:black)
ax2=Axis3(fig[1, 2], aspect =:data, xlabel ="X", ylabel ="Y", zlabel ="Z", title ="Proper conversion to faces")
poly!(ax2,M,strokewidth=5, color=:blue, transparency=false, overdraw=false,shading = FastShading)
# arrows!(ax2,VN,N)
fig
My guess is that normal_mesh does not create all 4 tetrahedron triangles. The below shows the issue, i.e. several "holes" exist in the mesh (sorry hard to see as shading for these is a mess too... not sure how to fix that @SimonDanisch) and the bottom corner for instance clearly misses triangles. The visualisation on the right is for my "fixed" visualisation using the above.
The text was updated successfully, but these errors were encountered:
The example in the README contains something like:
Where use is made of
normal_mesh
. However this function does not correctly obtain the triangles.Below is my first attempt at fixing this, i.e. to get the tetrahedra and then to create a face based mesh representation to correctly visualise the tetrahedral mesh.
My guess is that
normal_mesh
does not create all 4 tetrahedron triangles. The below shows the issue, i.e. several "holes" exist in the mesh (sorry hard to see as shading for these is a mess too... not sure how to fix that @SimonDanisch) and the bottom corner for instance clearly misses triangles. The visualisation on the right is for my "fixed" visualisation using the above.The text was updated successfully, but these errors were encountered: