I am replacing my closed line with polygon to fill colour in it. Below is what i am trying, but this is not reflecting on the scene.
Where as when i replacing Polygon with line mesh, it is getting plotted.
departmentBoundary.forEach((boundary, index) => {
const points: BABYLON.Vector3[] = this.getMultiLineToCoordinate(boundary.geom_outline);
const polygon = BABYLON.MeshBuilder.CreatePolygon(`department${index}`, { shape: points }, this.scene, earcut);
// const polygon = BABYLON.MeshBuilder.CreateLines(`department_${index}`, { points }, this.scene);
// polygon.color = BABYLON.Color3.Green();
material.diffuseColor = BABYLON.Color3.Green();
polygon.material = material;
polygon.parent = this.rootNode;
console.log('polygon', polygon);
this.nodes.push(polygon);
});
https://playground.babylonjs.com/#ZD60FU#113
expected (the below red lines should be with polygon)