Hi, there are some mixed shapes. How can I separate rectangular surfaces from the other ones?
Forum-CullingRectangles.gh (27.0 KB)
Hi, there are some mixed shapes. How can I separate rectangular surfaces from the other ones?
Forum-CullingRectangles.gh (27.0 KB)
My geometry is not “simple”. I just have shown a small part of the hole modell. Do you know a solution that does the sperating more geometrically? This way is just culling by distance and is not that precise.
@Joseph_Oster Thank you, but it seams to me that there are some rectangular faces inside the non-rectangle group.
Green = rectangles
Blue = non rectangles
Simple was a way to say that there was just some basic shapes with no holes, curved part … that could lead to bad results.
For example I am sure my algorithm doesn’t wort with diamond as the one of Joseph.
Lets come back to math and measure angles between edges if all angles = 90° it must be a rectangle
@laurent_delrieu Thank you, you are right. Just planar nurbs. How could your idea look like includin the angle measurement? I think there should be the option of tollerances inside, because I do not think that all surfaces are perfectly 100 % rectangles
Yes, I noticed that. It’s because your rectangles are not precise, their edge lengths aren’t the same. Adding the expression “round(x,1)” to the Len output seems to fix that - but it’s dicey.
Measuring angles will have the same problem when the geometry is sloppy.
let me quickly check for the hole model
Unfortunatetly I can not optimize the geo beacuse it was scanned by drone with lidar sensors
check this, not the most elegant, but works here for all casesForum-CullingRectangles PS.gh (42.4 KB)
Thank you @Piotr
You can change the expression to “round(x)” (to the nearest integer) and change Equals (2) to Smaller (than 3) to handle squares where there is only one length for all four sides.
Clever and quick, but comparing length in sets may result that rhombs are selected as well. Am I right or not?
You can ignore it, it was just for cross-checking.
You are right. Triangles too.
I’d love to see your solution?
It is attached to my post above.
I, basically, run bounding box plane through each surface and then measured the sum of distances from each control point to boundary of bounding box.
It equals zero only for rectangles, any other polygons are eliminated.