关于曲线法线的问题
<p>请问如何能获取曲线上任意点处的法线方向,请哪位高手指点一下!</p> <p>Download VLAX.cls and Curve.cls... Then the following codes can find out the tangent direction of a point on curve.</p><p>Sub TEST()<br/>Dim C As Curve<br/>Dim objCur As AcadEntity<br/>Dim pickPnt As Variant<br/>Dim closePnt As Variant<br/>Dim paramatclosePnt As Double<br/>Dim tangentatclosePnt As Variant<br/>Set C = New Curve<br/>ThisDrawing.Utility.GetEntity objCur, pickPnt, "SELECT A CURVE:"<br/>Set C.Entity = objCur<br/>closePnt = C.GetClosestPointTo(pickPnt)<br/>paramatclosePnt = C.GetParameterAtPoint(closePnt)<br/>tangentatclosePnt = C.GetFirstDerivative(paramatclosePnt)</p><p>Dim objRay As AcadRay<br/>Dim origin(2) As Double<br/>Dim pt2(2) As Double<br/>origin(0) = 0#: origin(1) = 0#: origin(2) = 0#<br/>pt2(0) = tangentatclosePnt(0): pt2(1) = tangentatclosePnt(1): pt2(2) = tangentatclosePnt(2)<br/>Set objRay = ThisDrawing.ModelSpace.AddRay(origin, pt2)<br/>objRay.Move origin, closePnt<br/>End Sub</p>
页:
[1]