three-slicer-viewer displays G-code, 3mf projects and models, and it is MIT. It does
not slice. Slicing is plugged into it from three-slicer, which is AGPL. This guide
shows the three ways to set it up and which license each one puts your application under. The
policy itself is on the license page.
npm i three-slicer-viewer
import Viewport from 'three-slicer-viewer'
// Opens models, 3mf projects and G-code; no kernel, no presets.
<Viewport settings={settings} setSettings={setSettings} gcode={gcodeText} />
This is the whole viewer: model loading, the toolpath preview of any slicer's G-code,
.gcode.3mf print jobs, 3mf project open and save, and the settings panel. Without a
slicer plugged in, the Slice action reports that no slicer is attached. Without the extracted
data, the settings panel labels each field by its key. Everything here can ship in a
closed-source product.
Without React, the reader and the renderer are available directly:
import { parseGcode } from 'three-slicer-viewer/gcode'
import { buildSegmentData, makeToolpath } from 'three-slicer-viewer/toolpath'
npm i three-slicer
import Viewport, { useSlicer } from 'three-slicer-viewer' // MIT
import { makeSlicerWorker } from 'three-slicer/client' // AGPL — this import puts your app under the AGPL
import { bundledCatalog } from 'three-slicer/settings' // AGPL — OrcaSlicer's vendor presets
// Module level: it is called as a hook, so its identity must not change between renders.
const slicer = (deps) => useSlicer({ ...deps, makeWorker: makeSlicerWorker })
<Viewport slicer={slicer} catalog={bundledCatalog} settings={settings} setSettings={setSettings} />
With these imports the application contains AGPL code. If you distribute it, or offer it to users over a network — a website that slices in the browser does both — its complete source has to be available to those users under the AGPL.
The slicer at /slice is built this way, and its source is public for that reason.
useSlicer belongs to the MIT package. Its only link to a kernel is
makeWorker, a function that returns a Web Worker speaking the viewer's slicing
protocol:
import Viewport, { useSlicer } from 'three-slicer-viewer'
const slicer = (deps) => useSlicer({ ...deps, makeWorker: () => new Worker(myWorkerUrl, { type: 'module' }) })
<Viewport slicer={slicer} settings={settings} setSettings={setSettings} />
The application's license then depends on that worker. A worker containing no AGPL code keeps the
application under MIT. A worker built from OrcaSlicer, PrusaSlicer or three-slicer
sources is AGPL like they are. The protocol's reference implementation is
packages/engine/src/slicer.worker.js in the repository, and it is AGPL, so read it as a
specification rather than copying it.
| Your application imports | Can it slice? | License |
|---|---|---|
three-slicer-viewer only | No — viewing only | MIT |
three-slicer-viewer + your own AGPL-free worker | Yes | MIT |
Anything from three-slicer (/client, /settings, /viewer, /data, …) | Yes | AGPL-3.0-or-later |
A license-boundary test in the repository fails the build if three-slicer-viewer ever
imports three-slicer, so installing the viewer alone never pulls AGPL code in. This
guide summarizes the licenses and is not legal advice.