
@me1150 has joined the channel

@mccoybecker has joined the channel

@stephen has joined the channel

@markus.pfeiffer has joined the channel

@dyllongagnier has joined the channel

@guy.w has joined the channel

@kl13 has joined the channel

@prithamm has joined the channel

@slade has joined the channel

@shaobo has joined the channel

@tchajed has joined the channel

@qbradley has joined the channel

@willbanders has joined the channel

@kristianalnaes has joined the channel

@beyer.andrew has joined the channel

@jordan has joined the channel

@jacob.wachala has joined the channel

@ryanxh has joined the channel

@jacob.wachala818 has joined the channel

@keenencates has joined the channel

@ashton.wiersdorf has joined the channel

@aaronstgeorge has joined the channel

@pierce.darragh has joined the channel

@wardj1 has joined the channel

@geb_a has joined the channel

Hi

Hey guys, could yoo post the link to the workshop channel?




@bmitchell33 has joined the channel

@mitron6 has joined the channel

Is there a way, using the pict library, to do something like (with-clip-region <something orother> (lambda() (draw a pict)))
, or (intersect-clip-region <something> (lambda() (draw a pict)))
? In particular, I’m trying to clip to a polygonal (but not-rectangle) region

@blerner Like a mask?

basically, yes.

the ideal version would basically be, “Draw pict1. Draw pict2. Treat pict1 as an alpha channel, and mask off all the parts of pict2 based on pict1”

but I don’t know how to achieve that.

so I’ll settle for, “Create some voodoo that lets me draw a polygonal, binary path, and mask off all parts of pict2 that are outside that path”

So, its easy enough to do with the racket/draw lib, using pict->bitmap
to convert to it, and bitmap
to convert back.

Like this:


lemme take a look

The main method you need is draw-bitmap
: https://docs.racket-lang.org/draw/dc___.html?q=draw-bitmap#%28meth._%28%28%28lib._racket%2Fdraw..rkt%29._dc~3c~25~3e%29._draw-bitmap%29%29

It takes a mask as an argument.

lemme try it a bit

Okay

got it, thanks!

@blerner FWIW MetaPict provides `clipped, which draws the part of a pict that’s inside a closed curve.

It is used like: (clipped p c)
where p is a pict and c is a curve.

@skanaley has joined the channel