Hi there,
does anybody have a mesh implementation for a polygon mesh (ideally with hole) ready or does anybody know about a project using such a mesh?
If there's nothing like that available, I would create such a mesh myself - in such case I'd appreciate feedback/suggestions on the API. Currently I would favour something like:
// polygons defined 2D plane, n > 2
// with vectors of first and last segment must not be parallel
// inner polygon must not intersect with outer polygon, but may have a joined
// point, but no joined segments
QPolygonMesh * mesh = new QPolygonMesh();
mesh->setPolygon(outerPolygon);
mesh->setInnerPolygon(innerPolygon);
mesh->setMaxSegmentLength(0.1);
// polygons defined 2D plane, n > 2
// with vectors of first and last segment must not be parallel
// inner polygon must not intersect with outer polygon, but may have a joined
// point, but no joined segments
QPolygonF outerPolygon = ...;
QPolygonF innerPolygon = ...;
QPolygonMesh * mesh = new QPolygonMesh();
mesh->setPolygon(outerPolygon);
mesh->setInnerPolygon(innerPolygon);
mesh->setMaxSegmentLength(0.1);
To copy to clipboard, switch view to plain text mode
Polygon would be created in x-z plane such, that p0 is the origin (0,0,0) (translating all polygon points accordingly).
What do you think?
-Andreas
Bookmarks