[vtkusers] Preserve the color of a vtkPolyData after it is split by vtkOBBDicer

kadek ananta.satriadi at gmail.com
Thu Jun 22 02:15:44 EDT 2017


Hi, I am trying to implement isosurface visualisation in Unity using
VTK.Since Unity mesh's number of vertices is limited to 65553, a large
surface needs to be split  up into smaller chunks. I used vtkOBBDicer,
vtkThreshold, and vtkGeometryFilter to spit and extract the
polydata.However, the resulting polydata from the extraction process lost
the color array element.Is there any solution to split up the vtkPolyData
and keep the color accordingly?Thank you in advance.
<http://vtk.1045678.n5.nabble.com/file/n5743711/partitionedgameobject.png>
This is the method I use to return the vtkPolyData chunks (it uses Activiz
C# wrapper)./public static List CreateGroups(vtkPolyData poly)    {	
vtkOBBDicer dicer = vtkOBBDicer.New ();		vtkThreshold th = vtkThreshold.New
();		vtkGeometryFilter geo = vtkGeometryFilter.New ();		List polys = new
List ();		dicer.SetInput (poly);		dicer.SetDiceModeToSpecifiedNumberOfPieces
();		dicer.SetNumberOfPointsPerPiece((int) VERTICESMAX);		dicer.Update ();	
th.SetInput (dicer.GetOutput ());		th.AllScalarsOff ();              
th.SetInputArrayToProcess(0, 0, 0, 0, "vtkOBBDicer_GroupIds");              
geo.SetInputConnection (th.GetOutputPort ());		for(int i = 0; i <
dicer.GetNumberOfActualPieces(); i ++){                       
th.ThresholdBetween (i, i);				th.Update ();			geo.Update ();			vtkPolyData
pol = vtkPolyData.New();                      
pol.DeepCopy(geo.GetOutput());                      polys.Add (pol);		}	
return polys;	}/Cheers,Kadek



--
View this message in context: http://vtk.1045678.n5.nabble.com/Preserve-the-color-of-a-vtkPolyData-after-it-is-split-by-vtkOBBDicer-tp5743711.html
Sent from the VTK - Users mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20170621/6b57ec0c/attachment.html>


More information about the vtkusers mailing list