I am a fashion designer and I have these “x” shaped staples that hold the fabric together. I’d like to use them to form a larger image on a garment. The size of the buttons cannot change, but their proximity to each other can.
My original plan was to create a set of points based on light and dark values of my image and then convert these points to attractors and setting a population of points that can be moved closer to the attractors using weighted average distance between points and attractors. This is proving difficult because I’m having trouble creating the points from the original image that then need to be converted into attractor points.
If anyone has any other advice that would be amazing. Thank you!
Creating a weighted distribution of points is a classic problem, and luckily there are a few ways to do it. If you want to avoid using scripting components, I’d suggest you do something like this:
- Generate a dense grid of points and slightly move the points in random directions, or create a point cloud using something like populate surface/geometry (the former will result in “regular randomness” and the later will look much messier, so pick your favorite).
- Sample the image at these points, and multiply each value by a random number between zero and one.
- If this multiplied value is below a threshold, cull the corresponding point, otherwise keep it. This threshold will depend on how many points you want and how dense you want them. Unfortunately there is no way to just set the number of points you get at the end using this method, but you can eye ball it pretty closely. You can also invert the threshold (cull values above it) if you wish.
You can also sort the points by their corresponding value and take the first n for some desired n points then unsort them afterwards. If you need an example, just let me know.
How about Image Based Circle Packing and then put your "X"s inside each circle?
This thread asks how to do it with fixed circle sizes, you would need just one size if your "X"s are all the same size.
https://discourse.mcneel.com/t/imaged-based-circle-packing-with-fixed-circle-size/90195
I’m sure I’ve seen examples of this here somewhere so have a search and see what turns up and hopefully someone else might remember too.
If you had an example that would be amazing. Thank you!