algorithmic modeling for Rhino
K-Means Clustering from Davideo Reeves on Vimeo.
8 dimensional k-means clustering of ~16000 quadrilateral panels
Tags:
Comment
Nice.. !
Assuming the quads are planar, maybe its possible to shrink the dimensions to only 3: a perimeter and 2 diagonals. I'm not completely sure, but I think there's only 1 quad you can build from those.. and it eliminates the issue of rotation if you always use the longer diagonal first.
Ah, I'm surprised you hadn't seen that before. Man that thread covers a lot of ground! Anyway I ran out of fun time for that project and I didn't end up with a very robust solution. The end goal (obviously) was flat panel families controlled by joint width parameters. Edge conditions make things complicated.
Hey Taz,
I don't know how I missed it at the time but I just found this monster thread on k-means from back in 2011. The idea of clustering during a physical relaxation is an interesting one. Did you guys wind up having any luck with it?
It seems especially approachable when the nearest mean is being calculated based on edge/diagonal lengths as each mean is essentially providing set of rest lengths to all the panels closest to it. I might have to take a crack at it.
The tricky part (if I recall correctly) is to come up with a unique identifier for all possible geometric characteristics to use for sorting. Even more fun for hexagons.
After trying a few different approaches, I wound up using a combination of edge lengths and diagonal lengths. For each quad with vertices A,B,C,D the 8d data point looks like this:
(AB, AC, BC, BD, CD, CA, DA, DC)
Two of those diagonal lengths are obviously redundant but they allow you to simply shift the array to get at different rotational permutations. This makes the search for the nearest mean a bit more straightforward since, in the context of panel clustering, you'd need to consider all rotational permutations of each one.
8 dimensions ? X&Y for each vertex ?
© 2020 Created by Scott Davidson. Powered by
You need to be a member of Grasshopper to add comments!
Join Grasshopper