+ p1=curve(t); // the closest point on the curve
+ tangent=deriv(t).norm(); // the unit tangent at that point
+
+ // if the point we're nearest to is at either end of the
+ // bline, our distance from the curve is the distance from the
+ // point on the curve. we need to know which side of the
+ // curve we're on, so find the average of the two tangents at
+ // this point
+ if (t<0.00001 || t>0.99999)
+ {
+ if (t<0.5)
+ {
+ if (iter->get_split_tangent_flag())
+ {
+ tangent=(iter->get_tangent1().norm()+tangent).norm();
+ edge_case=true;
+ }
+ }
+ else
+ {
+ if (next->get_split_tangent_flag())
+ {
+ tangent=(next->get_tangent2().norm()+tangent).norm();
+ edge_case=true;
+ }
+ }
+ }