You can use a path with an even-odd-fill to cut out parts. An example:
#lang racket (require metapict metapict/polygons) (define (cutout p x y r) (defv (w h) (pict-size p)) (with-window (window 0 w 0 h) (brushstipple (pict->bitmap p) (eofill (rectangle (pt 0 0) (pt w h)) (circle x y r))))) (set-curve-pict-size 400 400) (def p (brushcolor "red" (fill (regular-polygon 5)))) (cutout p 200 200 50) /Jens Axel The result (the yellowish color is the background color in my editor): [image: image.png] Den man. 9. sep. 2019 kl. 20.20 skrev Hendrik Boom <hend...@topoi.pooq.com>: > I'm wondering how to cut a transparent hole in something. > > Say I have a rectangle and I want to make part of it transparent so > that I cn see what's behind it. > Drawing a transparent rectangle on top of it won't workm because it'll > just reveal the original rectangle. > The only way I cn see it to draw the original rectangle in pieces, > careful avoiding the area I want to make transparent. (that may be > tricky if the transparent area is, say, a circle). > > Is there some convenient operation in Pict that can accomplish this > more directly? Kind of the union and intersection and complementation > on constructive solid geometry, but now 2D. > > My guess is no. I haven't found it. So I ask. > > Maybe I'll need some other drawing tool than Pict. Suggestions welcome. > > -- hendrik > > -- > You received this message because you are subscribed to the Google Groups > "Racket Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to racket-users+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/racket-users/20190909182018.74o322qfwehrmqaz%40topoi.pooq.com > . > -- -- Jens Axel Søgaard -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/CABefVgy0cxZD1dJv6dA51_rTEFqk3wu-zBSpGdQV-eD1fmurag%40mail.gmail.com.