mirror of
https://github.com/Doodle3D/Doodle3D-Slicer.git
synced 2024-11-22 21:47:59 +01:00
don't convert geometry
This commit is contained in:
parent
c65a5a3df4
commit
9c233b1ab6
@ -10,12 +10,8 @@ export function placeOnGround(mesh) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function createScene(canvas, props, state) {
|
export function createScene(canvas, props, state) {
|
||||||
let geometry;
|
const { width, height, printers, geometry } = props;
|
||||||
if (props.geometry.isGeometry) {
|
const { controlMode, printer } = state;
|
||||||
geometry = props.geometry;
|
|
||||||
} else if (props.geometry.isBufferGeometry) {
|
|
||||||
geometry = new THREE.Geometry().fromBufferGeometry(props.geometry);
|
|
||||||
}
|
|
||||||
|
|
||||||
// center geometry
|
// center geometry
|
||||||
geometry.computeBoundingBox();
|
geometry.computeBoundingBox();
|
||||||
@ -24,9 +20,6 @@ export function createScene(canvas, props, state) {
|
|||||||
const centerZ = (geometry.boundingBox.max.z + geometry.boundingBox.min.z) / 2;
|
const centerZ = (geometry.boundingBox.max.z + geometry.boundingBox.min.z) / 2;
|
||||||
geometry.applyMatrix(new THREE.Matrix4().makeTranslation(-centerX, -centerY, -centerZ));
|
geometry.applyMatrix(new THREE.Matrix4().makeTranslation(-centerX, -centerY, -centerZ));
|
||||||
|
|
||||||
const { width, height, printers } = props;
|
|
||||||
const { controlMode, printer } = state;
|
|
||||||
|
|
||||||
const renderer = new THREE.WebGLRenderer({ canvas, alpha: true });
|
const renderer = new THREE.WebGLRenderer({ canvas, alpha: true });
|
||||||
renderer.setClearColor(0xffffff, 0);
|
renderer.setClearColor(0xffffff, 0);
|
||||||
renderer.setSize(width, height);
|
renderer.setSize(width, height);
|
||||||
|
Loading…
Reference in New Issue
Block a user