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

Cory Quammen cory.quammen at kitware.com
Mon Apr 3 12:48:11 EDT 2017


What fun would it be if I just wrote the code for you? :-)

I'm happy look at some code you write based on my initial hints, but
you'll have to try some things first. I told you how to get the point
to pass to plane->SetOrigin() in my previous email, so start with
that.

On Mon, Apr 3, 2017 at 12:34 PM, MarWas18 <marcinwas94 at interia.pl> wrote:
> Cory,
>
>>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.
>
> May you give me some simple example of code, please? Let's say that we have
> vtkPlane and vtkParametricSpline defined on 5 points. Let's say:
>
> vtkSmartPointer<vtkPlane> plane =
>         vtkSmartPointer<vtkPlane>::New();
>
> vtkSmartPointer<vtkParametricSpline> spline =
>                         vtkSmartPointer<vtkParametricSpline>::New();
>
> //splinePoints are those 5 points that I want to use
>
> spline->SetPoints(splinePoints);
>
> //What to do now? How to set that origin of plane should be point of spline
> after arbitrary shift?
>
> plane->SetOrigin(.....) ???
>
>>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.
>
> Got it, thank you!
>
> Best regards,
> Marcin Wasiucionek
>
>
>
> --
> View this message in context: http://vtk.1045678.n5.nabble.com/VTK-shift-plane-along-spline-perpendiculary-at-each-point-of-curve-tp5742707p5742710.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