Compute total length of spline

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Seymour Clufley
Addict
Addict
Posts: 1264
Joined: Wed Feb 28, 2007 9:13 am
Location: London

Compute total length of spline

Post by Seymour Clufley »

This function, equivalent to the SVG function getTotalLength() for paths, would be very useful.
JACK WEBB: "Coding in C is like sculpting a statue using only sandpaper. You can do it, but the result wouldn't be any better. So why bother? Just use the right tools and get the job done."
User avatar
STARGÅTE
Addict
Addict
Posts: 2227
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: Compute total length of spline

Post by STARGÅTE »

It is already there, isn't it?
PathLength()
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
Seymour Clufley
Addict
Addict
Posts: 1264
Joined: Wed Feb 28, 2007 9:13 am
Location: London

Re: Compute total length of spline

Post by Seymour Clufley »

That's for the vector drawing library, not the spline library.
JACK WEBB: "Coding in C is like sculpting a statue using only sandpaper. You can do it, but the result wouldn't be any better. So why bother? Just use the right tools and get the job done."
marc_256
Addict
Addict
Posts: 837
Joined: Thu May 06, 2010 10:16 am
Location: Belgium
Contact:

Re: Compute total length of spline

Post by marc_256 »

Hi,

It is impossible to calculate the length of a spline ...
You can calculate the approximated length by adding the distances between each point on the spline.
If you want the most accurate length, you need to add lots of points on the spline.

Marc,
- every professional was once an amateur - greetings from Pajottenland - Belgium -
PS: sorry for my english I speak flemish ...
Post Reply