/** * Creates a 2D polygon with the provided vertices. * * @param vertices * List of vertices which will be copied. Each vertex should have * a position in 2D space, positions beyond 2D will be ignored. */ public DefaultWritablePolygon2D( final List< ? extends RealLocalizable > vertices ) { // Regions.getBoundsReal(...) could create an interval with n > 2, if // the first vertex had n > 2. Instead create 2D interval, and then set // min/max. super( 2 ); x = new VertexList( vertices.size() ); y = new VertexList( vertices.size() ); populateXY( vertices ); }