Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/5/84; site ism780c.UUCP Path: utzoo!watmath!clyde!cbosgd!ukma!psuvm.bitnet!psuvax1!burdvax!sdcrdcf!ism780c!tim From: tim@ism780c.UUCP (Tim Smith) Newsgroups: net.micro.mac Subject: Re: bug in FillPoly? Message-ID: <417@ism780c.UUCP> Date: Mon, 3-Feb-86 17:02:47 EST Article-I.D.: ism780c.417 Posted: Mon Feb 3 17:02:47 1986 Date-Received: Wed, 5-Feb-86 02:28:55 EST References: <664@harvard.UUCP> Reply-To: tim@ism780c.UUCP (Tim Smith) Organization: Interactive Systems Corp., Santa Monica, CA Lines: 52 In article <664@harvard.UUCP> matthews@harvard.UUCP (Jim Matthews) writes: > > We have found what seems to be a quickdraw bug. The code that >triggers it is as follows (in C): > > PolyHandle ph; > > ph = OpenPoly(); > MoveTo(2134,638); > LineTo(-5000,-4954); > LineTo(5000,2051); > LineTo(1646,882); > ClosePoly(); > FillPoly(ph,white); > > [ describes violent system crash ] I experimented with triangles this weekend. The triangle with vertices at ( 50, 50 ), ( 150*n + 50, 150*n + 50 ), ( 150*n + 50, 50 ) crashed with an out-of-memory bomb when n was 100, but was ok at n=10. There is no explanation for this in the pre-final editions of IM. However, the final edition of IM says the following, on page I-191: Graphic Operations on Polygons ------------------------------ Four of the operations described here - PaintPoly, ErasePoly, InvertPoly, and FillPoly - temporarily convert the polygon into a region to perform their operations. The amount of memory required for this temporary region may be far greater than the amount required by the polygon alone. You can estimate the size of this region by scaling down the polygon with MapPoly, converting it into a region, checking the region's size with the Memory Manager function GetHandleSize, and multiplying that value by the factor by which you scaled down the polygon. Warning: If any horizontal or vertical line drawn through the polygon would intersect the polygon's outlie more than 50 times, the results of these operations are undefined The violent crash you are getting sounds like a bug, but there may not be enough memory to do what you want, even if you get around that bug. You might have to split your large polygon into several smaller polygons and fill them one by one. Does anyone know what property of the polygon determines the size of the region made from it? Is it area? -- Tim Smith sdcrdcf!ism780c!tim || ima!ism780!tim || ihnp4!cithep!tim