ZSLICEDOCS

Project

References and licenses

zslice is licensed under AGPL-3.0-or-later. See LICENSE.

This file lists each source that zslice uses. See the rules in AGENTS.md.

Code in the binaries

The zslice library, command line tool, and wasm module contain code from these projects. Their license texts are in licenses/.

ProjectLicenseTextNotes
Zig standard libraryMITlicenses/zig-std-MIT.txtThe compiler links the parts that zslice calls into each binary.
musl libc (math functions in the Zig standard library, for example atan2 and acos)MITlicenses/musl-MIT.txtThe Zig standard library has ports of musl math functions. The port keeps the musl notice.
Go (std.fmt.parseFloat in the Zig standard library is derived from Go strconv/atof.go)BSD-3-Clauselicenses/go-BSD-3-Clause.txtzslice parses numbers in ASCII STL files and in settings with parseFloat.
ARM optimized-routines (std.math.acos and std.math.atan in the Zig standard library)MIT (dual MIT OR Apache-2.0 WITH LLVM-exception; zslice uses the MIT terms)licenses/arm-optimized-routines.txtsrc/offset.zig uses acos for round joins. src/arachne/skeletal.zig uses atan (a port of musl and ARM) for the parabola steps.
Khronos Vulkan headers (vendor/vulkan/include, version 1.4.350, copied from charttable)Apache-2.0 (the headers say SPDX-License-Identifier: Apache-2.0; the repository also allows MIT)licenses/vulkan-headers.txt, licenses/apache-2.0.txtThe types of the Vulkan renderer. The headers have declarations only. zslice loads the Vulkan loader at run time and does not link it.
Zig compiler_rt (parts ported from LLVM compiler-rt)MIT, and Apache-2.0 WITH LLVM-exceptionlicenses/zig-std-MIT.txtThe LLVM exception removes the notice requirement for compiled code. The entry is here for completeness.
boost::polygon Voronoi, Andrii Sydorchuk, https://github.com/boostorg/polygon, commit ddb9c8adadbbb539fe52cb7f8ee0a446ba5ead04 (2 May 2025). "Copyright Andrii Sydorchuk 2010-2012."Boost Software License 1.0licenses/boost-BSL-1.0.txtsrc/voronoi.zig, src/voronoi_predicates.zig, and src/voronoi_ctypes.zig are a port to Zig of include/boost/polygon/voronoi_builder.hpp, voronoi_diagram.hpp, voronoi_geometry_type.hpp, detail/voronoi_structures.hpp, detail/voronoi_predicates.hpp, detail/voronoi_robust_fpt.hpp, and detail/voronoi_ctypes.hpp: the sweep line Voronoi diagram of points and segments, with robust predicates. The Arachne walls use it. Each file keeps the copyright line and names its sources.
CuraEngine, UltiMaker, https://github.com/Ultimaker/CuraEngine, commit 5eff812d2124b2eb93f832e92d33ccdba721135b (16 November 2026). "Copyright (c) 2026 UltiMaker". "CuraEngine is released under the terms of the AGPLv3 or higher."AGPL-3.0-or-laterLICENSE (the same AGPL-3.0 text as zslice)The Arachne walls (project.wall_generator = arachne) are a port to Zig of these files: src/arachne/SkeletalTrapezoidation.cpp, src/arachne/SkeletalTrapezoidationGraph.cpp, src/arachne/STHalfEdge.cpp, src/arachne/STHalfEdgeNode.cpp and their headers in include/arachne/ (SkeletalTrapezoidation.h, SkeletalTrapezoidationGraph.h, SkeletalTrapezoidationEdge.h, SkeletalTrapezoidationJoint.h, STHalfEdge.h, STHalfEdgeNode.h) to src/arachne/skeletal.zig; src/beading_strategy/BeadingStrategy.cpp, DistributedBeadingStrategy.cpp, RedistributeBeadingStrategy.cpp, WideningBeadingStrategy.cpp, OuterWallInsetBeadingStrategy.cpp, InnerWallInsetBeadingStrategy.cpp, LimitedBeadingStrategy.cpp, their headers in include/beading_strategy/, and src/utils/beading_strategy_factory.cpp to src/arachne/beading.zig; src/types/geometry/ExtrusionJunction.cpp, ExtrusionLine.cpp, PolylineStitcher.cpp, and the extrusion line parts of Simplify.cpp to src/arachne/extrusion.zig; src/WallToolPaths.cpp and src/types/geometry/MendedShape.cpp to src/arachne/walls.zig; the parts of src/utils/voronoi_utils.cpp that the trapezoidation uses (the parabola steps) to src/arachne/skeletal.zig. Each file keeps the copyright line and names its sources.

zslice has ports of the code of CuraEngine and boost::polygon (see above). It copies no other code.

Data in the binaries

The printer library (src/printers/library.txt) has data from the printer definitions of four slicers. tools/printer_library.py converts them: it reads the bed, the nozzle, the motion limits, the firmware, and the start and end G-code of each printer model, and writes one record for each model. The native C library (libzslice, which the GTK app links) embeds the file (src/printers.zig). The wasm module does not embed it: the web app loads the file as printers.txt. The license texts of the sources are in all binaries, the wasm module too. The header of the file names the sources and their versions.

SourceLicenseTextNotes
Cura printer definitions, UltiMaker, https://github.com/Ultimaker/Cura, resources/definitions and resources/extruders, commit 1a221ec29a86960d16a412940becc1f63534c41f (9 November 2026)LGPL-3.0-or-later ("Cura is released under the terms of the LGPLv3 or higher")licenses/lgpl-3.0.txt (from the Cura repository), licenses/gpl-3.0.txt (the LGPL-3.0 adds to the GPL-3.0)The values of the .def.json files, and the G-code with the variables of zslice. The LGPL-3.0 allows the use in a work under the AGPL-3.0.
PrusaSlicer vendor bundles, Prusa Research, https://github.com/prusa3d/PrusaSlicer, resources/profiles/*.ini, tag version_2.9.7 (commit 450d70dd81c9b8990bc6bc8e690e31f82ddceb11). The main branch moved the bundles out of the repository, so the tool uses the last release.AGPL-3.0 (the license of the PrusaSlicer repository)LICENSE (the same AGPL-3.0 text as zslice)The [printer_model:*] and [printer:*] sections, with their inherits.
OrcaSlicer profiles, https://github.com/SoftFever/OrcaSlicer, resources/profiles, commit e76b4d676c74f43ee1736675e0e8894425179cc4 (17 November 2026)AGPL-3.0 (the license of the OrcaSlicer repository)LICENSEThe machine_model and machine presets of each vendor, with their inherits.
Cura LulzBot Edition resources, FAME 3D (LulzBot), https://github.com/lulzbot3d/CuraLE_Resources, definitions and extruders, commit e44e13dedd1a055e956deced8723bec0ae7966be (31 January 2025)LGPL-3.0 (the LICENSE file of the repository)licenses/lgpl-3.0.txt, licenses/gpl-3.0.txtThe LulzBot printers (TAZ Workhorse, TAZ Pro, TAZ 5 to 8, Mini, SideKick, Bio) in the Cura format. LulzBot comes first for its own printers. The nozzle of a tool head is in its name ("SE 0.50 mm"): the tool takes it from there.

Data next to the binaries

The bed models of the printers are files in src/printers/beds/: 456 meshes (.mesh) and 280 textures (.png), 10.5 MB in all. No binary and no wasm module contains them. The GTK app installs them in share/zslice/beds, and zig build web puts them in zig-out/web/app/beds. A shell loads the two files of the current printer (zs_printers_bed, zs_view_set_bed). The D lines of src/printers/library.txt name the files, and the P line of each printer model links its D line: 830 of the 1080 models have a bed, 813 with a mesh and 549 with a texture.

tools/printer_library.py --beds makes the files with tools/printer_beds.py. The tool reads the bed files of the four sources below, converts them (a mesh in printer axes with 16-bit coordinates and at most 5000 triangles; a PNG of at most 1024 pixels with 64 colors), and writes each file once. The bed of a model comes from the first of its records that has one, in the order of the library (the vendor bundle of a brand first, then OrcaSlicer, PrusaSlicer, Cura).

The bed files have no license notes of their own: no license or readme file is in the mesh, image, or vendor folders, and no mesh, SVG, or PNG file has license metadata. So the license of the repository covers them. The exceptions are in the notes of each row.

SourceLicenseTextWhat zslice takes
Cura, UltiMaker, https://github.com/Ultimaker/Cura, resources/meshes and resources/images, commit 1a221ec29a86960d16a412940becc1f63534c41f (9 November 2026)LGPL-3.0-or-later (the license of the repository)licenses/lgpl-3.0.txt, licenses/gpl-3.0.txtThe platform mesh (STL, OBJ, 3MF) of each definition, with platform_offset, and the platform_texture of an OBJ platform with UV coordinates. 275 models. The RatRig meshes (ratrig_*.stl) came to Cura from https://github.com/slic3r/slic3r-profiles (AGPL-3.0) "with kind permission of the author" (Cura commit f6cc7993e).
PrusaSlicer vendor bundles, Prusa Research, https://github.com/prusa3d/PrusaSlicer, resources/profiles/<vendor>/, tag version_2.9.7 (commit 450d70dd81c9b8990bc6bc8e690e31f82ddceb11)AGPL-3.0 (the license of the repository)LICENSEThe bed_model STL and the bed_texture SVG or PNG of each [printer_model:*] section. 145 models.
OrcaSlicer profiles, https://github.com/SoftFever/OrcaSlicer, resources/profiles/<vendor>/, commit e76b4d676c74f43ee1736675e0e8894425179cc4 (17 November 2026)AGPL-3.0 (the license of the repository)LICENSEThe bed_model STL and the bed_texture SVG or PNG of each machine_model preset. 410 models.
Cura LulzBot Edition resources, https://github.com/lulzbot3d/CuraLE_Resources, meshes/bed_plates, commit e44e13dedd1a055e956deced8723bec0ae7966beLGPL-3.0 (the license of the repository; meshes/README.md adds no terms)licenses/lgpl-3.0.txtThe bed plates of the LulzBot printers, placed as Cura places them (platform_offset).

Left out:

Some textures show the logo of a brand. The logos are trademarks of their owners; the license of the files is not a license of the trademarks.

The shells link these libraries as shared libraries from the system. Their code is not in a zslice binary. The Licenses window of each shell lists them.

ShellLibraryLicense
Linux (linux/)GTK 4LGPL-2.1-or-later
Linux (linux/)GLibLGPL-2.1-or-later
Linux (linux/)cairoLGPL-2.1-only OR MPL-1.1
Linux (linux/)libsoup 3 (HTTP for the printer connections)LGPL-2.0-or-later
Linux (linux/)json-glib (the JSON of the printer APIs)LGPL-2.1-or-later
macOS (macos/)The system frameworks of macOS: SwiftUI, AppKit, Metal, QuartzCore, ImageIO, UniformTypeIdentifiers, AVFoundation, Network, CryptoKit, SecurityApple system frameworks, part of macOS

Algorithms, formats, and conventions

These sources gave methods or formats. zslice does not copy their code. Each zslice file that uses a source names it in its header comment.

SourceLicenseUsed inHow zslice uses it
Clipper2, Angus Johnson. https://github.com/AngusJohnson/Clipper2Boost Software License 1.0src/offset.zigThe offset method: move each edge along its normal, join at the vertices (miter, round, or a loop through the original vertex at a closing corner), then a union with the "positive" fill rule. zslice has its own implementation.
Bala R. Vatti, "A generic solution to polygon clipping", Communications of the ACM 35(7), 1992Papersrc/clip.zigNamed as the sweep-line method that Clipper uses. zslice uses a different method (planar arrangement and winding numbers).
Winding numbers and fill rules (even-odd, non-zero, positive)General computational geometry; the names follow the SVG and PostScript fill rules and Clipper2src/clip.zig, src/offset.zigThe rule that decides if a point is inside a polygon set.
Shoelace formula for polygon areaMathematicssrc/geom.zigThe signed area of a polygon.
John Amanatides and Andrew Woo, "A Fast Voxel Traversal Algorithm for Ray Tracing", Eurographics 1987Papersrc/clip.zigThe walk of an edge through the cells of the uniform grid that finds candidate crossings.
Doubly connected edge list (half-edge structure), as in de Berg et al., "Computational Geometry: Algorithms and Applications"Textbook methodsrc/clip.zigThe faces of the arrangement, walked to find the winding numbers.
Cura profile files (Ultimaker Cura, https://github.com/Ultimaker/Cura): .def.json definitions with inherits and overrides, .inst.cfg files with a [values] section, .xml.fdm_material materials, and the setting namesLGPL-3.0 (Cura; the formats and the names, not code)src/import_cura.zig, src/cura_compare.zigThe import of a Cura profile stack, and the comparison of the zslice settings with it.
The Cura configuration folders (Ultimaker Cura, https://github.com/Ultimaker/Cura): active_machine in cura.cfg, the stack files in machine_instances/ and extruders/ with their [containers] list (user, quality_changes, intent, quality, material, variant, definition_changes, definition), the container folders of the user and of the resources, and the file names with the URL escapes of Python quote_plusLGPL-3.0 (Cura; the layout, not code)linux/src/prefs/cura-stack.cThe GTK app finds the stack of the active Cura printer for "Compare with Cura".
TOML v1.0.0, https://toml.io/en/v1.0.0MIT (the specification)src/toml.zig, src/profile.zigThe profile file format. zslice parses a subset.
GitHub REST API, https://docs.github.com/rest (GET /repos/{owner}/{repo} for default_branch, GET /repos/{owner}/{repo}/commits/{ref} for sha, GET /repos/{owner}/{repo}/git/trees/{sha}?recursive=1), the files at raw.githubusercontent.com/{owner}/{repo}/{sha}/{path}, and the Git LFS pointer file (https://github.com/git-lfs/git-lfs, docs/spec.md: a small text file that starts with version https://git-lfs) with the file at media.githubusercontent.com/media/{owner}/{repo}/{sha}/{path}The APIs and the format (facts, no code)web/app/project.js, linux/src/net/project-source.cOpen a printdeck.yml project from a public repository with no login.
OctoPrint REST API, https://docs.octoprint.org/en/master/api/ (/api/printer, /api/printerprofiles, /api/job, /api/files/local, the X-Api-Key header)AGPL-3.0 (OctoPrint; the API, not code)linux/src/net/printer-link.c, tools/farm_sim/farm_sim.pyRead the state of a printer, and send G-code to it. printdeck has the same API.
The App Keys plugin of OctoPrint, https://docs.octoprint.org/en/master/bundledplugins/appkeys.html (POST /plugin/appkeys/request with the app name, then GET /plugin/appkeys/request/<app_token>: 202 wait, 200 with api_key, 404 denied)AGPL-3.0 (OctoPrint; the API, not code)linux/src/net/printer-link.c, web/app/link.js"Get a key": the printer asks its user to allow zslice, and gives zslice an API key of its own. printdeck has the same flow.
RFC 1035 (DNS messages and name compression), RFC 6762 (Multicast DNS), and RFC 6763 (DNS-Based Service Discovery), https://www.rfc-editor.orgIETF RFCs (the formats)src/discovery.zigThe query packet (PTR questions with the unicast bit) and the reading of the PTR, SRV, TXT, and A records of an answer. A query from a port other than 5353 gets a unicast answer (RFC 6762, section 6.7).
The service types of printer servers: _octoprint._tcp of the OctoPrint discovery plugin (https://github.com/OctoPrint/OctoPrint, src/octoprint/plugins/discovery/__init__.py, AGPL-3.0), _moonraker._tcp of the Moonraker zeroconf component (https://github.com/Arksine/moonraker, moonraker/components/zeroconf.py, GPL-3.0), _prusalink._tcp and _octoprint._tcp of PrusaLink (https://github.com/prusa3d/Prusa-Link, prusa/link/service_discovery.py, GPL-3.0), and the printdeck service file (os/board/rootfs/usr/lib/systemd/dnssd/printdeck.dnssd: _octoprint._tcp, port 80)The names and the TXT keys (facts, no code)src/discovery.zigThe service types that the finder asks for, and the TXT keys path, model, and version. The text of /api/version tells printdeck ("Printdeck") and PrusaLink from OctoPrint. The toolhead object of Klipper through Moonraker (/printer/objects/query?toolhead, axis_minimum and axis_maximum) gives the size of the bed. PrusaSlicer (src/slic3r/GUI/BonjourDialog.cpp) also finds printers as _octoprint._tcp with the TXT keys version and model.
The printer definition formats: Cura .def.json (inherits, metadata, overrides with default_value and value), PrusaSlicer vendor bundles (INI sections [printer_model:*] and [printer:*], inherits lists, bed_shape), and OrcaSlicer vendor profiles (machine_model and machine presets, instantiation, printable_area)LGPL-3.0 (Cura), AGPL-3.0 (PrusaSlicer, OrcaSlicer); the formats, no codetools/printer_library.py, src/printers.zigThe converter reads these formats. The simple G-code variables of the three slicers get the names of zslice; the other variables and the scripts stay, for the core (see the next line). Newer OrcaSlicer profiles keep the G-code of a Bambu Lab preset in a preset of its own ("<preset> template machine_start_gcode"). CuraEngine heats the bed and the nozzle before a start G-code with no heat commands (machine_start_gcode), so the converter adds them to such a Cura G-code.
The G-code variables and the macro languages of the start and end G-code: the Cura settings of fdmprinter.def.json and the Cura 5 start G-code syntax ({name}, {name, extruder}, {if}, {elif}, {else}, {endif}), https://github.com/Ultimaker/Cura; the PrusaSlicer macro language and list of placeholders (https://help.prusa3d.com/article/macros_1775 and https://help.prusa3d.com/article/list-of-placeholders_205643); the OrcaSlicer placeholder list (https://github.com/SoftFever/OrcaSlicer/wiki, "Built-in placeholders variables"); the Bambu Studio placeholders in its machine presets (through the OrcaSlicer BBL profiles); the object model expressions of RepRapFirmware (https://docs.duet3d.com, "GCode Meta Commands")LGPL-3.0 (Cura), AGPL-3.0 (PrusaSlicer, OrcaSlicer, Bambu Studio); the names, the syntax, and the documented behavior, no codesrc/gcode_vars.zig, src/gcode.zig, tools/profile_check.pyThe variable names of each slicer and the zslice value of each, the expression syntax ([name], {expr}, ? :, =~ /regex/, is_nil, local, if ... then), and the rule of PrusaSlicer and CuraEngine that heats the bed and the nozzle before a start G-code that does not. zslice has its own parser and its own small regular expression matcher. The acceleration commands of RepRapFirmware (M204 P T, M566 in mm/min, https://docs.duet3d.com/User_manual/Reference/Gcodes) and Repetier-Firmware (M201, M207, https://github.com/repetier/Repetier-Firmware)
Moonraker API, https://moonraker.readthedocs.io/ (/printer/objects/query, /server/files/upload)GPL-3.0 (Moonraker; the API, not code)linux/src/net/printer-link.c, tools/farm_sim/farm_sim.pyThe same, for Klipper printers.
printdeck deck API (same author, AGPL-3.0), deck/internal/octoapi of printdeck: /api/plugin/printdeck (the filament, the spools, the job)AGPL-3.0linux/src/net/printer-link.cThe filament in the printer, for "Use the filament in the printer".
G-code over a serial port: one command, then wait for the line ok (the Marlin and RepRap host protocol), https://reprap.org/wiki/G-codeProtocollinux/src/net/printer-link.cThe USB connection.
Tree support: the idea of branches that hold overhangs at points and join on the way down, as in Cura "tree support" (LGPL-3.0/AGPL-3.0) and PrusaSlicer "organic support" (AGPL-3.0)Idea; no codesrc/tree_support.zigzslice has its own method: tips on a fixed grid, moves limited by the branch angle, joins of nodes that touch, and a radius that gets smaller in narrow spaces. The wider foot of a branch on the bed is the idea of the Cura setting "Branch Diameter on the Build Plate" (support_tree_bp_diameter); zslice has its own rule and code. A hollow branch (one wall loop, no lines inside) is the idea of the Cura tree defaults (support_wall_count 1, support_infill_rate 0). A travel from support to support with no retraction is the idea of the Cura setting "Limit Support Retractions" (limit_support_retractions). zslice has its own rules: the solid layers at the foot and under the tip, the join of a circle into a circle that holds it, and the test that the travel crosses no edge of the part.
Lightning infill, Ultimaker Cura 4.12 (December 2021), https://github.com/Ultimaker/Cura/releases/tag/4.12.0, implemented in CuraEngine (https://github.com/Ultimaker/CuraEngine)AGPL-3.0 (CuraEngine); the method only, no code copiedsrc/lightning.zigThe idea of the pattern: branches only under the top surfaces, grown from the top down, joined into trees that end at the walls, and shortened on each layer down by an angle. zslice has its own method and code (see the file header).
Thibault Tricard, Frédéric Claux, and Sylvain Lefebvre, "Ribbed Support Vaults for 3D Printing of Hollowed Objects", Computer Graphics Forum 39(1), 2020, https://diglib.eg.org/handle/10.1111/cgf13750Papersrc/lightning.zigThe method that the Cura lightning infill comes from: walls under the surfaces of a hollow object that get smaller and straighter on the way down, and merge into the walls of the object.
Juraj Vanek, Jorge A. Garcia Galicia, and Bedrich Benes, "Clever Support: Efficient Support Structure Generation for Digital Fabrication", Computer Graphics Forum 33(5) (SGP 2014)Paper (prior art)src/lightning.zig, src/tree_support.zigTree-like support: points under an overhang that join on the way down. Listed as prior art of branch structures.
Autodesk Meshmixer tree supports (about 2014)Product (prior art)src/lightning.zigBranch supports that join on the way down. Listed as prior art.
Cura tree support (Ultimaker Cura, 2017 to 2018)LGPL-3.0/AGPL-3.0 (prior art; the idea, not code)src/lightning.zig, src/tree_support.zigBranch supports that join on the way down. Listed as prior art.
PrusaSlicer 2.3 "Support Cubic" infill (2020 to 2021), https://github.com/prusa3d/PrusaSlicerAGPL-3.0 (prior art; the idea, not code)src/lightning.zigInfill that is dense only near the top surfaces, where they need support. Listed as prior art.
Gap fill: PrusaSlicer "gap fill" (https://github.com/prusa3d/PrusaSlicer) and Cura "fill gaps between walls" (https://github.com/Ultimaker/Cura)AGPL-3.0 (PrusaSlicer), LGPL-3.0 (Cura); the idea, not codesrc/gapfill.zigThe idea: a line along the middle of each narrow area that no wall and no skin line covers, with the width of the area. zslice finds the areas with its own method and makes the lines with its Arachne port (see "Code in the binaries").
Ivan E. Sutherland, Gary W. Hodgman, "Reentrant polygon clipping", Communications of the ACM 17(1), 1974Papersrc/gapfill.zigThe cut of a polygon to a box, one side of the box at a time.
STL file format, 3D Systems. Description: https://en.wikipedia.org/wiki/STL_(file_format)File formatsrc/mesh.zigThe binary and ASCII STL loader and the binary STL writer.
Steven Fortune, "A sweepline algorithm for Voronoi diagrams", Algorithmica 2, 1987Papersrc/voronoi.zigThe sweep line method of the Voronoi diagram, which boost::polygon extends to segments. The code is a port of boost::polygon (see "Code in the binaries").
Tim Kuipers, Eugeni L. Doubrovski, Jun Wu, Charlie C. L. Wang, "A framework for adaptive width control of dense contour-parallel toolpaths in fused deposition modeling", Computer-Aided Design 128, 2020Papersrc/arachne/The Arachne method: the skeletal trapezoidation of the medial axis, the beading strategies, and the transitions between bead counts. The code is a port of CuraEngine (see "Code in the binaries").
Integer coordinates in micrometers, as in CuraEngine (https://github.com/Ultimaker/CuraEngine)AGPL-3.0src/geom.zigThe coordinate unit. CuraEngine uses 1 unit = 1 micrometer (include/types/Coord_t.h). zslice uses the same unit. No code is copied.
CuraEngine G-code comments: ;FLAVOR:, ;LAYER_COUNT:, ;LAYER:n, ;TYPE:WALL-OUTER, WALL-INNER, SKIN, FILLAGPL-3.0 (the convention, not code)src/gcode.zigThe comment names, so that G-code viewers and printdeck (deck/internal/gcode/gcode.go) find the layers and features.
The gyroid, a triply periodic minimal surface (Alan Schoen, 1970), with the common approximation sin x cos y + sin y cos z + sin z cos x = 0. Gyroid infill is in CuraEngine and PrusaSlicerMathematics (the surface); general slicer technique (its use as infill)src/infill.zigThe gyroid infill pattern. zslice solves the equation for one coordinate in closed form.
The Slic3r flow model: the cross section of an extruded bead is a rectangle with half circles on the sides (Slic3r and PrusaSlicer, Flow.cpp, and the Slic3r manual)AGPL-3.0 (the model, not code)src/flow.zigThe plastic volume for each line, and the bead width in the 3D view.
Scanline polygon fill (sort the edge crossings on each line, fill between them by winding number)General computer graphics techniquesrc/infill.zigThe line infill.
Combined infill: sparse infill printed once every n layers, as one taller bead. PrusaSlicer "Combine infill every n layers" (infill_every_layers, https://github.com/prusa3d/PrusaSlicer, from Slic3r) and Cura "Infill Layer Thickness" (infill_sparse_thickness, https://github.com/Ultimaker/CuraEngine) have it. Slic3r and PrusaSlicer limit the combined thickness to the nozzle diameterAGPL-3.0 (the idea and the limit, not code)src/layer.zig, src/engine.zigproject.infill_layers. zslice has its own method: groups from the bottom skin up, the area that is sparse in all layers of a group (with no band under a top), a bead of the group height from the flow model. No code was read or copied.
Cura project 3MF files (Ultimaker Cura, https://github.com/Ultimaker/Cura, plugins/3MFReader and plugins/3MFWriter): the per-object settings in <metadata name="cura:..."> entries of each object, in the namespace http://software.ultimaker.com/xml/cura/3mf/2015/10, the modifier volume flags (infill_mesh, cutting_mesh, anti_overhang_mesh, support_mesh), infill_mesh_order, and the setting names in fdmprinter.def.jsonLGPL-3.0 (Cura; the format and the names, not code)src/threemf.zig, src/import_cura.zig, src/part_settings.zigThe reader keeps the metadata of each object. The importer maps the per-object settings to zslice settings.
Infill meshes ("Modify settings for infill of other models") and infill_mesh_order in CuraEngine (https://github.com/Ultimaker/CuraEngine, FffPolygonGenerator::processInfillMesh): the volume does not print; inside it, the infill of the other meshes gets the settings of the volume, and the mesh with the higher order wins an overlapAGPL-3.0 (the behavior, not code)src/layer.zig, src/engine.zig, src/part_settings.zigThe modifier volumes of zslice (layer.Modifier). zslice has its own method: the area of a volume on each layer, cut from the sparse area (and the skin area, if the volume has no top and no bottom thickness) of the part. No code was copied.
The trihexagon infill pattern of CuraEngine (Infill::generateTrihexagonInfill: three line sets at 0, 60, and 120 degrees, the third moved by half the line distance), the infill line distance of each pattern (infill_line_distance: line width / density times 2 for grid, 3 for triangles, trihexagon, and cubic), and the list of infill angles (infill_angles, one angle for each layer in turn; Cura measures the angle from the Y axis)AGPL-3.0 (the patterns and the conventions, not code)src/layer.zig, src/import_cura.zig, src/settings.ziginfill_pattern = trihexagon, the density from infill_line_distance, and project.infill_angles. The pattern was compared with the G-code of CuraEngine 5.14 on a box.
Triangle, cubic, and concentric infill, as in CuraEngine and PrusaSlicerGeneral slicer technique (the patterns, not code)src/layer.zig, src/infill.zigThe triangles, cubic, and concentric infill patterns.
Greedy nearest-neighbor path orderGeneral techniquesrc/layer.zigThe order of the paths in a layer.
Junction deviation, Sonny Jeon, grbl (https://github.com/grbl/grbl, "Improving Grbl: Cornering Algorithm", 2011)MIT (grbl); the method, not codesrc/motion.zigThe speed limit at a junction of two moves, from the angle and the corner speed.
Klipper kinematics documentation, docs/Kinematics.md (https://www.klipper3d.org/Kinematics.html): look-ahead, the square corner velocity, and the minimum cruise ratioGPL-3.0 (Klipper); the method, not codesrc/motion.zigThe look-ahead passes, the junction speed from the square corner velocity, the limit of the arc to the middle of each move, the extruder corner speed, and the peak of a group of moves with the minimum cruise ratio. zslice has its own implementation.
Order by island: all paths of one connected part of a layer before the next part, as the "layer parts" of CuraEngine (AGPL-3.0) and the islands of PrusaSlicer (AGPL-3.0)General slicer technique (the order, not code)src/layer.zigThe plan prints the walls, skin, infill, and ironing of one island, then goes to the nearest island that is not done.
Mathematical morphology "opening" (erode, then dilate)General techniquesrc/offset.zig, src/layer.zigRemoves skin areas that are too thin to print.
Slab index (bucket edges into equal bands of one axis, then cast a ray only against one band)General techniquesrc/clip.zigFinds the edges that a winding ray crosses.
Compressed sparse row (CSR) layout: one array of items and one array of start offsetsGeneral techniquesrc/clip.zig, src/slicer.zigThe slab index and the per-layer face index.
Cut plane at the middle of each layerGeneral slicing practicesrc/slicer.zigThe z where the mesh is cut for each layer.
Joining cut segments by the ID of the mesh edge that they crossGeneral mesh techniquesrc/slicer.zigMakes closed loops from the segments of a layer without a coordinate tolerance.
Polyline simplification with an anchor point and a distance boundGeneral techniquesrc/geom.zigRemoves points that change a shape by less than the tolerance.
PrusaSlicer G-code comment name ;TYPE:Ironing (https://github.com/prusa3d/PrusaSlicer)AGPL-3.0 (the convention, not code)src/gcode.zigzslice writes ;TYPE:IRONING. printdeck reads the name in lowercase.
Ironing: a pass of the hot nozzle with a small flow over a top surface, as in PrusaSlicer and CuraGeneral slicer technique (the method, not code)src/layer.zig, src/slope.zigPlanar ironing of top surfaces, and slope ironing over the filled steps, at the height of the filled step at each point.
Lookout Marine, linux/src/engine/surface.c (same author, MIT license)MITlinux/src/ui/native-surface.cAdapted: a Wayland subsurface under the GTK window, with an empty input region, for the Vulkan view.
charttable, src/gpu/gpu_vk.zig (same author, MIT license)MITsrc/render/vk.zigThe structure of the Vulkan backend: run-time loading of the loader, a surface from the shell, a swapchain sized by the host, a UNORM swapchain format, and SPIR-V words copied at comptime. The code is new.
Lookout Marine (same author): a Zig core with a C API and one native shell for each platformSame authorsrc/app.zig, linux/The structure of the app: the core has the logic, and each shell draws widgets, does file I/O, and moves events to its UI thread.
Grid ("normal") support: overhang by angle, columns down to the bed or the part, XY and Z gaps, dense interface layers. As in CuraEngine and PrusaSlicerGeneral slicer technique (the method, not code)src/support.zigThe support areas of each layer.
PKWARE, ".ZIP File Format Specification" (APPNOTE.TXT), https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXTPublic specificationsrc/zipfile.zigThe zip records (local header, central directory, end record, and the zip64 records and extra field). The header structs and deflate come from the Zig standard library (MIT).
RFC 8032, "Edwards-Curve Digital Signature Algorithm (EdDSA)", https://www.rfc-editor.org/rfc/rfc8032IETF documentsrc/gcode_sign.zig, web/app/signing.js, linux/src/net/signing.c, macos/Sources/ZSlice/Core/Signing.swiftEd25519 signs the G-code files. The code is std.crypto.sign.Ed25519 of the Zig standard library (MIT) in the core, and WebCrypto in the browser. The test uses the key pair of test 1 of section 7.1.
NIST FIPS 180-4, "Secure Hash Standard", https://csrc.nist.gov/pubs/fips/180-4/upd1/finalPublic specificationsrc/gcode_sign.zig, web/app/signing.jsSHA-256 hashes the G-code before the signature, and makes the key id. The code is std.crypto.hash.sha2 of the Zig standard library (MIT), and WebCrypto in the browser.
RFC 4648, "The Base16, Base32, and Base64 Data Encodings", https://www.rfc-editor.org/rfc/rfc4648IETF documentsrc/gcode_sign.zigThe base64 of the keys and the signatures (std.base64.standard).
Apple, "Metal Shading Language Specification" and the Metal, AppKit, and SwiftUI documentation, https://developer.apple.com/documentation/Documentationmacos/Sources/ZSlice/Render/, macos/Sources/ZSlice/Views/The Metal API, the shader language, CAMetalLayer, the display link of a view (macOS 14), and the document windows of SwiftUI. The shaders port src/render/shaders/* to the Metal Shading Language. The code is new.
Uniform Type Identifiers: public.standard-tesselated-geometry-format (STL, a system type of macOS) and org.3mf.3mf (3MF, declared by the app)Apple documentationmacos/Info.plist, macos/Sources/ZSlice/ZSliceApp.swiftThe file types that the app opens.
RFC 1951 (DEFLATE) and RFC 1952 (the gzip file format, with the CRC-32), https://www.rfc-editor.org/rfc/rfc1952IETF RFCmacos/Sources/ZSlice/Core/Gzip.swiftThe gzip header and trailer around the raw DEFLATE stream of the Compression framework of Apple, for the estimate of a printdeck. The code is new.
3MF Consortium, "3MF Core Specification" 1.3 and "Production Extension", https://github.com/3MFConsortium/spec_coreBSD-2-Clause (the specification)src/threemf.zigThe 3MF package, the model file, objects, components, build items, transforms, and units. The code is new.
Christer Ericson, "Real-Time Collision Detection" (2005), 5.1.5: the closest point on a triangleGeneral computational geometry techniquesrc/plate.zig (pointTriangle2)The side of a part nearest to a picked point, for "this side on the bed".
Auto orientation of a part for less support (the method of the "Tweaker" auto-rotation of Cura and PrusaSlicer: score candidate directions by overhang area, bed contact, and height)General slicer technique (the method, not code)src/orient.zigThe best orientation of a part for the smart, less-support, and strength placements.
Iterated snap rounding (repeat the intersection pass on the rounded result)General computational geometry techniquesrc/clip.zigMakes the boolean operations robust after crossing points are rounded to the grid.
Least significant digit radix sort (a stable counting sort for each digit, from the low digit to the high digit)General techniquesrc/clip.zigSorts the cell entries of the crossing grid by cell.
A. M. Andrew, "Another efficient algorithm for convex hulls in two dimensions", Information Processing Letters 9(5), 1979 (the monotone chain)Papersrc/offset.zigThe convex hull of a loop, for the test that a loop vanishes in an offset.
A convex shape with an inscribed circle of radius r has area A >= r P / 2 (P is the perimeter)Mathematicssrc/offset.zigThe bound r <= 2 A / P on the largest circle in a convex hull.
Uniform grid search for the nearest point, ring by ringGeneral techniquesrc/layer.zigFinds the nearest path start in the greedy path order.
Memoization: keep a result with the inputs that made it, and use it again for the same inputsGeneral techniquesrc/layer.zig, src/engine.zigThe memo of each layer, which keeps the slow results between slices.
Arena allocators kept in a pool and reset between usesGeneral techniquesrc/scratch.zigThe work memory of the booleans and offsets.
Extra beads at Z heights between the layers, to fill the stair of a sloped surface: IBM, US 5,402,351 (filed 1991, expired)Expired; free to usesrc/slope.zigThe idea of the slope smoothing pass: after a layer, beads at heights between two layers fill the steps.
Hai-Chuan Song, Nicolas Ray, Dmitry Sokolov, Sylvain Lefebvre, "Anti-aliasing for fused filament deposition", Computer-Aided Design 89, 2017Papersrc/slope.zigSmall Z changes inside a layer, so that the edge of each layer follows the true surface between the layers. zslice uses the idea for its smoothing beads: a Z for each point between two layers.
Daniel Ahlers, Florens Wasserfall, Norman Hendrich, Jianwei Zhang, "3D Printing of Nonplanar Layers for Smooth Surface Generation", IEEE CASE 2019Papersrc/slope.zigNon-planar moves on top surfaces, and the check of the nozzle shape (a cone) against the printed part. zslice uses a cone on a flat tip, and checks it against the layer that it just printed, for the smoothing beads and the slope ironing.
Debapriya Chakraborty, B. Aneesh Reddy, A. Roy Choudhury, "Extruder path generation for Curved Layer Fused Deposition Modeling", Computer-Aided Design 40(2), 2008Papersrc/slope.zigExtrusion paths with a Z that changes along the path.
Volume of a triangle (h * L / 2) and the distance from a point to a segmentMathematicssrc/slope.zig, src/geom.zigThe plastic of a smoothing bead, and the room for the nozzle.
The bed placement of Cura: Uranium UM/Scene/Platform.py, the mesh readers plugins/FileHandlers/STLReader/STLReader.py and OBJReader/OBJReader.py (https://github.com/Ultimaker/Uranium, main of 17 November 2026, commit a5dab929d07c85eb4d96b18a50973da3a46fb8b7), and Cura plugins/3MFReader/ThreeMFReader.py (commit 1a221ec2)LGPL-3.0 (the rules, not code)tools/printer_beds.pyThe axes of each mesh format (the scene has y up; STL and OBJ turn (x, y, z) into (x, z, -y); a 3MF platform keeps the coordinates of its file), the origin at the bed center, platform_offset as the node position, and the UV of the OBJ file with the image mirrored.
The bed placement of PrusaSlicer: src/slic3r/GUI/3DBed.cpp (tag version_2.9.7)AGPL-3.0 (the rules, not code)tools/printer_beds.py, src/bed.zigThe origin of the model at the center of the bed shape, 0.03 mm down, and the texture over the box of the bed shape.
The LAN mode of Bambu Lab printers: the SSDP packets on UDP port 2021 (DevModel.bambu.com, DevName.bambu.com, USN), the .gcode.3mf layout (Metadata/plate_1.gcode and its .md5), the FTPS upload (port 990, user bblp, the access code), and the MQTT topics and messages (device/<serial>/request, project_file, pushall, the print report fields), as the Bambu Lab wiki and open source LAN tools describe them (for example the Home Assistant integration ha-bambulab, MIT)Public documents and tools; the formats and messages, no codesrc/discovery.zig, src/bambu.zig, src/app/printer_status.zig, macos/Sources/ZSlice/Core/Bambu.swiftzslice finds Bambu printers on the network, writes the file they print, and makes the messages that start a print and read its status. Not yet tested with a real printer.
The printdeck API (deck/internal/octoapi in https://github.com/beetlebugorg/printdeck): /api/plugin/printdeck (the roll, the limits, the job) and its queue (/api/plugin/printdeck/queue, the move and the delete of an item); a printdeck never starts a print by itselfAGPL-3.0 (printdeck; the API, not code)tools/farm_sim/farm_sim.pyThe simulated printdecks of the farm simulator answer as printdeck does, and keep a file in the queue until a press on the deck.
XcodeGen, https://github.com/yonaskolb/XcodeGenMIT (a tool; nothing of it goes into the app)macos/project.yml, macos/ZSlice.xcodeprojMakes the Xcode project of the macOS app from project.yml.
RFC 959 (FTP), https://www.rfc-editor.org/rfc/rfc959; RFC 4217 (FTP over TLS: PBSZ, PROT P, and the implicit TLS of port 990), https://www.rfc-editor.org/rfc/rfc4217; MQTT Version 3.1.1 (OASIS Standard), https://docs.oasis-open.org/mqtt/mqtt/v3.1.1/mqtt-v3.1.1.htmlPublic standardsmacos/Sources/ZSlice/Core/Bambu.swift, macos/tools/fake_bambu.pyThe FTPS upload (USER, PASS, TYPE I, PASV, STOR, the replies) and the MQTT packets (CONNECT, CONNACK, SUBSCRIBE, PUBLISH, DISCONNECT, the remaining length) of the Bambu link of the macOS app, and of its test server. The code is new.
The bed placement of OrcaSlicer: src/slic3r/GUI/3DBed.cpp and PartPlate.cpp (commit e76b4d67)AGPL-3.0 (the rules, not code)tools/printer_beds.py, src/bed.zigThe origin of the model at the center of the printable area, 0.45 mm down; the printer coordinates of the "bbl-3dp-" models; the texture over the box of the printable area, 12 mm more to the front for Bambu Lab.
PNG (Portable Network Graphics) Specification, W3C, https://www.w3.org/TR/png-3/W3C specificationsrc/bed.zigThe chunks, the filters of the rows (Paeth among them), and the color types of the texture reader. The zlib stream goes through std.compress.flate of the Zig standard library.

Test tools

zslice runs these programs in its test tools. No code of these programs is in zslice.

ProgramLicenseUsed inHow zslice uses it
CuraEngine (Ultimaker Cura 5.x), https://github.com/Ultimaker/CuraEngine, and the Cura definition files fdmprinter.def.json and fdmextruder.def.jsonAGPL-3.0 (CuraEngine), LGPL-3.0 (the definitions)tools/compare_cura.pyA test oracle. The script slices each STL file of the corpus with zslice and with CuraEngine, and compares the layer count, the filament, the time estimate, the speed, and the memory.
CuraEngine (Ultimaker Cura 5.x) and OrcaSlicer 2.5 (the orca-slicer command line, with the profiles of its Custom vendor), https://github.com/SoftFever/OrcaSlicerAGPL-3.0 (both); the definitions and profiles are data, no codetools/support_check.pyTest oracles for support. The script slices the same parts with zslice, CuraEngine (normal and tree support), and OrcaSlicer (normal and organic tree support), and compares the unsupported overhang area, the floating support, the support volume, and the time.
librsvg (rsvg-convert), https://gitlab.gnome.org/GNOME/librsvgLGPL-2.1-or-latertools/printer_beds.pyDraws the SVG bed textures as images.
Pillow, https://python-pillow.orgMIT-CMU (HPND)tools/printer_beds.pyReads, scales, and writes the texture images (PNG with a palette).
NumPy, https://numpy.orgBSD-3-Clausetools/printer_beds.pyThe arrays of the meshes, and the vertex clustering.