bezier
bezier copied to clipboard
how to find the 30% of the total line curve length.
how to find the 30% of the total line curve length.
The current curve length implementation is here: https://github.com/oysteinmyrmo/bezier/blob/master/include/bezier.h#L744
It's a simple, brute force implementation that splits the curve into N
intervals and sums the length of each arc. Since t
starts at 0.0
and ends at 1.0
by summing all dt
s you get the total curve length. There is currently no direct function call to achieve what you want. It would require some small changes to the length()
function. I may look at it after the summer, but feel free to make a pull request with a function starting at some t1
and ending at some t2
, doing the same work as in the current function.
Another approach could be to use the split(float t)
function at https://github.com/oysteinmyrmo/bezier/blob/master/include/bezier.h#L770 and split the curve at t=0.3
and calculate the total length of the left
part of the resulting curves, if this is what you need. Would that work?
Closing due to inactivity.