CenterPoint 2D

'
' Generates a Bounding Box and generates the CenterPoint of each of the objects in the ground surface
'
' IN: arrobject - Array of object
' OUT: arr CenterPoint - Center Points
'
Function centerpoint (arrobject)
Dim arrCenterPoint, arrBBox
Dim i
For i = 0 To UBound(arrObject)

arrBBox = Rhino.BoundingBox(arrObject(i))
arrCenterPoint = Array((((arrBBox(2)(0)) + (arrBBox(0)(0))) / 2), (((arrBBox(2)(1)) + (arrBBox(0)(1))) / 2), (((arrBBox(2)(2)) + (arrBBox(0)(2))) / 2))

Call Rhino.AddPoint (arrCenterPoint)

Next
End Function

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License