文档介绍:vlax曲线函数(vlax-curve函数)
The vlax-curve-get family functions include some of the following functions:
Vlax-curve-getPoinriv obj param) function of the value is calculated on the curve in the parameter values for the tangent at point param, the value is a form of , (x y z), using the following method can calculate the tangent direction in the perspective of the value of the parameter param:
(setq ang (angle (setq Pt (vlax-curve-getpointatparam obj param) (mapcar) + Pt (vlax-curve-getFirstDeriv obj param)))).
The vlax-curve-getSecondDeriv function calculates the normal direction of the curve, which is a table (x, y, z), and the normal angle is also computed using the above method. Returns the ' (0, 0, 0)' if the curve at the calculated point is a straight line.
When you understand the meaning of the parameter, you can calculate the various curves through the above functions. Some specific examples are given below:
,,,
1==========================================================
To determine whether the point is on the curve
;;TESTING: (gxl-ptoncurve (getpoint) (car (entsel))
(defun, gxl-ptoncurve (PT, curve) (setq, H (* (/ getvar, viewsize) (Cadr (getvar, screensize))) (getvar, pickbox))
;;;;((equal, Pt (vlax-curve-getClosestPointTo, curve, PT) H)
(equal, Pt (vlax-curve-getClosestPointTo, curve, PT) )
2==========================================================
function;
Return curve length
grammar
(gxl-ax:GetCurveLength, curve)
parameter
Lines, circles, circles, sections, lines, splines, splines and so on
Return value
Curve length
Sample (gxl-ax:GetCurveLength (car (entsel))
(defun, gxl-ax:GetCurveLength (curve /)
(if (= ename (type curves)) (setq curves (vlax - ename - > away -object curves)
(vlax - curves - getdistatparam curves (vlax - curves - getendparam curves)
)
;;;3 = = = = = = = = = = = = = = = = = = = = = = = = = = = =
;;;(gxl - ax: getmidpointcurve curves)计算曲线中点
(defun gxl - ax: getmidpointcurve (curves / d)
(setq d (/ (gxl