/** * Data structures and parsing logic for 3MF mesh elements */ /** * Represents a 3D vertex with x, y, z coordinates */ export interface Vertex { x: number; y: number; z: number; } /** * Represents a 3D vector */ export interface Vector3 { x: number; y: number; z: number; } /** * Represents a triangle with vertex indices and optional property indices */ export interface Triangle { v1: number; v2: number; v3: number; p1?: number; p2?: number; p3?: number; pid?: number; } /** * Complete mesh data */ export interface Mesh { vertices: Vertex[]; triangles: Triangle[]; isManifold?: boolean; hasConsistentOrientation?: boolean; } import { ValidationError } from './errors'; /** * Error thrown when mesh parsing or validation fails */ export declare class MeshError extends ValidationError { constructor(message: string); } /** * Parse vertices from mesh XML * @param meshElement The mesh element from the model XML * @returns Array of vertices * @throws MeshError if parsing fails or validation errors occur */ export declare function parseVertices(meshElement: any): Vertex[]; /** * Parse triangles from mesh XML * @param meshElement The mesh element from the model XML * @param vertexCount Total number of vertices for index validation * @returns Array of triangles * @throws MeshError if parsing fails or validation errors occur */ export declare function parseTriangles(meshElement: any, vertexCount: number): Triangle[]; /** * Parse a complete mesh from XML * @param meshElement The mesh element from the model XML * @returns Complete mesh object * @throws MeshError if parsing fails or validation errors occur */ export declare function parseMesh(meshElement: any): Mesh; /** * Calculate the face normal of a triangle * @param v1 First vertex * @param v2 Second vertex * @param v3 Third vertex * @returns Face normal vector (normalized) */ export declare function calculateNormal(v1: Vertex, v2: Vertex, v3: Vertex): Vector3; /** * Check if a mesh has manifold edges * @param mesh The mesh to check * @returns true if all edges are manifold, false otherwise */ export declare function checkManifoldEdges(mesh: Mesh): boolean; /** * Check if a mesh has consistent triangle orientation * @param mesh The mesh to check * @returns true if all triangles have consistent orientation, false otherwise */ export declare function checkConsistentOrientation(mesh: Mesh): boolean; /** * Validate a mesh according to 3MF requirements * @param mesh The mesh to validate * @param objectType The type of object containing this mesh * @returns The mesh with validation state fields set * @throws MeshError if validation fails for model or solidsupport object types */ export declare function validateMesh(mesh: Mesh, objectType: string): Mesh; //# sourceMappingURL=mesh.d.ts.map