I am looking to find the actual surface area of an intersection between a triangle and an AABB. Currently, I am using Tomas Akenine-Möller's AABB-Triangle intersection test, which works quite well - but I also need further information to improve the rendering quality of my realtime triangle-to-voxel engine I am developing.
The basic application of this will give me the ability to figure out which triangle from the original model takes up the most space in a given voxel. This allows me to associate the resulting voxels created from the model with the original triangle IDs, for not only color accuracy but persistance.
Sofar the approach I have thought of is take all intersection points of the triangle and the AABB, grouping them in pairs. Once you have all of the pairs, you can pretty easily find the third point associated with the pair that actually lies outside of the AABB. Then simply take the set of 3 vectors and construct triangles with them. Take the area of the full original triangle, and subtract the area of the constructed triangles. In the case that the triangle does not "primarily lie inside the AABB", you construct triangles that are inside the AABB and add them together, ignoring the overall area. I am not sure what to do yet if the triangle creates a non-triangular shape when intersecting the AABB. Here are some of the cases I came up with (there could be more) as 2D representations:
I really doubt the viability of my idea here, so I am open to any suggestions. If anyone might have a better solution given my particular problem that doesn't need the actual area, let me know.
Thanks.