(DEFINE-FILE-INFO PACKAGE "INTERLISP" READTABLE "INTERLISP" BASE 10) (FILECREATED "14-May-2023 15:49:02" ("compiled on " {DSK}larry>il>medley>sources>XXGEOM.;5) "11-May-2023 22:09:12" brecompiled ALL in "FULL 11-May-2023 ..." dated "11-May-2023 22:09:16") (FILECREATED "14-May-2023 15:47:43" {DSK}larry>il>medley>sources>XXGEOM.;5 48712 :EDIT-BY "lmm" :CHANGES-TO (MACROS GETLINEORIG) :PREVIOUS-DATE "13-Jun-2021 14:39:29" {DSK}larry>il>medley>sources>XXGEOM.;4) \IRND :D8 (I 1 D I 0 N) !jdA@bjAbj@@Aك@AANIL NIL () MAKEXYPT :D8 (L (1 IY 0 IX)) @ANIL NIL () IRNDLIST :D8 (P 2 I P 1 Y P 0 X I 0 PATH) C00@6dZJH3 HojظI3 IojعHILKh]K&MNIL NIL ( 40 0.5 26 0.5) NORMLOOP :D8 (P 6 ANTISGN P 5 PREVSGN P 4 Y2 P 3 Y1 P 2 LAST P 1 HEAD P 0 LOOP I 0 LIST) p@ Xd ZdHH[H\HJKLLKjkHLHjLKmj]djHHhIL[H\KLjkjKLmjdM#HLHKLjkjKLmjHYHhI(15 LAST 8 COPY) NIL () SLITLOOP :D8 (P 7 CURR P 6 LAST P 5 CURR P 4 PREV P 3 PREVSGN P 2 CURRSGN P 1 CURRLIST P 0 SECTLIST I 0 KLST) p@ bd ^@Nh bd\@bd]dLjkjMLmj[LhYdhX@KdOLjkjOLmjZdjKZKOI OL hYHJ[O\H (155 REVERSE 131 COPY 121 ATTACH 27 \NCONC2 17 COPY 8 COPY) NIL () PREPLOOP :D8 (P 4 I P 3 TLIST P 2 LLIST P 1 ILIST P 0 NLIST I 0 PathOrPathList) 3P@d3$hbd\ X [I I(42 \NCONC2 35 SLITLOOP 29 NORMLOOP 24 IRNDLIST) NIL () YMAPLIST :D8 (P 9 I P 8 DY P 7 DX P 6 Y0 P 5 X0 P 4 NEXTPT P 3 CURRPT P 2 Y P 1 X P 0 YMAP I 1 PATH2 I 0 PATH1) r AZ@J@@V@bd OAJAAbA0AAKKLM_LN_MNOOJ YJHH (111 REVERSE 94 MIDDX) NIL () IMAPLIST :D8 (P 18 V1 P 17 U1 P 16 Y1 P 15 X1 P 14 DV P 13 DU P 12 V0 P 11 U0 P 10 DY P 9 DX P 8 Y0 P 7 X0 P 6 NEXT2 P 5 CURR2 P 4 NEXT1 P 3 CURR1 P 2 PT P 1 IMAP P 0 ADVANCE I 1 PATH2 I 0 PATH1) @@[A]@\A^L_ N_$dO -lM_"M_$K_K_L_O_O O_*kK_K_ M_M_N_"O_O$O_@AHk+O_O _@\_L_ OO_O O_)O"_O$_A^_"N_$O"O_O$O_OOOOOOOO ZO$O AblxI@bkiI (276 REVERSE 235 XYSECTLSEG) NIL () UNIQLIST :D8 (P 2 NEWLIST P 1 V P 0 Y I 0 LIST) )@@X@hZ@d[HIIKJJ (38 REVERSE) NIL () MERGLIST :D8 (P 4 Y2 P 3 Y1 P 2 CURR2 P 1 CURR1 P 0 IMAP I 1 PATH2 I 0 PATH1) vP@AA@@YAZI[J\@ATLK7JHKLIH@b `[Y[Ab `ZIH@b `YH (115 REVERSE) (100 MAX.INTEGER 76 MAX.INTEGER 56 MAX.INTEGER) () MMLTLIST :D8 (P 5 PT P 4 V P 3 U P 2 Y P 1 X P 0 NLIST I 6 M23 I 5 M22 I 4 M21 I 3 M13 I 2 M12 I 1 M11 I 0 KLIST) @ `0@2d]MIAJBCԻIDJEFԼKLONh_N&_ONIL NIL () IMLTLIST :D8 (P 5 PT P 4 V P 3 U P 2 Y P 1 X P 0 NLIST I 6 M23 I 5 M22 I 4 M21 I 3 M13 I 2 M12 I 1 M11 I 0 KLIST) D `0@6d]MIAJBCԻIDJEFԼKjLjONh_N&_ONIL NIL () XYPT.LESSP :D8 (L (1 PT2 0 PT1))  @XAYHIHIh@AhNIL NIL () PATH.LESSP :D8 (P 7 U2 P 6 U1 P 5 X2 P 4 X1 P 3 Y2 P 2 Y1 P 1 PT2 P 0 PT1 I 1 PATH2 I 0 PATH1) `@iAh@XAYHZI[JKJKhH\I]LM@Abb@ A@XAYH^I_LNMOhLMhNIL NIL () CONVEXP :D8 (P 21 TANGDY P 20 TANGDX P 19 TANGY0 P 18 TANGX0 P 17 CURRDY P 16 CURRDX P 15 CURRY0 P 14 CURRX0 P 13 ORIGDY P 12 ORIGDX P 11 ORIGY0 P 10 ORIGX0 P 9 LASTY P 8 LASTX P 7 Y P 6 X P 5 PT P 4 OSGN P 3 CSGN P 2 TSGN P 1 NEGSGN P 0 RESULT I 0 PATH) Mp@ li@]d_M_@]d_$M_&O$O_O&O_@]d_M_OO$_(OO&_*O_O_OO_ OO_"jOOOOOO YdjkjImjY@biX@H]M_O$O&O(O*NO OOO O"NO OOOONO JjkjJmjKjkjKmjLjkjLmjJIKILIh@bO_$O_&NO_(OO_*NO_ OO_"N_O_K(214 XPROD 196 XPROD 178 XPROD 122 XPROD 11 LENGTH) NIL () MAKELINE :D8 (P 0 DIR I 3 DY I 2 DX I 1 Y0 I 0 X0) :jC@BbACbjBbjCbmk@A BC Hh(50 MAKEXYPT 43 MAKEXYPT) NIL () MSECT :D8 (I 7 DXDV I 6 DU I 5 V0 I 4 U0 I 3 DUDY I 2 DX I 1 Y0 I 0 X0) C@jGDBFEACGNIL NIL () XSECT :D8 (P 3 DXDV P 2 DUDY P 1 Y P 0 X I 7 DV I 6 DU I 5 V0 I 4 U0 I 3 DY I 2 DX I 1 Y0 I 0 X0) M@FCZBG[jBBjBjCCjC@ABJDEFK A@CKEDGJ A@CBI (74 LINEY 62 MSECT 46 MSECT) NIL () YSECT :D8 (P 3 DXDV P 2 DUDY P 1 Y P 0 X I 7 DV I 6 DU I 5 V0 I 4 U0 I 3 DY I 2 DX I 1 Y0 I 0 X0) N@FCZBG[jBBjBjCCjC@ABJDEFK @ABCH A@CKEDGJ (75 MSECT 59 LINEY 47 MSECT) NIL () XYSECT :D8 (P 3 DXDV P 2 DUDY P 1 Y P 0 X I 7 DV I 6 DU I 5 V0 I 4 U0 I 3 DY I 2 DX I 1 Y0 I 0 X0) g@FCZBG[JKUjBBjBjCCjC@ABJDEFK @ABCH A@CKEDGJ A@CBI HIh(94 LINEY 82 MSECT 64 LINEY 52 MSECT) NIL () KNOTLINE :D8 (P 7 I P 6 PREVY P 5 PREVX P 4 CURRY P 3 CURRX P 2 ALINE P 1 ALIST P 0 I I 0 KNOTS) Bp@Xd]H^@bd&dOOMNKMLN ZIKL^I (63 REVERSE 44 MAKELINE) NIL () KNOTLOOP :D8 (P 7 I P 6 PREVY P 5 PREVX P 4 CURRY P 3 CURRX P 2 ALINE P 1 ALIST P 0 I I 0 KNOTS) Cp@ Xd]H^@&dOOMNKMLN ZIKL^I (64 REVERSE 45 MAKELINE 8 LAST) NIL () LINE.LESSP :D8 (L (1 ARG2 0 ARG1)) &@@XAYHIHIh@ZA[JKhNIL NIL () LINEY :D8 (I 4 X I 3 DY I 2 DX I 1 Y0 I 0 X0) !BjCjAClD@bADCB (29 \IRND) NIL () MIDDX :D8 (I 4 Y I 3 DY I 2 DX I 1 Y0 I 0 X0) ABjCj@BlDAbdjkjDmjCjkjCmj@@DBC (61 \IRND) NIL () INITX :D8 (P 0 X I 4 Y I 3 DY I 2 DX I 1 Y0 I 0 X0) DBjCj@DAbdjkjDmjCjkjCmj@klDBBlCNIL NIL () TERMX :D8 (P 1 D P 0 X I 4 Y I 3 DY I 2 DX I 1 Y0 I 0 X0) E BjCj@BDAbdjkjDmjCjkjCmj@@BlDBlCNIL NIL () SCANX :D8 (P 3 XR P 2 XL P 1 DY2 P 0 YDX2 I 4 Y I 3 DY I 2 DX I 1 Y0 I 0 X0) X@BjCj@dBDAbdjkjDmjCjkjCmjlDBXlCY@kHBIZ@HBI[JKNIL NIL () XPROD :D8 (L (5 Y 4 X 3 DY 2 DX 1 Y0 0 X0)) D@bEAb BECDNIL NIL () XYSECTLSEG :D8 (P 9 UMIN P 8 UMAX P 7 XMIN P 6 XMAX P 5 VT P 4 UT P 3 YT P 2 XT P 1 Y P 0 PT I 7 DV I 6 DU I 5 V0 I 4 U0 I 3 DY I 2 DX I 1 Y0 I 0 X0) p  @BZAC[DF\EG]jBJ_@@_JjFL_DD_L_NO4OO-@ABCDEFG XddYdAKI dEMIH(81 XYSECT) NIL () MAKEBRES :D8 (P 3 PXY P 2 PY P 1 PX P 0 SELF I 3 DY I 2 DX I 1 Y0 I 0 X0) +P`Xd@HAHBjkjBmjHCjkjCmj jBBjBٹjCCjCٺIJٻJdj:HhH@BHk HkHmIHHgHlJڼkLLk HH IHlJI>HgHlIHHJHlIJ HNIL (287 BRES 274 BRES 268 BRES 255 BRES 246 Y 241 BRES 225 BRES 212 BRES 206 BRES 185 BRES 176 X 171 BRES 154 BRES 144 BRES 134 BRES 122 BRES 112 BRES 58 BRES 35 BRES 25 BRES 15 BRES 7 |BRESTYPE#|) () TRAPLOOP :D8 (P 22 I P 18 K P 16 J P 14 I P 10 LOOP P 9 PT.LESSP P 8 TEMP P 7 XPATH P 6 KPATH P 5 JPATH P 4 IPATH P 3 LEN P 2 CLIST P 1 PLIST P 0 KNOTS I 0 PATH F 26 TRAP.DEBUG)  g_@ Y@ bdd3Xd HO X0 I6dOO O O_O Oh_O&_OYW4o I [I ZKkkOOIO KOkO O|IO LM _Kk2O$O"PJO$ O$OO$O O ON _N _*O(O*h_(_&O$k_$O*&_(O&O k_ Ok__W4o HO 0 I%dHO _O Oh_O&_O_Kk2O,O*:OO, JO,  _2O0O2h_0_.O,k_,O2&_0O.Zd (471 TRAPMAKE 429 MERGLIST 423 NTH 414 NTH 363 YMAPLIST 344 SORT 335 DV 267 MERGLIST 259 YMAPLIST 250 COPY 229 NTH 206 IMAPLIST 197 NTH 172 NTH 147 COPYALL 140 LENGTH 133 DV 88 REVERSE 77 LAST 49 \NCONC2 22 COPYALL 15 PREPLOOP) (7 XYPT.LESSP) ( 330 (CLIST) 128 (PLIST)) TRAPMAKE :D8 (P 11 ALIST P 10 CURRY P 9 TRAP P 8 PT4 P 7 PT3 P 6 PT2 P 5 PT1 P 4 LIST2 P 3 LIST1 P 2 PTR P 1 UNFINISHED P 0 TRAPLIST I 0 EDGELIST)   iYIH@g @_@h_OJJJKKL_L_MNKNK[O_L\_OOLMNOOh_NK KO_OL LO_MONO oi i o OHJ?OJg bl@ hY(253 LENGTH 242 MERGE 216 DV 205 TERPRI 198 PRIN1 159 LAST 137 LAST 19 SORT) (237 PATH.LESSP 14 PATH.LESSP) ( 211 (TRAP) 192 "NON-TRAPEZOID FOUND!") (PRETTYCOMPRINT XXGEOMCOMS) (RPAQQ XXGEOMCOMS ((* ;;; "Integer Geometry Library") (* ;;; "Scalar methods") (DECLARE%: EVAL@COMPILE DONTCOPY (MACROS \SGN)) (FNS \IRND) (* ;;; "XYpt object and methods") (RECORDS XYPT) (DECLARE%: EVAL@COMPILE DONTCOPY (MACROS XYPT.X XYPT.Y)) (DECLARE%: EVAL@COMPILE DONTCOPY (MACROS HEADPT NEXTPT HEADPTY NEXTPTY)) (FNS MAKEXYPT IRNDLIST NORMLOOP SLITLOOP PREPLOOP YMAPLIST IMAPLIST UNIQLIST MERGLIST MMLTLIST IMLTLIST XYPT.LESSP PATH.LESSP CONVEXP) (* ;;; "Line object and methods") (RECORDS XXLINE) (DECLARE%: EVAL@COMPILE DONTCOPY (MACROS GETLINEDIFF GETLINEORIG \GETLINEDIFF \GETLINEORIGY \GETLINEDIFFY)) (FNS MAKELINE MSECT XSECT YSECT XYSECT KNOTLINE KNOTLOOP LINE.LESSP) (FNS LINEY MIDDX INITX TERMX SCANX XPROD) (* ;;; "line segment methods") (FNS XYSECTLSEG) (* ;;; "Bresenham line object and methods") (RECORDS BRES) (FNS MAKEBRES) (DECLARE%: EVAL@COMPILE DONTCOPY ( MACROS BRESSTEP)) (* ;;; "Debugging control panel") (DECLARE%: EVAL@COMPILE DONTCOPY (VARS \GEOM.PANEL )) (* ;;; "Trapezoidal decomposition") (FNS TRAPLOOP TRAPMAKE) (VARS TRAP.DEBUG) (DECLARE%: EVAL@COMPILE DONTCOPY (VARS \TRAP.PANEL)))) (RECORD XYPT (X . Y)) (RECORD XXLINE (ORIG DIFF WIND)) (DATATYPE BRES (MAJOR X Y P IX IY IPX IPY)) (/DECLAREDATATYPE (QUOTE BRES) (QUOTE (POINTER POINTER POINTER POINTER POINTER POINTER POINTER POINTER )) (QUOTE ((BRES 0 POINTER) (BRES 2 POINTER) (BRES 4 POINTER) (BRES 6 POINTER) (BRES 8 POINTER) (BRES 10 POINTER) (BRES 12 POINTER) (BRES 14 POINTER))) (QUOTE 16)) (RPAQQ TRAP.DEBUG NIL) NIL