> 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

![](https://1430428134-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Ld8QK19sjP1I9rhLouo%2F-MFlOrNWdm4KH8d_ieVa%2F-MFlPKTMVJM0CskCD4j-%2FunAlignedBoundingBox.png?alt=media\&token=85f8bb55-6a85-4ac4-a812-30a86615964b)

```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 %}
