Go to file
2017-08-03 00:17:34 +02:00
example Updated API 2017-07-20 10:29:33 +02:00
simpleExample merge vertices of example 2017-07-28 10:48:46 +02:00
src add duration and filament usage 2017-08-03 00:17:34 +02:00
.babelrc Switching to babel 2017-07-20 11:20:43 +02:00
.gitignore simple example fixed 2017-07-20 12:12:25 +02:00
.npmignore Switching to babel 2017-07-20 11:20:43 +02:00
package-lock.json upgrade version 2017-07-24 17:56:59 +02:00
package.json Disable public publish to npm 2017-07-31 10:31:26 +02:00
README.md Merge remote-tracking branch 'origin/develop' into develop 2017-07-20 16:22:11 +02:00

Doodle3D-Slicer

JavaScript gcode slicer, Intended to use with the Doodle3D WiFi-Box

Usage

import * as THREE from 'three';
import { defaultSettings, sliceGeometry } from 'Doodle3D/Doodle3D-Slicer';

const settings = {
  ...defaultSettings.base,
  ...defaultSettings.material.pla,
  ...defaultSettings.printer.ultimaker2go,
  ...defaultSettings.quality.high
};

const geometry = new THREE.TorusGeometry(20, 10, 30, 30).clone();

const gcode = await sliceGeometry(settings, geometry);

API

Settings

import { defaultSettings } from 'Doodle3D/Doodle3D-Slicer';

const settings = {
  ...defaultSettings.base,
  ...defaultSettings.material.pla,
  ...defaultSettings.printer.ultimaker2go,
  ...defaultSettings.quality.high
};

Create settings object to be used by the slicer

Slice Mesh

import { sliceMesh } from 'Doodle3D/Doodle3D-Slicer';

GCode: String = sliceMesh(settings: Object, mesh: THREE.Mesh, [sync: Boolean = false, onProgress: Func ])

Slice function that accepts Meshes

  • Settings: settings object (see settings)
  • Mesh: THREE.Mesh instance that contains the geometry
  • Sync: determines if the slicing progress will be sync (blocking) or async (non-blocking). A webworker is used to slice async
  • onProgress: progress callback

Slice Geometry

import { sliceGeometry } from 'Doodle3D/Doodle3D-Slicer';

GCode: String = sliceGeometry(settings: Object, geometry: THREE.Geometry | THREE.BufferGeometry, [matrix: THREE.Matrix, sync: Boolean = false, onProgress: Func ])

Slice function that accepts Geometry

  • Settings: settings object (see settings)
  • Geometry: THREE.Geometry instance
  • matrix: matrix that can control the scale, rotation and position of the model
  • Sync: determines if the slicing progress will be sync (blocking) or async (non-blocking). A webworker is used to slice async
  • onProgress: progress callback