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

image

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?

1 Like

Iā€™ve moved this to the Grasshopper Developer category.

1 Like

Why?
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.

1 Like

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).

1 Like

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.

CustomDisplay	
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?

1 Like

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.

1 Like

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

181101_CirclePlane_GHPython_00.gh (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?

2 Likes

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.

image

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

1 Like

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 Like

GH.PlaneFromPlanarCurves.gh (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:

1 Like

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

181106_HasProperty_GHPython.gh (8.4 KB)

2 Likes

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.

1 Like