algorithmic modeling for Rhino
I tried to find cylinder center with Cylinder.Center. If the input cylinder is referenced from Rhino, it all works alright. If the cylinder is created in Grasshopper, the center is out of the cylinder. It is always offset to half the height of the cylinder. How could I differentiate these two cases? Thank you.
Not sure if this works for all cases, but getting the boundingbox and then taking centre out of it seems to work for this example.
Point3d cPt = brep.GetBoundingBox(true).Center;
Just realized that in Cylinder component, it output cylinder.ToRevSurface(). Maybe this is why. Wondering why it output RevSurface instead of cylinder itself.