import { VecN, type SourceSimplexProjectionN, type SourceSimplexReferenceN } from '@holotope/core'; import { type ClampedLogBarrierForceN } from './clamped-log-barrier.js'; import { type XpbdIncrementalPotentialStepFilterContextN, type XpbdIncrementalPotentialStepFilterN } from './xpbd-incremental-potential-step-filter.js'; import { type PointSimplexProjectedResult } from './exact-point-simplex-distance.js'; import { XpbdParticleN, type XpbdConservativeForceProviderEvaluationN, type XpbdConservativeForceProviderN, type XpbdParticlePositionQueryN } from './xpbd-world.js'; /** * Reasons naming an exact point--simplex decision that could not be published. * * One vocabulary serves both released refusals — the barrier's typed domain * error and the step filter's `indeterminate` — because both describe the same * event: a decision the exact query declined to certify. A caller writes one * recovery table keyed by these four strings and reads it in both places. * * A publication reason states what could NOT be represented. It does not, on * its own, classify recoverability: see the per-reason measurements in the * contact guide, where each reason is shown to be repairable by a shorter step * from some start states and not from others. */ export type XpbdParticleSourceSimplexBarrierPublicationReasonN = 'point-simplex-weight-underflow' | 'point-simplex-value-overflow' | 'point-simplex-value-underflow' | 'point-simplex-accuracy-bound-overflow'; /** * Open-domain refusal vocabulary of a point--source-simplex barrier. * * Three kinds of failure, kept apart because their recoveries differ: the * distance was measured and is inadmissible, the exact decision could not be * published at all, or the published direction is less accurate than the * caller's authored policy admits. */ export type XpbdParticleSourceSimplexBarrierDomainReasonN = 'at-or-below-minimum-distance' | 'minimum-distance-not-certified' | XpbdParticleSourceSimplexBarrierPublicationReasonN | 'direction-error-exceeds-policy' | 'barrier-component-outside-float64'; /** Construction options for one conservative RN point--source-simplex barrier. */ export interface XpbdParticleSourceSimplexBarrierNOptions { /** Stable provider identifier. */ readonly id: string; /** Live particle whose candidate position is evaluated. */ readonly particle: XpbdParticleN; /** Persistent finite source simplex supplying closest-point provenance. */ readonly simplex: SourceSimplexReferenceN; /** Open unsigned distance boundary. Default zero. */ readonly minimumDistance?: number; /** Distance at and above which the barrier is exactly zero. */ readonly activationDistance: number; /** Positive energy scale. */ readonly stiffness: number; /** * Caller policy: the largest published direction error the force law admits. * * A dimensionless Euclidean radius on the published unit direction, finite * and in the open interval `(0, 2)` — two unit vectors are at most 2 apart, * so a larger bound would admit every direction including the exact * opposite. **Required** on the exact `intrinsicDim` 1..3 arm, which * publishes a direction enclosure, and **rejected** on the 4..17 legacy * fallback, which publishes none: supplying it there would imply a * certification the fallback cannot make. * * This is an explicit caller policy about direction usability. It is not a * derived physical constant and it does not certify force accuracy. */ readonly maximumDirectionError?: number; } /** Conservative force and closest-source evidence at one candidate point. */ export interface XpbdParticleSourceSimplexBarrierEvaluationN extends XpbdConservativeForceProviderEvaluationN { /** Closest point, barycentric coordinate, and source-simplex evidence. */ readonly projection: SourceSimplexProjectionN; /** Exact decision and outward error evidence for source dimensions 1..3. */ readonly pointSimplex?: PointSimplexProjectedResult; /** Unsigned Euclidean distance to the closed finite simplex. */ readonly distance: number; /** Unit vector from the closest simplex point toward the particle. */ readonly separationNormal: VecN; /** `distance - minimumDistance`. */ readonly barrierCoordinate: number; /** `activationDistance - minimumDistance`. */ readonly barrierActivation: number; /** * The graded order-1 scalar evaluation this force was built from. Both * required components were available (the provider refused otherwise). */ readonly barrier: ClampedLogBarrierForceN; /** One force paired with the provider's one particle. */ readonly forces: readonly [VecN]; } /** * Conservative RN distance barrier between one point and a finite source simplex. * * Unlike `XpbdParticleHyperplaneBarrierN`, this term uses unsigned distance to * a closed, finite simplex. In R4 a point and a source tetrahedron are the * complementary contact-feature pair. The closest point retains barycentric * coordinates and persistent source-cell identity, including transitions * from simplex interior to its edges and vertices. * * This is a two-sided proximity term, not an inside/outside test. It does not * generate mesh candidates, move the simplex, or imply complete self-contact. * Pair it with `XpbdParticleSourceSimplexBarrierStepFilterN`: endpoint energy * alone cannot detect a segment that passes through the simplex and ends clear * on the other side. */ export declare class XpbdParticleSourceSimplexBarrierN implements XpbdConservativeForceProviderN { /** Stable force-provider identity. */ readonly id: string; /** Ambient particle and source-simplex dimension. */ readonly dimension: number; /** Live particle whose current and candidate positions are evaluated. */ readonly particle: XpbdParticleN; /** One-element provider particle list paired with returned forces. */ readonly particles: readonly [XpbdParticleN]; /** Persistent finite source simplex retained by every projection result. */ readonly simplex: SourceSimplexReferenceN; /** Open hard unsigned-distance boundary. */ readonly minimumDistance: number; /** Distance at and above which energy and force are zero. */ readonly activationDistance: number; /** Positive scalar energy multiplier. */ readonly stiffness: number; /** * Caller-authored direction-usability policy, or `null` on the legacy * `intrinsicDim` 4..17 arm, which publishes no direction enclosure. */ readonly maximumDirectionError: number | null; /** * Creates one source-retained finite-simplex proximity barrier. * * @param options Particle, source simplex, open distance, activation, and scale. */ constructor(options: XpbdParticleSourceSimplexBarrierNOptions); /** Evaluates from the particle's current live position without mutation. */ evaluate(): XpbdParticleSourceSimplexBarrierEvaluationN; /** Evaluates one caller-supplied candidate position without live-state writes. */ evaluateAt(positionOf: XpbdParticlePositionQueryN): XpbdParticleSourceSimplexBarrierEvaluationN; } /** Construction options for a conservative point--source-simplex step filter. */ export interface XpbdParticleSourceSimplexBarrierStepFilterNOptions { /** Stable authored identity within one compiled problem. */ readonly id: string; /** Barrier whose particle, simplex, and open boundary define admissibility. */ readonly barrier: XpbdParticleSourceSimplexBarrierN; /** Fraction of the certified Lipschitz prefix retained; default `0.9`. */ readonly conservativeScale?: number; } /** * Why the finite-simplex filter could not certify any segment prefix. * * Exactly two things can go wrong, and they are different claims. * `initial-domain-violation` says the start is certifiably NOT admissible — its * certified distance does not clear the open minimum. The four publication * reasons say the start's exact decision could not be published at all, so * there is no certified start distance to compare. Unknown is not violated, and * conflating them would report a domain error the filter never established. */ export type XpbdParticleSourceSimplexBarrierStepFilterRefusalReasonN = 'initial-domain-violation' | XpbdParticleSourceSimplexBarrierPublicationReasonN; /** Evidence available for every finite-simplex segment result. */ export interface XpbdParticleSourceSimplexBarrierStepFilterEvidenceN { /** Euclidean length of the complete proposed point path. */ readonly pathLength: number; /** Certified fraction of the requested segment, in `[0, 1]`. */ readonly certifiedFraction: number; } /** * Evidence available whenever the segment START published a decision. * * These three quantities exist only when the start's exact point--simplex * decision was certified. When it was not, they are absent from the result * rather than filled with `NaN`, `0`, or a sentinel: a fabricated distance in * an evidence field is indistinguishable from a measured one at the call site. */ export interface XpbdParticleSourceSimplexBarrierStepFilterStartEvidenceN extends XpbdParticleSourceSimplexBarrierStepFilterEvidenceN { /** Unsigned point--simplex distance at the segment start. */ readonly startDistance: number; /** Certified lower bound on start distance above the open minimum. */ readonly startMargin: number; /** Initial distance derivative over the complete segment fraction. */ readonly startDirectionalDerivative: number; } /** * Proof used to certify a prefix; never an inferred or exact impact time. * * Each name is a theorem about the START state and the displacement vector. * `stationary`: the path has zero length. `convex-nondecreasing`: distance to a * convex set is convex, so a non-negative start directional derivative makes it * non-decreasing over the whole segment. `global-lipschitz`: distance is * 1-Lipschitz, so the certified start margin bounds how far the point may move * before the margin could be spent. */ export type XpbdParticleSourceSimplexBarrierStepFilterCertificationN = 'stationary' | 'convex-nondecreasing' | 'global-lipschitz'; /** Result of one conservative finite-simplex segment query. */ export type XpbdParticleSourceSimplexBarrierStepFilterEvaluationN = (XpbdParticleSourceSimplexBarrierStepFilterStartEvidenceN & { readonly status: 'safe'; readonly maximumStepLength: number; readonly certification: XpbdParticleSourceSimplexBarrierStepFilterCertificationN; }) | (XpbdParticleSourceSimplexBarrierStepFilterStartEvidenceN & { /** A strict prefix is certified; only the Lipschitz bound produces one. */ readonly status: 'limited'; readonly maximumStepLength: number; readonly certification: 'global-lipschitz'; }) | (XpbdParticleSourceSimplexBarrierStepFilterStartEvidenceN & { readonly status: 'indeterminate'; readonly reason: 'initial-domain-violation'; }) | (XpbdParticleSourceSimplexBarrierStepFilterEvidenceN & { readonly status: 'indeterminate'; readonly reason: XpbdParticleSourceSimplexBarrierPublicationReasonN; }); /** * Conservative RN point--static-source-simplex collision-free step filter. * * Distance to a closed convex simplex is convex and 1-Lipschitz. A segment * whose initial directional derivative is non-negative is therefore safe in * full; otherwise the global Lipschitz bound certifies a strict prefix. The * result intentionally reports a `certifiedFraction`, not an impact time: * this filter does not solve the piecewise closest-feature crossing exactly. * * Only the segment's START is queried. Both proofs above are statements about * the start state and the displacement VECTOR — convexity propagates from a * start subgradient, and the Lipschitz constant is 1 globally, so neither * needs a sample at the far end. Querying the endpoint anyway would add a * failure mode without adding a proof: an endpoint whose exact decision cannot * be published would refuse a prefix that provably exists, and take the * enclosing line search down with it. */ export declare class XpbdParticleSourceSimplexBarrierStepFilterN implements XpbdIncrementalPotentialStepFilterN { /** Stable authored filter identity. */ readonly id: string; /** Ambient particle and source-simplex dimension. */ readonly dimension: number; /** Paired finite-simplex barrier. */ readonly barrier: XpbdParticleSourceSimplexBarrierN; /** Exact particle identity read by this filter. */ readonly particles: readonly [XpbdParticleN]; /** Strict scale applied to the Lipschitz prefix. */ readonly conservativeScale: number; /** Creates one conservative finite-simplex step filter. */ constructor(options: XpbdParticleSourceSimplexBarrierStepFilterNOptions); /** Certifies a complete segment or a conservative strict prefix. */ evaluate(context: XpbdIncrementalPotentialStepFilterContextN): XpbdParticleSourceSimplexBarrierStepFilterEvaluationN; } //# sourceMappingURL=xpbd-source-simplex-barrier.d.ts.map