Problem with solid creation by TessellatedShapeBuilder

Problem with solid creation by TessellatedShapeBuilder

Erik_Wu
Participant Participant
3,338 Views
24 Replies
Message 1 of 25

Problem with solid creation by TessellatedShapeBuilder

Erik_Wu
Participant
Participant

I want to import some solids created by an external library into Revit with TessellatedShapeBuilder. All solids are correctly tessellated and closed. But I got sometimes the following error on calling TessellatedShapeBuilder.Build()

 

Could not Crate consistent vertext list

 

As far as I know there are some restriction about triangle. e.g. the distance between two vertex. I could merge two vertex in this case. But I dont know other restriction and how could I adjust my vertex list and triangle list to avoid the above error?

 

Thanks

Erik 

0 Likes
3,339 Views
24 Replies
Replies (24)
Message 21 of 25

jeremytammik
Autodesk
Autodesk

Dear Erik,

 

Thank you for your update.

 

How about gardening? Some people cultivate roses. I love the smell. I am more into vegetables myself. Food.  🙂

 

Another option is to search the Internet for a solution, e.g., for 'geometry eliminate sliver triangle':

 

https://duckduckgo.com/?q=geometry+eliminate+sliver+triangle

 

I see lots of lively discussions of that challenging topic.

 

Although, probably, your best bet is to use a powerful computational geometry library.

 

Two well-known ones are:

 

 

I hope this helps.

 

Please let us know if you end up growing anything beautiful or nourishing or both.

 

Best regards,

 

Jeremy

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 22 of 25

Erik_Wu
Participant
Participant

Dear Jeremy,

 

thanks for your information. Now it is time for barbecue 🙂

 

I could not eliminate the sliver triangle simply. As the following solid, it is a thin layer. If the labeled triangle is removed, the whole solid and its volume is changed what I don't expect. The geometry library I am using has no such limit. 

SmallAngle.PNG

 

Best Regards

Erik

0 Likes
Message 23 of 25

jeremytammik
Autodesk
Autodesk

Dear Eric,

 

Happy grilling!

 

I see two options: 

 

  • Split the long thin sliver triangle into a long series of smaller triangles that fill the entire sliver with pieces that are more triangular and less slivery, with all three corner angles greater than 1 degree.
  • Eliminate the long thin sliver triangle completely, leaving a small gap, and adjust the neighbouring triangle edges slightly to close the gap.

 

I hope this helps.

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 24 of 25

jeremytammik
Autodesk
Autodesk

Update: Erik reports that it sometimes does not work even if all triangles have been adjusted so no angle is smaller than 1 degree. Also, in some cases, it does work, even with angles that are smaller still, below 0.11 degrees. So, I reopened the development issue REVIT-130028 [TessellatedShapeBuilder solid creation throws Could not create consistent vertex list -- 14029415] and await further advice from the development team.

 

Cheers,

 

Jeremy

 

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 25 of 25

jeremytammik
Autodesk
Autodesk

Dear Erik,

 

The development team carefully analysed the issue REVIT-130028 [TessellatedShapeBuilder solid creation throws Could not create consistent vertex list -- 14029415] for you again with your new sample input data and report:

 

For the input data in TessellatedFaceTest3/GetData6, TessellatedShapeBuilder fails because the input contains overlapping adjacent triangles, in this case the triangles with indices 1313 and 1307 (these indices start at 0, not 1). The overlap means that the input does not represent a valid solid.

 

Ideally, the API author would be able to query diagnostic information when an error occurs, but it seems that TessellatedShapeBuilder does not preserve all the information it collects while processing the input data.

 

Specifics on the overlapping triangles:

 

The following lists the indices of the three vertices of each of the two triangles and the 3D coordinates of the four vertices used by the two triangles. All indices start at 0, not 1.

 

 

triangle[1313]: (275, 238, 204)
triangle[1307]: (236, 238, 275)

vertex[204]: (43.021174968, -134.267616735, 1041.113201778)
vertex[236]: (43.0033295, -134.621581121, 1041.100295416)
vertex[238]: (43.030770825, -134.077283172, 1034.944028842)
vertex[275]: (43.104820012, -132.608519508, 1041.353348379)

 

Since the TessellatedShapeBuilder correctly detected invalid input data for a solid, I'm closing this as "By Design".

 

It seems to me that you need to further improve your triangle generation and sample data testing to ensure you really are defining valid solids.

 

Best regards,

 

Jeremy

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes