Re: [racket-users] How to fill a shape with a texture using 2htdp/image or similar?
Maybe there are other useful pict/brush modifiers of interest? https://github.com/soegaard/metapict/blob/master/metapict/pict.rkt#L149 /Jens Axel 2015-05-21 18:41 GMT+02:00 Robby Findler ro...@eecs.northwestern.edu: Oh, nice! We should add brushstipple to pict itself. Robby On Thu, May 21, 2015 at 11:28 AM, Jens Axel Søgaard jensa...@soegaard.net wrote: Here is an example from MetaPict: http://soegaard.github.io/docs/metapict/metapict.html#%28def._%28%28lib._metapict%2Fpict..rkt%29._brushstipple%29%29 The same effect can be achieved by setting the brush to a stipple and then filling a path. /Jens Axel 2015-05-20 17:03 GMT+02:00 Robby Findler ro...@eecs.northwestern.edu: 2htdp/image doesn't support that now, but the color argument of various functions there could be generalized to support a new brush struct (in the way that pen structs work for outline images) that had a bitmap field to do what you want. The internal helper function mode-color-brush would have to change to support that, which would be pretty straightforward I expect (it creates a brush% object). And then there's the work of updating the documentation and adding new examples and test cases. The relevant files are mrlib/image-core and various files in the 2htdp collection. Patches welcome. :) Robby On Tue, May 19, 2015 at 6:36 PM, Daniel Prager daniel.a.pra...@gmail.com wrote: 2htdp/image makes it easy to draw all sorts of solid shapes (triangles, squares, stars, etc.) and fill them with a solid color. But say I want to fill with a texture (say from a bitmap loaded from a file). I could brute-force it by creating a separate stencil image, converting both to pixels and converting back, but that seems laborious, or presumably switch to GL. Any other ideas? Thanks Dan -- 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. For more options, visit https://groups.google.com/d/optout. -- 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. For more options, visit https://groups.google.com/d/optout. -- -- 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. For more options, visit https://groups.google.com/d/optout. -- -- 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. For more options, visit https://groups.google.com/d/optout.
Re: [racket-users] How to fill a shape with a texture using 2htdp/image or similar?
Yes, indeed. All those functions right there feel like they belong in the generic pict library, not in the meta-pict layer on top. Robby On Thu, May 21, 2015 at 11:53 AM, Jens Axel Søgaard jensa...@soegaard.net wrote: Maybe there are other useful pict/brush modifiers of interest? https://github.com/soegaard/metapict/blob/master/metapict/pict.rkt#L149 /Jens Axel 2015-05-21 18:41 GMT+02:00 Robby Findler ro...@eecs.northwestern.edu: Oh, nice! We should add brushstipple to pict itself. Robby On Thu, May 21, 2015 at 11:28 AM, Jens Axel Søgaard jensa...@soegaard.net wrote: Here is an example from MetaPict: http://soegaard.github.io/docs/metapict/metapict.html#%28def._%28%28lib._metapict%2Fpict..rkt%29._brushstipple%29%29 The same effect can be achieved by setting the brush to a stipple and then filling a path. /Jens Axel 2015-05-20 17:03 GMT+02:00 Robby Findler ro...@eecs.northwestern.edu: 2htdp/image doesn't support that now, but the color argument of various functions there could be generalized to support a new brush struct (in the way that pen structs work for outline images) that had a bitmap field to do what you want. The internal helper function mode-color-brush would have to change to support that, which would be pretty straightforward I expect (it creates a brush% object). And then there's the work of updating the documentation and adding new examples and test cases. The relevant files are mrlib/image-core and various files in the 2htdp collection. Patches welcome. :) Robby On Tue, May 19, 2015 at 6:36 PM, Daniel Prager daniel.a.pra...@gmail.com wrote: 2htdp/image makes it easy to draw all sorts of solid shapes (triangles, squares, stars, etc.) and fill them with a solid color. But say I want to fill with a texture (say from a bitmap loaded from a file). I could brute-force it by creating a separate stencil image, converting both to pixels and converting back, but that seems laborious, or presumably switch to GL. Any other ideas? Thanks Dan -- 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. For more options, visit https://groups.google.com/d/optout. -- 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. For more options, visit https://groups.google.com/d/optout. -- -- 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. For more options, visit https://groups.google.com/d/optout. -- -- 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. For more options, visit https://groups.google.com/d/optout.
Re: [racket-users] How to fill a shape with a texture using 2htdp/image or similar?
Thanks Jens That looks great. I'll give MetaPict whirl! Dan On Fri, May 22, 2015 at 2:28 AM, Jens Axel Søgaard jensa...@soegaard.net wrote: Here is an example from MetaPict: http://soegaard.github.io/docs/metapict/metapict.html#%28def._%28%28lib._metapict%2Fpict..rkt%29._brushstipple%29%29 The same effect can be achieved by setting the brush to a stipple and then filling a path. /Jens Axel 2015-05-20 17:03 GMT+02:00 Robby Findler ro...@eecs.northwestern.edu: 2htdp/image doesn't support that now, but the color argument of various functions there could be generalized to support a new brush struct (in the way that pen structs work for outline images) that had a bitmap field to do what you want. The internal helper function mode-color-brush would have to change to support that, which would be pretty straightforward I expect (it creates a brush% object). And then there's the work of updating the documentation and adding new examples and test cases. The relevant files are mrlib/image-core and various files in the 2htdp collection. Patches welcome. :) Robby On Tue, May 19, 2015 at 6:36 PM, Daniel Prager daniel.a.pra...@gmail.com wrote: 2htdp/image makes it easy to draw all sorts of solid shapes (triangles, squares, stars, etc.) and fill them with a solid color. But say I want to fill with a texture (say from a bitmap loaded from a file). I could brute-force it by creating a separate stencil image, converting both to pixels and converting back, but that seems laborious, or presumably switch to GL. Any other ideas? Thanks Dan -- 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. For more options, visit https://groups.google.com/d/optout. -- 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. For more options, visit https://groups.google.com/d/optout. -- -- Jens Axel Søgaard -- *Daniel Prager* Agile/Lean Coaching, Software Development and Leadership Startup: www.youpatch.com Twitter: @agilejitsu https://twitter.com/agilejitsu Blog: agile-jitsu.blogspot.com Linkedin: au.linkedin.com/in/danielaprager -- 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. For more options, visit https://groups.google.com/d/optout.
Re: [racket-users] How to fill a shape with a texture using 2htdp/image or similar?
Oh, nice! We should add brushstipple to pict itself. Robby On Thu, May 21, 2015 at 11:28 AM, Jens Axel Søgaard jensa...@soegaard.net wrote: Here is an example from MetaPict: http://soegaard.github.io/docs/metapict/metapict.html#%28def._%28%28lib._metapict%2Fpict..rkt%29._brushstipple%29%29 The same effect can be achieved by setting the brush to a stipple and then filling a path. /Jens Axel 2015-05-20 17:03 GMT+02:00 Robby Findler ro...@eecs.northwestern.edu: 2htdp/image doesn't support that now, but the color argument of various functions there could be generalized to support a new brush struct (in the way that pen structs work for outline images) that had a bitmap field to do what you want. The internal helper function mode-color-brush would have to change to support that, which would be pretty straightforward I expect (it creates a brush% object). And then there's the work of updating the documentation and adding new examples and test cases. The relevant files are mrlib/image-core and various files in the 2htdp collection. Patches welcome. :) Robby On Tue, May 19, 2015 at 6:36 PM, Daniel Prager daniel.a.pra...@gmail.com wrote: 2htdp/image makes it easy to draw all sorts of solid shapes (triangles, squares, stars, etc.) and fill them with a solid color. But say I want to fill with a texture (say from a bitmap loaded from a file). I could brute-force it by creating a separate stencil image, converting both to pixels and converting back, but that seems laborious, or presumably switch to GL. Any other ideas? Thanks Dan -- 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. For more options, visit https://groups.google.com/d/optout. -- 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. For more options, visit https://groups.google.com/d/optout. -- -- 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. For more options, visit https://groups.google.com/d/optout.
[racket-users] How to fill a shape with a texture using 2htdp/image or similar?
2htdp/image makes it easy to draw all sorts of solid shapes (triangles, squares, stars, etc.) and fill them with a solid color. But say I want to fill with a texture (say from a bitmap loaded from a file). I could brute-force it by creating a separate stencil image, converting both to pixels and converting back, but that seems laborious, or presumably switch to GL. Any other ideas? Thanks Dan -- 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. For more options, visit https://groups.google.com/d/optout.
Re: [racket-users] How to fill a shape with a texture using 2htdp/image or similar?
2htdp/image doesn't support that now, but the color argument of various functions there could be generalized to support a new brush struct (in the way that pen structs work for outline images) that had a bitmap field to do what you want. The internal helper function mode-color-brush would have to change to support that, which would be pretty straightforward I expect (it creates a brush% object). And then there's the work of updating the documentation and adding new examples and test cases. The relevant files are mrlib/image-core and various files in the 2htdp collection. Patches welcome. :) Robby On Tue, May 19, 2015 at 6:36 PM, Daniel Prager daniel.a.pra...@gmail.com wrote: 2htdp/image makes it easy to draw all sorts of solid shapes (triangles, squares, stars, etc.) and fill them with a solid color. But say I want to fill with a texture (say from a bitmap loaded from a file). I could brute-force it by creating a separate stencil image, converting both to pixels and converting back, but that seems laborious, or presumably switch to GL. Any other ideas? Thanks Dan -- 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. For more options, visit https://groups.google.com/d/optout. -- 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. For more options, visit https://groups.google.com/d/optout.