[vtkusers] How to use vtkBooleanOperationPolyDataFilter correctly
cory.quammen at kitware.com
Thu Oct 9 15:49:46 EDT 2014
I looked at this problem in some depth today. The cylinder shape in
input_2.stl is not a water-tight object. It looks like the end cap
tessellation does not match the tessellation of the cylinder body.
Attached is an image showing this where we are looking down the
cylinder from one end. Note that parts of the end cap sticks out past
Why does this matter? The signed distance computation from a query
point on one polydata to another finds the closest point on the other
polydata, then computes the dot product of the surface normal at the
closest point with the vector in the direction from the query point to
the closest point. The dot product determines the sign of the
distance, positive if outside the queried object, negative if inside.
Since that little part of the end cap sticks out past the side of the
cylinder, it is closer to the query point than the side of the
cylinder, the normal of the end cap at that point is used as the
surface normal. This causes the dot product for that query point to be
the sign opposite of what it would be if a point on the cylinder wall
was selected, hence the missing triangles.
My recommendation is to make your cylinder end cap tessellation match
the cylinder body tessellation and give this a try again.
On Wed, Oct 8, 2014 at 9:05 PM, Cory Quammen <cory.quammen at kitware.com> wrote:
> This particular problem looks like it stems from the distance
> computation from one of the surfaces to another, which is computed in
> vtkImplicitPolyData. It looks like the normal used in this calculation
> is being flipped for the missing triangles. I'm tracking it down.
> On Wed, Oct 8, 2014 at 1:18 PM, Cory Quammen <cory.quammen at kitware.com> wrote:
>> Hi Santosh,
>> Your input geometries are fine. I, too, see missing polygons from the
>> output. This is definitely not expected. These missing triangles are
>> apparently being misclassified as to whether they belong to the union
>> or intersection surface.
>> I'll take a look to see if there is a quick fix for this.
>> On Wed, Oct 8, 2014 at 9:23 AM, santosh <scbiradar at gmail.com> wrote:
>>> Hi Cory,
>>> I tried the vtkBooleanOperationPolyDataFilter on two closed surfaces which
>>> are intersecting with each other.
>>> I made sure that the normals of both the closed surfaces point outwards.
>>> After i perform a union operation using the
>>> vtkBooleanOperationPolyDataFilter, I get holes in the
>>> final result. I am attaching the two individual STL files and the result of
>>> the union operation. I am aslo attaching an image that shows the holes in
>>> the resultant STL file. Is this expected behavior ? Can I do something to
>>> get a surface without any holes?
>>> input_1.stl <http://vtk.1045678.n5.nabble.com/file/n5729039/input_1.stl>
>>> input_2.stl <http://vtk.1045678.n5.nabble.com/file/n5729039/input_2.stl>
>>> output.stl <http://vtk.1045678.n5.nabble.com/file/n5729039/output.stl>
>>> union.png <http://vtk.1045678.n5.nabble.com/file/n5729039/union.png>
>>> View this message in context: http://vtk.1045678.n5.nabble.com/How-to-use-vtkBooleanOperationPolyDataFilter-correctly-tp5728839p5729039.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
>>> Follow this link to subscribe/unsubscribe:
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 9115 bytes
Desc: not available
More information about the vtkusers