Discussion:
[vtkusers] How to put vtkDiskSource on vtkPolyDataMapper
Matthew D
2018-11-11 10:21:32 UTC
Permalink
I need to put multiple vtkDiskSource over the mesh surface (represented as
vtkPolyDataMapper) so that the disks lay on the mesh surface. Objects like
vtkRegularPolygonSource has SetNormal method which could be used for
"rotation". Also there is vtkTransform but I don't know how to calculate
X,Y,Z values. Can anybody help me with that?

disk = vtk.vtkDiskSource()
disk.SetInnerRadius(1.0)
disk.SetOuterRadius(2.0)

<---- rotation

mapper = vtk.vtkPolyDataMapper()
mapper.SetInputConnection(disk.GetOutputPort())



--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
_______________________________________________
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://public.kitware.com/mailman/listinfo/vtkusers
Andaharoo
2018-11-12 07:08:16 UTC
Permalink
Do the disks need to be "apart" of the polygon for exporting and other
things? Or do you just need to render/visualize them?

If they need to be apart of the dataset then you need to join the disk's
polyData with your target polyData using vtkTransformFilter to move and
transform the disks and use vtkAppendPolyData or
vtkBooleanOperationPolyDataFilter to join all the disks with the target.

If you just need to render them then it's much easier:

For just a few of them you can simply specify a different vtkActor for each
disk and use SetPosition and SetOrientation to get them where you want them.

For visualizing many of them I would highly suggest using the glyphing
features of VTK as long as the disks only vary in position, scale, and/or
color. You can use vtkOpenGLGlyph3DMapper to render hundreds of thousands of
them on the latest gpus (assuming the disks are relatively low poly). Or use
vtkGlyph3DMapper if you don't have a gpu. Just supply it with the source, in
your case vtkDiskSource's output. And supply it with an input data object.
Which should contain point data, orientation data, and/or scalars in the
input data object. I'd use this to draw the normals of a polygon or a vector
field from image data as polygonal arrows. It's a little tricky and
undocumented currently and lacking examples. I can supply one if this is
what you need.



--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
_______________________________________________
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://public.kitware.com/mailman/listinfo/vtkusers
Matthew D
2018-11-12 09:15:59 UTC
Permalink
I need differect vtkActor for each Ring. But the problem I don't know how to
calculate SetPosition and SetOrientation for each of them (which function
filter use to do that).

Loading Image...

Current picture, at top two images from different coordinate positions, and
at the bottom how it should be in any place. The surface is a "head"
(vtkPolyData), coordinate system begins in head center.





--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
_______________________________________________
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://public.kitware.com/mailman/listinfo/vtkusers

Loading...