Announcements
Autodesk Community will be read-only between April 26 and April 27 as we complete essential maintenance. We will remove this banner once completed. Thanks for your understanding

Face Class, Intersect() method problem

giancarlo.web
Contributor Contributor
1,434 Views
3 Replies
Message 1 of 4

Face Class, Intersect() method problem

giancarlo.web
Contributor
Contributor

I have two objects not touching or intersecting each other.

 

After extracting every face from each object and iterating through the collection i get unexpected result:

 

faceElement1[a].Intersect(faceElement2[b]) gives Intersecting as result

 

How can this be possible?

0 Likes
1,435 Views
3 Replies
Replies (3)
Message 2 of 4

RPTHOMAS108
Mentor
Mentor

Is it instance geometry or symbol geometry?

 

Presumably you have two face collections one for each element and are comparing each item from one against each item from the other?

0 Likes
Message 3 of 4

giancarlo.web
Contributor
Contributor

i have 2 walls, and each face collection reports correctly 6 faces

 

this is my workflow for collecting faces: 

 

 

                    GeometryElement geometryelem1 = (GeometryElement)join[e1].GetGeometryObjectFromReference(new Reference(join[e1]));
                    //Tutti i solidi nel primo GeometryObject
                    List<Autodesk.Revit.DB.Solid> solids1 = new List<Autodesk.Revit.DB.Solid>();
                    //Tutte le facce dei Solidi del primo GeometryObject
                    List<Autodesk.Revit.DB.Face> faces1 = new List<Autodesk.Revit.DB.Face>();

                    //inserisco  i solid1 nelle liste solids1
                    foreach (var element in geometryelem1)
                    {
                        solids1.Add((Autodesk.Revit.DB.Solid) element);
                    }

                    //inserisco le FacesArray di ogni solid nella lista arrays1
                    foreach (Autodesk.Revit.DB.Solid solid1 in solids1)
                    {
                        foreach (Autodesk.Revit.DB.Face face in solid1.Faces)
                        {
                            faces1.Add(face);
                        }
                    }
0 Likes
Message 4 of 4

RPTHOMAS108
Mentor
Mentor

Apparently faces are infinite with therefore many possible intersections beyond the range of the element itself.

 

So perhaps not the best approach for your needs.

 

In the image below the green lines are plotted using curves from the overload Face.Intersect(ByVal Face, ByRef Curve). Hard to understand at first why they all exist but once you trace along parallel to the faces you start to see all are valid.

 

WallIntersects.PNG 

 

0 Likes