Domain of trimmed surface

Hi, how would I find the ‘midpoint’ of a trimmed surface? My function currently evaluates the untrimmed surface. I’m looking for the point this function would return if a trimmed surface was first shrunk.


Function GetSurfaceMidPoint(ByRef strObject)
	Dim arrDomainU, arrDomainV, arrParam(1), arrPoint

	If Rhino.IsSurface(strObject) Then

		arrDomainU = Rhino.SurfaceDomain(strObject, 0)

		arrDomainV = Rhino.SurfaceDomain(strObject, 1)

		arrParam(0) = (arrDomainU(0) + arrDomainU(1)) / 2

		arrParam(1) = (arrDomainV(0) + arrDomainV(1)) / 2

		arrPoint = Rhino.EvaluateSurface(strObject, arrParam)

		GetSurfaceMidPoint = arrPoint
		Rhino.MessageBox "Not a surface, can't get mid point."
		GetSurfaceMidPoint = Null
		Exit Function
	End If

End Function