[vtkusers] Mesh cutting using freehand curve
Goodwin Lawlor
goodwin.lawlor.lists at gmail.com
Tue May 22 02:16:58 EDT 2012
Hi Miguel,
Try out this pipeline:
(in Tcl but it's the same idea in any language)
vtkPoints selectionPoints
selectionPoints InsertNextPoint 1.0 1.0 1.0
# etc...
vtkSelectPolyData select
select SetLoop selectionPoints
# connect your data here
select SetInputConnection [mydataFilter GetOutputPort]
select GenerateSelectionScalarsOn
select SetSelectionModeToLargestRegion;
vtkClipPolyData selectclip
selectclip SetInputConnection [select GetOutputPort]
selectclip SetValue 0.0
It's not 100% robust but works for most meshes that have well behaved
topology...
hth
Goodwin
On Tue, May 22, 2012 at 4:45 AM, Miguel Sotaquira <msotaquira at gmail.com>wrote:
> Hi everyone!
>
> I have a 3D manifold mesh and I want to be able to cut it using a freehand
> (drawn by user) contour. An example of such a mesh and the contour drawn by
> the user is shown in this image: http://postimage.org/image/sbnmcoodj/. By
> cutting I mean generating a 3D surface from the freehand contour and then
> splitting the mesh in two parts.
>
> Up to this point I've came up with this workflow for generating the
> freehand contour: vtkContourWidget -> vtkPolygonalSurfacePointPlacer. With
> this approach I'm able to draw the contour on the polydata mesh (see
> previous figure) and extract the set of contour point coordinates.
>
> However I'm lost from this point:
> - How to generate the 3D cutting surface?
> - Which would be the most adequate class to perform the cutting:
> vtkClipPolyData, vtkCutter, vtkExtractPolyDataGeometry?
> - In any of the previous classes I need a vtkImplicitFunction. How to
> define a vtkImplicitFunction using the 3D cutting surface?
>
> Thanks for any suggestions,
> Miguel
>
> _______________________________________________
> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120522/09908758/attachment.htm>
More information about the vtkusers
mailing list