import { ValidationError } from './errors'; import type { ObjectResource, Component } from './resources'; import type { Mesh, Vertex } from './mesh'; /** * 3D Matrix as defined in the 3MF spec (4x4 matrix with last row fixed as [0,0,0,1]) */ export declare class Matrix3D { private values; /** * Creates a new Matrix3D * @param values Array of 12 numbers for the matrix (row-major order) */ constructor(values?: number[]); /** * Parse a Matrix3D from a string representation * @param matrixString String representation of the matrix (12 space-separated values) * @returns Matrix3D instance * @throws Error if the string is invalid */ static fromString(matrixString?: string): Matrix3D; /** * Get the determinant of the 3x3 rotation/scale part of the matrix * Used to detect if the matrix flips orientation (negative determinant) */ get determinant(): number; /** * Transform a vertex using this matrix * @param vertex The vertex to transform * @returns Transformed vertex */ transformVertex(vertex: Vertex): Vertex; /** * Multiply this matrix by another matrix (this * other) * @param other The matrix to multiply with * @returns A new Matrix3D representing the result */ multiply(other: Matrix3D): Matrix3D; /** * Convert the matrix to a string representation * @returns String representation of the matrix */ toString(): string; } /** * Error thrown when component resolution fails */ export declare class ComponentError extends ValidationError { constructor(message: string); } /** * Parse component references from object XML * @param componentsElement The components element from the object XML * @returns Array of Component objects * @throws ComponentError if parsing fails */ export declare function parseComponents(componentsElement: any): Component[]; /** * Validate all component references in the resource set * @param objects Map of all objects * @throws ComponentError if validation fails (circular references or missing references) */ export declare function validateComponentReferences(objects: Map): void; /** * Flatten a component hierarchy into a single mesh * @param rootId ID of the root object to flatten * @param objects Map of all objects * @param transform Optional matrix transform to apply to the entire hierarchy * @returns Flattened mesh combining all components with transformations applied * @throws ComponentError if flattening fails */ export declare function flattenComponentHierarchy(rootId: number, objects: Map, transform?: Matrix3D): Mesh; /** * Update components with transforms from the XML and validate all references * @param objects Map of objects to validate component references * @throws ComponentError if validation fails */ export declare function validateAllComponentReferences(objects: Map): void; //# sourceMappingURL=components.d.ts.map