UNPKG

react-three-nurbs

Version:

A React component library for NURBS (Non-Uniform Rational B-Spline) curves, surfaces, and solids in Three.js. Built with React Three Fiber, zero external NURBS dependencies — all math implemented from scratch. Boolean operations powered by OpenCASCADE WAS

24 lines (23 loc) 1.12 kB
import type { ReactElement } from "react"; import type { AdaptiveRefinementOptions } from "../core/tessellate"; import { BufferGeometry } from "three"; import type { Mesh } from "three"; import type { MeshProps } from "@react-three/fiber"; export interface NurbsSurfaceProps extends Omit<MeshProps, "geometry" | "ref"> { controlPoints: number[][][]; weights: number[][]; degreeU: number; degreeV: number; knotsU?: number[]; knotsV?: number[]; resolutionU?: number; resolutionV?: number; color?: string; wireframe?: boolean; /** Skip analytical normals and use computeVertexNormals for speed */ fastNormals?: boolean; /** Enable adaptive tessellation — subdivides high-curvature areas automatically */ adaptive?: AdaptiveRefinementOptions | boolean; children?: ReactElement; } export declare const NurbsSurface: import("react").ForwardRefExoticComponent<NurbsSurfaceProps & import("react").RefAttributes<Mesh<BufferGeometry<import("three").NormalBufferAttributes>, import("three").Material | import("three").Material[], import("three").Object3DEventMap>>>;