Points as lists, geometry code, segments, bulges:
Defined in the module STDPOINT, the file STDPOINT.LSP
.
(X-OF pt) ; x-value of (x y [z])
(Y-OF pt) ; y-value of (x y [z])
(Z-OF pt) ; z-value of (x y [z])
(XY-OF pt) ; (x y) of (x y [z])
(STD-X-MIN,STD-Y-MIN,STD-Z-MIN pts) ; lower limit 1D of point list
(STD-X-MAX,STD-Y-MAX,STD-Z-MAX pts) ; upper limit 1D of point list
(STD-XY-MIN, STD-XY-MAX pts) ; 2D boundaries of point list
(STD-XYZ-MIN, STD-XYZ-MAX pts) ; 3D boundaries of point list
(STD-PT+ p1 p2) ; vector sum
(STD-PT- p1 p2) ; vector subtraction: p1-p2
(STD-MIDPT pt1 pt2) ; mid between two pts
(STD-HALFPT pt) ; mid of a vector
(STD-NEW-Z pt num) ; changes z to num
(STD-ADD-Z pt num) ; increases z by num
(STD-RANDOM-PT) ; 3D point in [0,0,0] [1,1,1]
(STD-POINTP pt) ; 2d or 3d
(STD-2DPOINTP pt) ;
(STD-3DPOINTP pt) ;
(STD-SEG-P obj) ; is it a segment?
(STD-DISTANCE-2D p1 p2) ;
(STD-TRANS01 pt) ; transform point to UCS
(STD-TRANS10 pt) ; transform point to WCS
(STD-MAPTRANS01 pts) ; transform pointlist to UCS
(STD-MAPTRANS10 pts) ; transform pointlist to WCS
(STD-FIXANG angle) ; [radians], reduce angle to [0, 360°)
(STD-CENTROID-2D pts) ; centroid of a 2d polygon
(STD-VECTOR-MEAN-3D pts) ; 3d mean vector
(STD-VECTOR-MEAN pts) ; n-dim mean vector
(STD-CCW p0 p1 p2) ; counterclockwise?
(STD-PTONSEG-P p1 p2 testpt) ; on segment?
(STD-INSIDE-POLY-P pt pts) ; strictly inside polygon? UCS
(STD-MAKE-SEG p1 p2 bulge) ; create a segment, bulge may be nil
(STD-SEG-P1 seg) ; first point of segment
(STD-SEG-P2 seg) ; second point of segment
(STD-SEG-BULGE seg) ; bulge of segment or nil
(STD-SEG-BULGE-NUM seg) ; bulge of segment as number
(STD-SEG-ANGLE seg) ; 2D WCS angle p1-p2
(STD-SEG-LENGTH seg) ; curved length
(STD-SEG-PTS-DIST seg) ; 3D length p1-p2
(STD-SEG-STRAIGHT-P seg) ; bulge = nil?
(STD-SEG-P1-UC seg) ; p1 in current UCS
(STD-SEG-P2-UC seg) ; p2 in current UCS
(STD-SEG-ANGLE-UC seg) ; UCS 2D angle p1-p2
(STD-SEG->CIR seg) ; => cir: (midpt radius)
(STD-ARC->SEG cir ang1 ang2) ; => seg: (p1 p2 bulge)
(STD-ARC->BUL p1 p2 cir ccw) ; => bulge as number
(STD-BUL->ANG seg) ; => inner angle from p1 to p2
(STD-ARC->ANG chord rad) ; => absolute inner arc angle
(STD-ARCLEN seg) ; => signed arc length in current UCS
(STD-PTS->SEGS pts) ; pointlist to straight segments
(STD-SEGS->PTS segs) ; segments to pointlist
(STD-POLYEDGE i poly len) ; i-th edge of polygon => segment
(STD-SEGS-CLOSED-P segs) ; closed polygon?
Segments, Bulges:
Segments are a useful abstraction of polyline edges, containing the two subsequent points and optionally the bulge (p1 p2 [bulge]). A circle is a list of the center point and the radius.
All the segment functions deal with WCS values besides the three extra functions ending with -UC. So it is completely UCS independent.
Acad Dependency
Note that certain functions are Acad dependent! Those which create abstract data from acad entities, such as STD-PLINE-SEGS
, STD-GETPTS
and the four TRANS
functions.
We rather have special or advanced geometry, intersections, circles, splines or more pline-code in seperate modules.