mirror of
https://github.com/Doodle3D/Doodle3D-Core.git
synced 2024-12-22 11:03:48 +01:00
don't regenerate hole mesh when not needed
This commit is contained in:
parent
da3e109cdd
commit
2b9eac38c7
7
src/d3/ShapeMesh.js
vendored
7
src/d3/ShapeMesh.js
vendored
@ -61,10 +61,12 @@ class ShapeMesh extends THREE.Object3D {
|
|||||||
if (!this._solid) return false;
|
if (!this._solid) return false;
|
||||||
if (holes === this._holes && !this._changedGeometry) return false;
|
if (holes === this._holes && !this._changedGeometry) return false;
|
||||||
|
|
||||||
this._holeMesh.geometry.dispose();
|
|
||||||
|
|
||||||
if (holes === null || !this._fill || this._type === 'EXPORT_SHAPE') {
|
if (holes === null || !this._fill || this._type === 'EXPORT_SHAPE') {
|
||||||
|
if (this._holeMeshIsOriginal) return false;
|
||||||
|
|
||||||
|
this._holeMesh.geometry.dispose();
|
||||||
this._holeMesh.geometry = new THREE.Geometry().fromBufferGeometry(this._mesh.geometry);
|
this._holeMesh.geometry = new THREE.Geometry().fromBufferGeometry(this._mesh.geometry);
|
||||||
|
this._holeMeshIsOriginal = true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,6 +79,7 @@ class ShapeMesh extends THREE.Object3D {
|
|||||||
|
|
||||||
this._holes = holes;
|
this._holes = holes;
|
||||||
this._changedGeometry = false;
|
this._changedGeometry = false;
|
||||||
|
this._holeMeshIsOriginal = false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user