Least-squares conformal mapping (LSCM)
Create a VTK filter that accepts the output of the vtkGrowCharts
filter (from vtk/vtk!7102) and assigns (u,v) parametric coordinates via LSCM.
The filter should accept
- an input polydata
- an input scalar array to process as the chart assignment for each triangle (fetch the array inside your
RequestData()
method withGetInputArrayToProcess()
).
The filter should output
- a
vtkPartitionedDataSetCollection
ofvtkPolyData
objects (one output polydata for each chart) holding triangles of the chart with u-v coordinates assigned to each point. The points of each output polydata should include any global IDs that were on the input point-data; this will allow us to map the charts back to the input mesh. Our output mesh must have seams where point coordinates are duplicated but with different texture coordinates. - a
vtkPartitionedDataSetCollection
ofvtkPolyData
objects (one output polydata for each chart) holding polyline cells (VTK_POLY_LINE
) corresponding to seams of the chart and boundaries of the polydata (if the input polydata was not a closed surface). The polydata should have a cell-data vtkIdTypeArray with 2 components that mark each polyline with its partner on another output polydata using a (partition ID, cell ID) tuple. Polylines representing input boundaries have no partner and will have (-1,-1) as their cell-data tuple. The vtkPoints of this polydata and the corresponding one above can be identical (making it easy to map point IDs back to the input).