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

@ripl/3d

v1.4.0

Published

3D rendering for Ripl

Readme

@ripl/3d

npm license size

3D rendering for Ripl: shapes, lights, materials and textures, drawn onto a 2D canvas with a depth-sorted painter's algorithm, or on the GPU through @ripl/webgpu.

Features

  • Nine shapescube, sphere, cylinder, cone, plane, torus, mesh (raw faces), parametric (a tessellated surface function) and bezier surface (bicubic patches).
  • Five light typescreateAmbientLight, createHemisphereLight, createDirectionalLight, createPointLight and createSpotLight, each with colour, intensity and an enabled flag; directed lights are fixed in world space or locked to the camera. Point and spot lights add distance falloff (distance, decay) and spot lights a cone (angle, penumbra).
  • Materialscolor, opacity, emissive, emissiveIntensity, specular, shininess, side ('front' | 'back' | 'double'), wireframe, flatShading, vertexColors and map. Every property is optional; an element with only a fill shades as it always did.
  • TexturescreateTexture from an ImageBitmap, <img>, <canvas>, <video>, OffscreenCanvas or ImageData, or loadTexture from a URL. Per-axis wrapping ('clamp' | 'repeat' | 'mirror'), separate magnification and minification filters ('nearest' | 'linear'), and a UV transform of repeat, offset and flipY. Every built-in shape emits the coordinates, and both backends sample them the same way.
  • Perspective and orthographic cameracreateCamera drives the context's view and projection, batches changes through a microtask, and handles orbit, pan and pinch/wheel zoom with per-interaction sensitivity.
  • Fog'linear' or 'exponential' haze blending distant geometry towards a colour, computed identically on both backends.
  • Triangle raycastingcontext.raycast(x, y) builds a world-space ray and context.raycastAll(scene, x, y) returns every shape it meets, nearest first, with the hit point, face, interpolated normal and UV.
  • Group3D — a group whose transform composes into the model matrix of every shape beneath it, so a subtree orbits, tilts and scales as a unit.
  • Animation and events — shapes are Ripl elements, so renderer.transition, pointer events and scene querying all apply. interpolateVector3 tweens 3D positions — declare it in a custom element's interpolators to animate a vector-valued property.

Installation

# npm
npm install @ripl/3d @ripl/web

# yarn
yarn add @ripl/3d @ripl/web

# pnpm
pnpm add @ripl/3d @ripl/web

The scene and renderer come from @ripl/web; this package supplies the 3D context, camera, lights and shapes. For GPU rasterization, add @ripl/webgpu and import createContext from there instead.

Quick start

import {
    createCamera,
    createContext,
    createDirectionalLight,
    createTorus,
} from '@ripl/3d';

import {
    createRenderer,
    createScene,
} from '@ripl/web';

const context = createContext('.mount-element');
const scene = createScene(context);

createCamera(context, {
    position: [0, 2, 5],
    target: [0, 0, 0],
    interactions: true,
});

context.lights.add(createDirectionalLight({
    direction: [-1, -1, -0.5],
    intensity: 0.8,
}));

scene.add(createTorus({
    radius: 1.2,
    tube: 0.4,
    material: {
        color: '#4488ff',
        specular: '#ffffff',
        shininess: 48,
    },
}));

createRenderer(scene, {
    autoStop: false,
});

Key API

| Export | What it does | | --- | --- | | createContext | Canvas-backed Context3D that projects and depth-sorts faces | | createCamera | Perspective or orthographic camera with orbit, pan and zoom | | createAmbientLightcreateSpotLight | The five light constructors, added via context.lights | | createMaterial | How a surface responds to light | | createTexture / loadTexture | Images mapped across a surface | | createCubecreateBezierSurface | The nine built-in shapes | | createGroup3D | A group carrying a 3D transform for its subtree | | Context3D.raycastAll | Every shape under a point, nearest first | | computeFaceNormal / shadeFaceColor | Shading helpers for custom geometry |

Related packages

  • @ripl/web — the browser entry point supplying the scene, renderer and animation
  • @ripl/webgpu — GPU backend for the same Shape3D elements
  • @ripl/core — the element, scene and animation model these shapes build on

Documentation

Guides, live demos and the full API reference are at ripl.run/docs/3d.

License

MIT