Fix exporting stl

This commit is contained in:
casperlamboo 2017-12-14 14:11:19 +01:00
parent f243d98431
commit f74baea9c3
2 changed files with 6 additions and 1 deletions

6
src/d3/ShapeMesh.js vendored
View File

@ -48,6 +48,8 @@ class ShapeMesh extends THREE.Object3D {
this._color = color;
this.updateSolid(solid, active);
this.updatePoints(shapeData);
this._shapeData = shapeData;
}
add(object) {
@ -61,7 +63,8 @@ class ShapeMesh extends THREE.Object3D {
if (!this._solid) return false;
if (holes === this._holes && !this._changedGeometry) return false;
if (holes === null || !this._fill || this._type === 'EXPORT_SHAPE') {
const fill = this._shapeData.type === 'EXPORT_SHAPE' ? !this._shapeData.originalFill : !this._fill;
if (holes === null || fill) {
if (this._holeMeshIsOriginal && !this._changedGeometry) return false;
this._holeMesh.geometry.dispose();
@ -81,6 +84,7 @@ class ShapeMesh extends THREE.Object3D {
this._holes = holes;
this._changedGeometry = false;
this._holeMeshIsOriginal = false;
return true;
}

View File

@ -60,6 +60,7 @@ function createExportShapeData(shapeData, offsetSingleWalls, lineWidth) {
...shapeData,
transform: new Matrix(),
type: 'EXPORT_SHAPE',
originalFill: shapeData.fill,
fill,
shapes
};