public void InitializeOnTarget(DMeshSO target, double initial_width) { AxisAlignedBox3d bounds = target.Mesh.CachedBounds; Vector3d c = bounds.Center; SORayHit nearestPt; target.FindNearest(c, double.MaxValue, out nearestPt, CoordSpace.ObjectCoords); c = nearestPt.hitPos; Vector3d up = c + initial_width * Vector3d.AxisY; target.FindNearest(up, double.MaxValue, out nearestPt, CoordSpace.ObjectCoords); up = nearestPt.hitPos; Vector3d down = c - initial_width * Vector3d.AxisY; target.FindNearest(down, double.MaxValue, out nearestPt, CoordSpace.ObjectCoords); down = nearestPt.hitPos; SetPointPosition_Internal(StartPointID, new Frame3f(up), CoordSpace.ObjectCoords); SetPointPosition_Internal(EndPointID, new Frame3f(down), CoordSpace.ObjectCoords); }