Skip to content

Implicit Geometry and Include Fixes

Andrew Wilson requested to merge andrew.wilson/iMSTK:SDFAndIncludeFixes into master
  • Virtual and overriden destructors added in many many places
  • Complete pass over repo removing unused includes, moving header includes to source, adding forward declares were appropriate, and conforming some include format
  • Added imstkDataArray's. Wrappers for our vectors. Only used in imstkImageData as of now. These plan to be further developed and rolled out to Geometries and States as well as be used with an event system.
  • Decoupled imstkImageData from vtkImageData.
  • Added imstkNew (experimental namespace), imstkTypes, imstkSignal (experimental), also imstkNotUsed macro
  • Added filtering module and various filters, most are VTK filters (moved existing to module as well, left some simple methods as geometry utility functions though):
    • AppendMesh (VTK): Combines polygons, does not change topology
    • CleanMesh (VTK): Removes duplicate points/edges/etc
    • ExtractEdges (VTK): Extracts cells of triangle mesh to edges
    • ImageDistanceTransform (VTK): Produces DT from binary mask, can fail.
    • ImageGradient (VTK): Can compute/return gradient or gradient magnitude
    • ImageResample: Can resample an image to differing dimensions. Currently just trilinear. I might switch to VTK, they have more. But I used it for testing my trilinear function.
    • QuadricDecimate (VTK): Reduces the amount of triangles of a SurfaceMesh
    • SelectEnclosedPoints (VTK): Computes the points of a PointSet within a SurfaceMesh. Can prune or produce a mask. Uses a ray cast method from VTK.
    • SurfaceMeshDistanceTransform (VTK): For every point, compute implicit distance to SurfaceMesh (VTK implementation of 2005 psuedonormal paper), not as fast as I would like. Should add a narrow computation method.
    • SurfaceMeshFlyingEdges (VTK): Extracts the isosurface given an IsoValue
    • SurfaceMeshImageMask (VTK): Produces binary mask from input surface mesh. Good for structured point in polygon tests. Uses rasterization and is, in most cases, faster than ray based point in polygon tests.
    • SurfaceMeshSmoothen (VTK): Laplacian smoothening
    • SurfaceMeshSubdivide (VTK): Linear, loop, or butterfly subdivision
    • ImplicitGeometryToImageData: Given image specs it will rasterize/sample implicit geometry in the output image.
  • Added open edge count and isClosed functions to geometry utility, nice for determining if a surface is manifold (VTK).
  • Added ImplicitGeometry, these define a getFunctionValue and getFunctionGrad. The gradient will use central finite differences. But can be overridden if one has an analytical way of specifying it (as it is with sphere and plane)
    • AnalyticalGeometry inherits ImplicitGeometry now as all analytical geometry should be able to define these functions implicitly.
    • imstkPlane, imstkSphere, and imstkBox support it. Though oriented boxes aren't supported yet. imstkCylinder and imstkCapsule implicit functions not implemented yet, hidden.
    • imstkSignedDistanceField accepts an imstkImageData and implements trilinear interpolation for these functions.
    • imstkImplicitCompositeGeometry: Can add multiple implicit geometries to it with a boolean function (intersection, difference, or union). When a distance query is made, all of the composited geometries distance functions are called with appropriate mins/maxs for booleans. Can be used with collision detection. One may combine multiple SDFs, spheres, boxes, planes, to do detection and movement of the union in real time. Though I would recommend putting into a single SDF if static/non-moving. This is also greatly useful with ImplicitGeometryToImageData as one can then cut wholes in things and turn back into polygons with FlyingEdges (tho MC meshed polygons aren't great for physics).
  • Added ImplicitGeometry collision detection
  • Removed pure virtual functions from Geometry that didn't make sense to be pure
  • RenderDelegates:
    • PointSize in RenderMaterial can be used to specify the fluid radius
    • Opacity for polygons fixed
    • Image DisplayMode added. This way one can render ImageData as a pointset (center of voxels) (its base class) or with volume rendering. ImageData points are not generated by default though. You must call a function for that, similar to VTK.
  • In-constructor initialization of various primitives. ie sphere can now be created with Sphere sphere(Vec3d(0.0, 0.0, 0.0), 1.0);
  • More VR fixes. Replaced the openvr command observer with a proper interactor style.
  • Updated OpenVR version
  • Added OpenVRDeviceClient, this follows the pattern setup by the Devices library. These devices are tied to the view though. Only the viewer will return valid ones.
  • Added SDF examples, vessel example, and openvr controller example
Edited by Andrew Wilson

Merge request reports