datavis

2015-11-30T14:06:33.000238Z

Just had to post that intermediate image before switching back to cell simulations, the bunny is just the seed mesh to be deformed. If you squint you can see tiny extrusions along the path of the swarm, but need to do some tweaking to improve the mesh-mesh collision code.

meow 2015-11-30T14:21:44.000239Z

@kephale: How are you handling meshes in brevis? Do you have a lot of Java code for that? Have you looked at how http://thi.ng geom handles meshes? Just curious how they compare. I'm having to extend the http://thi.ng mesh quite a bit to do what I want.

2015-11-30T14:24:26.000240Z

Meshes aren’t super clean, but that is getting refactored a bit with some upcoming work from the image stuff. Yes, it is heavy on Java, but what I’ve been doing for that is actually subclassing Clojure maps, so you still get all those perks. I haven’t done that for meshes yet, since the only functionality they have really needed was load, render, and collide.

2015-11-30T14:24:47.000241Z

I’ve skimmed the gmesh code a bit from http://thi.ng, but i havent taken the full serious pass yet

2015-11-30T14:26:33.000242Z

what sort of extensions have you needed?

2015-11-30T14:26:46.000243Z

at least color and x3d?

2015-11-30T14:30:29.000244Z

i cobbled together a prototype for outputting a brevis scene to http://thi.ng luxor

2015-11-30T14:30:50.000245Z

but you dont really need to use geom meshes for that

2015-11-30T14:31:58.000246Z

i guess i’m most likely to add conversions to/from http://thi.ng meshes, and maybe try to match function names where that can still be done

meow 2015-11-30T14:34:40.000248Z

I'm adding these operators that take a mesh and create a new mesh using information about vertices, edges and faces from the original mesh. And some of the operations are funky like replacing a vertex with an n-gon face. So I'm having to build additional data structures and maps so that I can do these manipulations. Like this:

(defn vertex-edges
  "Returns a vector of edges for a vertex."
  [mesh vertex]
  (let [dataset ((:vertices mesh) vertex)
        xf (map (fn [datamap] [(:next datamap) (:prev datamap)]))
        np-map (into {} xf dataset)
        start (first (sort (keys np-map)))
        verts (reduce (fn [acc _]
                        (conj acc (np-map (last acc))))
                      [start] (range (dec (count np-map))))
        edges (map (fn [e-vert] [vertex e-vert]) verts)]
    edges))

meow 2015-11-30T14:35:35.000249Z

Because the new face needs to be in the right vertex order so that the normal points outward maintaining the integrity of the mesh.

meow 2015-11-30T14:36:10.000250Z

So I'm having to really dig into the mesh code to see what kind of helper functions already exist.

meow 2015-11-30T14:36:40.000251Z

And when they don't I have to figure out how to get what I need out of how the mesh info is stored internally.

meow 2015-11-30T14:37:43.000252Z

So I'm just taking a stab at all this and at some point I'll go back and clean it all up.

meow 2015-11-30T14:38:53.000253Z

The lack of documentation, docstrings, variable names that I understand, etc. is making it a challenge.

2015-11-30T14:39:37.000254Z

heh, i can sympathize

2015-11-30T14:40:17.000255Z

just thinking through a way to maximize the ability to reuse your code in brevis, where they might not quite be pure maps

meow 2015-11-30T14:40:32.000256Z

Plus the use of protocols defined in separate namespaces and such means that a lot of times Cursive F4 (to move to the source definition) puts me on the protocol definition, not the implementation, which tells me nothing worthwhile.

2015-11-30T14:41:54.000257Z

i haven’t tried overriding specific key entries, which might be interesting

meow 2015-11-30T14:41:56.000258Z

I have a couple of meshes (foo and bar) that I keep around to inspect in the REPL, which helps a lot.

2015-11-30T14:42:37.000259Z

i.e. (:vertices mesh) ends up being equivalent to a (.getVertices mesh) call, which I believe would be sliiightly faster

meow 2015-11-30T14:43:18.000260Z

mesh is a defrecord so things like (:vertices mesh) tend to be good performance-wise

2015-11-30T14:44:06.000261Z

mmm, brevis meshes are already java classes, which is the only reason i’d do something that obscure

meow 2015-11-30T14:44:28.000262Z

a defrecord is a java class

2015-11-30T14:44:56.000263Z

mmm, i mean literally java code

meow 2015-11-30T14:45:10.000264Z

right :simple_smile:

meow 2015-11-30T14:45:41.000265Z

I'm happy sticking with clojure code

meow 2015-11-30T14:46:51.000266Z

... for all my datavis needs ... 😉

2015-11-30T14:47:37.000267Z

mmm brevis was originally pure clojure, using penumbra to get graphics, but (and if it turns out to not be true i’d be all the happier) moving all rendering to java gave a significant performance boost, which made it easier to move meshes to java

2015-11-30T14:48:41.000268Z

honestly there are some discussions about moving the rendering to native code even, with clojure on top

meow 2015-11-30T14:50:56.000270Z

what about webgl?

2015-11-30T14:51:26.000271Z

and just to add, the hope is to not force java on anyone (its an awful thing to do to a person), so using brevis only involves clojure code

meow 2015-11-30T14:51:42.000273Z

Not sure what you use for rendering now...

2015-11-30T14:51:44.000274Z

yeah, there is a student helping out who is poking around at the webgl side of things

eggsyntax 2015-11-30T14:52:41.000275Z

You're probably aware of this, but just in case: Three.js (which is what MathBox is built on) provides a pretty cool higher-level abstraction over webgl.

2015-11-30T14:52:41.000276Z

it was penumbra, then it got migrated to pure LWJGL, i’m working with some J3D/JOGL people, and will probably move it over to that in december

2015-11-30T14:53:10.000277Z

mmm the student, Tim Stiles, is working in three.js

eggsyntax 2015-11-30T14:53:16.000278Z

:thumbsup:

2015-11-30T14:53:26.000279Z

but i wouldn’t claim to be familiar at the moment : P

eggsyntax 2015-11-30T14:53:55.000280Z

I'm essentially not either, since I'm working with a further abstraction over that abstraction 😉

2015-11-30T14:54:20.000281Z

and he’s in JS land, so i’m still quite excited about your cljs version of mathbox

2015-11-30T14:55:18.000282Z

http://thi.ng is certainly providing webgl as well, which keeps me on the fence about what to do next

2015-11-30T14:55:45.000283Z

but the difference in ease between using http://thi.ng, relative to actually extending it, is prohibitive at the moment

eggsyntax 2015-11-30T14:56:01.000284Z

Making steady progress on open-sourcing cljs-mathbox, by the way. Currently struggling a bit with getting it working properly with {:optimizations :advanced} & getting the externs file right.

meow 2015-11-30T14:56:22.000285Z

This seems to have stalled but for a while Kovas was working on Gamma https://github.com/kovasb/gamma

eggsyntax 2015-11-30T14:56:34.000287Z

I'm on vacation, so I'm only putting in about half-time on it, but I'm getting there 😉

👍 1
2015-11-30T14:57:26.000288Z

oh yeah, gamma looks super cool too

meow 2015-11-30T14:57:29.000289Z

I have done nothing with webgl and http://thi.ng so not sure what that is like.

meow 2015-11-30T14:58:26.000290Z

Mathbox looks so cool and if we could do that kind of stuff in clojure that would be awesome.

2015-11-30T14:58:46.000291Z

and fwiw, a lot of my image work stays really close to java, so i’m probably more open to tossing in java than i should be

2015-11-30T15:00:00.000292Z

yeah, my first plan for @eggsyntax and @georgek ’s mathbox cljs interface is to try hooking it up to a brevis world running on a cluster for visualizing ecological dynamics

meow 2015-11-30T15:00:19.000293Z

I'm totally agnostic on the rendering side of things. I just really needed a mesh construct that I could manipulate and keep valid.

2015-11-30T15:01:39.000294Z

mmm, i’ve been thinking that the smart thing to do would be to setup http://thi.ng meshes to behave like first-class physical objects in brevis

2015-11-30T15:02:23.000295Z

allowing all existing http://thi.ng mesh code to work as usual, but then you can toss it into a simulation where the mesh can be deformed by other objects, and other sorts of physical simulation

meow 2015-11-30T15:02:35.000296Z

I think Karsten has a little bit of physics code somewhere in http://thi.ng. Wonder if that would be useful.

2015-11-30T15:03:57.000297Z

perhaps

meow 2015-11-30T15:06:05.000298Z

looks like its just particle physics

2015-11-30T15:06:17.000301Z

yeah, and the example is 2d

meow 2015-11-30T15:06:42.000302Z

What kind of deformations do you want to apply to a mesh?

2015-11-30T15:06:44.000303Z

i mean brevis has physics with arbitrary meshes already

2015-11-30T15:06:59.000304Z

its just updating it for concave meshes and such

meow 2015-11-30T15:07:35.000305Z

so translating existing vertices along some vector in response to a collision, for example?

meow 2015-11-30T15:07:50.000306Z

to create a convex deformation

meow 2015-11-30T15:08:02.000307Z

oops, concave

2015-11-30T15:08:06.000308Z

yeah, thats for that swarm brush thing i’ve been playing with

2015-11-30T15:08:38.000309Z

then the other stuff that i’m currently doing in c++ involves actually simulating membrane tensions across the mesh

2015-11-30T15:08:44.000310Z

but thats a different story

2015-11-30T15:09:50.000311Z

the main thing under consideration is making http://thi.ng meshes interchangable with brevis meshes within a brevis simulation

meow 2015-11-30T15:10:24.000312Z

Yeah, that's a fairly different set of issues than my work, where I'm adding/removing vertices/faces according to various rules that come out of nowhere, rather than any laws of physics.

2015-11-30T15:11:00.000313Z

well, the actual ops on the mesh are similar though

meow 2015-11-30T15:11:14.000314Z

yes

2015-11-30T15:11:24.000315Z

its just what triggers the function calls that changes

2015-11-30T15:11:58.000316Z

gotta run, but, one thing

2015-11-30T15:12:05.000317Z

for example all the dice on shapeways

2015-11-30T15:12:16.000318Z

it would be amusing to be able to say you’ve rolled them to test whether they are biased ; P

meow 2015-11-30T15:12:24.000319Z

And a mesh is really just a minimal data structure that keeps track of vertices, edges, and faces so that their normals are valid. Then its combined with a bunch of functions defined by protocols.

2015-11-30T15:12:53.000320Z

a hangup i get into though, is that i often need metadata at the vertices

meow 2015-11-30T15:13:03.000321Z

dice bias is a discussion topic on the shapeways forum

2015-11-30T15:13:10.000322Z

oh really?

2015-11-30T15:13:11.000323Z

hah

meow 2015-11-30T15:13:32.000324Z

I'm running into needing more and more metadata as well.

2015-11-30T15:13:40.000325Z

it would be quite fun to take these meshes you’ve been making, inscribe some numbers, and test for bias

2015-11-30T15:13:59.000326Z

but must run, this is a good conversation to start the day with though!

meow 2015-11-30T15:14:55.000328Z

ttyl :simple_smile:

2015-11-30T16:17:58.000329Z

@meow: Your stuff is lookin’ Swank!

2015-11-30T16:18:56.000330Z

@kephale: Your plan sounds bad-ass! Fer it

meow 2015-11-30T18:41:33.000334Z

@georgek: tyvm! :simple_smile:

2015-11-30T19:01:58.000335Z

:simple_smile:

pleasetrythisathome 2015-11-30T20:59:57.000336Z

hey @georgek @eggsyntax. just coming back online after holidays and thought i'd say hi!

pleasetrythisathome 2015-11-30T21:00:06.000337Z

glad to see #C0F0V8DT5 is going strong

eggsyntax 2015-11-30T21:27:41.000338Z

@pleasetrythisathome: welcome! Yeah, things are off to a flying start :simple_smile:

pleasetrythisathome 2015-11-30T21:43:00.000339Z

love the http://thi.ng stuff above

pleasetrythisathome 2015-11-30T21:43:17.000340Z

I spent a lot of time with toxic.libs when I was using processing a lot years back

pleasetrythisathome 2015-11-30T21:43:28.000341Z

have always been a big fan of Karsten's work

meow 2015-11-30T23:42:16.000342Z

@pleasetrythisathome: Thanks! I'm having a lot of fun with it.

meow 2015-11-30T23:43:03.000343Z

Here's a low poly thing with lots of color blending to make it more interesting https://pbs.twimg.com/media/CVCECZBUkAEq227.png:large

meow 2015-11-30T23:44:38.000345Z

I'm still grinding out some basic mesh operators so that I have a basic grammar that I can combine in novel ways.

meow 2015-11-30T23:46:45.000346Z

For every function I write I have a ton more that I've thought of. And for every mesh I post I've created dozens and dozens of variations on my machine that I decided weren't good enough.