Jump to content

Curve Through Points 2D


Recommended Posts

Hi all!

I want to create a smooth curve through given points in 2D and I'm having trouble with using the built in interpolation functions in Labview.
I need something like this:

Interpolated Points

I found this thread from more than 10 years ago and I can't find the interpolation vi it's using, and I don't really understand what the other similar vis are doing.
It's only for a drawing application so it's not really important in details how the interpolation works (nurbs/bézier/whatever), it only needs to look okay.

Thanks for any hints in advance!

Edited by Lipko
Link to comment

I managed to solve it with some thinkering.

I used 3rd order Bézier curves to interpolate between neighbour points. The tangents in the points (which are the other two control points of the Bézier curve besides the end points) is calculated by the angle bisector of the two adjacent segments. The length of these control tangents are calculated from the length of the corresponding segment multiplied by a fix value ("strength"). Though it could be easily changed to have a separate strength value for each point.

Implemented closed and open version of the curve.

Note, that for some reason I havent looked into yet, the curve or some sections of it can suddenly snap into a seemingly opposite winding after a certain amount of deformity. The curve looks okay for my needs so I don't think I will fix that any time soon.

Attached a small quick demo. curve_through_points_demo.vi

The Bézier functio is also my "work" (copied the code into a formula node), I'm surprised that these basic geometry stuff are not implemented in Labview. by default

2D_curve_through_points.vi 2D_3rd_order_Bezier_curve.vi 2D_ccw_angle.vi 2D_3rd_order_Bezier_point.vi

Edited by Lipko
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.