> For the complete documentation index, see [llms.txt](https://gitbook.testingwaters.in/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gitbook.testingwaters.in/geometry-1/unaligned-bounding-box.md).

# Unaligned Bounding Box

![](/files/-MFlPKTMVJM0CskCD4j-)

```d
def UnalignedBoundingBox(gmty:var[]..[],coSy:var[]..[])
{
	coSy1 = CoordinateSystem.Identity().Transform(coSy);
	gmBb1 = BoundingBox.ByGeometry(gmty.Transform(coSy1,CoordinateSystem.Identity())<1>);
	gmBb2 = Math.Round(gmBb1.MinPoint.DistanceTo(gmBb1.MaxPoint),3);
	gmBb3 = DSCore.List.FirstItem(DSCore.List.SortByKey(gmBb1,gmBb2)["sorted list"]).ToCuboid();
	coSy2 = DSCore.List.FirstItem(DSCore.List.SortByKey(coSy1,gmBb2)["sorted list"]);
	return gmBb3.Transform(CoordinateSystem.Identity(),coSy2);
};
```

{% file src="/files/-MFlPVD\_89chJ-kuI\_\_g" %}
Dynamo Version 2.9
{% endfile %}
