I am super impressed by your Goldberg polyhedra examples, here: https://playground.babylonjs.com/#A8VZGP#9
I would love to start using this in a game project. However, I am struggling to get access to the extended methods in my npm project (I have tried a variety of starter/template projects). Apologies if this is a rudimentary issue with my understanding of typescript, but I thought others may have the same issue.
This code from the playground referenced above is working:
const makeGoldberg = function(m, n) {
const goldberg = BABYLON.MeshBuilder.CreateGoldberg("g", {m: m, n: n});
const colset = [];
colset.push([0, 11, new BABYLON.Color4(247 / 255, 150 / 255, 70 / 255, 1)]);
for (let k = 0; k < 12; k++) {
colset.push([goldberg.relFace(k, 0), goldberg.relFace(k, goldberg.nbFacesAtPole - 1), new BABYLON.Color4(k % 2, Math.floor(k / 2) % 2, Math.floor(k / 4), 1)]);
}
goldberg.setFaceColors(colset);
return goldberg;
}
My code (below) fails to recognize setFaceColors. I have forked and modified a git repo (GitHub - andrewcantos/babylonjs-typescript-webpack-starter: babylonjs-typescript-webpack-starter) to show this error.
The offending lines:
// create goldberg polyhedron
let goldberg = BABYLON.MeshBuilder.CreateGoldberg("goldberg", {m: 12, n: 2});
goldberg.setFaceColors([0, 10, new BABYLON.Color4(1, 0, 0, 1)]);
Error:
Property 'setFaceColors' does not exist on type 'Mesh'.
Babylonjs version: 5.0.0-alpha.65