[vtkusers] how to draw a 3D spring
Marius S Giurgi
rendezvous at dreamxplosion.com
Sun Jan 16 14:30:37 EST 2005
Here's an example I used to create tubed axes, using the vtkTubeFilter.
axes SetOrigin 0 0 0
axes SetScaleFactor 200
tubedAxes SetInput [axes GetOutput]
tubedAxes SetRadius 3
tubedAxes SetNumberOfSides 16
axesMapper SetInput [tubedAxes GetOutput]
axesActor SetMapper axesMapper
Once you get the polyline created (the spiral/helix for your spring)
you can pass it as an input to the vtkTubeFilter to get it tubed.
Pretty cool. Check it out and see if this is what you're looking for.
(I don't know whether there's a class to create the helix though. You
might have to generate it on your own).
On Jan 15, 2005, at 9:07 PM, Shi Jin wrote:
> Hi there,
> I am very new to VTK. My first intention is to draw
> something for my research which requires drawing a
> spring-mass system. My question is how to draw the
> spring connectting the two balls. I am thinking using
> a sprial(helix) tube. The helix has a very simple
> mathematica form but the problem is how to draw it
> three dimensionly, like the real springs. I am
> thinking the vtkSweptSurface Class. But is there any
> other way to do it, like curved tubes?
> Thanks a lot.
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
> Follow this link to subscribe/unsubscribe:
More information about the vtkusers