Morning all !
I have beams like the picture below. How to filter the outer surface (marked O) ?.
Any help is much appreciated
Morning all !
something like this?
or you can directly select from Select Face
I have a thousand beams so I can not use “select face”. To the image above, I still can not filter the surface outside the beam as i want
what i’m getting is every beam has different number of faces?
My best guess would be to extract the Surfaces as @ROY did, compute the points of each surface, and filter the surfaces given the coordinates of the points.
For instance, if you have a beam that goes along the Z-axis, you will have to check all the surfaces which perimeter points reach either X_max and X_min or Y-max and Y-min, depending on whzat you want.
You could also consider computing the bounding box that defines each beam, recreate a Solid from that Bounding Box, and intersect the Solid with the geometry of the original beam.
You could try using math. Find the area of the surfaces and if it is less than say 70% of what it should be, filter out. You can find what it should be by using combinations of length, width, height. If you want to go further, use the orientation it is in to determine if it should be length x width or if you need to use height.
It might a good idea on paper, but i guess that if you have a beam that looks like the beam of the second screen, but the hole in it is much bigger, or even if you have a beam that has a huge height (in comparaison to its width), you might have trouble determining either the “70%” or the “what it should be” part
Finding the normals to determine the orientation would solve whether to use width or height. But yes, it depends on how big/shape the holes are.
Alternatively, use the normals to find walls that are opposite (vector is reverse) of each other and then find ones that are the width distance apart. Do the same for the height.
I’m just halfway of the this script. I’m leaving for lunch.
the idea is desired sides of bounding box if intersecting with the surfaces of beam then filtering it through boolean mask.
I hope i will continue after lunch if you need.
Wonderful ! Thank you very much
I thought I had a solution but there is a flaw as it only works for indents that don’t pass through the centreline…
For each beam, create planes aligned to its axis, then test the distance to each of the faces to those planes. Since the planes should be parallel to the faces, two of the planes intersect and thus have distance 0. For the indents, there will be only one intersection, so you can filter those surfaces out.
Maybe testing against the bounding box faces instead?
surfselect.dyn (27.6 KB)
Any surface on the outside will necessarily intersect 3 surfaces of the bounding box, whereas any surface not on the outside will not. This should be universally true and not require any twiddle factor.
@nguyenvietthanh27059 it occurs to me you might not get notified if I edit my post, but see above
I am trying. Thank you very much
Hello @ROY !
I’m having a problem. The node “Geometry.DoesIntersect” gives the false result when i work with multiple sublist at input. It is true when I have 1 sublist at the input
Where are all these sublists coming from? Are you splitting up the surfaces further? Because that would throw a spanner into the workings of this since the number of intersections per outside surface is then no longer a given as it’s no longer a good approximation of a cuboid…
With different levels you might still get the appropriate results but it’ll take some fiddling.
for the first option my best guess is its only comparing between first two items of the lists.
I think you should take each surface of bounding box at a time and use lacing to longest.
what you say @mellouze @Avz?
@ROY it really depends on how his lists are organised and why they are that way… The bounding box really shouldn’t be more than just a list of 6 surfaces. It looks like maybe it’s the surfaces of two bounding boxes, split up into sublists by orientation (e.g. top/bottom/left/right/front/back) but that would be a real headache to work with.
A different solution might be getting points on each surface and then comparing the surface normal at those points against the position of the points, so that if the normal is pointing towards -Z, then if the Z-coordinate is equal, the surface is on the outside. A bit easier said than done but more robust at least?
I think this should be a more robust way of finding the outer surfaces…
I’m assigning each surface a point (in the middle, or at least not at any corner or edge, that’s important), testing the distance of each of those points to each of the bounding box surfaces, and then just filtering out the surfaces for which that’s not true… This way it’s orientation independent and it shouldn’t matter how many surfaces touch.
Will need some adjustments if you want to feed it multiple objects at a time, though.
surfselect2.dyn (51.0 KB)
BoundingBox intersection will give a false positive for an angled beam. If you think that will be an issue, there are two other options to explore below. Both assume that your sides are perfectly vertical.
Filter first by normals with no Z value to get ride of your top and bottom surface. Then get the point at each surfaces’s 0.5, 0.5 parameter and ask if they intersect the edge planes noted by @ROY above. This may be less computationally heavy as it doesn’t make as much geometry.
Get the point and normal at the midpoint of each surface. Filter out point/normal combinations which don’t have a 0 z value. Then draw a line by start point, vector, and distance by each point/vector combo, using the beams length or a large number as the distance. Then use a geometry.intersects to test for intersections between each line and the original solid. If they intersect than the surface is internal. If not than the surface is external.
You mean that by “axis aligned”, the bounding box description is referring to the world axis, not the local axis? That’s really unpleasant… Good to know for future reference.
For the second solution there’s no reason to filter the Z-value, I think. It should work perfectly well for any angle that way, shouldn’t it?
Some potential issues in cases where the cut isn’t all the way through the beam in more than one axis, though, but if there are no such cases then I’d say it’s good?
PS I’m not ROY