mirror of
https://github.com/Doodle3D/Doodle3D-Core.git
synced 2025-01-03 08:33:48 +01:00
Fix exporting stl
This commit is contained in:
parent
f243d98431
commit
f74baea9c3
6
src/d3/ShapeMesh.js
vendored
6
src/d3/ShapeMesh.js
vendored
@ -48,6 +48,8 @@ class ShapeMesh extends THREE.Object3D {
|
|||||||
this._color = color;
|
this._color = color;
|
||||||
this.updateSolid(solid, active);
|
this.updateSolid(solid, active);
|
||||||
this.updatePoints(shapeData);
|
this.updatePoints(shapeData);
|
||||||
|
|
||||||
|
this._shapeData = shapeData;
|
||||||
}
|
}
|
||||||
|
|
||||||
add(object) {
|
add(object) {
|
||||||
@ -61,7 +63,8 @@ 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;
|
||||||
|
|
||||||
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;
|
if (this._holeMeshIsOriginal && !this._changedGeometry) return false;
|
||||||
|
|
||||||
this._holeMesh.geometry.dispose();
|
this._holeMesh.geometry.dispose();
|
||||||
@ -81,6 +84,7 @@ class ShapeMesh extends THREE.Object3D {
|
|||||||
this._holes = holes;
|
this._holes = holes;
|
||||||
this._changedGeometry = false;
|
this._changedGeometry = false;
|
||||||
this._holeMeshIsOriginal = false;
|
this._holeMeshIsOriginal = false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,6 +60,7 @@ function createExportShapeData(shapeData, offsetSingleWalls, lineWidth) {
|
|||||||
...shapeData,
|
...shapeData,
|
||||||
transform: new Matrix(),
|
transform: new Matrix(),
|
||||||
type: 'EXPORT_SHAPE',
|
type: 'EXPORT_SHAPE',
|
||||||
|
originalFill: shapeData.fill,
|
||||||
fill,
|
fill,
|
||||||
shapes
|
shapes
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user