LarryO Posted June 14, 2022 Share Posted June 14, 2022 Why do neither of these Poly(); not create an equilateral triangle with 15mm sides? first point is cartesian, second and third are intended to be polar. d1:=15.000000mm; ClosePoly; Poly(0,0, d1,#0.000000d, d1,#150.000000d); ClosePoly; Poly(0,0, #0.000000d,d1, #150.000000d,d1); Quote Link to comment
Pat Stanford Posted June 14, 2022 Share Posted June 14, 2022 You need a Relative; before your code. ClosePoly; sets the mode to close polygons, it does not close the polygon just drawn. It is a toggle. Your angels for equilateral should be 120° instead of 150. Try this: Procedure Test; VAR d1 :Real; Begin Relative; ClosePoly; d1:=15.000000mm; {ClosePoly;} Moveto(0,0); Poly(d1, #0.000000d, d1, #120.000000d); { Poly(0,0, #0.000000d, d1, #150.000000d, d1); } End; Run(Test); Quote Link to comment
LarryO Posted June 14, 2022 Author Share Posted June 14, 2022 omg! Thanks. As soon as you mentioned Relative; I recalled that I had done this once before a few years ago. I think that I am missing the obvious path to finding out these basics. I am always expecting the function and procedure reference to give me that insight into those basic aspects of the compiler but never find them. The old help used to have compiler basics in it but I'm not sure where it has migrated to these days. I was fumbling around trying to close the result of RegularPolygon and was getting to the point of wanting a workaround by using polar vectors in the Poly procedure. In the end I was able to figure out how to close the result of RegularPolygon and eliminate the extra point at the start vertex. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.