Hello, I don’t know how to ensure that all the rectangles have the same coordinate axes as the global coordinate system without changing the geometry.
Thank you!
Orient Curves.gh (17.2 KB)
Hello, I don’t know how to ensure that all the rectangles have the same coordinate axes as the global coordinate system without changing the geometry.
Thank you!
Orient Curves.gh (17.2 KB)
I’m not sure I understand correctly your goal…
You can build a plane that is always normal to your building and have the plane V/Y axe pointing “up” with something like this:
Planes made this way ignore the actual shape and rotation of your windows curves.
Your guide curve for Flip is not internalized. However, there are other issues to consider.
I typically use a circle as shown to make sure curves on the same plane have the same direction. BUT - how do you know your planes are correct? And even if they are, the seam of each rectangle may be different, causing the points to be numbered differently as shown, even though they are all counter-clockwise in this case, branch {14}
. None of the curves are flipped. All four planes in this branch have the same Z direction but their X and Y axes differ.
Thanks for helping.
What I want is to create Types of a family of hollow windows for Revit with RIR and the problem I have is that the curves have their CPlanes rotated where sometimes the “z” is the “x” or the “y” is the "z ". and when I deconstruct the rectangles to extract the dimensions of the holes, they appear horizontal instead of vertical.
“Your guide curve for Flip is not internalized. However, there are other issues to consider.”
Sorry, I’ve been looking for a way to solve the problem and I thought Flip could solve it, but it didn’t. The seam issue hasn’t worked for me either. I don’t know how to solve it to modify the relative coordinate plans of each rectangle while maintaining the current geometry.
Does this help?
Orient Curves.gh (27.3 KB)
Multiple ways to go about it - I thought a simple one would involve constructing your plane at each window, making your " X " axis from the center of the window to the midpoint of one vertical edge of your window - then this edge becomes your " Y " axis for the plane. Check the EdgesDir
component. Because the ‘R’ input has a ‘false’ boolean, then only one of the two vertical edges of each window are picked. If you switch that to ‘true’, then the component gives you both vertical edges - you can choose between them to swap XandY:
Thank you!!!. It works perfectly and is simple
And how would you solve it, I’ve been thinking about flip and seam all week
The text panel in this version tells me that zero rectangle curves are flipped.
I don’t see that you touched it? I didn’t say it would solve anything, it’s just another concern.
That means nothing to me?
Not sure what that means either? I’m not sure that you’ve clearly demonstrated the problem since all planes (from rectangles) in each branch appear to have the same Z direction.
P.S. Are there buildings associated with these rectangles?
It doesn’t, at least not when you feed in all windows not just the branch you were working with - but there’s a fix.
All windows have two ‘z’ edges, one points up, and points down - when you obtain one of the two via the EdgesDir
component method, it might output either a positive or negative ‘z’ edge, which then translates into the direction of your ‘Y’ vector for the plane - so just choose the regular Rhino Z vector:
Orient CurvesZ.gh (27.4 KB)
This way Y always points ‘up’, while Z and X are swapped.
Which means this:
was slightly off
*Extra:
Seconding Joseph’s last question, if you have the building geometries these windows come from, then the ‘plane’ data for each one can be borrowed from the building wall they sit on.
Does this work for you? All plane axes are aligned the same, all seams aligned so rectangle corners are numbered consistently.
Here’s an illustration of that:
Orient Curves-wall.gh (30.0 KB)
“Yes, of course it works. It took me some time to understand it, but it’s simple and requires precise knowledge of Grasshopper. Thank you very much.”
“I wish I could write scripts as simple as yours. Here is how I solved it.”
Orient Curves_Resuelto.gh (33.3 KB)
Yes, but they haven’t given them to me
Thanks for sharing! Cool stuff. I see you’re trying to get a local plane from the directions of each rectangle similar to how we got the ‘Z’ edges.
It’s close! I noticed a mismatch in your rectangle construction:
Windows: 153
Planes: 153
X dimensions: 143
Y dimensions: 153
Reasons:
We only used the handy edges from directions component once, to get vertical edges only.
We didn’t search for the local X or Y with the same component because you have some rectangles that do not align with the Rhino world, such as these:
That will cause the mismatch because the horizontal edges on those do not match Rhino X/Y.
Notes:
EdgesDir
expedites things a lot (however I left you an example to get your local vertical/horizontal without that component, just for fun )EdgesDir
component (+ CullIndex
) - this is just to get their lengths for your rectangle creation - we could use them as your X-axis but there’s no need given you’ve already established that .Here’s that tweak:
See the attachment for some insight(s):
Orient Curves_Resuelto-3.gh (53.1 KB)
Best,
RC
Thank you very much, I will look into it.
I guess you just obsess over it lol - here’s a more simplified one:
Orient Curves_Resuelto-4.gh (32.6 KB)
Hello, thank you very much for dedicating your time and knowledge to clarify my ignorance.
I am amazed by the simplicity of your algorithms. What I’m learning! Thanks to you and Joseph