Hi @lavairye
The CityGML surfaces will be converted to triangular meshes by the OBJ writer, but in order to count the resulting vertices, we can do the mesh conversion before writing, with the Triangulator transformer.
After the Triangulator, add a PythonCaller with the following code:
import fme
import fmeobjects
def meshStats(feature):
geom = feature.getGeometry()
numVerts = geom.numVertices()
feature.setAttribute("_numVertices", numVerts)
msurf = geom.getAsMultiSurface()
numTriangles = msurf.numParts()
feature.setAttribute("_numTriangles", numTriangles)
This will create two new attributes on the feature:
- _numVertices will contain the number of vertices in the Mesh
- _numTriangles will contain the number of triangles in the Mesh
Although the geometry in the Python is converted from a Mesh to a MultiSurface to get the number of triangles, that geometry is not written back to the feature, so the feature geometry will be unchanged.