Hello,
I need to compute a point on a bspline curve which has the tangential vector parallel to the straight segment (chord) connecting another two points on the same curve.
Is there a way to do it with the current v7? It would be awesome to see any ideas.
Thank you.
Point on a bspline with a condition
Re: Point on a bspline with a condition
I assume the curve is 2D? In 3D this problem generally does not have a solution (on a 3D spiral a chord parallel to the axis between two full turns is never parallel to a tangent).
So you will probably need to construct the curve as IBSplineCurve2d_DG and query ICurve2d_DG from it to access points and tangents.
I doubt there is finite equations solution. I suggest using a numerical method for finding a root of a function of the parameter u along the curve. As the function in the case, you could take 2D cross product between the chord and the tangent:
You will have two vectors: c (chord) and the tangent t as T2DDg, So the function returning cross product c.CrossProduct(t(u)); should do. It changes sign when the two are parallel and are rotating relatively to each other.
Coding finding the root is normally like 20 lines of code. See https://en.wikipedia.org/wiki/Root-finding_algorithms
Regards
So you will probably need to construct the curve as IBSplineCurve2d_DG and query ICurve2d_DG from it to access points and tangents.
I doubt there is finite equations solution. I suggest using a numerical method for finding a root of a function of the parameter u along the curve. As the function in the case, you could take 2D cross product between the chord and the tangent:
You will have two vectors: c (chord) and the tangent t as T2DDg, So the function returning cross product c.CrossProduct(t(u)); should do. It changes sign when the two are parallel and are rotating relatively to each other.
Coding finding the root is normally like 20 lines of code. See https://en.wikipedia.org/wiki/Root-finding_algorithms
Regards