[vtkusers] Problem with vtkContourTriangulator and vtkPlaneCutter

David Gobbi david.gobbi at gmail.com
Wed Mar 7 14:46:51 EST 2018


Hi Jeffery,

I can get your example to work by providing a tolerance to vtkCleanPolyData:

        polygonsContourClean->SetTolerance(1e-6);

A better fix is to clean the toroid itself:

vtkSmartPointer<vtkCleanPolyData> clean =
vtkSmartPointer<vtkCleanPolyData>::New();
        clean->SetInputConnection(source->GetOutputPort());
        clean->SetTolerance(1e-4);

The parametric surface has duplicate points where it joins back on itself.
If vtkCleanPolyData isn't given a tolerance, it uses its default tolerance
of zero, and isn't able to resolve the duplication.

 - David




On Fri, Mar 2, 2018 at 3:57 PM, Jeffery Lewis <jlewis at accuray.com> wrote:

> I have a prototype that generates a super toroid surface model. A cut
> plane is defined to be orthogonal to the camera line of sight, and cuts
> through the middle of the surface model. The cut contour (generated by
> vtkCutter), and filled cut contour (generated by vtkContourTriangulator) is
> rendered with the surface model. The surface model is shown transparent as
> it is only a reference. The rendering of interest is the cut contour (shown
> as red contour) and filled cut contour (shown as green). Moving the mouse
> rotates the surface model. The cut plane stays orthogonal to the camera
> while the surface model rotates. By rotating the surface model, you can see
> the cut contour and filled cut contour get updated interactively as it
> slices through the middle of the surface model.
>
>
>
> Unfortunately, the filled cut contour does not look right and I can’t seem
> to figure it out. If I change the surface model to something simpler like a
> cone, then everything looks fine.
>
>
>
> Also of note is that if I switch out the vtkCutter with a vtkPlaneCutter,
> the program crashes. I would like to use the vtkPlaneCutter since from its
> documentation seems to indicate that it will get better performance. The
> vtkPlaneCutter crashes using either the super toroid or cone.
>
>
>
> Attached is the source code. The stuff between “// Setup a slider widget
> for each varying parameter BEGIN” and “// Setup a slider widget for each
> varying parameter END” can be ignored as this only involves setting up
> sliders to manipulate the super toroid, which comes from the
> ParametricSuperToroidDemo example. The setup of the pipleline for the cut
> contour and filled cut contour is near the bottom.
>
>
>
> Also attached is a sample screen shot of the incorrect filled cut contour.
>
>
>
>
>
>
>
>
>
>              <https://www.facebook.com/AccurayIncorporated>
> <http://www.twitter.com/accuray>
> <https://www.linkedin.com/company/accuray>
> <https://www.youtube.com/user/AccurayIncorporated>
>
>
>
>
>
> [image:
> /private/var/folders/fl/x96rg8l57plbh3g8pgkqcchr0000gp/T/com.microsoft.Outlook/Outlook
> Temp/EMAIL SIGNATURE GRFX/Asset 6.png]
>
>
>
>
>
> *Jeffery Lewis*
>
> Staff Software Engineer, Treatment Planning Systems
>
>
>
> 1310 Chesapeake Terrace
>
> Sunnyvale, CA 94089
>
> USA
>
> Tel: 1.408.789.4367 <(408)%20789-4367>
>
> *jlewis at accuray.com <jlewis at accuray.com>*
>
>
>
>
>
>
> -- WARNING - CONFIDENTIAL INFORMATION: The information contained in the
> e-mail may contain confidential and privileged information and is intended
> solely for the use of the intended recipient(s). Access for any review,
> re-transmission, dissemination or other use of, or taking of any action in
> regard and reliance upon this e-mail by persons or entities other than the
> intended recipient(s) is unauthorized and prohibited. If you are not the
> intended recipient, please contact the sender by reply e-mail and destroy
> all copies of the original message and any attachments.
>
> _______________________________________________
> 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:
> https://vtk.org/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://vtk.org/pipermail/vtkusers/attachments/20180307/8eff68cf/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image014.png
Type: image/png
Size: 1447 bytes
Desc: not available
URL: <https://vtk.org/pipermail/vtkusers/attachments/20180307/8eff68cf/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image017.png
Type: image/png
Size: 1344 bytes
Desc: not available
URL: <https://vtk.org/pipermail/vtkusers/attachments/20180307/8eff68cf/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image015.png
Type: image/png
Size: 1625 bytes
Desc: not available
URL: <https://vtk.org/pipermail/vtkusers/attachments/20180307/8eff68cf/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image018.jpg
Type: image/jpeg
Size: 831 bytes
Desc: not available
URL: <https://vtk.org/pipermail/vtkusers/attachments/20180307/8eff68cf/attachment.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image016.png
Type: image/png
Size: 1612 bytes
Desc: not available
URL: <https://vtk.org/pipermail/vtkusers/attachments/20180307/8eff68cf/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image013.png
Type: image/png
Size: 12364 bytes
Desc: not available
URL: <https://vtk.org/pipermail/vtkusers/attachments/20180307/8eff68cf/attachment-0004.png>


More information about the vtkusers mailing list