clojure-art

eggsyntax 2015-12-22T14:28:49.000137Z

@meow: @mikera: my sense is that there’s nothing wrong (or even unidiomatic) with using mutability quite freely as long as it’s confined within a limited scope, typically a single function. & see http://clojure.org/transients

meow 2015-12-22T14:31:52.000138Z

@eggsyntax: Sure, and I do use transients sometimes.

meow 2015-12-22T14:33:48.000139Z

Giving serious thought to writing a polygon mesh processing library using vectorz for the data representation.

eggsyntax 2015-12-22T14:35:18.000140Z

:thumbsup:

meow 2015-12-22T14:40:56.000141Z

This has to be the most concise implementation of Conway's Game of Life in clojure that I have seen, and I think I've seen a lot of them: https://github.com/mikera/core.matrix/blob/0cf43fe3b3a1992aec2fbe041ae0ab5ed34d02b5/src/test/clojure/clojure/core/matrix/demo/life.clj

meow 2015-12-22T14:42:55.000143Z

Would also love to extend my ergo library of l-systems and cellular automata code to use vectorz as well. Very curious to see what kind of performance improvement I could get.

stathissideris 2015-12-22T18:05:36.000144Z

@meow: that's tiny!

meow 2015-12-22T18:20:11.000145Z

I know, right!

meow 2015-12-22T18:20:54.000146Z

Of course, like all such efficient implementations it gives up a lot of flexibility.

meow 2015-12-22T18:24:52.000147Z

I have some CA code that is very flexible, but I'm sure not as fast: https://github.com/decomplect/ion/blob/master/src/ion/ergo/core.cljc

meow 2015-12-22T21:03:06.000151Z

@mikera: When you have some spare time I would love to see a few more examples of how I could use clisk functions on these polygon meshes. I made some changes to how the clisk functions get used. Now the call looks something like this: (op/colorize (partial mc/clisk-sampler clisk/vnoise))

meow 2015-12-22T21:03:59.000152Z

I tried to use some other functions like (op/colorize (partial mc/clisk-sampler clisk/agate)) and the results aren't good. I'm sure I don't understand something fundamental.

meow 2015-12-22T21:05:26.000153Z

The clisk-sampler function lives here: https://github.com/pkobrien/cad/blob/master/src/cad/mesh/color.clj#L205-L211

meow 2015-12-22T21:05:49.000155Z

(defn clisk-sampler [colorer mesh]
  (let [sampler (clisk/sampler (clisk/node colorer))
        fc (fn [_ face]
             (let [[x y z] (gu/centroid face)
                   color (sampler [x y z 0])]
               color))]
    [mesh fc]))