if I get a circle I can define it from the center point and then radius
while the rectangle node, does start from one point which considers as a corner, and then from it makes a square
is there any way to make the rectangle start from a centered point like in the circle cnr node?
The standard Rectangle curve works that way, using a domain for the X and Y inputs.
The Center Box and Domain Box work the same way in 3D.
If you just plug in a width and height into the Rectangle component, it does start from the 0,0 point of your plane.
However, as @Joseph_Oster mentions above, if you plug in a domain, you can change how your rectangle is positioned. Assuming your inputs are width, height, and center point, the easiest way I’ve found is to:
- Create a domain from -width/2 to width/2
- Repeat for height
- Plug those into the Rectangle inputs.
Rectangle.gh (9.7 KB)
You can do the same thing with fewer components by using expressions on the Domain inputs.
Rectangle_2022Oct3a.gh (6.8 KB)
Right-click on the Domain inputs and choose “Expression”:
That’s a cleaner way of doing it, thanks! I don’t know why I completely forgot about the expression on the input. I guess I’m generally inclined to keep things visible, makes it easier to debug later (but can be more cluttered).