When you say “outer” contour, does this imply there is also an “inner” contour?
I’m not sure if it fits your requirements, but VTK has a class called vtkPolyDataToImageStencil that slices polydata and generates a stack of binary images. However,
- It uses a simple inside/outside check: if the pixel is on the “inside” side the contour, it’s on, and if it’s on the “outside” side, it’s off. There is no percentage calculation.
- The output data (vtkImageStencilData) isn’t 1 BPP, it’s actually a run-length compression of a 1BPP image. A custom class would be needed to write it out to a TIFF.