MarcoAttene / VolumeMesher

Convex Polyhedral Meshing for Robust Solid Modeling
50 stars 11 forks source link

Tetras identification #1

Closed Vilo176 closed 2 years ago

Vilo176 commented 2 years ago

Hi,

I've discovered your awesome work thanks to Marco Livesu, and after some very early tests I must say it is just incredible. My goal is to tetrahedralize a large amount of BREP solids altogether, so that I'm having at the end a full decomposition of there split parts.

The decomposition itself is well achieved by passing all solids as one triangles soup to your algo. Valid tetras are produced as well.

But how can I retrieve, from these tetras, the initial parent solid ?

Obviously, I could perform some geometrical inclusion test, but this is not very efficient. Another way would be to make CSG between each solids, taken 2 by 2, and check face's color to choose tetra's parent(s). Ugly.

Is there a more elegant way to achieve this ? maybe some IDs to assign to triangles, that are propagated to cells, and then check tetra's faces IDs to decide parent(s) ?

Thanks a lot guys.

Vilo176 commented 2 years ago

Maybe you want some problematic cases ? Here is one very simple ... Input.zip

Input image

Computed image image

MarcoAttene commented 2 years ago

Hi, thank you for your interest in our work. Tracking triangle IDs is an intrinsically ill-posed problem when dealing with triangle soups as you do. The same solid part in the decomposition, indeed, might be bounded by several (coplanar) triangles with different IDs and, vice versa, a same triangle (with its own ID) might be split and eventually bound different solids. You may study heuristics that work most of the times for your specific application, but I'm afraid that implementing them into our code might be rather tricky as you may not clearly formalize the problem.

Thank you for sharing the problematic case. We will go through that. In general, our graphcut-based approach to filter out external cells is guaranteed correct if the input is unambiguous (i.s. closed and with no self-intersections), whereas it might produce unexpected results (i.e. such as in your example) otherwise. It usually behaves well even for ambiguous cases, but we cannot guarantee that.

Best Marco

http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail Mail priva di virus. www.avg.com http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

Il giorno dom 19 dic 2021 alle ore 13:09 Vilo176 @.***> ha scritto:

Maybe you want some problematic cases ? Here is one very simple ... Input.zip https://github.com/MarcoAttene/VolumeMesher/files/7740747/Input.zip

Input [image: image] https://user-images.githubusercontent.com/25245090/146674351-92ac6f9a-4868-4e39-a8fc-063008efbcd7.png

Computed [image: image] https://user-images.githubusercontent.com/25245090/146674365-04553aff-33a5-478e-b6c4-26f31b954b60.png [image: image] https://user-images.githubusercontent.com/25245090/146674372-ebe5bb3a-f479-4ee1-9a86-2a3018dfc1d9.png

— Reply to this email directly, view it on GitHub https://github.com/MarcoAttene/VolumeMesher/issues/1#issuecomment-997381263, or unsubscribe https://github.com/notifications/unsubscribe-auth/AED5QTIKICRQMSGDJKV6VH3URXDPFANCNFSM5KKZTCPQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you are subscribed to this thread.Message ID: @.***>

Vilo176 commented 2 years ago

Thank you Marco for this quick answer.

In general, our graphcut-based approach to filter out external cells is guaranteed correct if the input is unambiguous (i.s. closed and with no self-intersections)

The triangle soup I'm sending comes from N solids. Each solid is (should be) closed and not self-intersecting. But if you take all the solids as a whole, of course there will be lot of self-intersections ... that is the initial point.

By the way, filtering out "bad" tetras from the final result will/could be part of the general algo to retrieve the parent solid for each cell/tetra. If a tetra does not belong to any entry solid, it has to be discarded.

Vilo176 commented 2 years ago

The issue above (external tetras not being discarded) is due to a misuse of the tool. The triangle soup is not representing a closed / non self-intersecting volume, so the "inclusion" test fails. These tetras must be treated by other means outside the algo.