UNPKG

@bitbybit-dev/occt

Version:

Bit By Bit Developers CAD algorithms using OpenCascade Technology kernel. Run in Node and in Browser.

41 lines (40 loc) 1.35 kB
import { OCCTAssemblyManager } from "./manager"; import { OCCTAssemblyQuery } from "./query"; /** * High-level OCCT Assembly service for creating and querying assembly documents. * * The manager provides methods for: * - Building assembly documents from structure definitions * - Creating parts and nodes for visual programming * - Modifying document labels (color, name) * - Exporting to STEP and glTF formats * - Loading STEP files into documents * * The query provides methods for: * - Querying document parts, hierarchy, colors, and transforms * - Getting shapes from labels * * All methods use document handles directly (no global document storage). * The caller is responsible for managing document lifetime by calling document.delete() when done. * * @example * ```typescript * // Create assembly document * const document = occt.assembly.manager.buildAssemblyDocument({ structure }); * * // Query document parts * const parts = occt.assembly.query.getDocumentParts({ document }); * * // Export to STEP * const stepData = occt.assembly.manager.exportDocumentToStep({ document }); * * // Clean up when done * document.delete(); * ``` */ export class OCCTAssembly { constructor(occ, och) { this.manager = new OCCTAssemblyManager(occ, och); this.query = new OCCTAssemblyQuery(occ, och); } }