Open sysuyl opened 2 months ago
Your unit direction vectors have only 2 degrees of freedom, while 3D rotations and unit quaternions have 3. I don't think the splines.quaternion
module is the right tool for your situation.
I'm sure that most of what I derived for unit quaternions can similarly be derived for a "normal" sphere. I don't know the details, though.
You can have a look at #5, which mentions an application with 2 degrees of freedom and it references this paper: https://doi.org/10.1016/S0010-4485(00)00049-X
I also tested other implmentation of Squad method and interpolated correctly when this library fails.
Out of curiosity, which implementation was that?
Hello,
First, I updated the code when checking if interpolated samples cross the control points, use interpolate_and_check_if_cross_control_point
instead of the old one '''interpolate_and_compare_last''' which is incorrect. The new one will show that if the samples cross a control point, the dot product will near to be 1.0.
And I want to ask is there any problem in function interpolate_catmull_rom_centripetal
when do quanterion interpolation? Because I'm not familiar with the concept of grid
in code,
ts = np.linspace(spline.grid[0], spline.grid[-1], num_samples, endpoint=False)
sample_rotations = spline.evaluate(ts)
Out of curiosity, which implementation was that?
I tested the Squad(ShoemakeC1Spline) in interpolation-methods library. It seems just a directly implemenation of squad interpolation.
By the way, I'm interested in your library because it discussed the centripetal parameterization, which has the very nice property that it guarantees no cusps and no self-intersections.
Finally, thanks for your work!
I'm not familiar with the concept of
grid
in code
spline.grid
is the list of parameter values (a.k.a. time values) corresponding to the list of quaternions used to construct spline
(there is one more grid
value if closed=True
was chosen).
Those time values could be given when constructing a spline, but when using the alpha
parameter, they are instead chosen automatically (starting with zero).
spline.evaluate(spline.grid[0])
gives you the first quaternion in the spline.
spline.evaluate(spline.grid[-1])
gives you the last quaternion in the spline (if closed=False
was given).
Hello,
I am tring to interpolate a set of unit direction vectors' endpoints with spline. It means that the spline will interpolate/cross each direction vector's endpoint on a unit sphere surface. The result will look like this picture,
I used the following process,
The problem is that the interpolated result seems not correct with some inputs. Below is my code and test data,
The output is,
When I plot the original direction vectors and sampled vectors, it shows that the problem more clearly, test-data1, test-data2,
Besides, I'm not that confident about the direction vector and quanterion conversion, and maybe also use this library's interpolation in wrong way. But it worked for part of test data, and I also tested other implmentation of Squad method and interpolated correctly when this library fails.