I’ve pushed the new version of our app to our dev environment so you can see the result, you’re powering the compass cardinal points at The Iveria, 3bedroom, D9, 2020. Thank you!
For others who may want to do this, you could save them a bit of research by sharing the tree shakable imports needed in the README. They go as below:
import { Vector3, Vector2, Path2, Curve3, Color3 } from '@babylonjs/core/Maths/math'
import { Mesh } from '@babylonjs/core/Meshes/mesh'
import { StandardMaterial } from '@babylonjs/core/Materials/standardMaterial'
import { SolidParticleSystem } from '@babylonjs/core/Particles/solidParticleSystem'
import { PolygonMeshBuilder } from '@babylonjs/core/Meshes/polygonMesh'
import { CSG } from '@babylonjs/core/Meshes/csg'
import MeshWriter from 'meshwriter'
const babylonMethods = {
Vector2,
Vector3,
Path2,
Curve3,
Color3,
SolidParticleSystem,
PolygonMeshBuilder,
CSG,
StandardMaterial,
Mesh
}
const Writer = MeshWriter(scene, { methods: babylonMethods })
Thank you all for this.
Unfortunatly, I found a new error on BabylonJs v5.29.0 when calling MeshWriter with methodsObj specified as mentioned @tibotiber above.
SOLUTION : I solved the problem by editing line 64 of meshwriter.js
return csgShape.toMesh("Net-"+letter+i+"-"+weeid(), null, scene)
//just add 2 more params: null and scene
The error I got before :
I’m using BabylonJs with es6 classes, so for those it could be usefull
Darius, thank you. I have incorporated that change into the repositories at Babylon Extensions and also at briantbutton/meshwriter. I updated the NPM module to boot.
It might be worth loading it from one of those sources and checking to see if my changes matched yours.
I just got the new version from ‘‘npm i meshwriter’’, and it works fine.
Some may be confuse by error saying Mesh is required, just be aware of adding ‘‘Mesh’’ in ‘‘methodsObj’’ and not ‘‘Meshbuilder’’ in the required methods. I made same error