Unaligned Bounding Box
1
def UnalignedBoundingBox(gmty:var[]..[],coSy:var[]..[])
2
{
3
coSy1 = CoordinateSystem.Identity().Transform(coSy);
4
gmBb1 = BoundingBox.ByGeometry(gmty.Transform(coSy1,CoordinateSystem.Identity())<1>);
5
gmBb2 = Math.Round(gmBb1.MinPoint.DistanceTo(gmBb1.MaxPoint),3);
6
gmBb3 = DSCore.List.FirstItem(DSCore.List.SortByKey(gmBb1,gmBb2)["sorted list"]).ToCuboid();
7
coSy2 = DSCore.List.FirstItem(DSCore.List.SortByKey(coSy1,gmBb2)["sorted list"]);
8
return gmBb3.Transform(CoordinateSystem.Identity(),coSy2);
9
};
Copied!
unAlignedBoundingBox.zip
5KB
Binary
Dynamo Version 2.9
Last modified 1yr ago
Copy link