[vtkusers] vtkBooleanOperationPolyDataFilter doesn't work for certain polydata.
Cory Quammen
cory.quammen at kitware.com
Wed Jan 13 09:37:18 EST 2016
The reason this is done for the cube source is so that you can have
separate normals at each point for each face. This is commonly done in
computer graphics where sharp edges are desired. If you have just one
point, you can associate just one normal with the point, and normals
will be interpolated across the faces, leading to an undesirable round
appearance to the cube. If you don't have sharp angles between
adjacent polygons in your source, then you don't need to duplicate
points.
On Wed, Jan 13, 2016 at 9:31 AM, Rakesh Patil <rakesh.p at tataelxsi.co.in> wrote:
> Ok, I shall try that and get back to you. And is it necessary to have same point to be inserted multiple times? Like in vtkCubeSource, the same set of points (8) are being inserted three times. Can't we just limit to eight points and share their indices for the faces?
>
> Thanks
>
> Rakesh Patil
>
> ________________________________________
> From: Cory Quammen <cory.quammen at kitware.com>
> Sent: Wednesday, January 13, 2016 7:48 PM
> To: Rakesh Patil
> Cc: vtkusers at vtk.org
> Subject: Re: [vtkusers] vtkBooleanOperationPolyDataFilter doesn't work for certain polydata.
>
> By winding order, I mean which order the node points are inserted for
> each face. The normals should indeed face outward, which requires a
> counter-clockwise insertion order.
>
> On Wed, Jan 13, 2016 at 9:17 AM, Rakesh Patil <rakesh.p at tataelxsi.co.in> wrote:
>> Hey Cory,
>>
>> What exactly do you mean by winding order? Is it the order in which the faces are added, or the order in which node points are inserted for each face? My normals are probably facing outside the polydata. I shall confirm it once again.
>>
>> Thanks
>>
>> Rakesh Patil
>> ________________________________________
>> From: Cory Quammen <cory.quammen at kitware.com>
>> Sent: Wednesday, January 13, 2016 7:31 PM
>> To: Rakesh Patil
>> Cc: vtkusers at vtk.org
>> Subject: Re: [vtkusers] vtkBooleanOperationPolyDataFilter doesn't work for certain polydata.
>>
>> Rakesh,
>>
>> My first guess is to check the winding order of the polygons in your
>> custom source. My guess is that they are in reverse order of what they
>> should be.
>>
>> The reason I suspect a reversal is because the boolean operations
>> filter looks at the normal for each face to determine whether points
>> are inside or outside the poly data. If your normals are opposite of
>> what they should be, which would happen if your winding order is
>> backwards, that would explain the behavior you see.
>>
>> HTH,
>> Cory
>>
>> On Wed, Jan 13, 2016 at 3:29 AM, Rakesh Patil <rakesh.p at tataelxsi.co.in> wrote:
>>> Dear users,
>>>
>>>
>>> I am trying to implement UNION, INTERSECTION & SUBTRACTION operations using
>>> vtkBooleanOperationPolyDataFilter. I succeeded in performing these
>>> operations for polydata coming from vtkCubeSource and vtkCylinderSource. I
>>> have created another class called My3DPolygonSource which is similar to
>>> vtkRegularPolygonSource, but it computes 'n' sided 3D objects. The polydata
>>> coming from My3DPolygonSource gives opposite results. i.e. for UNION, it
>>> produces output of INTERSECTION. For INTERSECION,the output is of UNION, and
>>> for SUBTRACTION, the output is B-A (actual output should be A-B).
>>>
>>>
>>> I would like to know what are the prerequisite criteria to be considered
>>> before performing these operations. In which scenarios, the behavior gets
>>> reversed (as mentioned above)?
>>>
>>>
>>> Thanks
>>>
>>> Warm Regards
>>>
>>>
>>> Rakesh Patil
>>>
>>>
>>> _______________________________________________
>>> 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.
>
>
>
> --
> Cory Quammen
> R&D Engineer
> Kitware, Inc.
--
Cory Quammen
R&D Engineer
Kitware, Inc.
More information about the vtkusers
mailing list