Pseudo-lloyds with kangaroo

Hey folks!

Could you please help me get my Kangaroo code running? It’s giving nulls, not the lines I need. I copied @DanielPiker 's code (grouped and disabled) in the same script––I tried to adapt it but failed.

My goals are:
(0 to use kangaroo)
1 keep the end points of the lines on the hemisphere
2 keep the end points that lie on the hemisphere’s naked edge on that naked edge
3 the lines to have similar lengths –– similar to the Dual, but with voronoi properties (more varied sizes and number of edges per minimum cycle basis)

Thanks a lot!
voronoi-kangaroo.gh (67.8 KB)

Are you after something like this?


trivalent_kangaroo.gh (71.4 KB)

You were getting just nulls in the output because none of the goals you were using produce a geometry output. Some goals such as Length automatically output lines, but EqualLength doesn’t (the thinking was that you don’t want lots of copies of the same geometry in the Kangaroo output, and you’d nearly always have some Length goals in the same sim). You can connect a ‘Show’ component to get particular lines in the output.
Here though it does make sense to include some zero length goals on the lines. Equal Length alone gives this:


(the lines all have the same length, but with no guidance on what that length is. Instead we want them close to equal, while also being close to as short as possible).

Also - regarding point 3 - those aren’t really Voronoi properties. What makes a Voronoi diagram a Voronoi diagram is dividing the space into regions according to which point they are closest to - nothing to do with randomness or number of sides - that’s just a common association because people often use it with randomised points as input.

1 Like

Wow! Thank you so much for the very detailed breakdown of kangaroo and what I’m trying to do! Kangaroo’s outputs (why we sometimes need Interleave for inputs and Bang! for outputs was a total mystery to me…)

Before I saw your reply, I tried equal length & length (set to the average of all lengths) and got a similar messiness.

I got these voronois from BBX with voronoi cells (centered at points randomly populated over the BREP) cleaned up with remove_duplicate_lines(). I attempted pseudo lloyds algorithm, where the voronoi centers are BREP_closest_point(centroid(polyline(BBX of the voronoi cells)), my BREP), and it never got close to directly relaxing the polylines with Kangaroo!