License Delivery maintenance is expected to occur on Saturday, November 30, between 8 AM and 11 AM CET. This may cause a short 3-hours outage in which license-related tasks: license key upload, download, update, SSA validation, access to the license pool and Graphisoft ID authentication may not function properly. We apologize for any inconvenience.
Archicad C++ API
About Archicad add-on development using the C++ API.

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

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!