[vtkusers] How to triangulate two non-intersecting polylines, now in 3D

Bill Lorensen bill.lorensen at gmail.com
Mon Mar 5 17:29:28 EST 2018


This example may be useful.
https://lorensen.github.io/VTKExamples/site/Cxx/PolyData/ContoursToSurface/

On Mar 5, 2018 1:35 PM, "normanius" <juch at zhaw.ch> wrote:

> (I think I forgot to set the HTML flag before, now the code should be
> visible.)
>
>
> # comboBefore = combinePolyData(edge1, edge2)
> # center1 = computeCenter(edge1)
> # center2 = computeCenter(edge2)
> # edge2 = scaleObject(edge2, 1.2)
> # Scaling is required to make sure that the contours are not intersecting in 2D
> # edge2 = moveObject(edge2, center1-center2)
> # comboAfter = combinePolyData(edge1, edge2)
> result = vtk.vtkContourTriangulator()
> result.SetInputData(combo)
> result.Update()
>
> poly = vtk.vtkPolyData()
> poly.SetPoints(comboBefore.GetPoints())
> poly.SetPolys(result.GetPolys())
> poly.BuildLinks()
> poly.BuildCells()
>
>
> ------------------------------
> Sent from the VTK - Users mailing list archive
> <http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html> 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
>
> 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/20180305/b76addbb/attachment.html>


More information about the vtkusers mailing list