This is a technique I use somewhat frequently to find the most common direction of a shape. I frequently use it for stuff like finding dimensions (ie: the length and width of a room) or placing a grid onto a surface so the ‘most common square edge’ aligns to the grid (ie: a ceiling tile array). This doesn’t attempt to make grid spacing work out to ‘magic’ fits, or any other aspect of the design - it just helps identify on the most common curve tangent vector, and allows you to use that to help ensure you get the most parallel and perpendicular lines. There is definitely a better name for what this finds, but at the moment I’m too tired to look it up.
A quick animation showing how the graph working, with a 1 second delay:
The built graph should look like this:
Note that some shapes might want to work with just utilizing the ‘longest’ edge instead of the most common angle, and interior shapes or non-uniform curves may create other edge cases where this doesn’t work, but as designers we already knew that when we put that shape into our design, right?
This was built with Dynamo Sandbox 2.11, but I’ve confirmed it works as far back as 2.1 (I am confident it would work in a 2.0 build, but it would require some list mapping and such to go too far back into the 1.x, so you may be on your own).
Feel free to play around with it, and as always reach out with questions on the graph or it’s application and the larger community will do our best to help.
Hope you find this useful.
Find Most Common Edge Axis and Build Grid.dyn (86.0 KB)