Developer forum
cancel
Showing results for 
Search instead for 
Did you mean: 

Element Bodies: Meshes, Tessellated meshes, Nurbs.

drjustice
Newcomer
Hi!

I am looking to extract triangles out of a ModerAPI::Element.

I see 3 methods:

GetTessellatedBody/Count()
GetMeshBody/Count()
GetNurbsBody/Count()

What do these return exactly?

Does the GetTessellatedBodyCount return the number of mesh+nurbs bodies?

In other words, if my object is a nurbs, will GetTessellatedBody return a polygonal tessellated version of the nurbs geometry?

Also, I read somewhere that tessellated bodies doesn't mean triangles, it only guarantees convex polygons. is this true?

Finally, let's say my element is a wall, will getting the tessellated bodies of the wall contain the openings, or will I just get a flat rectangle?

thx!
4 REPLIES 4

Viktor Kovacs
Graphisoft
Graphisoft
There are two types of bodies in the model:
- MeshBody: Body represented as planar polygon boundaries.
- NurbsBody: Body represented as a NURBS surface.

TessellatedBody is a helper class that contains the planar polygon boundary representation of the body regardless of it's original representation. So if you would like to have triangles, you can always use TessellatedBody, and don't have to use the other two types.

From a TessellatedBody you can access Polygon instances, and get ConvexPolygon instances from that polygon. A ConvexPolygon - as the name says - always convex, so you can easily triangulate it by forming a fan from the first vertex.

drjustice
Newcomer
Thank you. That's exactly the answer I was looking for. Cookies for you.

But also, an important part of the question that remained unaswered:

"let's say my element is a wall, will getting the tessellated bodies of the wall contain the openings, or will I just get a flat rectangle?"

Viktor Kovacs
Graphisoft
Graphisoft
The element will have all the holes. Openings will be separate elements, but their place will be cutted out from their owner element.

drjustice
Newcomer
That is most excellent, thanks

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!