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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@r3f-cutter/r3f-cutter

v1.0.8

Published

<a href="https://codesandbox.io/s/r3f-cutter-box-example-q3uip1"><img src="doc/images/gifted-sound-q3uip1.png" width="128"/></a> <a href="https://codesandbox.io/s/torus-and-box-single-cutplane-y6hl0d"><img src="doc/images/torus-and-box-single-cutplane-y6h

Downloads

37

Readme

Overview

This package provides a <Cutter> component based on react-three-fiber that can clip and cap Meshes in an arbitrary scene in a manner similar to this example. A <Cutter> will clip and cap all descendant meshes using a Plane specified via its plane prop. This gives the meshes the appearance of filled solids instead of hollow objects with just surfaces. The caps at the clipping plane position use the same material as the original meshes. This means that each mesh will get a cap that looks like its own material. See Limitations/Bugs section below for some issues with the current implementation that are expected to be fixed in the future.

A simple example of usage is something like:

import Cutter from '@r3f-cutter/r3f-cutter';

// ...later...
<Cutter plane={xPlane}>
  <mesh position={[0, 0.5, 0]}>
    <boxGeometry />
    <meshStandardMaterial color="orange" />
  </mesh>
</Cutter>

Installation

npm i @r3f-cutter/r3f-cutter

Limitation/Bugs

  • Only one plane supported at present. Support for multiple planes will be added.
  • Caps use the same material as the original Mesh. If the Mesh uses an array of materials then it is capped using the first material from the list.
  • If the Mesh is modified after it is initially clipped (for example, via useFrame()) then the caps are not correctly recomputed. This needs to be fixed. An live example that illustrates this issue is available here.
  • It might be useful to have an option to disable capping entirely and just use clipping.