[vtkusers] Interception or Subtract of two polyDatas

Cory Quammen cory.quammen at kitware.com
Thu Dec 7 11:00:12 EST 2017


The vtkCubeSource produces quads for the faces, but these filters
require triangle input. You should be getting a warning with a message
to that effect.

The solution is to place a vtkTriangleFilter after the vtkCubeSource
but fore the vtkBooleanOperationPolyDataFilter or
vtkIntersectionPolyDataFilter.

HTH,
Cory

On Thu, Dec 7, 2017 at 10:55 AM, Jose Barreto <jose.de.paula at live.com> wrote:
> Good afternoon guys,
>
> I'm trying to pick up the interception between two polydatas, a cube and a
> sphere.
>
> I tried using vtkBooleanOperationPolyDataFilter and
> vtkIntersectionPolyDataFilter
> but the output of the two is empty.
>
> the code for vtkIntersectionPolyDataFilter:
>
>                 auto cubeSource = vtkSmartPointer<vtkCubeSource>::New();
>                 cubeSource->SetXLength(size[0]);
>                 cubeSource->SetYLength(size[1]);
>                 cubeSource->SetZLength(size[2]);
>                 cubeSource->Update();
>
>                 auto sphereSource = vtkSmartPointer<vtkSphereSource>::New();
>                 sphereSource->SetRadius(20);
>                 sphereSource->Update();
>
>
>                 auto  intersectionPolyDataFilter =
> vtkSmartPointer<vtkIntersectionPolyDataFilter>::New();
>                 intersectionPolyDataFilter->SetInputConnection(0,
> cubeSource->GetOutputPort());
>                 intersectionPolyDataFilter->SetInputConnection(1,
> sphereSource->GetOutputPort());
>                 intersectionPolyDataFilter->Update();
>
>
> But when I using two sphere the output is working.
> vtkBooleanOperationPolyDataFilter and vtkIntersectionPolyDataFilter don't
> work for the cube?
>
>
>
>
>
> --
> Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
> _______________________________________________
> 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
Staff R&D Engineer
Kitware, Inc.


More information about the vtkusers mailing list