[standard-fish] Reverse engineered quilt design

80 vues
Accéder directement au premier message non lu

Daniel Prager

non lue,
30 juil. 2019, 19:04:4030/07/2019
à Racket Users
Here's a photo of the original quilt from Red Pepper Quilts (not my work):



More images, including details, here:  http://bastings54.rssing.com/browser.php?indx=6115008&item=60

And here's my reverse-engineered Racket version:

super-duper-HST-and-QST-quilt.png

Top-level code, below.


#lang racket

(require threading
         "quilt.rkt")

;; EXAMPLES
;;

;; Build a super-duper quilt from rectangles, hsts, squares, and a
;; few qsts

(define qst_ (qst 1 'black 'white))
(define qst__ (qst 1 'black 'black 'black 'white))
(define hst_ (hst 1 'black 'white 'forward))

(define (around-the-world . ss)
  ; error on (< (length ss) 3)
  (define ts (map (λ (s)
                    (if (symbol? s)
                        (square 1 s)
                        s))
                  ss))
 
(let around ([n(- (* 2 (length ss)) 3)])
  (define half (/ (- n 1) 2))
  (if (= n 3)
      (apply surround (take ts 3))
      (let* ([ps (take (drop ts half) (min (+ half 1)
                                           (- (length ts) half)))]
             [center (first ps)]
             [corner (last ps)]
             [ts (rest (reverse (rest ps)))]
             [side (apply beside
                          (append (make-list (- half (length ts) 1)
                                             corner)
                                  ts))])
        (surround (around (- n 2))
                  (reflect side center)
                  corner)))))

(define (diamond center [surround 'white])
  (4-square (hst 1 surround center 'forward) R))

(define hst-strip
  (~> (reflect (beside/n 4 hst_) qst__)
      (B (H hst_))
      reflect))
   
(define b1 (around-the-world 'black
                             qst_
                             'cerise
                             'lupine
                             'caribbean
                             hst_))

(define b2 (around-the-world 'black
                             qst_
                             'amber
                             'cactus
                             'maize
                             hst_))

(define diamond-strip
  (beside/n 11 (diamond 'black) (diamond 'caribbean)))

(define geese
  (beside/n 9 (A (V hst_) hst_)))

(define quilt
  (~> (grid [b1 (R geese) b2]
            [geese (diamond 'maize 'cactus) (H geese)]
            [b2 (L geese) b1])
      (surround hst-strip hst_)
      (surround diamond-strip (diamond 'caribbean))
      (add-strips 'cactus)
      (add-strips 'caribbean)
      (add-strips 'black)))


(parameterize ([units 20]
               [show-outline #t])
  (draw quilt))

Stephen De Gabrielle

non lue,
31 juil. 2019, 04:28:5231/07/2019
à Daniel Prager,Racket Users
Wow. 

--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/CAFKxZVUFCee6LXoejHcrToKnDzOi4AUPLjCk%3DFX%3DF-MLkqLHCA%40mail.gmail.com.
--
----

Daniel Prager

non lue,
31 juil. 2019, 09:16:0731/07/2019
à Stephen De Gabrielle,Racket Users
On Wed, Jul 31, 2019 at 6:28 PM Stephen De Gabrielle <spdega...@gmail.com> wrote:
Wow. 

Thanks Stephen, and good on you for this fun competition!

It's been almost 5 years since RacketCon 2014, where I talked about youpatch.com, still up and running, BTW.

https://www.youtube.com/watch?v=8psnTEjYIEA

I've done some other experiments subsequently, and may one day develop a #lang quilt, but have been diverted by other stuff lately.

Dan

Stephen De Gabrielle

non lue,
31 juil. 2019, 10:39:2231/07/2019
à Daniel Prager,Racket Users
Hi Daniel

On Wed, 31 Jul 2019 at 14:16, Daniel Prager <daniel....@gmail.com> wrote:
On Wed, Jul 31, 2019 at 6:28 PM Stephen De Gabrielle <spdega...@gmail.com> wrote:
Wow. 

Thanks Stephen, and good on you for this fun competition!
:)


It's been almost 5 years since RacketCon 2014, where I talked about youpatch.com, still up and running, BTW.
TBH. I’d like to hear more about it.

https://www.youtube.com/watch?v=8psnTEjYIEA

I've done some other experiments subsequently, and may one day develop a #lang quilt, but have been diverted by other stuff lately.

That sounds like an idea for another competition. I wonder how people feel about hats?



Dan
--
----

Daniel Prager

non lue,
1 août 2019, 05:03:1901/08/2019
à Stephen De Gabrielle,Racket Users
Hi Stephen

What specifically would you like to hear more about?


Cheers

Dan

Stephen De Gabrielle

non lue,
1 août 2019, 06:31:3401/08/2019
à Racket Users
How your use of racket has evolved over the past 5 years
* how you handled the changes to racket in that time 
* what was good (and bad) about using Racket

in general what has changed since that presentation?

Stephen



On Thursday, August 1, 2019 at 10:03:19 AM UTC+1, Daniel Prager wrote:
Hi Stephen

What specifically would you like to hear more about?


Cheers

Dan

On Thu., 1 Aug. 2019, 00:39 Stephen De Gabrielle, <spdega...@gmail.com> wrote:
Hi Daniel

John Clements

non lue,
1 août 2019, 07:53:3401/08/2019
à Daniel Prager,Racket Users
That’s a really nice example of the uses of abstraction in non-programming domains. Thanks!

John

> On Jul 30, 2019, at 19:04, Daniel Prager <daniel....@gmail.com> wrote:
>
> Here's a photo of the original quilt from Red Pepper Quilts (not my work):
>
>
>
> More images, including details, here: http://bastings54.rssing.com/browser.php?indx=6115008&item=60
>
> And here's my reverse-engineered Racket version:
>

Daniel Prager

non lue,
1 août 2019, 08:13:2901/08/2019
à John Clements,Racket Users,Mirela Djordjevic-Stojkovic
On Thu, Aug 1, 2019 at 9:53 PM John Clements <clem...@brinckerhoff.org> wrote:
That’s a really nice example of the uses of abstraction in non-programming domains. Thanks!

Thanks, John!

I think there's real potential for a #lang quilt as a(nother) creative way to teach aspects of programming while exploring a subset of computational art.

Mirela and I made some progress in this direction, from which this example emerged, but there's a fair bit more to be done.

Dan

Daniel Prager

non lue,
1 août 2019, 08:22:5501/08/2019
à Stephen De Gabrielle,Racket Users
Hi Stephen

On Thu, Aug 1, 2019 at 8:31 PM Stephen De Gabrielle <spdega...@gmail.com> wrote:
How your use of racket has evolved over the past 5 years
* how you handled the changes to racket in that time 
* what was good (and bad) about using Racket

in general what has changed since that presentation?

Not a lot to report.

Incremental improvements — go play with the site — didn't make youpatch.com hugely successful, and we didn't pivot in a big way, but the site's still there and gets used. Occasionally there's a flurry of quilt designs created as new quilters find the site and tell their friends.

I experimented with making more traditional quilts using random-ness and symmetry, but haven't released that software commercially.

I found Racket terrific for the reasons mentioned in the talk, but because I didn't take anything else commercial — I've mainly been doing non-tech work of late — so I haven't really upped my Racket game, although I continue to tinker and learn as time permits.

The changes to Racket occasionally broke something on the site, but those changes were easily fixed.

Dan

 

Stephen De Gabrielle

non lue,
1 août 2019, 11:48:0401/08/2019
à Racket Users
Thanks Daniel. the ideal of a #lang quilt sounds good.

S.
Répondre à tous
Répondre à l'auteur
Transférer
0 nouveau message