I am trying to make rectangle with point taken as center, i have achieved this with some operation like divide the length by 2 and displace in opposite direction, you will find that in below file. I made this as a cluster so i can reuse it by making a toolbar of that cluster but the problem is that it works only with xy plane, i want it to accept any plane, can anyone suggest me how to achieve this.
My node tree-
This is because of the unit vector components you are using.
You should be feeding the plane input alone into the Rectangle From Center component.
The X Y inputs can be handled with an expression on the inputs to get the division and other math operands you may need.
Alternatively you can use the Point Oriented component to move locally within the context of a plane. That will allow you to “move” the plane origin location while still being aligned with the plane itself even if the plane is a random rotation for instance.
So if you Deconstruct the plane and reconstruct the plane, pass the XY values from component to component but in-between O to O inputs you would have a Point Oriented component where you input U(X) V(Y) and W(Z) offset number values.
If you only need to go from point A to B with the move mode, you can use a Vector 2pt component, connect the from plane to A and the to plane to B inputs. Then take the output of that and connect to the move component.
I’ll attach a GH file when I’m at my computer next
actually i am very new to grashopper, i know 3d well but i am learning grashopper from youtube , can you suggest some good resources to learn from. atleast basic functioning of all nodes.
Deconstructing files shared on these forums is a good place to learn.
Unlike most CAD operations that are open then closed, GH is more of a “flow” and often problems are solved with algorithmic planning.
And one of the great things in GH is you don’t have to commit geometry to Rhino until you absolutely want to.
You can preview every step of the way and keep the file very lightweight and then bake everything you need at the end, ignoring all other “steps” along the way.
Probably the biggest difference transitioning from 3D CAD to GH is understanding data trees and what that means within GH context in relation to geometrical operations.
This concept makes what would be very long and complicated scripts very simple and computationally efficient once you grasp the concepts of data trees.
This is a good resource for data trees:
Another good resource:
I like to think of data tree branches as buckets.
If one branch has a bunch of sand in it, that doesn’t mean it can touch the sand in another branch/bucket but if you flatten bucket B, then A bucket has access to B buckets sand as well, and if you have both flattened, you just have a pile of sand and its harder to organize now.
For an overview of native nodes I like this resource:
For actually using all the different nodes, probably YouTube is best or these forums.
You don’t need vectors for this at all. The ‘X’ and ‘Y’ inputs to Rectangle are domains so you can construct the domains using ‘-x/2’ and ‘x/2’, like this:
That’s because if you supply only a number instead of a domain for ‘X’ or ‘Y’, a domain is constructed, such as ‘0 To 16.3’ or ‘0 To -16.3’ - but @Kalpit_3d wants the rectangle centered, so the domain approach I posted is the best way, from '-x/2 To x/2’.
I’m not following this part but believe the issue is clear to both of us, eh.
That does what i need, thanks for your time and explanation, i need to learn a lot. i also learn that we can use expression like x/2 instead of using division node.