-
Notifications
You must be signed in to change notification settings - Fork 13
Description
I have been thinking about a good way to allow for congruity of SDF types and Mesh types. Part of the current issue is that one may generate an SDF using Float32, but the internal computations for Meshing are Float64 converted back to Float32. Similarly, all direct samplings of a function pass Float64.
Geometry Types exports facetype
and vertextype
. These can be used to determine the sampling/interpolation types. If vertextype
is nothing, in the case of an SDF we will use a Point
of the same type as the sampling data.
If neither are specified, such as just calling HomogenousMesh(x -> norm(dot(x)) - 1, MarchingCubes())
we default to Float32 points for performance and better GPU interop.
TODO: In the case of faces I am not sure if Int32 or Int64 for Faces is preferable for GPU/Makie/Plots.
Normals:
I think there are mechanism for specifying normals in Geometry types. Since we may add ForwardDiff in the future for root finding, the computation of true normals on a smooth function should be possible to do in one pass.