Segment Properties | ![]() |
(std-seg-p1-uc <seg>) ; first point in UCS
(std-seg-p2-uc <seg>) ; second point in UCS
(std-seg-bulge-num <seg>) ; numeric bulge (not nil)
(std-seg-straight-p <seg>) ; straight or curved?
(std-seg-angle <seg>) ; angle p1-p2 in ECS
(std-seg-angle-uc <seg>) ; angle p1-p2 in UCS
(std-seg-pts-dist <seg>) ; straight length p1-p2
(std-seg-length <seg>) ; curved length p1-p2
These functions provide more higher level accessors to the segment structure, explained in some detail below:
STD-SEG-BULGE-NUM
guarantees the return of a numeric value, say 0 instead of NIL
as with STD-SEG-BULGE
, to avoid type errors in arithmetic code.
STD-SEG-STRAIGHT-P
is used to test for the existance of a zero bulge, if the segment is just a straight line.
The STD-SEG-ANGLE
function return the result of the angle function applied to p1 and p2.
The -UC
functions convert the result to the current UCS (user coordinate system).
STD-SEG-PTS-DIST
returns the 3D distance between p1 and p2, the length of the secant.
std-seg-length
is more general, for curved segments it returns the true arc length (as with STD-ARCLEN
) instead of just the secant.
Note
STD-SEG-ANGLE
is not the same as STD-BUL->ANG
! STD-SEG-ANGLE
returns the angle from the x-axis to p1-p2, STD-BUL->ANG
returns the inner angle between the triangle p1-mid-p2, the angle to the endpoint minus the angle to the startpoint.
Examples
;;
seg: A segment structure, returned by STD-MAKE-SEG
. Currently: (p1 p2 [bulge]), but this might be changed with the addition of splines (cubic polynoms).
They may return a point (2D or 3D) or a numeric value.
The predicate STD-SEG-STRAIGHT-P
returns T or nil.
None.
(std-require 'STDPOINT)
Defined in STDPOINT
Note: Before version 0.4001 it was in STDENT!