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

@antoninrousset/three-edge-projection

v0.0.3

Published

[![build](https://img.shields.io/github/actions/workflow/status/gkjohnson/three-edge-projection/node.js.yml?style=flat-square&label=build&branch=main)](https://github.com/gkjohnson/three-edge-projection/actions) [![github](https://flat.badgen.net/badge/ic

Readme

three-edge-projection

build github twitter sponsors

Edge projection based on three-mesh-bvh to extract visible projected lines along the y-axis into flattened line segments for scalable 2d rendering. Additonally includes a silhouette mesh generator based on clipper2-js to merge flattened triangles.

Examples

Geometry edge projection

Silhouette projection

Floor plan projection

Planar intersection

Use

Generator

More granular API with control over when edge trimming work happens.

const generator = new ProjectionGenerator();
generator.generate( geometry );

let result = task.next();
while ( ! result.done ) {

	result = task.next();

}

const lines = new LineSegments( result.value, material );
scene.add( lines );

Promise

Simpler API with less control over when the work happens.

const generator = new ProjectionGenerator();
const geometry = await generator.generateAsync( geometry );
const mesh = new Mesh( result.value, material );
scene.add( mesh );

API

ProjectionGenerator

.sortEdges

sortEdges = true : Boolean

Whether to sort edges along the Y axis before iterating over the edges.

.iterationTime

iterationTime = 30 : Number

How long to spend trimming edges before yielding.

.angleThreshold

angleThreshold = 50 : Number

The threshold angle in degrees at which edges are generated.

.includeIntersectionEdges

includeIntersectionEdges = true : Boolean

Whether to generate edges representing the intersections between triangles.

.generate

*generate(
	geometry : MeshBVH | BufferGeometry,
	options : {
		onProgress: ( percent : Number ) => void,
	}
) : BufferGeometry

Generate the edge geometry using a generator function.

.generateAsync

generateAsync(
	geometry : MeshBVH | BufferGeometry,
	options : {
		onProgress: ( percent : Number ) => void,
		signal: AbortSignal,
	}
) : Promise<BufferGeometry>

Generate the geometry with a promise-style API.

SilhouetteGenerator

Used for generating a projected silhouette of a geometry using the clipper2-js project. Performing these operations can be extremely slow with more complex geometry and not always yield a stable result.

.iterationTime

iterationTime = 10 : Number

How long to spend trimming edges before yielding.

.doubleSided

doubleSided = false : Boolean

If false then only the triangles facing upwards are included in the silhouette.

.sortTriangles

sortTriangles = false : Boolean

Whether to sort triangles and project them large-to-small. In some cases this can cause the performance to drop since the union operation is best performed with smooth, simple edge shapes.

.output

output = OUTPUT_MESH | OUTPUT_LINE_SEGMENTS | OUTPUT_BOTH

Whether to output mesh geometry, line segments geometry, or both in an array ( [ mesh, line segments ] );

.generate

*generate(
	geometry : BufferGeometry,
	options : {
		onProgress: ( percent : Number ) => void,
	}
) : BufferGeometry

Generate the geometry using a generator function.

.generateAsync

generateAsync(
	geometry : BufferGeometry,
	options : {
		onProgress: ( percent : Number ) => void,
		signal: AbortSignal,
	}
) : Promise<BufferGeometry>

Generate the silhouette geometry with a promise-style API.

PlanarIntersectionGenerator

.plane

plane : Plane

Plane that defaults to y up plane at the origin.

.generate

generate( geometry : MeshBVH | BufferGeometry ) : BufferGeometry

Generates a geometry of the resulting line segments from the planar intersection.