GH: Dynamic CPlane with GhPython?

rhino5

#1

I would like to be able to dynamically generate the Plane, for example using GhPython, and then feed the Plane into another GH component? (The Plane depends on user interaction, in 90 degree flips), for example like so :

Or is there a smarter way of achieving a “flippable plane”?

// Rolf


(David Rutten) #2

Interaction in Rhino, in Grasshopper? Like mouse moves, or mouse clicks?


#3

Yes, Interactive with GrassHopper. Ticking a Button should flip (Button name = “Mirror Model”, kind of.


BTW, I just tried using a PlaneSurf component (input from Srf, see below), and I read the centroid of the surface as to determine on which side of the Y axis it currently lays and so flip the surface over to the other side. But GhPython doesn’t like me, it just complains on type error all the time.

This is what I have; The open surface connected to the Srf component, and on row 10 I’m trying to determine on which side of the Y-axis the Srf currently is:

The in-port srf_plane is a one “Item Access”, of type Surface, but the RotateObject seems to expect a list, while it won’t accept a list either…

// Rolf


(David Rutten) #4

Ok, so if I understand you want a special object which takes planes on the left side, outputs the same planes on the right side, except when you click on it the outputted planes are flipped?
flipplane.gh (10.8 KB)


(David Rutten) #5

Or, with separate buttons for X-Flip, Y-Flip and XYSwap: flipplane_ex.gh (15.3 KB)


#6

Yes, cool solutions. This is exactly what I need, thanks!

// Rolf


(Giulio Piacentino) #7

If you want to do this in Python (RhinoCommon), here is the exact thing David did, in Python.

Thanks,

Giulio

Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com

flipplane_ex_py.gh (12.2 KB)


#8

Wow, that was perfect. Yes, I try to use Python for this project so this version came handy in.

Thanks.

// Rolf