How can I create multple cplanes (coordinate systems) visible simultaneously? [Python]


This Frames GH component creates multiple CPlanes visible while in preview, but when baked they appear as square surfaces.

How can I (is it possible) to create multiple CPlanes, but all of them be visible at the same time?

I’ve moved this to the Grasshopper Developer category.

I want them being created in Rhino without Grasshopper.
It was just weird how they appear in the preview of this component but when baked they look just like surfaces.

Those are Rhino.Geometry.Plane, you can make as many as you like and output them from your GHPython component.

Yes, Rhino does not have a plane object that can be added to the Rhino document (as far as I know). So David properly just chose to represent/bake them as surfaces instead. If you want to simply render planes via RhinoCommon, you’ll need to look into display conduits, or make your own little plane render function/class through CustomDisplay (i.e. draw three coloured vectors for instance).

Thanks for the reply,

Oh, is that how they are called. I was looking for CPlanes, Coordinate systems. Silly me.

:thinking: that will take me some time to understand.

Constructs a new CustomDisplay instance. You must call Dispose() when you are done with this instance, otherwise the display methods will never be switched off

What does that mean? If I use this constructor on a square surface and I dont use Dispose() at some point, all my surfaces will be CustomDisplay-ed?

I came to that same conclusion.
McNeel, is this planned for Rhino7?
This is kind of an important thing if you’re about to go deeper in parametric design in Rhino (without Grasshopper)

As you can see in Catia, FreeCAD, etc… having a plane is the start of every new model.

Indeed, I tend to use other objects to indirectly define/manipulate planes in Rhino. For instance circles, which have a plane property: (4.3 KB)

I suspect you’ll find yourself keeping banging your head against stuff like this (dataflow, events, rendering seemingly simple objects etc), that’s all neatly implemented already for you in Grasshopper (through over ten years of development!). So I’d advice to maybe reconsider that trajectory, especially now that Grasshopper and GHPython is a part of vanilla Rhino. I’m curious though, to why you would want/need to ditch GH?

1 Like

Could you make an exception and allow PMs for the time being?

And yet many things were not thought through completely or were limited by Rhino(Common) missing object types.

I made a few tests with your script, really nice.

I didn’t think you can extract ‘Plane’ attribute from curves.

I noticed something weird though. When adding polygons and adding them to the script as Rectangles (because there’s no polygon type hint) the plane is not placed in their CoG.

Although, when I connect the polygons to a rectangle container component the rectangles created match the result of the planes.


@pascal, do you think this is a bug? Why is the rectangle created like that?

You can’t, unless they have a property or method for it. Which the Circle structure does (a circle is inherently defined by a plane).

I’m not sure what’s going on in your case (as always, provide files), but I’d guess it might have something to do with the implicit casting Grasshopper does on the fly (“guessing” which type to pass forward and such). (1.9 KB)

I simply pass Polygons to your script and I have changed the input type from circle to rectangle.

Apparently the rectangle is created but its area centroid doesn’t coincide to the centroid of the polygon. Which is weird, since both the rectangle and the polygon can be created from two points (one of which is the center)

The second weird thing I notice is if you use Rhino polygon (rectangle) to create that plane, and subsequently you move one of the points in Z direction, thus making the curve non-planar, the plane is still created :smiley:

I don’t follow, if you want to figure out if an object has a plane, you can check that using hasattr(): (8.4 KB)

1 Like

Still though, some objects may be converted into objects that have a ‘plane’ attribute. Like Polygon for example. If it is converted into Rectangle it can have a plane attached to it as well.