tinyspline
tinyspline copied to clipboard
Function suggestion
Dear msteinbeck Below project has a lot function for your reference. https://github.com/SINTEF-Geometry/SISL
function no. list
s1850 - Find all the intersections between a curve and a plane (if curve dimension and dim = 3) or a curve and a line (if curve dimension and dim = 2).
s1240 - Compute the length of a curve. The length calculated will not deviate more than epsge divided by the calculated length, from the real length of the curve.
s1364 - To check if a curve is closed, i.e. test if the distance between the end points of the curve is less than a given tolerance.
s1363 - To pick the parameter range of a curve.
s1241 - To calculate the area between a 2D curve and a 2D point. When the curve is rotating counter-clockwise around the point, the area contribution is positive. When the curve is rotating clockwise around the point, the area contribution is negative. If the curve is closed or periodic, the area calculated is independent of where the point is situated. The area is calculated exactly for B-spline curves, for NURBS the result is an approximation. This routine will only perform if the order of the curve is less than 7 (can easily be extended).
s1243 - To calculate the weight point and rotational momentum of an area between a 2D curve and a 2D point. The area is also calculated. When the curve is rotating counter-clockwise around the point, the area contribution is positive. When the curve is rotating clockwise around the point, the area contribution is negative. OBSERVE: FOR CALCULATION OF AREA ONLY, USE s1241().
best regards, jeff
Hi @liufeijin,
the functions you listed look quite useful. I will consider to add them to TinySpline. Thanks!
s1364 and s1363 have been implemented.
wow, a good news! Many thanks for your great job. Hope , we can get other functions.
s1240 is now available with sample.
Hi msteinbeck Many thanks for your work on this!!! Could you continue to complete S1850,S1241,S1243? If complete these , tinyspline can replace SISL .
pop
Could you provide test cases for S1850, S1241, and S1243 so that I know what you are expecting?
Hi msteinbeck
For function S1850 as below
For function S1241 like as below
to get the area of blue part an red part. sometime the line is not cross the spline, so the area shall be 0 of empty
Hi msteinbeck Cloud you add these functions to your plan ?
Hi @liufeijin,
I already did some research. Function S1850 should be straight-forward. The other two functions are more complex. I'm not sure when I'll find the time to work on these features. Currently I'm working on the next release of TinySpline (0.4.0).
Hi msteinbeck Many thanks for you reply. It is big good news that you have plan on it. SISL is just only write by c. and it not convenient on NURBS. Hope your project tinyspline become a great and popular project.