I am trying to use vtkImprintFilter to imprint flat text on a box. Most of the time it works well, but occasionally it will leave holes and non-manifold in its output. This seems to happen most often when an edge of the text line up closely with an edge on the target. See the following example:
OutputType is MergedImprint (the orange part is a back-facing cell from the other side of the box)
When looking at just the ImprintedCells for the same example, the cells that are missing in the MergedImprint are still there
OutputType is ImprintedCells
The following image is the same as above but, with the “ImprintedCells” scalars visible
Zooming into the point indicated by the red circle we can see that it successfully imprinted the near coincident line.
OutputType is ImprintedCells
The following image is the same shot as above, but of the MergedImprinted rather than the ImprintedCells. Notice the cell that is missing (the orange part is a back-facing cell from the other side of the box).
My current hypothesis is that because the cell that is marked with the F-1
point is not labeled as a transition cell (in green) and the original cell from the original target is not the same (as it was split during the imprint), that when merging the ImprintedCells into the original target neither side can account for that area.
If someone (possibly @will.schroeder since I think you are the main author and maintainer of this filter) could take a look, I would greatly appreciate it.
Extra info:
- The box is being generated by creating a
vtkRectilinearGrid
of the size I want and running that through avtkDataSetSurfaceFilter
and avtkTriangleFilter
to get the box polydata. - The text is being generated via
vtkVectorText
and running that through avtkTriangleFilter
- Turning
BoundaryEdgeInsertion
on or off does not seem to make a difference
I am using the following code to run the imprint
imprint = vtk.vtkImprintFilter()
imprint.SetTargetData(boxPolyData)
imprint.SetImprintData(textPolyData)
imprint.SetOutputTypeToMergedImprint()
imprint.BoundaryEdgeInsertionOn()
imprint.SetTolerance(1.0e-6)
imprint.SetMergeTolerance(1e-6)
imprint.SetMergeToleranceTypeToAbsolute()
imprint.Update()