You are browsing as a guest. Sign up (or log in) to start making projects!

2h 16m 35s logged

Devlog 6 - Fusion Voronoi Script

Today I first started thinking about how i would implement lloyd’s relaxation into my code (It’s an algorithm that moves every seed of the voronoi to its center of mass, which makes the cells more similar in volume to each other) but I quickly faced a big problem, sometimes my voronoi cells goes partly off the original body, which would mess up with the relaxation and could move the seeds out of the original body, what would cause me bugs, I tried some different methods using scipy’s ConvexHulls but I wasn’t able to create the cells just by using the points such as the voronoi algorithm does.

So, I started working on another problem that actually helped me solve the first one! The weird connections on the faces, to solve it I improved the way I was generating ghost points (some voronoi seeds that are put outside the body to restrain the pattern but are not extruded afterwards), at first I was generating them 50% evenly spaced along each face and the other 50% randomically inside a margin around the body, now I am mirroring each seed across each face and using the mirrored points as the ghost points, since both of them are the same distance from the surface, they create beautiful boundaries, it works perfectly with flat faces but still gets kind of messy sometimes with the rounded ones.

I faced some problems while doing it, at first, I was just mirroring them against the bounding box of the body, what made it easier and looked great for simple shapes like cubes, but, the rounded edges were not taken in account and if the faces were not parallel to the unit vectors they didn’t look good, since the bounding box is always parallel to them. To solve that I tried iterating through each face, getting the minimum distance point between the face and the seed and then mirroring it through that point, at first it looked really bad, as if I didn’t even had the ghost points, I tried the other method again and at the end came back to the minimum distance method again just to realize that the first time I was getting the minimun distance point at the seed instead of the point at the surface 😅. Even though it looked better for the faces not parallel with the main axis, it still look weird sometimes on the rounded faces.

Some pics of how it’s looking right now, you can see at the second one that some of the edges on the rounded surfaces are still getting clipped sometimes

0
6

Comments 0

No comments yet. Be the first!