[vtkusers] How to filter poly data while preserving point data arrays?

Cory Quammen cory.quammen at kitware.com
Wed Aug 26 10:30:30 EDT 2015


Hi normanius,

I think the problem is that there is probably no point data array named
"Mean_Curvature" in the poly data you are using to make the cut with the
boolean operations filter. I think the boolean operations filter will pass
on only data arrays that *both* input poly data objects have.

A solution would be to add a point data array to your cutting object.
Something like:

vtkPolyData* cutPolyData = ...;
vtkDoubleArray* dummyCurvature = vtkDoubleArray::New(); // maybe you need a
vtkFloatArray?
dummyCurvature->SetNumberOfComponents(1);
dummyCurvature->SetNumberOfTuples(cutPolyData->GetNumberOfPoints());
dummyCurvature->SetName("Mean_Curvature");
// fill in values in dummyCurvature if needed

cutPolyData->GetPointData().AddArray(dummyCurvature);
// boolean operation filter...

HTH,
Cory

On Thu, Aug 20, 2015 at 6:28 AM, normanius <juch at zhaw.ch> wrote:

> Hi everyone.
>
> I use vtkCurvatures to measure the average curvature of irregular dome-like
> surfaces (domeSurface). Because of numerical problems close to the edge of
> the dome, I would like to filter away the points close to the edge of the
> dome. See attached image: the edge is indicated by a red line, the blue
> color indicates the excessively high curvature values close to the edge,
> which I want to get rid of.
>
> <
> http://vtk.1045678.n5.nabble.com/file/n5733572/Screen_Shot_2015-08-20_at_11.png
> >
>
> The edge is created by a planar cut and I do have a triangulated
> representation of the "missing" face of the dome: cutFace.
>
> My approach is to use vtkBooleanOperationPolyDataFilter to calculate the
> difference between domeCurvature and cutFace - however, this way I loose
> the
> point data arrays that contain the curvature information of the surface.
> This is roughly the processing pipeline:
>
> domeSurface -> *curvatureFilter* -> domeCurvature ->
> *booleanOperationFilter*(intersect with cutFace) ->
> domeCurvatureWithoutPointsCloseToEdge
>
> The problem: while data1 exists, data2 does not exist after the boolean
> operation.
> data1 =
> curvatureFilter.GetOutput().GetPointData().GetArray("Mean_Cuvature")
> data2 =
>
> domeCurvatureWithoutPointsCloseToEdge.GetOutput().GetPointData().GetArray("Mean_Cuvature")
>
> *So here is my question*: How can I get rid of the points close to the edge
> while preserving the curvature data retrieved by the curvature filter?
>
> Thank you for any suggestions!
>
>
>
>
>
> --
> View this message in context:
> http://vtk.1045678.n5.nabble.com/How-to-filter-poly-data-while-preserving-point-data-arrays-tp5733572.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>



-- 
Cory Quammen
R&D Engineer
Kitware, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20150826/41fc087b/attachment.html>


More information about the vtkusers mailing list