import { VecN } from '@holotope/core'; import { type GjkFeaturePair, type GjkOptions, type GjkResult } from './gjk.js'; import type { SupportShapeN } from './support-shape.js'; export interface EpaOptions4 { /** GJK intersection policy used to enter EPA. */ readonly gjkOptions?: GjkOptions; /** Expansion steps after the seed contains the origin. Default 96. */ readonly maxIterations?: number; /** Support expansions allowed while enclosing the origin. Default 32. */ readonly maxSeedIterations?: number; /** Hard tetrahedral-facet budget. Default 4096. */ readonly maxFacets?: number; /** Relative support-gap termination tolerance. Default 1e-10. */ readonly relativeTolerance?: number; /** World-space support-gap/contact tolerance. Default 1e-10. */ readonly absoluteTolerance?: number; /** Scale-relative affine-rank and facet-volume band. Default 1e-12. */ readonly degeneracyTolerance?: number; /** Scale-relative facet visibility band. Default 1e-12. */ readonly visibilityTolerance?: number; /** Dimensionless tetrahedral barycentric band. Default 1e-10. */ readonly barycentricTolerance?: number; /** Retain one compact record per expansion. Default false. */ readonly recordTrace?: boolean; } export type EpaStatus4 = 'separated' | 'touching' | 'penetrating' | 'indeterminate'; export type EpaTerminationReason4 = 'gjk-separated' | 'gjk-iteration-limit' | 'support-gap' | 'duplicate-support' | 'degenerate-seed' | 'seed-iteration-limit' | 'seed-stalled' | 'degenerate-facet' | 'non-manifold-horizon' | 'invalid-hull' | 'invalid-closest-facet' | 'facet-limit' | 'iteration-limit'; export interface EpaFacetCertificate4 { readonly vertexIndices: readonly [number, number, number, number]; readonly featurePairs: readonly GjkFeaturePair[]; /** Convex weights aligned with vertexIndices and featurePairs. */ readonly weights: Float64Array; /** Outward normal of the Minkowski-difference boundary facet. */ readonly minkowskiNormal: VecN; readonly distance: number; readonly conditionEstimate: number; readonly projectionConditionEstimate: number; readonly witnessResidual: number; } /** Single ordered EPA witness; deliberately not a persistent manifold type. */ export interface EpaPointContactPatch4 { readonly kind: 'point'; readonly normal: VecN; readonly pointA: VecN; readonly pointB: VecN; readonly alignmentShift: number; readonly translationA: VecN; readonly resolvedPoint: VecN; readonly penetrationDepth: number; } export interface EpaTraceEntry4 { readonly iteration: number; readonly facetCount: number; readonly supportCount: number; readonly lowerBound: number; readonly upperBound: number; readonly supportGap: number; readonly visibleFacetCount: number; readonly horizonTriangleCount: number; } export interface EpaTerminationCertificate4 { readonly reason: EpaTerminationReason4; readonly supportGap: number | null; readonly threshold: number | null; readonly seedIterations: number; readonly expansionIterations: number; readonly supportCount: number; readonly facetCount: number; readonly maxFacetCount: number; } export interface EpaPenetrationResult4 { readonly status: EpaStatus4; readonly intersects: boolean | null; /** Minimum-translation magnitude when convergence is certified. */ readonly penetrationDepth: number | null; /** Unit direction from ordered B toward ordered A. */ readonly normal: VecN | null; readonly pointA: VecN | null; readonly pointB: VecN | null; readonly patch: EpaPointContactPatch4 | null; /** Inner-polytope lower bound on penetration magnitude. */ readonly lowerBound: number | null; /** Support-plane upper bound along the selected direction. */ readonly upperBound: number | null; readonly errorBound: number | null; readonly facet: EpaFacetCertificate4 | null; readonly gjk: GjkResult; readonly termination: EpaTerminationCertificate4; readonly trace?: readonly EpaTraceEntry4[]; } /** * Auditable Float64 EPA fallback for full-dimensional compact convex shapes * in R4. It returns one minimum-translation witness, not a persistent contact * manifold. Every numerical failure remains an explicit indeterminate result. */ export declare function epaPenetration4(shapeA: SupportShapeN, shapeB: SupportShapeN, options?: EpaOptions4): EpaPenetrationResult4; //# sourceMappingURL=epa4.d.ts.map