Set<Polygon> polygonSet = new HashSet<>();
for(int polygonIndex = 1; polygonIndex <= polygonsCount; polygonIndex++) {
polygonSet.add(polygonMap.get(((Number) xpath.evaluate("(face-id)[" + polygonIndex + "]",
faceNode, XPathConstants.NUMBER)).intValue()));
}
PolygonalSceneObject polygonalSceneObject = new PolygonalSceneObject(name, polygonSet);
sceneObjectSet.add(polygonalSceneObject);
logger.debug("Added SceneObject[{}]: {}", name , polygonalSceneObject);
}
} catch (XPathExpressionException e) {
logger.error("Wrong XPath expression:", e);