[vtkusers] VTK- shift plane along spline, perpendiculary at each point of curve

Cory Quammen cory.quammen at kitware.com
Mon Apr 3 10:47:24 EDT 2017


On Mon, Apr 3, 2017 at 7:59 AM, MarWas18 <marcinwas94 at interia.pl> wrote:
> Hello!
>
> My problem is that I have a parametric spline (vtkParametricSpline) defined
> on few points and I want to shift along this spline a plane (vtkPlane) which
> is cutting function for cutter (vtkCutter).
>
> I want this plane to have center on spline and to be perpendicular to the
> spline at each point.
>
> Here are my questions:
> 1. How to shift plane smoothly along whole spline? Let's say that I have
> only 5 points defined and spline is very long- I know how to place plane at
> this 5 points (SetOrigin, and I take coordinates of these points), but how
> to shift plane along whole spline smoothly?

Calling vtkParametricSpline::Evaluate(double u[3], double Pt[3],
double Du[9]) will give you arbitrary points along the spline. u's
first element should contain parametric value. The returned point will
be stored in Pt. Du is not modified with this call, so you can ignore
that.

> 2. How to make plane perpendicular to spline at each point automatically?
> Are there any methods that might be used?

You want the normal of the plane to equal the tangent of the spline.
There is nothing built in that gives you the tangent, but you could
use some simple finite differences of points along the spline to
approximate it.

HTH,
Cory

>
> Best regards,
> Marcin
>
>
>
> --
> View this message in context: http://vtk.1045678.n5.nabble.com/VTK-shift-plane-along-spline-perpendiculary-at-each-point-of-curve-tp5742707.html
> Sent from the VTK - Users mailing list archive 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:
> http://public.kitware.com/mailman/listinfo/vtkusers



-- 
Cory Quammen
Staff R&D Engineer
Kitware, Inc.


More information about the vtkusers mailing list