API reference
This page documents the public-facing surface of the package. It lists the types you construct,
call methods on, or read fields from when wiring up anchor placement and localization. It does
not cover every public C# symbol in the source tree. Internal pipeline stages (RANSAC, ICP,
descriptor matching), licensing plumbing, and math/serialization primitives are deliberately left
out. See how alignment works if you want the algorithm
internals.
Each entry names the file the contract was read from, so you can go straight to source for anything not covered here. Contracts are written from the current implementation, not from intent. Where a member’s behavior was not obvious from the code alone, this page says so instead of guessing.
Placing and saving anchors
ManualAnchoring
src/LansAnchor.Unity/Assets/MeshBasedAnchoring/Anchoring/ManualAnchoring.cs:17
Single-room MonoBehaviour: one source scan, one anchor, one client scan trying to find it. Set up as described in Manual anchoring; the table below is the method/ event surface behind that Inspector.
| Member | Signature | Contract |
|---|---|---|
SetSource | void SetSource(Transform source) | Sets the source (Client A) root Transform without touching the Inspector. |
SetClient | void SetClient(Transform client) | Sets the client (Client B) root Transform without touching the Inspector. |
TryCreateAnchor | AnchorResult<AnchorDescriptor> TryCreateAnchor(WorldMesh[] sourceMeshes, Transform center, RegistrationParams options) | Client A side: extracts features around center and builds an AnchorDescriptor to send to Client B. Fails when fewer than the minimum feature count is found near the anchor. |
TryImportAnchor | AnchorResult<AnchorPose> TryImportAnchor(AnchorDescriptor descriptor, Feature[] ownFeatures, float clientCharacteristicLength = 0f, Action<RegistrationProgress> onProgress = null, CancellationToken cancellationToken = default) | Client B side: registers ownFeatures against the descriptor and returns an AnchorPose mapping client world space to source world space. Fails when the result does not clear DiagnosticInfo.IsReliable. |
Calculate | Task<DiagnosticInfo> Calculate() | Convenience wrapper: runs TryCreateAnchor then TryImportAnchor using the component’s serialized Inspector fields, applies the resulting pose to the assigned client Transform, and writes a FeatureRegistration_*.log file. Returns diagnostics regardless of outcome; check IsReliable. |
CancelCalculate | void CancelCalculate() | Requests cooperative cancellation of an in-flight Calculate() call. No-op when nothing is running; the in-flight call returns a clean WasCancelled result rather than throwing. |
BuildParams | RegistrationParams BuildParams() | Builds a RegistrationParams from the component’s current serialized fields, same values Calculate() uses internally. Useful for calling TryImportAnchor/TryCreateAnchor directly with the Inspector’s own settings. |
OnProgress | ProgressEvent OnProgress (UnityEvent<RegistrationProgress>) | Invoked on the main thread with phase-level progress while Calculate() runs. |
AnchorDescriptor
src/LansAnchor.Unity/Assets/MeshBasedAnchoring/Anchoring/AnchorDescriptor.cs:11
Produced by TryCreateAnchor. This is the wire/save format for a single anchor: serialize it
with ToBytes(), send it to Client B by whatever transport you choose (file, network, LAN
share), and deserialize with FromBytes().
| Member | Signature | Contract |
|---|---|---|
SourceFeatures | Feature[] SourceFeatures | Anchor-local feature set collected within AnchorRadius of the anchor. |
RoomFeatures | Feature[] RoomFeatures | Optional whole-scan feature set (the room tier). Null/empty when Build Room Tier was off at creation time. |
Params | RegistrationParams Params | Registration settings shipped with the descriptor so Client B matches Client A’s configuration. |
AnchorOffset | Vector3 AnchorOffset | How far AnchorPlacementRadius snapping moved the anchor from the caller’s requested position. Zero when that snap was not used. Informational only. |
RequestedAnchorPosition | Vector3 RequestedAnchorPosition | Client A’s original requested anchor position, before any snap. Client B recovers this directly once frames are unified; see AnchorPose. |
SourceCharacteristicLength | float SourceCharacteristicLength | Median edge length of Client A’s source scan, used to resolve scale-relative thresholds against Client B’s own scan. |
FingerprintQuality | float FingerprintQuality | Same-room fingerprint richness score computed once at build time. 0 = not computed. |
Strength | AnchorStrength Strength | Creation-time strength feedback (Weak/OK/Strong with plain-language message). Not serialized; set directly on the descriptor TryCreateAnchor returns. |
FrameEpoch | int FrameEpoch | Which ARSession reset epoch this descriptor’s features/position were captured in. -1 means not recorded (older descriptors, or a caller that never stamped it); never treated as equal to another unknown epoch. |
FeatureCount | int FeatureCount (get) | SourceFeatures?.Length ?? 0. |
HasRoomTier | bool HasRoomTier (get) | True when RoomFeatures is non-null and non-empty. |
ToBytes | byte[] ToBytes() | Serializes the descriptor to a binary blob for saving/transmitting. |
FromBytes | static AnchorDescriptor FromBytes(byte[] data) | Deserializes a blob produced by ToBytes(). Accepts the current and one prior format version. |
SaveToFile / LoadFromFile | void SaveToFile(string path) / static AnchorDescriptor LoadFromFile(string path) | File-based convenience wrappers around ToBytes/FromBytes. |
The descriptor also carries ScanQuality (a scan-quality self-check result) and QualityMeter
(a save-time local-data reading), both dev-facing diagnostics rather than integrator-facing API;
not detailed here since their own types are outside this reference’s include list. Read
ManualAnchoring.cs’s TryCreateAnchor if you need them.
AnchorStrength
src/LansAnchor.AnchorSystem.Companion/Runtime/AnchorStrength.cs:13 (StrengthBucket enum at :6)
Zero-mesh-knowledge Weak/OK/Strong feedback about how much distinctive geometry an anchor has around it at creation time. This is a coverage/richness proxy, not a prediction that localization will succeed later: a Strong anchor can still fail to register if Client B’s scan does not overlap it enough.
| Member | Signature | Contract |
|---|---|---|
Bucket | readonly StrengthBucket Bucket | One of Weak, Ok, Strong. |
Message | readonly string Message | Plain-language description of why the anchor scored this way. |
ImprovementHint | readonly string ImprovementHint | Plain-language suggestion for improving a weak/OK anchor. |
Summary | string Summary (get) | "Anchor strength: {Bucket} - {Message}" in one line, ready to log or display. |
HealthyFeatureCount | const int HealthyFeatureCount = 50 | Feature count threshold used internally when deciding whether an anchor can reach Strong. |
Assess | static AnchorStrength Assess(int sourceFeatureCount, float fingerprintQuality, bool hasRoomTier, float stableFraction = 1f, NormalQualitySelfCheck.Result? scanQuality = null) | Computes the bucket from feature count, fingerprint quality, room-tier presence, and geometry stability. Called automatically by TryCreateAnchor/MultiRoomAnchoring.BuildBatches; call directly only if you are building an AnchorDescriptor/AnchorBatch outside those paths. |
Strength (an AnchorDescriptor/log field) is always read through ManualAnchoring.TryCreateAnchor
or MultiRoomAnchoring.BuildBatches in normal use; you rarely construct AnchorStrength yourself.
Localizing (single room)
AnchorPose
src/LansAnchor.Unity/Assets/MeshBasedAnchoring/Anchoring/AnchorPose.cs:8
Produced by TryImportAnchor (Client B). Carries the transform that aligns the client’s
coordinate frame to the source’s, plus enough bookkeeping to recover the original anchor pose
after applying it.
| Member | Signature | Contract |
|---|---|---|
WorldTransform | Matrix4x4 WorldTransform | Maps a client-world point to the corresponding source-world point. |
Diagnostics | DiagnosticInfo Diagnostics | Full verification result for this registration attempt. |
AnchorOffset | Vector3 AnchorOffset | Copied from the source AnchorDescriptor.AnchorOffset; informational. |
RequestedAnchorPosition | Vector3 RequestedAnchorPosition | Copied from the source AnchorDescriptor.RequestedAnchorPosition; directly usable in Client B’s world once ApplyTo has run. |
ApplyTo | void ApplyTo(Transform t) | Applies WorldTransform to t, moving/rotating it into the source’s coordinate frame. |
Multi-room
MultiRoomAnchoring
src/LansAnchor.Unity/Assets/MeshBasedAnchoring/Anchoring/MultiRoomAnchoring.cs:24
Matches one client scan against several pre-registered rooms at once. Sits alongside
ManualAnchoring rather than replacing it; see Multi-room anchoring for
scene setup. Inspector surface is deliberately narrow (rooms, client, three feature-extraction
defaults); every algorithm knob comes from RegistrationParams.Default.
| Member | Signature | Contract |
|---|---|---|
Batches | IReadOnlyList<AnchorBatch> Batches (get) | The batches built by the most recent BuildBatches/BuildBatchesAsync/InstallBatches call. |
SetClient | void SetClient(Transform client) | Sets the client root Transform without touching the Inspector. |
SetRooms | void SetRooms(List<RoomSourceEntry> rooms) | Replaces the configured room list without reflecting into the private field. |
InstallBatches | void InstallBatches(List<AnchorBatch> batches) | Installs pre-built batches (for example, loaded from disk) instead of building them this session. |
BuildBatches | List<AnchorBatch> BuildBatches() | Synchronous: extracts one AnchorBatch per configured RoomSourceEntry from the scene meshes. Skips (with a warning, never throws) entries with no SourceRoot or too few features. |
BuildBatchesAsync | Task<List<AnchorBatch>> BuildBatchesAsync() | Same extraction as BuildBatches, but the CPU-heavy feature/scoring work runs off the main thread so it does not block the UI. |
BuildBatchAt | AnchorBatch BuildBatchAt(WorldMesh[] coreMeshes, Vector3 anchorPosition, string roomId, Vector3 gravity, out int anchorFeatureCount) | Builds a single-room batch at a fixed anchor position from already-baked meshes. Used for rebuilding one room’s payload (for example, a refresh flow) without re-deriving the whole-batch extraction recipe. Returns null when the anchor has fewer than 20 features. |
Localize | MultiRoomRegistrationResult Localize() | Synchronous: runs the client scan against every batch in Batches. Fires exactly one of OnMatched/OnAmbiguous/OnNoMatch and also returns the result. Call BuildBatches() first; Localize() does not build batches implicitly. |
LocalizeAsync | Task<MultiRoomRegistrationResult> LocalizeAsync() | Async variant of Localize; the client-feature extraction and registration fan-out both run off the main thread. |
CancelLocalize | void CancelLocalize() | Requests cooperative cancellation of an in-flight LocalizeAsync() call. |
OnMatched / OnAmbiguous / OnNoMatch | UnityEvent<MultiRoomRegistrationResult> | Exactly one fires per Localize/LocalizeAsync call, matching MultiRoomRegistrationResult.State. |
OnProgress | UnityEvent<RegistrationProgress> | Invoked on the main thread with phase-level progress during LocalizeAsync(). Never invoked by the synchronous Localize(). |
BuildRegistrationParamsTemplate | static RegistrationParams BuildRegistrationParamsTemplate() | Returns the same RegistrationParams.Default-based template Localize/LocalizeAsync use internally (scale estimation off, license-gate scoping applied). Useful if you are calling MultiRoomRegistration.Register yourself. |
MultiRoomRegistrationResult
src/LansAnchor.AnchorSystem.Model/Runtime/MultiRoomRegistrationResult.cs:7
Outcome of one client scan fanned out against every configured AnchorBatch. Carries every
room’s candidate, not just the winner, so a caller can explain a non-match.
| Member | Signature | Contract |
|---|---|---|
State | MultiRoomResultState State | Matched, Ambiguous, or NoMatch. |
WinningRoomId | string WinningRoomId | Set only when State == Matched; null otherwise. |
Transform | TargetToSourceTransform Transform | Winning transform, target frame to source frame. Default (identity) when not matched. |
WinningDiagnostics | DiagnosticInfo WinningDiagnostics | Full verification result for the winning candidate. Default when not matched. |
Candidates | List<RoomRegistrationCandidate> Candidates | Every batch that was fully registered against, in evaluation order. Never null. |
LicenseRequired | bool LicenseRequired | True when the installed license lacked the multi-room feature bit; Candidates stays empty in that case. |
LicenseFailureReason | string LicenseFailureReason | Plain-language reason paired with LicenseRequired. |
IsMatched / IsAmbiguous / IsNoMatch | bool (get) | Convenience checks against State. |
WinningAnchorWorldPoses | List<Float3> WinningAnchorWorldPoses() | Matched only: the winning room’s anchor(s) mapped into the client’s world frame, one pose per member of the winning batch. Empty (never null) otherwise. |
RankedCandidateSummaries | List<(string RoomId, float Score, string Reason)> RankedCandidateSummaries() | Every candidate, best-first by combined score, with a plain-language reason string. Useful for an Ambiguous prompt. |
NoMatchReasons | List<(string RoomId, string Reason)> NoMatchReasons() | Every candidate’s best-effort, plain-language reason it did not win, keyed by room ID. |
See Diagnostics for what the underlying gates mean, and the accuracy writeup for measured numbers behind them.
RoomRegistrationCandidate
src/LansAnchor.AnchorSystem.Model/Runtime/RoomRegistrationCandidate.cs:7
One room’s full registration result inside a MultiRoomRegistrationResult.Candidates list.
| Member | Signature | Contract |
|---|---|---|
RoomId | string RoomId | The batch’s room identifier. |
Transform | TargetToSourceTransform Transform | This candidate’s registered transform, target frame to source frame. |
Inliers | int Inliers | Inlier count from this candidate’s registration run. |
Diagnostics | DiagnosticInfo Diagnostics | Full verification result for this specific room. |
SameRoomScore | float SameRoomScore | Pre-registration ranking hint for this room. -1 = quality-insufficient (no opinion); report-only, never used for winner selection. |
CombinedScore | float CombinedScore | Score actually used for cross-room winner selection and the margin gate. Saturates at 1.0 once overlap/normal-agreement/RMSE all clear their gates. |
Passes | bool Passes (get) | Diagnostics.IsReliable. |
Batch | AnchorBatch Batch | The batch this candidate was registered against. |
ReferenceFrameEpoch | int ReferenceFrameEpoch | Frame epoch of whichever batch member was actually registered against; used by WorldAnchorPoses to skip members from a known-different epoch. |
FailureReason | string FailureReason() | Best-effort, plain-language reason this candidate did not win. Null when it passed. |
WorldAnchorPoses | List<Float3> WorldAnchorPoses() | Maps every batch member’s source-frame anchor position into the client’s target frame. Members whose frame epoch is known to differ from ReferenceFrameEpoch are silently skipped. |
MultiRoomResultState
src/LansAnchor.AnchorSystem.Model/Runtime/MultiRoomResultState.cs:5
| Value | Meaning |
|---|---|
Matched | Exactly one room scored confidently above the margin gate. |
Ambiguous | Two or more rooms scored comparably close; never auto-resolves to a pick. |
NoMatch | No room passed verification, or none was supplied. |
RoomSourceEntry
src/LansAnchor.Unity/Assets/MeshBasedAnchoring/Anchoring/RoomSourceEntry.cs:10
One Inspector-configured room entry. MultiRoomAnchoring.BuildBatches() turns each entry into
one AnchorBatch.
| Member | Signature | Contract |
|---|---|---|
RoomId | string RoomId | Caller-assigned room identifier, used as an opaque string key only. |
SourceRoot | Transform SourceRoot | Root Transform whose child MeshFilters make up this room’s source scan. |
Anchor | Transform Anchor | Anchor position within this room. Defaults to SourceRoot’s own position when left unset at BuildBatches() time. |
Payload and transport
AnchorPayload
src/LansAnchor.AnchorSystem.Model/Runtime/AnchorPayload.cs:7
The N-tier wire format for one anchor inside a multi-room AnchorBatch. Distinct from
Anchoring.AnchorDescriptor (the single-room, Unity-side type above); this is the Model-layer
equivalent used by AnchorBatch.
| Member | Signature | Contract |
|---|---|---|
SourceFeatures | Feature[] SourceFeatures | Anchor-local feature set. |
CharacteristicLength | float CharacteristicLength | Median edge length of the source scan this payload was built from. |
GravityDirection | Float3 GravityDirection | Gravity direction the features were canonicalized against. |
AnchorPosition | Float3 AnchorPosition | World-space anchor position, source frame. |
FineRadius | float FineRadius | Radius (meters) the fine-tier ICP considers around the anchor. 0 = auto via EffectiveFineRadius(). |
RoomFeatures | Feature[] RoomFeatures | Optional whole-scan feature set (own room tier, distinct from the batch’s shared tier). |
FingerprintQuality | float FingerprintQuality | Same-room fingerprint richness score computed once at build time. 0 = not computed. |
FrameEpoch | int FrameEpoch | Which ARSession reset epoch this payload was captured in. -1 = not recorded. |
HasRoomTier | bool HasRoomTier (get) | True when RoomFeatures is non-null and non-empty. |
EffectiveFineRadius | float EffectiveFineRadius() | Returns FineRadius if set, else max(1.5 m, 8 x CharacteristicLength). |
DefaultFineRadius | static float DefaultFineRadius(float characteristicLength) | The formula EffectiveFineRadius() falls back to. |
ToBytes | byte[] ToBytes() | Serializes the payload to a binary blob. |
FromBytes | static AnchorPayload FromBytes(byte[] data) | Deserializes a blob produced by ToBytes(). Throws InvalidDataException on malformed/truncated input rather than allocating unbounded memory. |
AnchorBatch
src/LansAnchor.AnchorSystem.Model/Runtime/AnchorBatch.cs:8
Groups one or more AnchorPayloads under a caller-assigned room ID. This is what
MultiRoomAnchoring registers against; build one per room, either via
MultiRoomAnchoring.BuildBatches() or by hand for a custom pipeline.
| Member | Signature | Contract |
|---|---|---|
RoomId | string RoomId | Caller-assigned room identifier. |
Members | List<AnchorPayload> Members | The anchors that belong to this room. |
RoomFeatures | Feature[] RoomFeatures | Batch-level shared room tier, used when a member does not carry its own. |
HasRoomTier | bool HasRoomTier (get) | True when the batch-level RoomFeatures is non-null and non-empty. |
FingerprintQuality | float FingerprintQuality | Batch-level fingerprint quality, same semantics as AnchorPayload.FingerprintQuality. |
EffectiveRoomFeatures | Feature[] EffectiveRoomFeatures(AnchorPayload payload) | Returns payload’s own room tier if it has one, else the batch’s shared tier. Never averages across members. |
EffectiveFingerprintQuality | float EffectiveFingerprintQuality(AnchorPayload payload) | Same own-first resolution rule as EffectiveRoomFeatures, for the quality score. |
ToBytes | byte[] ToBytes() | Serializes the batch (and every member) to a binary blob. |
FromBytes | static AnchorBatch FromBytes(byte[] data) | Deserializes a blob produced by ToBytes(). Throws InvalidDataException on malformed/truncated input; per-member and per-feature counts are bound-checked before allocating. |
Results and diagnostics
DiagnosticInfo
src/LansAnchor.AnchorSystem.Model/Runtime/DiagnosticInfo.cs:6
Full verification result for one registration run. AnchorPose.Diagnostics,
RoomRegistrationCandidate.Diagnostics, and MultiRoomRegistrationResult.WinningDiagnostics are
all this type. See Diagnostics for a plain-language walkthrough and
the accuracy writeup for how these thresholds were calibrated.
| Member | Signature | Contract |
|---|---|---|
SourceFeatureCount / TargetFeatureCount | int | Feature counts on each side. Below the minimum floor, registration fails before verification even runs. |
CoarseYawDegrees | float | The coarse yaw hypothesis chosen before ICP refinement. |
YawAmbiguity | float | Competing-peak mass over dominant-peak mass, [0,1]. Near 1 in symmetric (Manhattan) rooms. Reported, never gates IsReliable. |
YawCandidatesTried | int | How many (yaw, translation) hypotheses were fully evaluated. 0 on the non-yaw-voting (RANSAC) path. |
FinalRmse | float | Point-to-plane RMSE, whole-cloud average, after global ICP. |
OverlapRatio | float | Fraction of target features within the association radius. Gate: >= OverlapMinReliable (0.30). |
FloorCoincidence | float | |source floor - mapped target floor| in meters. -1 when not checked (no gravity/floor). |
NormalAgreement | float | Fraction of overlapping pairs whose rotated target normal agrees with the source normal within 35 degrees. Gate: >= NormalAgreementMinReliable (0.27). Catches wrong-90-degree-yaw confusion RMSE alone cannot see. |
LocalRmse | float | Point-to-plane RMSE restricted to the fine-tier region around the anchor, after LocalIcpRefine. What the user experiences standing at the anchor. 0 when the fine-tier ICP did not run. |
FootprintCoverage | float | Fraction of the source anchor patch’s occupancy footprint the target scan also covers. Gate: >= CoverageMinReliable (0.20). -1 = not computed (no gravity, or source patch too sparse to trust). |
BidirYawDeltaDeg | float | Forward-then-reverse composed yaw error. Gate: <= BidirYawMaxDeg (12 degrees). -1 = not computed; only runs when the forward result sits in the low-certainty doubt band. |
SameRoomScore | float | Cheap pre-registration same-room fingerprint score. Report-only; measured non-separating on real rooms, never gates IsReliable. -1 = gate skipped (too sparse to trust). |
IsSameRoom | bool (get) | SameRoomScore >= 0.716. Report-only, same caveat as SameRoomScore. |
WasCancelled | bool | True when a CancellationToken was cancelled mid-run; IsReliable is always false in that case. |
LicenseRequired / LicenseFailureReason | bool / string | Set when RequireLicense was true and no valid license was present; ComputeTransform returns immediately rather than throwing. |
Confidence | float (get) | bestInliers / min(source, target) counts. Display-only; does not gate IsReliable. |
Certainty | float (get) | Minimum of the per-gate margins, each normalized so 1.0 = exactly at its own gate. Gate: >= CertaintyMinReliable (1.03). |
IsReliable | bool (get) | Conjunction of every hard gate above (feature floor, overlap, RMSE, floor, normal agreement, certainty, coverage, bidirectional yaw). The single field to check before trusting a result. |
Format | string Format() | Human-readable multi-line summary, the same text written to the FeatureRegistration_*.log file. |
Candidates | CandidateDiagnostic[] | One row per fully-evaluated (yaw, translation) hypothesis, for offline debugging. Null on paths that skip the multi-hypothesis loop. |
RegistrationProgress
src/LansAnchor.AnchorSystem.Model/Runtime/RegistrationProgress.cs:6
One snapshot delivered through ManualAnchoring.OnProgress/MultiRoomAnchoring.OnProgress or
RegistrationParams.OnProgress directly.
| Member | Signature | Contract |
|---|---|---|
Phase | readonly RegistrationPhase Phase | Which phase this snapshot belongs to. |
Current | readonly int Current | 1-based index of the unit just completed within this phase (for example, candidate 4 of 30). 0 for phases with no i-of-N breakdown. |
Total | readonly int Total | Total units expected in this phase. 0 when not applicable. |
Candidate-phase reports may arrive from worker threads; every other phase reports from the
caller’s own thread. ManualAnchoring/MultiRoomAnchoring both marshal this onto the main
thread before invoking their UnityEvent; a caller using RegistrationParams.OnProgress
directly is responsible for its own marshaling.
RegistrationPhase
src/LansAnchor.AnchorSystem.Model/Runtime/RegistrationPhase.cs:5
| Value | Meaning |
|---|---|
FeatureExtraction | Reading mesh vertices/normals into Features (source and/or client side). |
Coarse | Descriptor matching plus yaw/occupancy candidate generation, before per-candidate evaluation. |
Candidates | Per-candidate evaluation loop (floor lock, ICP refine, verification). One report per candidate completion. |
FineRefine | Anchor-local second-stage ICP, after the global transform is already selected. |
Room | Multi-room fan-out: one report per room evaluated. Single-room callers never report this phase. |
AnchorResult<T>
src/LansAnchor.Unity/Assets/MeshBasedAnchoring/Anchoring/AnchorResult.cs:3
Generic success/failure wrapper returned by TryCreateAnchor (as AnchorResult<AnchorDescriptor>)
and TryImportAnchor (as AnchorResult<AnchorPose>).
| Member | Signature | Contract |
|---|---|---|
IsSuccess | readonly bool IsSuccess | Whether the operation succeeded. |
Value | readonly T Value | The result value. Populated on both success and failure (a failed TryCreateAnchor still returns a partial descriptor with feature counts and strength). |
FailureReason | readonly string FailureReason | Plain-language failure message. Null on success. |
Success | static AnchorResult<T> Success(T value) | Constructs a success result. |
Failure | static AnchorResult<T> Failure(T value, string reason) | Constructs a failure result. |
Presets and tuning
RegistrationParams
src/LansAnchor.AnchorSystem.Model/Runtime/RegistrationParams.cs:7
Pure-data configuration struct for one registration run. Most projects never construct this
directly; ManualAnchoring/MultiRoomAnchoring’s Inspector fields (see
Manual anchoring) build it for you. The fields below matter when
calling TryImportAnchor/ComputeTransform yourself, or tuning the no-gravity RANSAC fallback.
Feature extraction
| Member | Type | Contract |
|---|---|---|
AnchorRadius | float | Radius (meters) around the anchor used to build the source feature set. Default 5. |
MaxTargetFeatures | int | Global cap on client-side features. Default 3000. |
CurvatureMin | float | Minimum curvature for a vertex to count as a feature. Default 0.05. |
AnchorPlacementRadius | float | Radius to auto-relocate the anchor to nearby distinctive geometry. 0 disables. |
Matching and RANSAC (no-gravity fallback path only)
| Member | Type | Contract |
|---|---|---|
CurvDiffMax | float | Max curvature difference between a query feature and a source candidate. |
GeometryConsistency | float | Max pairwise-distance difference (meters) tolerated within a correspondence set. |
GeometryConsistencyScaleTolerance | float | Fractional version of the check above, used instead when EstimateScale is true and this is > 0. |
MinSampleSpread | float | Minimum distance between features sampled in the same RANSAC iteration. |
RansacIterations | int | Iteration count for the RANSAC fallback. |
InlierThreshold | float | Max spatial distance for a transformed point to count as an inlier. Also feeds RmseThreshold/FloorTolerance on the gravity path. |
EarlyExitInlierRatio | float | Stop RANSAC early once this fraction of target features are inliers. |
InlierSampleSize | int | Sample size for inlier counting instead of scanning every target feature. |
MinCorrespondences | int | Minimum correspondences per iteration to attempt Kabsch-Umeyama. |
MinItersBeforeEarlyExit | int | Iterations that must run before early exit is allowed. |
MaxTiltDegrees | float | Rejects candidates that tilt world up by more than this. No-gravity path only. |
EstimateScale | bool | Solve for uniform scale as well as rotation/translation. Leave false when both devices share physical scale. |
Seed | int | RANSAC random seed. Fixed at 0 by ManualAnchoring.BuildParams() for determinism. |
Gravity path (default) and scale-relative thresholds
| Member | Type | Contract |
|---|---|---|
GravityDirection | Float3 | Enables the entire gravity path (yaw voting, floor lock, ICP, relative thresholds) when non-zero. |
InlierThresholdRel / GeometryConsistencyRel | float | Thresholds as multiples of characteristic length; resolved to absolute values by ResolveSpatialThresholds. |
CharacteristicLength | float | The length these relative thresholds were last resolved against. Local per-device, not serialized. |
LockFloorHeight | bool | Lock vertical translation to the difference in estimated floor heights instead of solving it from correspondences. |
UseYawVoting | bool | Use the single-shot yaw-voting solver instead of per-iteration RANSAC on the gravity path. |
UseSegmentCandidates | bool | Opt-in third coarse-candidate source (structural segment matching). Off by default. |
RefineWithIcp | bool / IcpMaxIters int | Whether to run gravity-constrained point-to-plane ICP refine, and its iteration cap. |
Fine-tier ICP
| Member | Type | Contract |
|---|---|---|
RefineLocalIcp | bool | Run the anchor-local second-stage ICP after the global transform is accepted. |
AnchorWorldPosition | Float3 | Source-frame anchor position the fine tier centers on. Required when RefineLocalIcp is on. |
FineRadius | float | Radius the fine-tier ICP considers. 0 = auto. |
FineIcpMaxDistRel | float | Fine-tier correspondence-rejection distance as a multiple of characteristic length. |
FineIcpMaxIters | int | Max fine-tier ICP iterations. |
MinCorrespondenceFraction | float | Minimum fraction of queried points that must associate on ICP’s first pass, or refinement bails out early. 0 disables. |
Advanced/experimental
| Member | Type | Contract |
|---|---|---|
DenseGlobalRefine | bool | Opt-in post-selection dense whole-cloud ICP re-refine of the already-chosen winner. |
DenseGlobalPointBudget / DenseGlobalMaxIters | int | Point budget and iteration cap for the dense global refine pass. |
MaxDegreeOfParallelism | int | Parallelism for the per-candidate loop. 0 = Environment.ProcessorCount. Perf-only; does not change results. |
DescriptorMatchTargetSampleCap | int | Opt-in stride-subsampling of the target side of descriptor matching. 0 = off (default, every target feature matched). |
UseNccOccupancyScore / UseWallNormalCellWeights | bool | Experimental occupancy-correlation scoring variants. Off by default. |
Licensing and runtime
| Member | Type | Contract |
|---|---|---|
RequireLicense | bool | When true, ComputeTransform checks for a valid license before doing any work and returns a clean LicenseRequired result rather than throwing. |
OnProgress | Action<RegistrationProgress> | Optional progress callback, invoked synchronously/inline. Marshaling to a UI thread is the caller’s responsibility. |
CancellationToken | CancellationToken | Optional cooperative cancellation, checked between phases and candidates. |
Methods
| Member | Signature | Contract |
|---|---|---|
ResolveSpatialThresholds | RegistrationParams ResolveSpatialThresholds(float characteristicLength) | Returns a copy with InlierThreshold/GeometryConsistency resolved to absolute meters against characteristicLength. |
ResolveSpatialThresholds | RegistrationParams ResolveSpatialThresholds(float lengthA, float lengthB) | Same, resolved against max(lengthA, lengthB) (the coarser of two scans). |
Default | static RegistrationParams Default | The shipped default configuration: gravity path on, yaw voting on, ICP refine on, EstimateScale = true. |
InspectorPreset
src/LansAnchor.Unity/Assets/MeshBasedAnchoring/Anchoring/InspectorPreset.cs:7
| Value | Meaning |
|---|---|
Fast | Lower compute budget: fewer target features, fewer RANSAC/ICP iterations, looser fit tolerance. Never disables the room tier. |
Balanced | Matches RegistrationParams.Default/ManualAnchoring’s own field defaults exactly. |
Precise | Higher compute budget and tighter fit tolerance than Balanced. |
Custom | A slider was moved away from its preset’s exact value. Never written by a preset lookup; only detected. |
ManualAnchoringPresetMapper
src/LansAnchor.Unity/Assets/MeshBasedAnchoring/Anchoring/ManualAnchoringPresetMapper.cs:27
(nested ThoroughnessValues at :33)
Pure data/logic behind the simple-mode Inspector (preset dropdown plus Thoroughness/Fit Tolerance sliders). Raising Thoroughness makes the algorithm try more candidates; it does not raise the physical accuracy ceiling (see the accuracy writeup).
| Member | Signature | Contract |
|---|---|---|
ThoroughnessValues | struct { MaxTargetFeatures, RansacIterations, MinItersBeforeEarlyExit, IcpMaxIters, FineIcpMaxIters } | The five fields a Thoroughness setting maps to. |
Fast / Balanced / Precise | static readonly ThoroughnessValues | Canned values for each named preset. Balanced is byte-identical to ManualAnchoring’s own field defaults. |
ThoroughnessFor | static ThoroughnessValues ThoroughnessFor(InspectorPreset preset) | Looks up the canned values for a named preset (Custom falls back to Balanced). |
ThoroughnessForSlider | static ThoroughnessValues ThoroughnessForSlider(float t) | Piecewise-linear interpolation across [0, 1] (0 = Fast, 0.5 = Balanced, 1 = Precise), rounded per field. |
MinInlierThreshold / MaxInlierThreshold | const float | Hard floor/ceiling (0.05 m / 0.50 m) the Fit Tolerance slider cannot exceed either direction. |
FitToleranceFor | static float FitToleranceFor(InspectorPreset preset) | Resolves a preset to an InlierThreshold value, clamped to the floor/ceiling above. |
FitToleranceForSlider | static float FitToleranceForSlider(float t) | Same resolution, continuous over [0, 1]. Note the direction: 1 (Precise) means a smaller, tighter InlierThreshold, the opposite direction from the Thoroughness slider’s own [0, 1]. |
ClampInlierThreshold | static float ClampInlierThreshold(float value) | Clamps any value to [MinInlierThreshold, MaxInlierThreshold]. |
RoomTierFor | static bool RoomTierFor(InspectorPreset preset) | Always returns true. Room tier is never disabled by a preset. |
SliderValueFor | static float SliderValueFor(InspectorPreset preset) | The exact slider position (0, 0.5, or 1) a named preset corresponds to. |
DetectPreset | static InspectorPreset DetectPreset(float thoroughnessSlider, float fitToleranceSlider) | Returns the matching named preset if both sliders sit exactly on one, else Custom. |
Next
- Scene setup for a single anchor: Manual anchoring.
- Scene setup for several rooms: Multi-room anchoring.
- Reading the fields on
DiagnosticInfoin practice: Diagnostics. - Why the gate thresholds above are set where they are: the accuracy writeup.