When I create a cage (either with cage or with cageedit) for a part that is planar, in most cases Rhino creates a UV cage instead of the XYZ cage I get when the part is not planar (otherwise, I’d end up with stacked cage points, so this makes sense.) The main issue for me is when I’m scripting a cage. I could have the script check to see if the part is planar or not, and do the correct cage format for the correct part. But, checking to see if it is planar doesn’t work all the time. Specifically, if I have a planar surface that is not on the construction plane (I’m just using default construction planes), Rhino creates an XYZ cage instead. Other planar objects (at least planar curves, planar meshes, and planar subds) that aren’t on the construction plane generate UV cages. So what are the rules that I can use to see whether to use XYZ cage or UV cage in my scripts? Or alternatively, is there a way to force Rhino to always create an XYZ cage?
Anyone have any ideas? Also, I don’t see any documentation of these two types of cages in the help files. Maybe I’m missing them?
Hi @phcreates,
Yes, you can force a 3-D cage. In CageEdit, at the Select control object prompt pick Box, then at the box’s first-corner prompt pick BoundingBox. You still get the automatic bounding box around your selection, but this path always gives you an XYZ cage — if the box is flat in one direction, Rhino pads it so the cage has some thickness.
As for the rule when you pick BoundingBox directly: it isn’t a planarity test. Rhino takes the tight bounding box of your selection in whichever coordinate system you choose (World, CPlane, or 3Point) and counts the directions with zero extent — none gives a 3-D cage, one gives a UV rectangle, two gives a line. So a planar part only gets a UV control if its plane is parallel to one of the three planes of that frame. Parallel to World XY and you get UV, whether or not it sits on the CPlane; tilted so it’s parallel to none of them and you get XYZ.
For scripting, that means you can test the bounding box extents instead of planarity — but using Box and typing your own corner points is more predictable.
One thing I can’t explain: you say planar surfaces off the CPlane give XYZ while planar
curves, meshes and SubDs give UV. Could you post a small 3dm with one of each?
Thanks,
– Dale
Hi Dale,
Thanks for that detail - it’s very helpful.
Here’s an example of 3 types of objects that are all planar, but only the surface gives me an XYZ cage.
cage issue.3dm (83.6 KB)