Popis: |
A Signed distance field (SDF) is an implicit function that returns the distance to the surface of a volume given a point in the space. The sign of the field indicates if the point is inside or outside the volume. These fields are usually used to accelerate computer graphics algorithms in different areas, such as rendering or collision detection. There are many well-defined primitives and operators to model objects using these functions. For example, SDFs allow applying smooth boolean operations between primitives. Applying these operators to triangles meshes can require complex algorithms susceptible to precision problems. Even though SDFs allow modelling objects, they currently are not a used format, and not many modelling tools use it. Most of the time, we want to calculate this field from triangle meshes. If the mesh is two-manifold, the easiest way to calculate the signed distance from a point is by searching for the minimum distance at all the mesh triangles. This strategy requires iterating all the triangles for each query to the signed distance field. There are methods based on different strategies that accelerate this nearest triangle search. If the user does not require getting exact distances to the object, other strategies exist that discretize the space in some fixed sample points. Then, the queries to arbitrary points are calculated using an interpolation of the precalculated discretization. This project presents a new approach based on an octree-like subdivision to accelerate the computation of these signed distance fields queries from a triangle mesh. The main idea is to construct an octree structure in which each leaf will contain only the nearest triangles for all the points in that region. Therefore, when the user wants to calculate the distance from an arbitrary point in the space, it will only compare the triangles influencing that region. Moreover, we present a method to calculate approximated distances based on the discretization approach mentioned before. We designed and developed an octree discretization strategy and explored different interpolation techniques. The distance computation of this discretization is accelerated by the strategy developed in the project. |