Hi,
I’m wondering if I’m doing something wrong here, but when using cap on an extrusion reversing the order of points in the shape leads to weird behaviour :
To reproduce in the playground : comment and uncomment the reverse line. Is there a rule that the polygon needs to be direct , or with the path ? I’m trying to make solid filled parts
Thanks
const createScene = function () {
const scene = new BABYLON.Scene(engine);
const camera = new BABYLON.ArcRotateCamera("Camera", 3 * Math.PI / 2, Math.PI / 2, 30, BABYLON.Vector3.Zero());
camera.attachControl(canvas, true);
const light = new BABYLON.HemisphericLight("hemi", new BABYLON.Vector3(0, 50, 0));
//Shape profile in XY plane
const myShape = [
new BABYLON.Vector3(0, 5, 0),
new BABYLON.Vector3(1, 1, 0),
new BABYLON.Vector3(5, 0, 0),
new BABYLON.Vector3(1, -1, 0),
new BABYLON.Vector3(0, -5, 0),
new BABYLON.Vector3(-1, -1, 0),
new BABYLON.Vector3(-5, 0, 0),
new BABYLON.Vector3(-1, 1, 0)
];
myShape.reverse()
const myPath = [
new BABYLON.Vector3(0, 0, 0),
new BABYLON.Vector3(0, 0, -2),
new BABYLON.Vector3(0, 0, -4),
new BABYLON.Vector3(0, 0, -6),
new BABYLON.Vector3(0, 0, -8),
new BABYLON.Vector3(0, 0, -10)
];
const scaling = (index, distance) => {
return 1 / (index + 1);
};
const extrusion = BABYLON.MeshBuilder.ExtrudeShapeCustom("star", {shape: myShape, closeShape: true, path: myPath, cap: BABYLON.Mesh.CAP_ALL,}, scene);
return scene;
}