[plt-scheme] Question about drawing to a dc<%> and intersection of shapes

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Mon Jan 26 07:32:34 EST 2009

At Mon, 26 Jan 2009 06:25:27 -0600, Robby Findler wrote:
> On Sun, Jan 25, 2009 at 11:26 PM, Grant Rettke <grettke at acm.org> wrote:
> > Is there an existing function to detect intersection of shapes?
> 
> [...] You can
> create a region% object that is the intersection, then draw with that
> region and then see if any pixels get plotted.

You don't have to draw. The `region%' class provides an `is-empty?'
method, so you can directly detect whether there's any overlap after
intersecting two regions.


Matthew




Posted on the users mailing list.