[vtkusers] vtkSpline

mail.ru patalog at mail.ru
Mon May 31 08:40:58 EDT 2004


Hello vtkusers,

  Is there a way to evaluate coord. of points (around each control
  points) on spline such, that these points lie at equal distance from control points?
  
  If I do simply
  for (vtkIdType i = 0; i < control_point_count; ++i)
  {
       //the same coords. as control points
       const double t = i;
       double x = x_spline->Evaluate(t);
       double y = y_spline->Evaluate(t);
       vert->InsertNextPoint(x, y, 0);

       //eval coords. before cp, testing if this first cp skipping
       x = x_spline->Evaluate(t - .1);
       y = y_spline->Evaluate(t - .1);
       vert2->InsertNextPoint(x, y, 0);

       //eval coords. after cp, testing if this last cp skipping
       x = x_spline->Evaluate(t + .1);
       y = y_spline->Evaluate(t + .1);
       vert2->InsertNextPoint(x, y, 0);
  }
  - I get such result (see spline.jpg in attach, green vertex is
  control points, and red is eveluated points)

 In generally, I need to create "rings" with given width on the tube, maked from spline
 by vtkTubeFilter. These "rings" must be placed around of each control
 points of given spline.
 
 I can not use texture, because I need to assign different specular,
 ambient and diffuse color to these "rings" rather than the tube.
 (or maybe, I mistake and it's possible to use texture in that case?)

 Maybe there is another way to solve this problem?
 I think that it's possible to use cylinder (or torus) (the width of
 these "rings" is quite narrow), but how to find the guide for
 cylinder? Can I evaluate the tanget vector at control point?
 
-- 
Best regards,
 Dmitry Gurulev                         mailto:patalog at mail.ru
-------------- next part --------------
A non-text attachment was scrubbed...
Name: spline.JPG
Type: image/jpeg
Size: 10817 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20040531/9cb7b865/attachment.jpeg>


More information about the vtkusers mailing list