How can I improve my use of CGAL for implicit modelling of 3D lattice structures?

71 Views Asked by At

I am trying to use CGAL and OpenVDB for implicit modelling 3D lattice structures. But am unsure that I am using the correct approach.

In my method, the lattice is read in as a list of vertices (nodes) and the joining line-segment (struts), to produce spheres and cylinders with spherical ends. Each node and strut can have a unique diameter. The implicit geometry is represented as a grid (uniform spacing) enclosing all the nodes and struts to which a signed distance field is applied. Finally the surface of the signed distance field is saved as an STL. The following describes my attempts to populate the signed distance field in the grid.

First attempt - loops through each point in the grid and identifies the closest primitive (axis), then subtracts the struts diameter from that distance. This works accurately if the lattice struts have the same diameter, but not if there are different diameters.

Second attempt - loops through each point in the grid, calculates the minimum distance to each strut, then assigns the minimum of these distances. This produced the expected geometry but was extremely slow for larger lattices.

Third attempt - loops through the struts and uses the strut bounding box (CGAL::AABB tree package) to limit the region of the grid which is considered, updating the signed distance field only in that limited region for each strut. This produced the expected geometry with a considerable improvement in efficiency. Not all points in the grid will necessarily lie within a bounding box and won't be adjusted to get a true distance measure to the lattice surface.

The question is: Is there a better way to work with the implicit geometry and create the signed distance field?

Currently I am using CGAL and OpenVDB for producing an STL, however would like to move to visualising and am concerned that my method for creating the signed distance field will be too inefficient.

0

There are 0 best solutions below