[vtkusers] How to draw "Spider" shapes in vtkUnstructuredgrid

scotsman60 doug at beachmailing.com
Mon Feb 4 01:37:34 EST 2019


Hello!!!I'm trying to drawn what I call a "Spider" type shape in a
vtkUnstructuredGrid."What's a Spider type shape" you might ask?It's a shape
that has one reference point, attached via edges to multiple other
points.Imagine a + sign  - the reference point is a the center and the four
other points are each of the tips.I can draw this type of shape using a
vtkPolyLine as followsorigin = [0.0, 0.0, 0.0]p0 = [1.0, 0.0, 0.0]p1 =
[-1.0, 0.0, 0.0]p2 = [0.0, 1.0, 0.0]p3 = [0.0, -1.0, 0.0]points =
vtk.vtkPoints()points.InsertNextPoint(origin)points.InsertNextPoint(p0)points.InsertNextPoint(p1)points.InsertNextPoint(p2)points.InsertNextPoint(p3)mesh
= vtk.vtkUnstructuredGrid()mesh.SetPoints(points)polyLine =
vtk.vtkPolyLine()polyLine.GetPointIds().SetNumberOfIds(8)polyLine.GetPointIds().SetId(0,
0)polyLine.GetPointIds().SetId(1, 1)polyLine.GetPointIds().SetId(2,
0)polyLine.GetPointIds().SetId(3, 2)polyLine.GetPointIds().SetId(4,
0)polyLine.GetPointIds().SetId(5, 3)polyLine.GetPointIds().SetId(6,
0)polyLine.GetPointIds().SetId(7, 4)But I have to draw 100,000+ of these
shapes and this approach seems wasteful - 7 edges in the polyline when only
four are required.Any ideas for a more efficient approach will be gratefully
received,Thanks,Doug 



--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://vtk.org/pipermail/vtkusers/attachments/20190203/e6dd1090/attachment.html>


More information about the vtkusers mailing list