Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

use-rhino-loader

pixelsdevteam0MIT1.0.3TypeScript support: included

React hook for loading Rhino .3dm files with three.js and Rhino3dmLoader

r3f-rhino-loader, use-rhino-loader, 3dmloader, rhino, react-three-fiber, rhino3dm, three.js, hook

readme

use-rhino-loader

A lightweight React hook to load Rhino .3dm files into your React Three Fiber scenes using three.js and Rhino3dmLoader.


✨ Features

  • Load Rhino .3dm files as individual named mesh nodes
  • Preserves world transform and material data
  • Returns a nodes and materials object, just like gltfjsx
  • Typed with TypeScript

📦 Installation

npm install use-rhino-loader

Usage

import { useRhinoLoader } from 'use-rhino-loader'

export function RhinoModel() {
  const { nodes, materials } = useRhinoLoader('/models/sample.3dm')

  return (
    <group>
      {Object.entries(nodes).map(([name, mesh]) => (
        <primitive key={name} object={mesh} />
      ))}
    </group>
  )
}

Props

Name Type Description
url string Path to the .3dm file
libraryPath string Path to Rhino runtime (default: /rhino/)