Filter outer beam surface

Morning all !
I have beams like the picture below. How to filter the outer surface (marked O) ?.
Any help is much appreciated

1 Like

something like this?

or you can directly select from Select Face
http://dictionary.dynamobim.com/#/Revit/Selection/Action/Select%20Face

1 Like

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

1 Like

what iâ€™m getting is every beam has different number of faces?

Hi,

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.

4 Likes

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.

3 Likes

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

1 Like

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.

1 Like

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.

1 Like

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?

Edit
Got it:

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.

2 Likes

@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)

1 Like

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.

1. 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.

2. 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

1 Like