JSPM

use-rhino-loader

1.0.2
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 4
    • Score
      100M100P100Q36348F
    • License MIT

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

    Package Exports

    • use-rhino-loader
    • use-rhino-loader/dist/useRhinoLoader.cjs.js
    • use-rhino-loader/dist/useRhinoLoader.es.js

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (use-rhino-loader) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    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/)