-
Notifications
You must be signed in to change notification settings - Fork 13
RFC: Unify internal representation with isosurface method #45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Remove GeometryTypes - Remove _determine_types logic - unify algorithm function signature internals - return tuple of (vertex, face) rather than mesh
89f882b
to
595a7a3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems reasonable--it makes integration with GeometryTypes a bit harder but should make the transition to GeometryBasics a bit easier.
Just one note--there actually wasn't any type piracy happening here before this change. We were adding methods to HomogenousMesh
, but those methods all required an AbstractMeshingAlgorithm
argument, which is a type owned by this package and thus not type piracy. There was actual type piracy back in the day, before #14.
Thanks for clarifying the point on type piracy. I think we can retain the old API and just add the generic This will also make this PR much smaller which is good for getting a new release out soon. |
(had benchmarks here showing improvements. Upon some fixes, performance is identical to master) |
This is mostly good to go. Pending some additional docs, a few extra tests, decision on I am much happier with the result of this versus the prior proposal. Thanks for the feedback! |
Currently very WIP, butopening for comments early.This completely removes thewe now have the return of theHomogenousMesh(sdf::SignedDistanceField...)
idiom. In its placeisosurface
function.Type signature:
There is also a corresponding
isosurface
that takes aFunction
as the first argument and adds keywordsamples
ofNTuple
.returns:
With this form we can support a wide range of data types, such as AxisArrays. It does however make the use of
SignedDistanceField
more clunky. We may be able to have SDF<:AbstractArray and make this better. However, by setting defaults a small one-liner liner like:vts, fcs = isosurface(load("brain.nrrd"))
should just work.And for varied precision the call is far simpler:
vts, fcs = isosurface(load("brain.nrrd"), MarchingCubes(), Point{3,Float16}, Face{3,Int})
Since we don't rely on GeometryTypes for a mesh type and simply return a Vector of the specifiedMeshing should now work with either GeometryTypes of GeometryBasics for primitives.VertType
andFaceType
,It also removes the magical_determine_types
which wasn't really easy to use. This mechanism is far more generic and explicit.cc @rdeits @SimonDanisch