algorithmic modeling for Rhino
Hi! I recently face a weird problem when trying to do brep methods. The brep is from flat bounding box.
The error says: Object reference not set to an instance of an object. (line: 4) The goal is to get the area of the flat bounding box.
Any advice is appreciated! Thanks
Tags:
Update 1.
Figured out a "temporary" way of solving it by making Polyline of the flat box vertices. Pretty sure it only works to calculate base area of the bounding box. Any advice is appreciated :)
Point3d[] pts = bbox.GetCorners();
Point3d[] pt_ar = new Point3d[5]{pts[0],pts[1],pts[2],pts[3],pts[0]};
Polyline plln = new Polyline(pt_ar);
A flat boundingbox would result in an invalid brep, because four of the six sides would have zero area and coincident edges. Grasshopper specifically handles this case and creates a single plane surface instead.
However you can calculate the area of a boundingbox far more efficiently than from a brep. If you know your box is flat, all you have to do is multiply the difference in X and Y of the Min and Max points.
Wow that is nifty. Thanks David!
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by