[vtkusers] vtkBooleanOperationPolyDataFilter, issue & question
Bill Lorensen
bill.lorensen at gmail.com
Wed Mar 14 17:51:25 EDT 2012
Thanks for the report. I will change UNION to VTK_UNION, etc. In
general we try to keep enums unique by adding the VTK_ prefix.
Bill
On Wed, Mar 14, 2012 at 5:49 AM, Rémi Blanc <rblanc33 at gmail.com> wrote:
> Hi all,
>
> I have a small issue, and one question about
> vtkBooleanOperationPolyDataFilter.
>
> Issue:
>
> I experienced compilation errors when including
> vtkBooleanOperationPolyDataFilter.h within a project, under Windows and
> using Visual Studio 2008 (Express)
> It seems to be related to the enumeration definition (line 53)
> enum OperationType
> {
> UNION=0,
> INTERSECTION,
> DIFFERENCE
> };
> Actually, the problem apparently comes from the fact that the name
> DIFFERENCE is already used somewhere in windows standard includes (winuser.h
> there is a #define DIFFERENCE 11)
> I tried to #undef it before including vtkBooleanOperationPolyDataFilter.h
> but it doesn't seem to change anything.
> The only workaround I found yet is to replace DIFFERENCE by e.g.
> SETDIFFERENCE in the filter.
>
> Would someone have a better solution? (besides changing the OS and
> compiler...)
>
>
>
> Question:
>
> After doing so, I could successfully test the filter with various meshes.
> It works perfectly well for meshes created from the various vtk___Sources
> (which is already a great help for my project!)
> However, I obtain spurious results when working on 'manually' generated
> meshes, such as simple cubes defined with 8 points and 12 triangles (see
> code below)
> What are the requirements for the input meshes?
> and how should I define my custom meshes so they are compatible with the
> filter?
>
>
> Thanks,
>
> Rémi Blanc
>
>
>
> double W1 = 5, H1 = 4, D1 = 2;
> double W2 = 2, H2 = 5, D2 = 4;
> points1->InsertNextPoint(-W1,-H1,-D1); points1->InsertNextPoint(-W1,
> H1,-D1); points1->InsertNextPoint( W1, H1,-D1); points1->InsertNextPoint(
> W1,-H1,-D1);
> points1->InsertNextPoint(-W1,-H1, D1); points1->InsertNextPoint(-W1, H1,
> D1); points1->InsertNextPoint( W1, H1, D1); points1->InsertNextPoint(
> W1,-H1, D1);
> points2->InsertNextPoint(-W2,-H2,-D2); points2->InsertNextPoint(-W2,
> H2,-D2); points2->InsertNextPoint( W2, H2,-D2); points2->InsertNextPoint(
> W2,-H2,-D2);
> points2->InsertNextPoint(-W2,-H2, D2); points2->InsertNextPoint(-W2, H2,
> D2); points2->InsertNextPoint( W2, H2, D2); points2->InsertNextPoint(
> W2,-H2, D2);
>
> vtkIdType tri[3];
> //'lower' faces
> tri[0] = 0; tri[1] = 1; tri[2] = 2;
> cells1->InsertNextCell(3, tri);
> tri[0] = 0; tri[1] = 2; tri[2] = 3;
> cells1->InsertNextCell(3, tri);
> //side faces
> tri[0] = 0; tri[1] = 1; tri[2] = 5;
> cells1->InsertNextCell(3, tri);
> tri[0] = 0; tri[1] = 5; tri[2] = 4;
> cells1->InsertNextCell(3, tri);
> tri[0] = 1; tri[1] = 2; tri[2] = 6;
> cells1->InsertNextCell(3, tri);
> tri[0] = 1; tri[1] = 6; tri[2] = 5;
> cells1->InsertNextCell(3, tri);
> tri[0] = 2; tri[1] = 3; tri[2] = 7;
> cells1->InsertNextCell(3, tri);
> tri[0] = 2; tri[1] = 7; tri[2] = 6;
> cells1->InsertNextCell(3, tri);
> tri[0] = 0; tri[1] = 7; tri[2] = 3;
> cells1->InsertNextCell(3, tri);
> tri[0] = 0; tri[1] = 4; tri[2] = 7;
> cells1->InsertNextCell(3, tri);
> //'upper' face
> tri[0] = 4; tri[1] = 5; tri[2] = 6;
> cells1->InsertNextCell(3, tri);
> tri[0] = 4; tri[1] = 7; tri[2] = 6;
> cells1->InsertNextCell(3, tri);
>
> obj1->SetPoints(points1); obj2->SetPoints(points2);
> cells1->Squeeze();
> obj1->SetPolys(cells1); obj2->SetPolys(cells1);
> _______________________________________________
> 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
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
--
Unpaid intern in BillsBasement at noware dot com
More information about the vtkusers
mailing list