mirror of
https://github.com/Doodle3D/Doodle3D-Slicer.git
synced 2024-12-22 19:13:50 +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) {
|
||||
let geometry;
|
||||
if (props.geometry.isGeometry) {
|
||||
geometry = props.geometry;
|
||||
} else if (props.geometry.isBufferGeometry) {
|
||||
geometry = new THREE.Geometry().fromBufferGeometry(props.geometry);
|
||||
}
|
||||
const { width, height, printers, geometry } = props;
|
||||
const { controlMode, printer } = state;
|
||||
|
||||
// center geometry
|
||||
geometry.computeBoundingBox();
|
||||
@ -24,9 +20,6 @@ export function createScene(canvas, props, state) {
|
||||
const centerZ = (geometry.boundingBox.max.z + geometry.boundingBox.min.z) / 2;
|
||||
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 });
|
||||
renderer.setClearColor(0xffffff, 0);
|
||||
renderer.setSize(width, height);
|
||||
|
Loading…
Reference in New Issue
Block a user