Intersection fails

Intersection fails

amilcar.ferreira
Contributor Contributor
946 Views
4 Replies
Message 1 of 5

Intersection fails

amilcar.ferreira
Contributor
Contributor

Hi everyone,
I'm using the BooleanOperationsUtils.ExecuteBooleanOperation(solidA, solidB, BooleanOperationsType.Intersect)
And I'm finding several errors. I've verified that in every case the solid A and Solid B are not null with a face count >0 and the correct volume, But in some cases the intersection result is null even if the solids are intersecting.
Anyone experiencing this problem?

0 Likes
947 Views
4 Replies
Replies (4)
Message 2 of 5

amilcar.ferreira
Contributor
Contributor

Just a bit more info about the issue:
in this case I'm intersecting a rooms and elements

The rooms solid I got it like this:

var calculator = new SpatialElementGeometryCalculator(doc, new SpatialElementBoundaryOptions() { SpatialElementBoundaryLocation = SpatialElementBoundaryLocation.Center });
Solid roomSolid = calculator.CalculateSpatialElementGeometry(r).GetGeometry();


The element is a floor with only one layer:

Options opt = new Options();
opt.IncludeNonVisibleObjects = false;
GeometryElement geo = element.get_Geometry(opt);
solid = geo.OfType<Solid>().Where(s => s != null && s.Faces.Size > 0).FirstOrDefault();



 

It is working for the must part of the elements, walls, ceilings etc, but some like the floor in the image are not detecting the intersection

 

 



0 Likes
Message 3 of 5

RPTHOMAS108
Mentor
Mentor

If your intersection creates a sliver then this often will fail.

 

I would show the two solids by creating direct shapes to understand if a solid resulting from such Boolean operation would be realistic in terms of edges lengths of a face, distances between parallel faces etc.

0 Likes
Message 4 of 5

amilcar.ferreira
Contributor
Contributor

Hi @RPTHOMAS108 
Thank you for your feedback, in this case the intersection of both elements is a viable solid.

Other issues I'm founding with solids and intersections are:
1 - family instances gepmetry, it only gets solids from the geometries that are visible in medium detail level, other geometries with coarse or fine detail level  are not being detected.
2 - for elements inside groups, it allways gets the solid from an element of the same group instance.
In other words, if I have 2 instances of the same group, when I get the solids from one element inside each instance of this group it will get me the same solid no metter what instance I pick.
3 -  Get spacial elements from rooms in linked files: it doesn't work properly. In a file with 198 I got the solid of each room without problems, but if this file is linked in another revit file, and I try to get the spacial elements for those rooms from the otehr file it only gives me 110 of the 198 rooms.

0 Likes
Message 5 of 5

RPTHOMAS108
Mentor
Mentor

The shell of the room is going to be the internal space, intersecting this with a floor/ceiling (a boundary object) seems a dubious operation by description. You could graphically indicate here what you are trying to get the intersection of in order to highlight the result should be viable. 

 

For 1: You have to use Options class with a view of appropriate detail level or set the level of detail in the Options class.

For 2: I don't fully understand but you should just see groups as containers they have no geometry themselves really. They are not like blocks in AutoCAD (where one version is copied around) i.e. two groups the same have their own elements even though they are the same. Are you looking at instance or symbol geometry for the elements within?

For 3: You probably have to indicate some code for that (room calculation options may play a part). I would investigate which rooms don't return a solid and if there are any similarities for those.

0 Likes