/** * Shape tessellation for rendering CAD objects. */ import { NestedGroup } from "./nestedgroup.js"; import { BoundingBox } from "./bbox.js"; import type { Shapes, VisibilityState } from "../core/types.js"; /** * Tree data structure for shape visibility navigation. * Maps object names to either nested tree data or visibility state. */ interface ShapeTreeData { [key: string]: ShapeTreeData | VisibilityState; } /** * Result from rendering tessellated shapes. */ interface RenderResult { group: NestedGroup; tree: ShapeTreeData; } /** * Configuration options for shape rendering. */ interface ShapeRenderConfig { cadWidth: number; height: number; edgeColor: number; transparent: boolean; defaultOpacity: number; metalness: number; roughness: number; normalLen: number; } /** * Handles tessellation of CAD shapes for rendering. */ declare class ShapeRenderer { private config; private _bbox; constructor(config: ShapeRenderConfig); /** * Get the computed bounding box (set after rendering if shapes.bb is defined). */ get bbox(): BoundingBox | null; /** * Update configuration (e.g., when state changes). */ updateConfig(config: Partial): void; /** * Render tessellated shapes of a CAD object. * @param shapes - The Shapes object representing the tessellated CAD object. * @returns A nested THREE.Group object. */ private _renderTessellatedShapes; /** * Retrieve the navigation tree from a Shapes object. * @param shapes - The Shapes object. * @returns The navigation tree object. */ private _getTree; /** * Render the shapes of the CAD object. * @param shapes - The Shapes object. * @returns A nested THREE.Group object and navigation tree. */ render(shapes: Shapes): RenderResult; } export { ShapeRenderer }; export type { ShapeTreeData, RenderResult, ShapeRenderConfig };