/// <summary> /// Create FdCoordinateSystem from Rhino plane on surface mid u/v-point. /// </summary> internal static FdCoordinateSystem FromRhinoSurface(this Rhino.Geometry.Surface obj) { // reparameterize if necessary if (obj.Domain(0).T0 == 0 && obj.Domain(1).T0 == 0 && obj.Domain(0).T1 == 1 && obj.Domain(1).T1 == 1) { // pass } else { obj.SetDomain(0, new Rhino.Geometry.Interval(0, 1)); obj.SetDomain(1, new Rhino.Geometry.Interval(0, 1)); } Rhino.Geometry.Plane plane; obj.FrameAt(0.5, 0.5, out plane); return(plane.FromRhinoPlane()); }