mlivesu / cinolib

A generic programming header only C++ library for processing polygonal and polyhedral meshes
MIT License
930 stars 101 forks source link

intersection when rendering a .mesh file #179

Closed yanyiss closed 7 months ago

yanyiss commented 7 months ago

it seems many intersections when I slicing a .mesh file using 05_hexmesh_viewer image bunny_projected.zip

mlivesu commented 7 months ago

Hi, I am not sure what is the question here. All the slicer does is to hide elements that have their centroid past a certain threshold, showing the others. What is being shown depends on the mesh. If the mesh contains intersecting elements, these elements will become visible. I guess this is a positive thing, usually one wants to slice to visually inspect the interior, right? :)

yanyiss commented 7 months ago

Hi, I am not sure what is the question here. All the slicer does is to hide elements that have their centroid past a certain threshold, showing the others. What is being shown depends on the mesh. If the mesh contains intersecting elements, these elements will become visible. I guess this is a positive thing, usually one wants to slice to visually inspect the interior, right? :)

yeah, you are right. I do not check the mesh. I just generate the mesh from the code of your adaptive grid paper https://github.com/cg3hci/Gen-Adapt-Ref-for-Hexmeshing by running make_grid.exe --surface --input_mesh_path=bunny.obj --output_grid_path=bunny.mesh --strong_balancing --use_octree --max_refinement=10 --sanity_check=true --install_schemes=true --project_mesh=true I thought there is no intersection to generate hex from a simple .obj by using that code.

yanyiss commented 7 months ago

but still strange... you can compare the following pictures, the only difference is slicing: X. One is 0.575, the other is 0.554 image image The place where surface mesh intersects in the first picture doesn't have intersections in the second picture.

mlivesu commented 7 months ago

the code you mentioned is guaranteed to produce an adaptively refined grid and a conforming hexahedral mesh out of it, but the projection part is completely heuristic (and really bad, to be honest) so projecting can create any sort of trouble. We never got time/people to work on the projection part. If you omit the --project_mesh=true in your call you'll get a provably valid mesh (but axis aligned)

For the last comment. Prior to slicing, only the external quads of the mesh are rendered. When you slice, also interior vertices attached to the current inner boundary between sliced and non sliced elements are shown, so it may happen that all of a sudden weird stuff appears during slicing

yanyiss commented 7 months ago

the code you mentioned is guaranteed to produce an adaptively refined grid and a conforming hexahedral mesh out of it, but the projection part is completely heuristic (and really bad, to be honest) so projecting can create any sort of trouble. We never got time/people to work on the projection part. If you omit the --project_mesh=true in your call you'll get a provably valid mesh (but axis aligned)

For the last comment. Prior to slicing, only the external quads of the mesh are rendered. When you slice, also interior vertices attached to the current inner boundary between sliced and non sliced elements are shown, so it may happen that all of a sudden weird stuff appears during slicing

I got it. Thanks for your reply.