70001805 I wish to get the Tangent Vector at a point of a vdCurve

Article 70001805
Type Wish
Product Engine
Version 8005
Date Added 7/24/2020
Fixed 8.8006.0.1 (8/24/2020)
Submitted by lpch534


I wish to get the Tangent Vector at a point of a vdCurve


A new method getTangentAtPoint of vdCurve was added in version 8006.0.1


Vector getTangentAtPoint(gPoint pickPoint, out gPoint pointOnCurve)

Returns : the Tangent Vector direction from a point on the curve in World Coordinate System
pickPoint : A point in WCS near to to the curve boundary
pointOnCurve : The closest point to pickPoint that lies on the curve in WCS
The return Vector direction is always in the Counter ClockWise of the given arc and in World Coordinate System

Implementd for vdArc , vdCircle , vdEllipse and arc segments of vdPolyline entities


                //Prompt the user to select an Arc , Circle, Ellipse or Pline with Arc segments and if success draw the tangent line from the pick point on Curve
                vdCurve crv;
                vdFigure fig;
                gPoint pt;
                doc.Prompt("Pick Point on a Curve");
                StatusCode sc =  doc.ActionUtility.getUserEntity(out fig, out pt);
                if (sc != StatusCode.Success) return;
                crv = fig as vdCurve;
                if (crv == null) return;
                gPoint pointoncurve;
                Vector tang = crv.getTangentAtPoint(pt, out pointoncurve);
                if (tang == null) return;
                vdLine testline = new vdLine(doc, pointoncurve, pointoncurve + tang) { PenColor = new vdColor(Color.Red) };

Send comments on this topic.