npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@jgphilpott/polyslice

v25.12.8

Published

An AI powered slicer designed specifically for three.js - slice meshes directly to G-code without intermediary file formats.

Readme

Polyslice

An AI powered slicer designed specifically for the three.js ecosystem and inspired by the discussion on this issue. The idea is to be able to go straight from a three.js mesh to a machine usable G-code, thus eliminating the need for intermediary file formats and 3rd party slicing software.

Polyslice is designed to streamline the 3D printing workflow. Whether you're designing models in three.js or loading existing STL, OBJ, or other 3D files, Polyslice can process them and generate machine ready G-code. With built-in support for popular 3D file formats and the ability to send G-code directly to your 3D printer via Web Serial API or serialport, the entire design-to-print workflow can happen seamlessly in a web browser or Node.js environment. This makes 3D printing more accessible and eliminates the friction of using multiple tools.

Installation

Node

npm install @jgphilpott/polyslice

Browser

<!-- Include three.js first -->
<script src="https://unpkg.com/[email protected]/build/three.min.js"></script>

<!-- Include Polyslice next -->
<script src="https://unpkg.com/@jgphilpott/polyslice/dist/index.browser.min.js"></script>

Quick Start

Here is a simple example to get you started:

// Require THREE, Polyslice, Printer and Filament (omit for browser)
const THREE = require("three");
const { Polyslice, Printer, Filament } = require("@jgphilpott/polyslice");

// Create the printer and filament objects
const printer = new Printer("Ender3");
const filament = new Filament("GenericPLA");

// Create the slicer instance with the printer, filament and other configs
const slicer = new Polyslice({
  printer: printer,
  filament: filament,
  infillPattern: "triangles",
  infillDensity: 30,
  testStrip: true,
  verbose: true
});

// Create a 1cm cube (10mm x 10mm x 10mm)
const geometry = new THREE.BoxGeometry(10, 10, 10);
const material = new THREE.MeshBasicMaterial({ color: 0x00ff00 });
const cube = new THREE.Mesh(geometry, material);

// Slice the cube and generate the G-code
const gcode = slicer.slice(cube);

To run this example locally follow these steps:

  1. Clone the Polyslice repo: git clone [email protected]:jgphilpott/polyslice.git
  2. Navigate into the repo directory: cd polyslice
  3. Install the node modules: npm install
  4. Compile the code: npm run compile
  5. Run the example script: node examples/scripts/quick-start.js

Features

Polyslice provides a comprehensive set of features for the 3D printing workflow:

| Feature | Description | Documentation | |---------|-------------|---------------| | 🚀 Direct three.js integration | Work directly with three.js meshes and scenes | Examples | | 📁 File format support | STL, OBJ, 3MF, AMF, PLY, GLTF/GLB, Collada | Loaders | | 📝 G-code generation | Full set of G-code commands for 3D printing | G-code | | ⚙️ Printer profiles | 44 pre-configured printer profiles | Printer Config | | 🧵 Filament profiles | 35 pre-configured filament profiles | Filament Config | | 🔲 Infill patterns | Grid, triangles and hexagons patterns (more coming) | Infill | | 🧱 Wall generation | Configurable wall thickness | Walls | | 🎨 Skin layers | Top/bottom solid layers with exposure detection | Skin | | 🏗️ Support structures | Automatic support generation | Support | | 🔌 Serial streaming | Send G-code directly to printers | Exporters | | 🌐 Universal | Works in Node.js and browsers | API |

Documentation

For detailed documentation, see the docs folder:

Contributing

Contributions are welcome! Please feel free to Open an Issue or submit a Pull Request.

License

MIT © Jacob Philpott