Hi Brian,
> The values of the tangent or derivative is given as (x,y,z), a vector.
> Sometimes the tangent vector values appear different from the 1st derivative values,
> but I think that the two vectors are parallel?
The tangent has the same direction as the derivative but the tangent is normalized so it is a unit length vector.
> FromLeft = false, reverses the "direction" of calculation of tangent or derivatives.
Not quite - the FromLeft parameter only has an impact at a discontinuity. At a discontinuity there can be 2 different tangents at one single parameter value and "FromLeft" chooses whether it returns the tangent of the segment to the left or the segment to the right.
Say for example there is a curve like this:
If you evaluate the tangent right at that t = 6.3 location there is a discontinuity there and there are 2 possible tangent values, one from this segment (let's call this the "left segment":
And then there is a different tangent direction using the right segment:
The FromLeft parameter determines which of these 2 will be returned, if FromLeft = true (the default if you don't specify it) the one from the left segment will be returned, FromLeft = false means the one from the right segment will be returned.
The tangent is still in the overall direction from the start to end of the entire curve, so setting FromLeft = false does not reverse the direction of the tangent, it just picks which of the 2 will be returned.
> (Flipping the curve would result in reversing of FromLeft true vs false vector results. (except maybe at a corner point?))
Flipping the curve would result in both a flipping of all tangent directions and also which segment's tangent would be returned by FromLeft true vs false, since now the other one is lower in segment order.
> For a straight line, all of the 'FromLeft = true tangents' for all of the points on the line, will be the same, as will all of the 1st derivatives.
This is true if it is a simple 2 point line. If it's a curve made up of many control points which all happen to be arranged in a line then the tangents will be the same but the 1st derivatives will change depending on the control point spacing.
> In order to make a "Clothoid Blend" from a start point of a curve, the tangent at the startpoint will (MAYBE) have
> to be the "FromLeft = false" version.
Nope - if you want to have a direction pointing opposite from the start tangent of a curve you would evaluate the tangent of the curve with "FromLeft" not having any impact whether true or false, and then you would modify the tangent by multiplying it by -1.0 to flip it.
> A curve with a "corner point" in it, with non-tangent curve segments joined at the corner point, would have a discontinuity at the corner point.
Yes, a tangent discontinuity.
> I think that the Blend command would benefit from incorporating "crv.isClickSelectedNearEnd" ?
The Blend command already uses it internally in the blend factory.
> For non-corner point tangents of a curve, the 'FromLeft = true' tangent is 180 degrees from the 'FromLeft = false' tangent.
Nope - at non-corner points there is only one curve tangent and either FromLeft = true or FromLeft = false will return the same value there since the tangent as seen approaching the point from lower in parameter space (FromLeft = true) is the same a the one seen by approaching the point from higher in parameter space (FromLeft = false).
The evaluated tangent is always in the direction of start to end of the curve no matter what value you specify for FromLeft.
> A CurveSegment is part of a curve consisting of joined segments.
Yup. In MoI each segment is restricted to be tangent/G1 continuous. If there's a break in tangent continuity the segments will be divided there.
> Selecting a curve selects all of its segments.
Pretty much, but it's implicit, it's only the parent curve that will have obj.selected == true.
> Is there a corner point between all joined curve segments?
Yes, although it is possible for a corner point to still be tangent continuous if the segments happen to be formed that way (which is not unusual, for example a curve that is filleted will be like this). You'd only see a sharp corner in a case like that if you dragged the corner point somewhere.
> To tell if a curve has curve segments, Separate the curve. Is there another way?
The segments of a curve are returned by the getSubObjects() method which is available on every object type in MoI. A curve always has at least one segment. To see if it's made up of multiple segments you could do crv.getSubObjects().length > 1.
Hope this helps!
- Michael