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

brepjs-viewer

v0.2.0

Published

Shared React/R3F renderer for brepjs meshes (used by the playground and the brepjs-agent viewer)

Readme

brepjs-viewer

Shared React + @react-three/fiber renderer for brepjs meshes. Extracted from the playground so both apps/playground and the brepjs-agent standalone viewer render through one source of truth (no drift).

It is a thin, store-agnostic rendering layer: it takes a MeshData and optional selection callbacks; it owns no application state and never imports a consumer.

Exports

  • Renderer: draws a MeshData mesh; optional onFacePick/onFaceHover/onFaceContextMenu callbacks for selection.
  • ViewerCanvas: R3F <Canvas> wrapper that frames the model bbox, re-points the camera from a view prop (iso/front/top/right), re-frames on a fitSignal bump, toggles autoRotate/gridVisible, and switches projection between perspective and orthographic (zoom-fit ortho camera). Flips to frameloop="always" while spinning, demand otherwise. Fires onFirstFrame after first paint. Screenshot-agnostic.
  • ViewerControls: store-agnostic, fully-controlled toolbar (view-mode, edges, grid, turntable, projection, view presets, fit, screenshot). Each group renders only when its handler is supplied; self-contained inline styles, className to restyle.
  • ViewerInfoPanel: controlled, store-agnostic measurements readout (bbox size, volume, area, triangles, validity); renders only the rows whose values are supplied.
  • ViewerSelectionPanel: controlled readout for a picked FaceInfo (surface type, area, normal) with an optional clear button; renders nothing when no face is selected.
  • ViewerSectionControls: controlled section-plane bar (enable, axis, position slider, flip). Pair with sectionPlane(...) and pass the result to Renderer/EdgeRenderer via their clippingPlanes prop. ViewerCanvas enables local clipping, so only the model is cut (not the grid).
  • EdgeRenderer, SelectionHighlight, SceneSetup: companion components.
  • buildGeometry, findFaceGroupAt, meshSize, meshBounds, sectionPlane: pure helpers (meshBounds returns the bbox; sectionPlane builds a model-space clipping plane).
  • Types: MeshData, FaceGroup, FaceInfo, EdgeGroup, EdgeInfo, ViewMode, ViewName, VIEW_NAMES.

Peer dependencies

react, react-dom, three, @react-three/fiber, @react-three/drei: pinned to the versions apps/playground uses so a single copy resolves across the monorepo.

Usage

import { ViewerCanvas, Renderer } from 'brepjs-viewer';

<ViewerCanvas data={meshData} view="iso">
  <Renderer data={meshData} viewMode="solid" />
</ViewerCanvas>;