So if I have a polyline and I evaluate the curve at the kink point, the resulting tangent vector is along the second curve (in this case). I feel like just before the kink it should along the first curve and after the kink it should be along the second curve but at the kink it should be the result of the two ie the blue vector. I must be missing something.
Tangent Vector of Polyline.gh (14.8 KB)
It doesn’t matter how you feel it should work What matters is how it actually works.
I’m surprised and disappointed that this works to get the blue vector:
I feel that should definitely not work.
Thanks for being a complete sarcastic prick, that added nothing to thread. I don’t know why you even took the time to reply.
Tangent Vector of Polyline_2025Feb12a.gh (11.4 KB)
Expression on Rotate ‘A’ input is x/2
Tom_P
February 12, 2025, 10:53pm
5
RhinoCommons [Curve.DerivativeAt] (https://developer.rhino3d.com/api/rhinocommon/rhino.geometry.curve/derivativeat ) has an side parameter, which is CurveEvaluationSide side
tangent_below_above_00.gh (10.4 KB)
private void RunScript(
Curve crv,
double t,
int side,
ref object pt,
ref object tangent)
{
CurveEvaluationSide sideEnum = (CurveEvaluationSide)side;
pt = crv.PointAt(t);
Vector3d[] vecs = crv.DerivativeAt(t,1,sideEnum);
Vector3d tangentVec = vecs[1];
tangentVec.Unitize();
tangent = tangentVec;
}
this is the correct approach to handle tangents at curve kinks.
hopefully this is how it works and feels correct for everybody.
happy spaghetti, kind regards -tom