Generator for random orthogonal outline (Rhino 7 / Grasshopper)

Hello everyone,

I’m looking for a way to procedurally generate random orthogonal footprints in Rhino 7 (Grasshopper or RhinoPython).

The generated footprint should satisfy the following requirements:

  • One single closed outer boundary.
  • Only 90° angles (horizontal and vertical edges).
  • Every coordinate should lie on a 0.5 cm grid.
  • Edge lengths should be multiples of 0.5 cm, but not all edges should be 0.5 cm long.
  • Around 80–120 recesses/notches to create a fairly complex outline.
  • No self-intersections.
  • A different valid footprint should be generated every time (or controlled by a random seed).

The result should look like an irregular footprint with many orthogonal recesses, similar to the attached example.

I’m open to:

  • a Grasshopper definition,
  • a GhPython script,
  • a RhinoPython script,
  • or an existing algorithm/library that generates random orthogonal polygons and can be adapted.

Does anyone know of an existing implementation, or have suggestions on the best algorithm for this type of procedural generation?

Thank you!

You can take a mesh with 0.5 cm edges, explode it, jitter the faces, split the list of faces in 2, join the meshes, fill the holes

Or you can cluster the mesh, take some points on mesh select faces that touches the points, set the faces in separate list then grow the selection at each step until there is no more faces not affected to a list. Then jitter the border.

Surely possible also using some noise.

For the record, I made a little tool to Pixelate Curve in NAutilus plugin

Thank you so much, Laurent!! I really appreciate you taking the time to help, I think this approach will work much better than what I was trying before. Thanks again :folded_hands: :folded_hands:

Cluster Mesh is from Nautilus plugin, very simple to use.

Max value is the parameter to have more or less ramification

grow random cluster.gh (14.6 KB)

Main work here is to take the cluster that is near the center.