You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
Rick Companje 41be8dcfd1 Update package.json 2 months ago
data reify code formatting fix 2 months ago
img added logo 4 years ago
models Slicer now slices d3sketch files instead of stl's 4 years ago
src update css 2 months ago
.babelrc add transform-class-properties 4 years ago
.eslintrc setting up linter 3 years ago
.gitignore move example 4 years ago
.npmignore move example 4 years ago
DOCS.md update docs 3 years ago
README.md rename base to default 4 years ago
comb.js update combing 3 years ago
favicon.ico add favicon 4 years ago
index.js reify code formatting fix 2 months ago
package-lock.json reify code formatting fix 2 months ago
package.json Update package.json 2 months ago
webpack.config.js reify code formatting fix 2 months ago

README.md

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.default,
  ...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.default,
  ...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