Please add a "Z" input to "Construct" plane

Sometimes, to define a plane, the “Z” vector is at hand while the “Y” vector needs to be wrestled from other ones.
The logic could be that if a “Y” vector is input, any “Z” vector would be ignored.
But if there is no “Y” vector, then the “Z” vector is used to define the plane.

1 Like

Cross Product component is quite simple.
Y * Z = X
Z * X = Y
And then you create your plane…

1 Like

Yes, Riccardo, I use it all the time.
I wasn’t asking for this. I was suggesting it would be one of those little improvements that allow to weed-out useless components from the canvas.

If I follow your reasoning, there might as well be no “Z” output on the “Deconstruct plane” component since it can “easily” be obtained from the first two…
Well, that “Z” output is there for CONVENIENCE.
I like convenience.

My personal opinion is that, if I would really need that, I would make a mini cluster (cross product + plane creation) or a dedicated c# script (I can make it if you need it) to have the other 2 plane constructors (from YZ or XZ).

But also, the:

If working with single items, ok.
But what if you are working with a list or even a tree?
What is “no input”? A null object? Or when the component as whole have or not connected a source?
Usually grasshopper grow the shortest list to reach the length of the longest, that is the logic used everywhere.
Programming a single component that pick an input if another is missing is something i’ve seen only in “Triangle Trigonometry” component. A rare logic.

I might be wrong.

Hmm… you got a point.

On the other hand, your logic deals with the X-axis as a priority or mandatory, when it is just as important as the Y-axis. I understand your idea, but it is overcomplicating. Make a cluster to improve your workflow.

I think would be better a plane constructor that uses point, vector A, vector B and another parameter to choose the base (XY, YZ, ZX, YX, ZY, XY).

1 Like

Well, my understanding is that there has to be a “master” axis (in the present case, it’s X) since the second axis (here, Y) doesn’t have to be orthogonal to the first for GH to create a valid orthogonal reference frame ; it just has to be different.

Anyway, maybe I’m a bit fussy on that one, I admit.

This is a small c# that literally abort everything if you input any source to all of the 3 vector inputs
2021-03-17 21_49_54-Grasshopper - OXYZ_plane_
OXYZ_plane.gh (5.8 KB)
Not really deeply tested.

Maybe what you want could be achieved by “variable inputs” (What was the actual name?)
Zooming in the Plane component we could have the ability to “+” or “-” to get only the inputs we want to use.

Code of the script:

 private void RunScript(Point3d O, Vector3d X, Vector3d Y, Vector3d Z, ref object Pl)
  {
    List<Grasshopper.Kernel.IGH_Param> inputs = this.Component.Params.Input;
    int x = inputs[1].SourceCount;
    int y = inputs[2].SourceCount;
    int z = inputs[3].SourceCount;
    if(x > 0 && y > 0 && z > 0){
      this.Component.AddRuntimeMessage(Grasshopper.Kernel.GH_RuntimeMessageLevel.Error, "Please use only 2 of the vector inputs!");
      return;
    }
    Rhino.Geometry.Plane plane = Plane.Unset;
    if(x == 0){
      plane = new Plane(O, Rhino.Geometry.Vector3d.CrossProduct(Y, Z), Y);
    }
    if(y == 0){
      plane = new Plane(O, X, Rhino.Geometry.Vector3d.CrossProduct(Z, X));
    }
    if(z == 0){
      plane = new Plane(O, X, Y);
    }
    Pl = plane;
  }
1 Like

I’ll test this ! Thanks.
Maybe that could inspire a more versatile Plane component for GH2…