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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@cadit-app/image-extrude

v0.5.0

Published

Image Extrude for CADit - Extrude shapes from SVG or bitmap images

Readme

@cadit-app/image-extrude

Extrude 3D shapes from SVG or bitmap images. Supports both tracing (for raster images) and sampling (for SVGs).

Image Extrude Preview

Features

  • Trace mode: Convert any bitmap image (PNG, JPG) to 3D by tracing edges (browser only)
  • Sample mode: High-fidelity conversion of SVG files to 3D
  • Configurable size: Set maximum width to control output dimensions
  • Despeckle: Remove small artifacts during tracing
  • CLI support: Generate GLB and 3MF files from command line

Installation

npm install @cadit-app/image-extrude

Usage

As a CADit Script

Open this script in CADit and edit parameters inside the browser.

CLI Usage

# Generate GLB from default Cookiecad logo
npx tsx cli.ts output.glb

# Generate from a specific image
npx tsx cli.ts output.glb --image=logo.svg --height=2 --maxWidth=50

# Generate 3MF
npx tsx cli.ts output.3mf --image=photo.png --mode=trace

CLI Options

| Option | Description | Default | |--------|-------------|---------| | --image=<path> | Path to image file (SVG, PNG, JPG) | Built-in Cookiecad logo | | --height=<mm> | Extrusion height in mm | 1 | | --maxWidth=<mm> | Maximum width in mm | 50 | | --mode=<trace\|sample> | Processing mode | trace | | --despeckle=<size> | Despeckle size for tracing | 2 |

Programmatic Usage

import imageExtrude from '@cadit-app/image-extrude';

// Use the defineParams API - returns 2D shapes (SceneOutput)
const result = await imageExtrude.main({
  mode: 'trace',
  imageFile: {
    dataUrl: 'data:image/png;base64,...',
    fileType: 'image/png',
    fileName: 'logo.png'
  },
  height: 2,
  maxWidth: 50,
  despeckleSize: 2,
  threshold: 0,
  invert: false
});

// result is a SceneOutput containing polygon shapes
console.log(result.objects); // Array of polygon shapes with holes

Creating CrossSections for Embedding

import { makeCrossSection } from '@cadit-app/image-extrude';

const crossSection = await makeCrossSection({
  imageFile: { dataUrl: '...', fileType: 'image/svg+xml' },
  mode: 'sample',
  maxWidth: 30
});

// Use in your own maker - extrude to get a Manifold
const manifold = crossSection.extrude(5);

Parameters

| Parameter | Type | Description | |-----------|------|-------------| | mode | 'trace' \| 'sample' | Trace for bitmaps, Sample for SVGs | | imageFile | object | Image data with dataUrl, fileType, fileName | | height | number | Extrusion height in mm | | maxWidth | number | Maximum width in mm | | despeckleSize | number | Remove spots smaller than this (trace only) |

License

MIT