This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # aatree (257)
- # admin-announcements (13)
- # beginners (3)
- # boot (327)
- # cider (2)
- # cljs-dev (1)
- # clojure (127)
- # clojure-art (72)
- # clojure-russia (273)
- # clojure-sg (1)
- # clojurescript (39)
- # cursive (8)
- # datomic (6)
- # editors (2)
- # emacs (4)
- # hoplon (261)
- # immutant (2)
- # ldnclj (15)
- # liberator (10)
- # luminus (1)
- # off-topic (8)
- # om (9)
- # parinfer (1)
- # re-frame (11)
- # reagent (2)
- # yada (9)
@mikera: Would love to chat about this with you. Also interested in how to improve mesh performance. You've worked a lot on matrices and such. I want to really push the limits on mesh subdivision modeling and could really use your expertise.
The reason that core.matrix+vectorz-clj is 10-20x faster than core.matrix+clojure vectors is by using unboxed primitives with Java arrays rather than the much more heavyweight approach of boxed numbers in persistent vectors
Upshot is: you'll probably need to look at alternative representations if you really want max performance
Right. And I'd rather not reinvent the wheel there as I don't really have the experience or expertise to do so.
Am curious to know if something similar could be constructed using core.matrix+vectorz-clj?
@mikera: I'm adding clisk to my cad code so I can play with it more based on your example. Thank you for making it so easy.
I guess what I'm really asking is can you recommend an alternative representation for polygon meshes that would support the type of manipulations I'm doing?
Well - I'd probably take a look at using something like a dense Nx3 matrix to represent a large set of points. Would be backed by a single Java array, so very fast for memory access, cache line efficiency etc.
If you want to translate / transform points in bulk that is probably going to be the most efficient representation
Yeah, the catmull-clark smoothing function is a good example as it creates new vertices/faces/edges and "moves" previous ones.
I also want to do more generative creation of meshes way beyond the simple stuff that I've been doing with platonic solids as seeds.
I want to make use of the L-system and cellular automata code I worked on prior to this.
Yes, I like the idea that they can be 3d printed in real life - so the mesh needs to be watertight, etc.
If you look at the gmesh in http://thi.ng it uses a "winged edge data structure" like the Wings3D modeling software. But that's just an overly fancy way of saying that it has some indexes to keep track of its data. There are faces, vertices and edges and everything else is an index.
I just used
(op/colorize-clisk clisk/vnoise) on the latest shape I was playing around with. Cool. Got a new toy to play with. Thanks!
The only issue I see it that you will need to subdivide a lot if you want the finer details of the textures to show, since we are still only doing per-face colouring
I plan to add per-vertex coloring at some point. Won't be hard to do - just have so many things on my todo list.
So I'm still playing around with lowpoly and per-face coloring as interesting limitations.
@mikera: What is your interest in all of this? Where are you trying to go with your work? And are you interested in any collaboration?
It's more of a fun sideline for me (my main work is around data science / machine learning). happy to collaborate though where I have time.
I also have an interest in game programming, so I'm interested in tools that may help this
What I like about this is that its just a bunch of polygons - they can be used for 2d/3d rendering, printing, VR, games, etc.
What I want to do is create the building blocks that make it easy to create/manipulate/distort polygon meshes in an artistic/inventive way for use in a wide variety of applications.
So if I wanted a high-performance "dense Nx3 matrix" as you recommended, where would be the best place to start? Is there anything similar that you could point me to?
For subdivision etc. you'd need to track indices and "join" extra points onto the array as needed
In http://thi.ng the main function is
add-face which updates all the indexes as each face is added.
Immutable is nice.... I think that's definitely the best way to go for the overall API
You probably want mutability for some of the internal calculation however, that would be my guess
But there are mutable vesions for people who need them, like (add! a b) which mutates a