Finding unique vertex coordinates in jit.gl.plato / grid shape geometry

marleynoe's icon

Hey there,

I'd like to use jit.gl.plato @matrixoutput 2 to control the position of other objects, e.g. jit.gl.gridshapes in a 3D scene. Now, since the geometry of a jit.gl.plato is described via triangle primitives, a tetrahedron for instance has 12 vertices - instead of 4 (cubes 36 instead of 8 etc).

Is there a way to figure out which of the position (xyz) coordinates are doubles, i.e. get the "unique" vertex coordinates (e.g. by filtering out double position coordinates)? - Hopefully I was able to phrase that question so it makes sense - patch pasted below.

I would think this might be a common thing to do? Hopefully, there's a solution - pretty please...

All help highly appreciated!

Max Patch
Copy patch and select New From Clipboard in Max.

Cheers,
M

Rob Ramirez's icon
Max Patch
Copy patch and select New From Clipboard in Max.

i would use coll for this. you can create a unique key based on the coordinate values, and store it in the coll. any values that aren't unique get overwritten, so after each output you will be left only with unique values.

marleynoe's icon

Awesome, 1000^thanks for this great lesson! :D

Andy Rudolph's icon

You, sir, have saved me so much time and heartache. Thank you for providing this very illuminating example. I find that the reference sheets really don't give enough info/examples with regard to what's actually coming out of the matrix outputs for gl objects and how to use it. This just made it all make sense for me. Best!

Also, thank you, marleynoe, for asking the question.