Hello all.
Let me start with "I am in WAY over my head here". Please bare that in mind when you are rolling your eyes at me ;-)
So I have two B-Splines ( Generated in Solidworks ) that I extract 1500 - 3000 points from each.
At each one of these points I extract the tangents, normals, relationship to the equivalent point on the other spline and such.
With all of this data and some correction factors I create a new set of 1500 - 3000 points.
All of this is working as best I can tell.
Now I would like to create a new B-spline from my new set of corrected points.
Using interpolate_curve() on 1500 points takes just over 190 seconds (3 minutes) on my hardware.
Running over 750 points takes about 20 seconds
Running over 325 points takes about 1 second.
( I have not run 3000 points ... mostly because my attention span is not that long )
Clearly there is a steep exponential relationship to the number of points to fit.
My question is:
Are there any tuning type parameters that I might tweak to give up some accuracy for some speed.
( Or perhaps I am just coming about this the wrong way?)
i.e. in my case all of the points are in mm.
I do not need to be more accurate than about 0.01 mm in my curve fit.
My goal would be to generate two new B-Splines with 3000 points each in 10-20 seconds.
Here is a bit of made up points to test with.
import time
import math
from geomdl import fitting
points = []
steps = 1500 #Number of points to fit
for i in range(steps):
th= i* math.pi /steps
points.append((math.sin(th),math.cos(th),math.sin(th*3)))
degree = 4
timethen = time.time()
Curve = fitting.interpolate_curve(points,degree)
timenow = time.time()
print(timenow - timethen)
I do not understand the math behind how this works.
With the light of self proclaimed ignorance shining brightly I would like to ask ...
It seams to me that the fitting process must be iterating over all the points for each new point. (That would tend to have an exponential expense )
However it seams to me that there is really no need to go back to the first point once you are some number of points way from it.
i.e. the fit would be a moving window x many points wide.
Is this possible? Can I do this?
Is this even the appropriate place to ask such questions?
Thanks you much for your time.