3MAH / microgen

Microstructure generation
https://3mah.github.io
GNU General Public License v3.0
67 stars 8 forks source link

Add offset property to Tpms to be able to update it #55

Closed kmarchais closed 6 months ago

kmarchais commented 6 months ago

This PR brings a property for the offset attribute.

TLDR

Details

Especially with the new infill feature, the generation of a Tpms object can have a computational cost pretty high due to the number of points in the grid. For an Infill object, the clip_surface method is applied on the grid and is expensive. If we need to change the offset but keep the same grid, the grid does not need to be computed again.

At the same time, this PR fixes an issue of return type for the sheet, lower_skeletal, upper_skeletal properties and the generateVtk method where UnstructuredGrid were returned instead of a PolyData. The extract_surface is now called to return a PolyData instead of a UnstructuredGrid. The vtk_* methods have been renamed to grid_* for more clarity as their purpose is to return the corresponding UnstructuredGrid.

For now we can give a variable offset but not a variable density. It would be nice to make this possible in this PR or another.