self intersections from extrusion

I’m attempting to extrude and then make a solid voxel representation of a surface in VTK. The initial surface is well-behaved, not self-intersecting. The general pipeline is vtkLinearExtrusionFilter -> vtkPolyDatatoImageStencil -> vtkImageStencilToImage. This works as expected, except that the extrusion causes some self-intersections because I must extrude in the normal direction for this particular project. The vtkPolyDatatoImageStencil filter then does not count those self-intersecting parts as being “inside” the surface, so I end up with holes in the final mask volume. What would be the best way to address this problem? Thanks!

Mike

1 Like

You can easily and very robustly grow/shrink a surface when it is represented as a mask volume, so you can solve this by converting to volume first.

You can check out how this all works in 3D Slicer’s Segment editor: you can load a surface as a segmentation, then use “Margin” effect to grow/shrink or “Hollow” effect to create a hollow shell.

Thanks for the feedback. Unfortunately the “Margin” effect grows in all directions. Also it seems to need a closed surface. I need to specifically only grow in the normal direction (only on one side of the surface). My initial surface is a shell, not a closed surface. Think of a half of a sphere as an example. In the case of a half sphere, I need it to extrude in the normal direction (outwards), and not inwards.

Hollow effect creates a shell. It can grow central, towards inside, or towards outside, by combining the grown volumes with the original volumes.

We have run into this issue, too, when processing surface scans.

Our solution then was to close the surface by offsetting the surface by a large distance and connecting edges with a triangle strip.

If you cannot easily find a offset direction where extruded boundary edges would not overlap then you can close the surface using “Wrap Solidify” effect (provided by SurfaceWrapSolidify extension). Wrap Solidify effect also has the option for directly creating a thick shell from a surface.

Thanks I’ll look into the Surface wrap method. The other thing I might look into is using a signed distance field to extrude at the same time as converting to the volume.

While computing unsigned distance map is trivial (that’s what vtkImplicitModeller computes), I don’t think signed distance can be robustly computed for an open surface.

Also note that usually distance map is usually computed after conversion to volume. For example, we use signed distance map in Margin effect (because morphological operations would be magnitudes slower for large kernel sizes).

Good point. I suppose a third alternative is I could try to modify the extrusion filter code to avoid self-intersections somehow.