TessellatedFace

TessellatedFace

pmeigneux
Advocate Advocate
536 Views
8 Replies
Message 1 of 9

TessellatedFace

pmeigneux
Advocate
Advocate

Hi,

 

for TessellatedFace(IList<IList<XYZ>> allLoopVertices, ElementId materialId) :

If I understood correctly the first parameter is a list of list of points.
The first list contains a list of triangles (3 points) which define the surface.
On the other hand, for the following lists I do not understand what must provide
because the first list provides only the "solid" surface without the holes.

 

Philippe.

0 Likes
537 Views
8 Replies
Replies (8)
Message 2 of 9

jeremy_tammik
Alumni
Alumni

The TessellatedFace constructor has two overloads:

  

https://www.revitapidocs.com/2023/915c466c-4dfa-15e6-6267-72fea11af27d.htm

  

Taking just a single list of points, it constructs a tessellated face without holes.

 

With a list of lists of points, you can construct a tessellated face that has holes.

 

The lists contain boundary vertices without duplication of the ends. The first array describes the outer loop, the following arrays, if any, inner loops. It is expected that vertices of outer boundary are listed in CCW order with respect to the face normal in the solid, and the vertices of inner loops in CW order.

 

There is no requirement for triangulation or any such thing.

 

I would recommend that you ensure that each individual list describes a simple polygon, i.e., a polygon that does not intersect itself and has no holes:

 

https://en.wikipedia.org/wiki/Simple_polygon

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
Message 3 of 9

pmeigneux
Advocate
Advocate

hello Jeremy,

If a tessellated surface contains a hole but the tesselated does not cover that hole. Is it possible to go through the method without a hole?
I don't have the tessellation of this hole.

 

Philippe.

 

0 Likes
Message 4 of 9

jeremy_tammik
Alumni
Alumni

I do not understand what you mean by "a tessellated surface contains a hole but the tessellated does not cover that hole". Is that not a contradiction in itself?

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 5 of 9

pmeigneux
Advocate
Advocate

hello,

 

example :

!------------------------------!

!   tessallated                          !

!        !--------------!               !

!        !  nothing       !               !

!        !--------------!               !

!-----------------------------!

Philippe.

Message 6 of 9

jeremy_tammik
Alumni
Alumni

If you want the hole in your result, pass in the outer four point CCW in the first list, and the inner four points CW in the second.

  

If you do not want the hole in your result, skip the inner four points. In that case, you can use either one of the two constructors.

  

I do not understand what you problem is with that.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
Message 7 of 9

pmeigneux
Advocate
Advocate

hi,

I receive a file which contains solids defined for each of its faces by a set of vertices of triangles and a set of edges. I don't have any more information.

 

Philippe.

Message 8 of 9

pmeigneux
Advocate
Advocate

Hi Jeremy,

 

for the tessellation should we only pass all the vertices of triangles or groups of 3 vertices?
example for a square defined for 2 triangles, I have to pass 4 points or 2x3 points.

 

Philippe.

Message 9 of 9

jeremy_tammik
Alumni
Alumni

Please read my initial answer above more carefully, or simply read the API documentation that I pointed out. I very clearly stated: There is no requirement for triangulation or any such thing. Just pass in an ordered list of vertices for a simple polygon.

    

I'll repeat this once again, just in case it helps:

  

Please read my initial answer above more carefully, or simply read the API documentation that I pointed out. I very clearly stated: There is no requirement for triangulation or any such thing. Just pass in an ordered list of vertices for a simple polygon.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open