Mission-Control-MRI-VR

Assembly-CSharp

AlignCanvasWithView AnimationController
ArrowPointer AutomaticPauser
CameraDepthSetter CanvasActivator
IgnoredCanvas CaretHandler
CollisionEvent CollisionManager
ColorChanger ConfirmLookDirection
ControllerInputDetector CountdownAudioPlayer
CustomButtonInteractionHandler ButtonAction
EnableXR DragXRRig
EventSequence SequenceEntry
TriggerTagPair FadeScreen
FadeBackend FeedbackLogger
FeedbackEvent FullProjectCleaner
GraphicsImprover HeadsetType
HandleCollisionDetectionWithEvents HandleReticleCollision
HeadCollisionDetector HeadCollisionHandler
KeyboardDisplayer LanguageManager
Lang LoadingFillImage
LocationSetup LocationTransition
ManagedAudioSource ManagedVideoPlayer
ManualRealigner MenuManager
MenuPauser AxisSlider
CapsLockHighlight KeyboardKeyFunc
Function KeyboardValueKey
NonNativeKeyboard LayoutType
SymbolDisableHighlight SymbolKeyboard
UICollection MTQuadTreeBuildNode
MoonMovement MoonTripDurationController
OpenWebLink PlaySoundLoopSimple
ReticleController SceneController
ScenePrewarmer SceneSwitcher
SecretButtonClicker Segment
TextDisplayer VertexAnim
TMP_DigitValidator TMP_PhoneNumberValidator
TrackOriginChanges Dwyer
Incremental ITriangulator
SweepLine SplayNode
SweepEvent SweepEventVertex
Behavior Carver
BadSubseg BadTriangle
Osub Otri
Segment Triangle
Vertex FindDirectionResult
BoundingBox Edge
EdgeEnumerator InputGeometry
ISegment ITriangle
Point RegionPointer
InsertVertexResult DataReader
DebugWriter FileReader
FileWriter IGeometryFormat
IMeshFormat InputTriangle
TriangleFormat LocateResult
ILog\`1 ILogItem
SimpleLog SimpleLogItem
Mesh NewLocation
NodeNumbering Primitives
Quality Sampler
ISmoother SimpleSmoother
AdjacencyMatrix BoundedVoronoi
CuthillMcKee IVoronoi
QuadNode QuadTree
QualityMeasure AlphaMeasure
Q_Measure RegionIterator
Statistic Voronoi
VoronoiRegion TriangleLocator
TriangulationAlgorithm VertexType
UIUtils UpdateDropdownOptions

AlignCanvasWithView

Keeps a world-space canvas facing the VR camera at a fixed distance, with optional horizontal-only rotation and smooth interpolation.

AlignCanvasWithView.Update

Updates canvas position and rotation each frame to follow the VR camera smoothly.

AnimationController

Provides simple control over an Animator, including the ability to skip directly to the end of a specified animation state.

AnimationController.SkipToEndOfAnimation(stateName)

Instantly jumps the specified animation state to its final frame.

Name Description
stateName System.String
The name of the animation state to fast-forward.

ArrowPointer

Rotates an object (e.g., an arrow) to smoothly point toward a target in 3D space. Can optionally aim toward the center of the target’s Renderer instead of its pivot.

ArrowPointer.Update

Updates the arrow’s rotation each frame to face the target smoothly.

AutomaticPauser

Automatically pauses gameplay and plays audio feedback clips at timed intervals. Handles multilingual audio, text display on pause, and resuming after playback.

AutomaticPauser.DisplayMovingCanvasInFront

Displays the moving text canvas in front of the player and loads its text content.

AutomaticPauser.GetCurrentAudioClips

Returns the appropriate audio list based on the current language.

AutomaticPauser.PauseRoutine

Waits for the defined delay, then automatically pauses the simulation, displays the text canvas, and plays the next audio feedback clip. Skips execution if the automatic pause was disabled or stopped externally (e.g., if the user refocused their gaze on the moon before the timer completed).

AutomaticPauser.PlayNextClip

Plays the next audio clip and triggers pause if necessary.

AutomaticPauser.SetAudioIndex(System.Int32)

Sets the index of the next audio clip to play.

AutomaticPauser.SetIsPauseAutomatic(System.Boolean)

Enables or disables automatic pause directly.

AutomaticPauser.SetIsPauseAutomatic(dropdown)

Updates the automatic pause mode based on a UI dropdown value.

Name Description
dropdown UnityEngine.UI.Dropdown
Dropdown with 0 = manual pauses only, 1 = automatic.

AutomaticPauser.StartAutomaticPauser

Starts the automatic pause sequence if enabled.

AutomaticPauser.StopCountdownExternally

Stops the automatic pause routine, typically called from other scripts to interrupt the sequence.

AutomaticPauser.Update

Resets internal flags when audio playback finishes.

AutomaticPauser.WaitXSeconds(System.Single)

Waits for a given duration in real time before advancing the text segment.

CameraDepthSetter

Ensures the attached camera maintains a specified rendering depth, updating automatically both in Play mode and the Unity Editor.

CameraDepthSetter.Awake

Initializes the camera reference and applies the configured depth.

CameraDepthSetter.OnValidate

Called when the script is loaded or a value is changed in the Inspector. Ensures the camera depth is updated in the Editor.

CameraDepthSetter.UpdateCameraDepth

Updates the camera’s rendering depth based on the serialized value.

CanvasActivator

Manages activation and deactivation of all canvases in the current scene except specified ones, with support for ignored canvases and state restoration. Useful for temporarily disabling all active UI elements except specified ones (e.g., during a pause).

CanvasActivator.DisableAllCanvasesExceptIgnored

Disables all currently active canvases except the ignored ones, saving their previous enabled state for later restoration.

CanvasActivator.FindAllActiveCanvases

Finds all currently active canvases in the scene (enabled and active in hierarchy), excluding those specified in the ignored list.

IgnoredCanvas

Represents a canvas to ignore during activation/deactivation, optionally including its child canvases.

CanvasActivator.IsChildOf(UnityEngine.Transform,UnityEngine.Transform)

Checks if a given transform is a child of another transform.

CanvasActivator.RestoreCanvasStates

Restores the enabled state of all canvases previously disabled by DisableAllCanvasesExceptIgnored.

CanvasActivator.ShouldIgnoreCanvas(UnityEngine.Canvas)

Determines whether a canvas should be ignored based on the ignore list and hierarchy rules.

CaretHandler

Positions the caret of a TMProTMP_InputField exactly at the user’s click location. Designed for VR and UI contexts — does not require a camera reference. Prevents full text selection on focus and disables soft keyboard display.

CaretHandler.Awake

Initializes references and configures the input field to avoid full selection and unwanted keyboard display.

CaretHandler.GetNearestCharacterIndex(localClick)

Finds the index of the character closest to the click position within the text.

Name Description
localClick UnityEngine.Vector2
Local click coordinates relative to the text rectangle.

Returns

Index of the nearest character for caret placement.

CaretHandler.OnPointerDown(eventData)

Called when the user clicks or taps on the text field. Moves the caret to the closest character to the click position and consumes the event.

Name Description
eventData UnityEngine.EventSystems.PointerEventData
Pointer event data containing click position.

CollisionEvent

Defines a single collision rule, pairing a specific collider with UnityEvents for OnTriggerEnter, OnTriggerStay, and OnTriggerExit.

CollisionManager

Handles trigger-based collision detection for a group of predefined colliders, delegating scanner-related collision events to a LocationTransition script.

Remarks

TODO: Refactor so the parent object manages collisions for all child colliders automatically.

CollisionManager.HandlePlayerBottomCollision

Handles collision logic when the player interacts with the bottom scanner zone.

CollisionManager.HandlePlayerExitingArea

Handles logic when the player exits the defined interaction area. (e.g., fade-out, show UI hints, manage re-entry logic.)

CollisionManager.HandlePlayerTopCollision

Handles collision logic when the player interacts with the top scanner zone.

CollisionManager.OnTriggerExit(other)

Called when another collider exits this trigger. Triggers exit handling if the collider matches the configured exit object.

Name Description
other UnityEngine.Collider
The collider that exited the trigger area.

CollisionManager.OnTriggerStay(other)

Called while another collider stays within this trigger. Detects specific colliders and triggers corresponding scanner events.

Name Description
other UnityEngine.Collider
The collider currently intersecting this trigger.

ColorChanger

Changes the color of a specified UI UnityEngineUI.Image component. Can be used for visual feedback, UI highlighting, or state indication.

ColorChanger.ChangeImageColor

Applies the configured color to the target image, if assigned.

ConfirmLookDirection

Detects when the player (or camera) is looking in a specified direction within a given angle threshold. Invokes corresponding UnityEvents when the look direction is confirmed or unconfirmed. Useful for gaze-based interactions, calibration, or direction-based triggers in VR.

ConfirmLookDirection.SetTargetDirection(newDirection, newThreshold)

Dynamically updates the target direction and optional angle threshold at runtime.

Name Description
newDirection UnityEngine.Vector3
New target world-space direction to track.
newThreshold System.Single
Optional new acceptance angle (defaults to 15°).

ConfirmLookDirection.Start

Validates the camera reference at startup.

ConfirmLookDirection.Update

Checks each frame whether the camera is facing the target direction within the specified angle threshold. Invokes the corresponding UnityEvent based on the result.

ControllerInputDetector

Detects and manages VR controller input for both real devices and the XR Device Simulator. Handles primary, trigger, and menu buttons, as well as combo inputs (Y + joystick direction). Includes support for long press detection with visual and audio feedback.

ControllerInputDetector.DetectSecretButtonCombo(yPressed, stick, isLeft)

Detects a hidden button combination using the Y button and joystick direction. Invokes ControllerInputDetectorOnYLeftCombo or ControllerInputDetectorOnYRightCombo when the combo is valid and prevents repeated triggering while held.

Name Description
yPressed System.Boolean
True if the Y button is pressed.
stick UnityEngine.Vector2
Current joystick axis value.
isLeft System.Boolean
True if the input is from the left controller; false if from the right.

ControllerInputDetector.HandleDefaultInput

Handles hardware controller inputs for both hands.

ControllerInputDetector.HandleHoldInput(System.Boolean,System.Boolean)

Handles trigger button hold detection and associated visual/audio feedback.

ControllerInputDetector.HandleSimulatorInput

Handles XR Device Simulator inputs (keyboard/mouse-based testing).

ControllerInputDetector.InitializeDevices

Initializes XR input devices for left and right hands.

ControllerInputDetector.IsAnyHandPressed

Determines whether any hand (left or right) currently has its trigger button pressed. Includes checks for both XR devices and XR Device Simulator input actions.

Returns

True if at least one hand trigger is pressed; otherwise, false.

ControllerInputDetector.OnHoldTriggered

Invokes the configured UnityEvent when a hold action has been successfully detected. Prevents multiple invocations until all triggers are released.

ControllerInputDetector.SetHoldingEnabled(System.Boolean)

Enables or disables hold detection behavior globally.

ControllerInputDetector.Update

Updates input state each frame. Ensures controllers are initialized and processes input for both real XR devices and the XR Device Simulator.

CountdownAudioPlayer

Manages timed playback of a sequence of audio clips with countdown intervals, looping, language support (French/English), and event-based progression control.

Remarks

Supports multiple playback modes: - Countdown before playback - Continuous looping with stop condition - Automatic index incrementing based on trip duration (from MoonMovement) - Replay or stop at end Also triggers a UnityEvent when a clip finishes playing.

CountdownAudioPlayer.CountdownRoutine(System.Boolean)

Coroutine that waits for an optional previous clip, then plays the next one after the countdown delay.

CountdownAudioPlayer.CountdownRoutineUntilStop(System.Boolean)

Coroutine that loops through audio clips sequentially until manually stopped.

CountdownAudioPlayer.GetCurrentAudioClips

Returns the currently active list of audio clips based on the selected language.

CountdownAudioPlayer.PlayNextClipAfterCountdown(System.Boolean)

Starts a countdown and plays the next clip in sequence once.

CountdownAudioPlayer.PlayNextClipAfterCountdownUntilStop(System.Boolean)

Continuously plays clips in sequence after each countdown, until externally stopped.

CountdownAudioPlayer.PlaySpecificClipAfterCountdown(clipIndex)

Starts a countdown before playing a specific clip once.

Name Description
clipIndex System.Int32
The index of the clip to play after the countdown.

CountdownAudioPlayer.PlaySpecificClipAfterCountdownRoutine(System.Int32)

Coroutine handling the countdown and playback of a specific clip.

CountdownAudioPlayer.PlaySpecificClipInLoopAfterCountdown(System.Int32)

Starts a countdown, then plays the specified clip in a repeating loop until externally stopped.

CountdownAudioPlayer.PlaySpecificClipInLoopAfterCountdownRoutine(System.Int32)

Coroutine that loops playback of a single clip after each countdown period, until externally stopped.

CountdownAudioPlayer.SetCountDownTimer(System.Single)

Sets the countdown timer duration (in seconds) before the next audio clip plays.

CountdownAudioPlayer.SetCurrentClipIndex(System.Int32)

Manually sets the index of the next audio clip to play.

CountdownAudioPlayer.SetReplayAudios(System.Boolean)

Enables or disables looping playback of audio sequences when reaching the end.

CountdownAudioPlayer.Start

Ensures that an AudioSource is assigned at startup.

CountdownAudioPlayer.StartIndexIncrementCountdown

Begins automatic clip index scheduling based on trip duration from MoonMovement.

CountdownAudioPlayer.StopAudio

Immediately stops the current audio playback (if any).

CountdownAudioPlayer.StopCountdownExternally

Stops any active countdown or looping coroutines immediately.

CountdownAudioPlayer.StopIndexIncrementCountdown

Stops automatic clip index scheduling.

CountdownAudioPlayer.Update

Monitors audio playback completion, invokes OnFinishPlayback, and handles scheduled index increments.

CustomButtonInteractionHandler

Custom handler for UI button interactions, managing press, hold, and release events. Allows assigning UnityEvents for both continuous (hold) and discrete (release) actions, while coordinating controller input through a ControllerInputDetector to avoid conflicts during interaction.

CustomButtonInteractionHandler.AddEventTrigger(button, action)

Adds pointer down and pointer up event triggers to a button for detecting hold and release.

Name Description
button UnityEngine.UI.Button
The button to add triggers to.
action CustomButtonInteractionHandler.ButtonAction
The associated button action containing UnityEvents.

ButtonAction

Defines a button and its associated hold/release events.

CustomButtonInteractionHandler.OnButtonDown(action)

Called when a button is pressed down. Disables controller holding input and marks the button as held.

Name Description
action CustomButtonInteractionHandler.ButtonAction
The button action associated with the pressed button.

CustomButtonInteractionHandler.OnButtonUp(action)

Called when a button is released. Re-enables controller holding input, resets the button state, and invokes the release event.

Name Description
action CustomButtonInteractionHandler.ButtonAction
The button action associated with the released button.

CustomButtonInteractionHandler.Start

Initializes the button state map and sets up pointer event triggers for each button.

CustomButtonInteractionHandler.Update

Invokes the ButtonAction.onHold event for any button currently being held down.

EnableXR

This fixes issues with XR tools (Steam VR, Oculus Meta XR Simulator, ect.) not launching when in play mode. Attach to a game object in a scene using XR. Unity 2022.3 appears to not always dispose of the loader in XRGeneralSettings.Instance.Manager. This results in the console runtime error “Failed to set DeveloperMode on Start.” This should only be an issue in the editor, so this script stops the XR loader and then restarts it. This script doesn’t always activate the loader, maybe due to order of Awake calls, but it works most of time. Exiting Play mode and starting it again usually results in the XR loader launching… This script is based on the solution discussed here -> https://www.anton.website/enable-unity-xr-in-runtime/

DisableXR

Disables XR

DragXRRig

Moves the XR Rig in sync with this object’s transform, allowing indirect dragging of the player rig. Typically used when an interactable object (e.g., a bed or platform) is moved, and the XR Rig should follow that movement smoothly in world space.

DragXRRig.DoDragging

Coroutine that continuously updates the XR Rig position to follow this object’s movement. Runs every frame until dragging is stopped.

DragXRRig.PerformDragging

Begins the dragging process and starts the coroutine that updates XR Rig movement.

DragXRRig.Start

Initializes the object’s position to match the initial bed position and records it for tracking.

DragXRRig.Update

Checks if the object has moved since the last frame and starts dragging if movement is detected.

EventSequence

Manages a sequence of timed and event-driven steps. Originally developed by Michel Mohr; extended to include: - UnityEvents triggered when the script is disabled. - Optional automatic restart when re-enabled. Support for pausing, resuming, and custom external triggers.

EventSequence.Awake

Starts the sequence on Awake if enabled.

EventSequence.OnDisable

Invokes the onDisable event when disabled.

EventSequence.OnEnable

Restarts the sequence if already started.

EventSequence.RestartSequence

Restarts the sequence from the beginning.

SequenceEntry

Represents a single entry in the event sequence.

EventSequence.SequenceEnumerator

Coroutine that processes the sequence entries.

EventSequence.SetClearTriggersAfterTriggers(System.Boolean)

Sets whether to clear triggers after each trigger.

EventSequence.SetPause(System.Boolean)

Pauses or resumes the sequence.

EventSequence.SetTrigger(System.String)

Adds or updates a trigger.

EventSequence.StartSequence

Starts the sequence.

EventSequence.StartSequence(UnityEngine.Events.UnityAction)

Starts the sequence with an optional completion callback.

TriggerTagPair

Associates a trigger string with a tag.

EventSequence.Update

Updates the wait timer if not paused.

FadeScreen

Handles smooth screen fade transitions using either a Composition Layer (preferred) or a standard Renderer as fallback. Provides a unified API for fading in/out between black and transparent states, supporting both runtime control and editor preview.

Remarks

This component automatically selects the most suitable backend: - : uses UnityXR.CompositionLayers.Extensions.ColorScaleBiasExtension for efficient per-eye fades. - : uses a material alpha property as a fallback for non-layer environments. Supports automatic fade on start, runtime backend switching, and debug HUD display.

FadeScreen.ActivateRendererIfPresent

Enables the fallback renderer if it exists and is currently inactive.

FadeScreen.ApplyAlphaScale(System.Single)

Updates the alpha bias of the UnityXR.CompositionLayers.Extensions.ColorScaleBiasExtension component.

FadeScreen.ApplyBackendActivation

Activates or disables the proper rendering backend according to the selected mode.

FadeScreen.Awake

Initializes the fade backend by detecting available components and preparing default textures if needed.

FadeScreen.Fade(alphaIn, alphaOut)

Starts a fade transition from a given start alpha to end alpha. Automatically selects CompositionLayer or Renderer backend.

Name Description
alphaIn System.Single
Starting alpha (1 = black, 0 = transparent).
alphaOut System.Single
Target alpha (1 = black, 0 = transparent).

FadeBackend

Determines which fade rendering backend to use.

FadeScreen.FadeCompositionRoutine(System.Single,System.Single)

Smoothly interpolates fade alpha over time using the Composition Layer backend.

FadeScreen.FadeIn

Performs a fade-in transition (from black to clear).

FadeScreen.FadeOut

Performs a fade-out transition (from clear to black).

FadeScreen.FadeRendererRoutine(System.Single,System.Single)

Smoothly interpolates fade alpha over time using the Renderer material as fallback.

FadeScreen.GetFadeDuration

Returns the current fade duration in seconds.

FadeScreen.OnGUI

Displays a simple HUD overlay showing which fade backend is active. Only available in Editor or Development builds.

FadeScreen.PerformFade(targetAlpha)

Performs a fade to a target alpha, detecting the current alpha automatically.

Name Description
targetAlpha System.Single
Target fade alpha (1 = black, 0 = transparent).

FadeScreen.SetFadeDuration(System.Single)

Sets a new fade duration in seconds.

FadeScreen.ShouldUseCompositionLayer

Determines whether Composition Layers should be used based on the selected backend and component availability.

FadeScreen.Start

Automatically fades in at start if fadeOnStart is enabled.

FeedbackLogger

Collects and records user feedback events over time, including timestamps and session metadata, and exports the results to a structured CSV file for later analysis.

Remarks

The logger automatically handles key app lifecycle events (pause, focus loss, quit) to ensure logs are saved even if the session ends unexpectedly. Each event entry contains: - The participant or record ID - The session identifier - The local date and time - The event timestamp (relative to app time) - The feedback type Example filename: Participant01_SessionA__logs_moontrip_appPause_20251127_2042.csv

FeedbackLogger.CalculateDurations

Calculates total duration per feedback type (optional).

FeedbackEvent

Represents a single feedback event, containing a type label and a timestamp.

FeedbackLogger.OnApplicationFocus(System.Boolean)

Saves logs when the app loses focus (e.g., user opens system menu or Meta button).

FeedbackLogger.OnApplicationPause(System.Boolean)

Automatically saves progress when the app is paused (e.g., system interruptions).

FeedbackLogger.OnApplicationQuit

Ensures logs are automatically saved when the application quits.

FeedbackLogger.RegisterFeedback(System.String)

Registers a feedback event if recording is active and enabled.

FeedbackLogger.SaveLogToCsv

Saves the feedback log to a CSV file in persistent data path.

FeedbackLogger.SetContext(System.String)

Sets the pause context used in the CSV filename.

FeedbackLogger.SetRecordID(id)

Sets the record ID used in the CSV filename and file header.

Name Description
id System.String
The participant or record identifier.

FeedbackLogger.SetRecordIDFromTMP(inputField)

Sets the record ID from a TextMeshPro input field.

Name Description
inputField TMPro.TMP_InputField
The TMP_InputField containing the ID text.

FeedbackLogger.SetRecordSession(session)

Sets the session identifier used in the CSV filename and file header.

Name Description
session System.String
A unique session name or number.

FeedbackLogger.SetRecordSessionFromTMP(inputField)

Sets the session identifier from a TextMeshPro input field.

Name Description
inputField TMPro.TMP_InputField
The TMP_InputField containing the session text.

FeedbackLogger.SetShouldRecord(System.Boolean)

Enables or disables logging for this run.

FeedbackLogger.StartRegister

Starts recording feedback events if shouldRecord is enabled.

FeedbackLogger.StopRegister

Stops recording and saves the feedback log to a CSV file.

FullProjectCleaner

Provides a set of editor tools for safely cleaning a Unity project. Includes utilities for: - Removing missing MonoBehaviour scripts - Detecting renderers without materials - Clearing project cache folders (Library, Temp, obj) - Clearing editor-specific caches (Inspector, ScriptAssemblies) - Resetting lightmap-related material keywords These tools are accessible via the Unity Editor menu under:

Remarks

The cleaning actions here modify project assets and files. Always commit or back up your project before running the cache deletion functions.

This script is editor-only and excluded from runtime builds.

FullProjectCleaner.CleanMissingAndBrokenRenderers

Scans all scene GameObjects for missing MonoBehaviours and renderers without assigned materials. Removes missing scripts safely and logs detected issues.

FullProjectCleaner.Cleanup

Scans all materials in the project and disables obsolete lightmap keywords such as LIGHTMAP_ON and DIRLIGHTMAP_COMBINED. Helps reduce shader variant clutter in builds.

FullProjectCleaner.ClearEditorCache

Clears cached editor data such as and Inspector settings. This can resolve persistent editor errors without affecting project assets.

FullProjectCleaner.ClearUnityCache

Deletes the , , and folders in the project. Unity will automatically rebuild them the next time it opens. This can help fix serialization or import cache issues.

GraphicsImprover

Automatically configures graphics and XR settings for optimal performance on Meta Quest headsets, and exposes UnityEvents for pause and focus transitions.

Remarks

This component dynamically adjusts URP render scale, refresh rate, and foveated rendering depending on the detected headset model.

It also triggers UnityEvents when the application pauses or loses focus, allowing developers to hide controllers, pause simulations, or mute audio.

GraphicsImprover.Awake

Initializes application-level graphics and XR settings when the scene loads. This method runs before Start() and configures the render pipeline for optimal performance.

GraphicsImprover.DetectHeadset

Detects the current headset model based on Android device identifiers.

GraphicsImprover.GetTargetRenderScale

Returns the target URP render scale depending on the detected headset.

HeadsetType

Supported headset types used for automatic optimization.

GraphicsImprover.InitXRDisplay

Initializes the XRDisplaySubsystem reference if XR is active.

GraphicsImprover.OnApplicationFocus(hasFocus)

Called when the application loses or regains focus (e.g., Meta Home button pressed, system overlay, or casting interruption).

Name Description
hasFocus System.Boolean
True if the app regains focus, false if another app takes focus.

GraphicsImprover.OnApplicationPause(pauseStatus)

Called automatically when the application is paused or resumed (e.g., when the headset is removed or the app goes into the background).

Name Description
pauseStatus System.Boolean
True if the app is paused, false if resumed.

GraphicsImprover.OnApplicationQuit

Called when the application is about to quit. Resets graphics settings and clears temporary PlayerPrefs values.

GraphicsImprover.ResetRenderScale

Resets URP render scale to 1.0 (default) when exiting play mode or application quit.

GraphicsImprover.ResetRenderScaleInEditor

Ensures render scale resets properly after exiting Play Mode in the Editor.

GraphicsImprover.SetFoveatedRenderingLevel(System.Int32)

Configures the headset’s foveated rendering level and enables gaze-based foveation.

GraphicsImprover.SetRefreshRate

Adjusts the device refresh rate and texture resolution scale based on the detected headset.

HandleCollisionDetectionWithEvents

Handles collision detection for a configurable list of target colliders, triggering custom UnityEvents when they enter, stay, or exit the trigger zone.

Remarks

HandleCollisionDetectionWithEvents.DisableCollisionDetection

Disables all collision event detection.

HandleCollisionDetectionWithEvents.EnableCollisionDetection

Enables all collision event detection.

HandleCollisionDetectionWithEvents.OnTriggerEnter(UnityEngine.Collider)

Invokes the corresponding OnEnter event when a tracked collider enters the trigger.

HandleCollisionDetectionWithEvents.OnTriggerExit(UnityEngine.Collider)

Invokes the corresponding OnExit event when a tracked collider leaves the trigger.

HandleCollisionDetectionWithEvents.OnTriggerStay(UnityEngine.Collider)

Continuously invokes the OnStay event while a tracked collider remains inside the trigger.

HandleCollisionDetectionWithEvents.Start

Initializes the component with collision detection disabled by default.

HandleReticleCollision

Handles feedback (visual, audio, and data logging) when the XR reticle collides with a specific interactable target in the scene.

Remarks

HandleReticleCollision.HandleCorrectAudio

Handles audio feedback and data logging for correct interactions.

HandleReticleCollision.HandleCorrectFeedback

Applies correct visual feedback and triggers corresponding events.

HandleReticleCollision.HandleIncorrectAudio

Handles audio feedback and data logging for incorrect interactions.

HandleReticleCollision.HandleIncorrectFeedback

Applies incorrect visual feedback and triggers corresponding events.

HandleReticleCollision.Init

Initializes the components and subscribes to XR interaction events.

HandleReticleCollision.OnDisable

Invoked automatically when this component is disabled. Used to trigger exit-related cleanup or events.

HandleReticleCollision.OnInteractorHoverEntered(UnityEngine.XR.Interaction.Toolkit.HoverEnterEventArgs)

Called when the XR ray interactor begins hovering over an interactable object. Provides feedback depending on whether the hovered object is the target.

HandleReticleCollision.OnInteractorHoverExited(UnityEngine.XR.Interaction.Toolkit.HoverExitEventArgs)

Called when the XR ray interactor stops hovering over an interactable object. Resets feedback when leaving the correct target.

HandleReticleCollision.SetAudioFeedbackState(System.Boolean)

Enables or disables audio feedback events.

HeadCollisionDetector

Periodically performs ray-based proximity detection around the head (or camera), checking for nearby obstacles or walls to prevent clipping in VR.

Remarks

HeadCollisionDetector.DetectedColliderHits

List of currently detected colliders (updated periodically).

HeadCollisionDetector.OnDrawGizmos

Draws gizmos to visualize detection rays and proximity sphere in the Scene view.

HeadCollisionDetector.PreformDetection(position, distance, mask)

Performs a ray-based detection in forward, right, and left directions.

Name Description
position UnityEngine.Vector3
Starting position of the rays (typically the head/camera position).
distance System.Single
Maximum raycast distance.
mask UnityEngine.LayerMask
Layer mask for valid collision targets.

Returns

List of detected RaycastHits within the given parameters.

HeadCollisionDetector.Start

Initializes the first detection when the scene starts.

HeadCollisionDetector.Update

Periodically updates head collision detection based on the configured delay. Helps avoid unnecessary raycasts every frame.

HeadCollisionHandler

Applies a physical pushback when the player’s head collides with nearby obstacles, using collision data provided by HeadCollisionDetector.

Remarks

This prevents the player’s head (and camera) from clipping through walls in VR. The pushback is applied via a UnityEngineCharacterController for smooth movement.

HeadCollisionHandler.CalculatePushBackDirection(System.Collections.Generic.List{UnityEngine.RaycastHit})

Calculates the overall pushback direction by averaging all detected surface normals.

HeadCollisionHandler.Update

Continuously checks for nearby obstacles detected by HeadCollisionDetector and applies a small pushback movement via the CharacterController to prevent clipping.

KdTree.KdTree`2.RadialSearch(center, radius, count)

Performs a radial search up to a maximum count.

Name Description
center `0[]
Center point
radius `0
Radius to find neighbours within
count System.Int32
Maximum number of neighbours

KdTree.KdTree`2.RadialSearch(center, radius)

Performs a radial search.

Name Description
center `0[]
Center point
radius `0
Radius to find neighbours within

KdTree.PriorityQueue`2.Constructor(KdTree.ITypeMath{`1})

Remarks

This constructor will use a default capacity of 4.

KeyboardDisplayer

Displays and manages a MicrosoftMixedReality.Toolkit.Experimental.UI.NonNativeKeyboard for a TMProTMP_InputField in XR.

Remarks

KeyboardDisplayer.CloseKeyboard

Closes the currently open keyboard (if any).

KeyboardDisplayer.HandleKeyboardClosed(System.Object,System.EventArgs)

Called when the keyboard is closed, cleaning up listeners and caret visibility.

KeyboardDisplayer.HandleOtherKeyboardOpened(KeyboardDisplayer)

Closes this keyboard if another input field opens a new one.

KeyboardDisplayer.HandleTextSubmitted(System.Object,System.EventArgs)

Handles text submission (e.g., when the user presses Enter) and closes the keyboard.

KeyboardDisplayer.OnDisable

Unsubscribes from global events to prevent memory leaks or invalid callbacks when disabled.

KeyboardDisplayer.OnEnable

Subscribes to global keyboard events when this component is enabled.

KeyboardDisplayer.OnKeyboardOpenedGlobal

Static event fired globally whenever a keyboard is opened, so others can close.

KeyboardDisplayer.OpenKeyboard

Opens the non-native keyboard and attaches listeners for text input and close events.

KeyboardDisplayer.PositionKeyboard(Microsoft.MixedReality.Toolkit.Experimental.UI.NonNativeKeyboard)

Positions the keyboard relative to the given reference transform.

KeyboardDisplayer.SetCaretVisibility(System.Boolean)

Toggles the caret visibility to make typing feedback clearer.

KeyboardDisplayer.Start

Initializes keyboard behavior by linking it to the assigned input field. Automatically sets up the listener to open the XR keyboard on selection.

LanguageManager

Manages the current language state across the application. Supports persistence using UnityEnginePlayerPrefs and runtime updates triggered by UI elements.

Remarks

LanguageManager.ApplyLanguage(newLang)

Internal helper that safely converts a string to a LanguageManagerLang enum value.

Name Description
newLang System.String
Language string to apply.

LanguageManager.CurrentLang

The currently active language.

LanguageManager.Init

Initializes the LanguageManager and loads the saved preference if available.

LanguageManager.Instance

Global singleton instance for accessing the current language.

Lang

Supported language options.

LanguageManager.OnValidate

Automatically applies language changes when modified from the Unity Inspector during Play Mode.

LanguageManager.SetLanguage(newLang)

Changes the language and saves the selection to PlayerPrefs.

Name Description
newLang System.String
Language name as a string (“English” or “French”).

LoadingFillImage

Controls the progression of a UI Image with a “Filled” type to visually represent a loading or hold duration.

Remarks

LoadingFillImage.ResetLoading

Resets the loading bar immediately to 0%.

LoadingFillImage.SetLoadingDuration(duration)

Sets a custom duration for the loading process.

Name Description
duration System.Single
The desired duration (in seconds).

LoadingFillImage.StartLoading(duration)

Starts the loading progression and resets the fill amount.

Name Description
duration System.Single
Optional custom duration for this loading sequence.

LoadingFillImage.Update

Updates the fill progression each frame while loading is active and the canvas is visible.

LocationSetup

Represents a specific location configuration in the scene, including the transform reference and the objects to enable/disable when transitioning to this location.

LocationTransition

Manages transitions between predefined locations in a VR environment. Each location includes a target Transform and lists of GameObjects to enable or disable. Handles smooth scene transitions using a FadeScreen and keeps head/origin alignment consistent.

LocationTransition.EndLocation

Ends the current session, quitting play mode in Editor or exiting the application in a build.

LocationTransition.GoToFirstLocation(waitTime)

Coroutine that waits before moving to the first location.

Name Description
waitTime System.Single
Delay before recentering, in seconds.

LocationTransition.GoToLocation(newSetup)

Coroutine that fades the screen, transitions to a new location, activates/deactivates objects, adjusts orientation and position, and fades back in.

Name Description
newSetup LocationSetup
Target location configuration.

LocationTransition.GoToNextLocation

Moves to the next location in the list cyclically.

LocationTransition.GoToSpecificLocation(index)

Moves the player to a specific indexed location with fade transition and object activation handling.

Name Description
index System.Int32
Target index in the list of locations.

LocationTransition.GoToSpecificLocation(target)

Moves the player to a specific location based on a Transform reference.

Name Description
target UnityEngine.Transform
Transform of the target location.

LocationTransition.HandleScannerBottomCollision

A specific method that handles vertical adjustment when colliding with the bottom of the scanner area.

LocationTransition.HandleScannerTopCollision

A specific method that handles vertical adjustment when colliding with the top of the scanner area.

LocationTransition.IncrementLocation

Increments the internal location index (used for next-location transitions).

LocationTransition.PerformEndLocation(fadeDuration)

Performs a fade-out before ending the session or quitting the application.

Name Description
fadeDuration System.Single
Duration of the fade-out before quitting.

LocationTransition.Recenter(target)

Recenters the XR Origin based on the head’s position and a target transform. Adjusts both rotation (around Y-axis) and position to realign the view. Compatible with laying down and standing experiences.

Name Description
target UnityEngine.Transform
Transform representing the desired target position and rotation.

LocationTransition.ResetCurrentLocation

Re-centers the XR Origin to the current location without moving to a new one.

LocationTransition.SaveReferenceOrientation

Saves the current origin rotation and forward direction of the head to maintain consistent alignment between locations.

LocationTransition.SetLocationIndex(index)

Sets the current location index manually, without triggering a transition.

Name Description
index System.Int32
Target index within the location list.

LocationTransition.SetLocationTransitionDuration(duration)

Sets a custom duration for future location transitions.

Name Description
duration System.Single
Transition duration in seconds.

LocationTransition.Start

Initializes reference orientation at startup.

ManagedAudioSource

Manages audio playback for bilingual (French/English) content, with UnityEvents triggered at the start and end of playback. Supports playback of clips defined in the Inspector or dynamically provided at runtime.

Remarks

ManagedAudioSource.Awake

Ensures the AudioSource reference is assigned at runtime.

ManagedAudioSource.GetCurrentAudioClips

Returns the array of audio clips corresponding to the currently active language.

Returns

An array of UnityEngineAudioClips in the correct language.

ManagedAudioSource.Play(clip, vol)

Plays the specified audio clip at the given volume. Invokes the start playback event.

Name Description
clip UnityEngine.AudioClip
The UnityEngineAudioClip to play.
vol System.Single
The playback volume (default = 1.0).

ManagedAudioSource.PlayFromInspector(clipIndex)

Plays an indexed clip from the current language set at full volume (100%).

Name Description
clipIndex System.Int32
The index of the clip to play.

ManagedAudioSource.PlayFromInspector(clip)

Plays a specific clip from the Inspector manually.

Name Description
clip UnityEngine.AudioClip
The UnityEngineAudioClip to play.

ManagedAudioSource.PlayFromInspectorLowVolume(clipIndex)

Plays an indexed clip from the current language set at a lower volume.

Name Description
clipIndex System.Int32
The index of the clip to play.

ManagedAudioSource.StopAudio

Stops the current audio playback and invokes ManagedAudioSourceOnFinishPlayback.

ManagedAudioSource.Update

Monitors playback state each frame and triggers the end event when audio finishes.

ManagedVideoPlayer

Manages the playback of a UnityEngineVideo.VideoPlayer component with UnityEvent hooks for start and end of playback. Supports direct clip assignment and Inspector-based control.

Remarks

ManagedVideoPlayer.Awake

Initializes the component and ensures required references are set.

ManagedVideoPlayer.OnDestroy

Unsubscribes from Unity events.

ManagedVideoPlayer.OnVideoFinished(source)

Called automatically when the video reaches its end.

Name Description
source UnityEngine.Video.VideoPlayer
The VideoPlayer that triggered the event.

ManagedVideoPlayer.Play(clip)

Plays the specified video clip.

Name Description
clip UnityEngine.Video.VideoClip
The UnityEngineVideo.VideoClip to play.

ManagedVideoPlayer.PlayFromInspector(clip)

Allows triggering playback directly from the Unity Inspector.

Name Description
clip UnityEngine.Video.VideoClip
The UnityEngineVideo.VideoClip to play.

ManagedVideoPlayer.StopVideo

Stops the current video playback and invokes the finish event manually.

ManagedVideoPlayer.Update

Runtime checks or updates during playback.

ManualRealigner

Allows manual repositioning and rotation of a reference Transform (typically the XR Origin) using directional input, relative to the camera’s orientation.

Remarks

This component is useful for debugging or manual alignment in XR environments, where it might be needed to fine-tune the user’s origin. Supports:

ManualRealigner.HandleRepositioning

Applies movement and rotation logic based on active directional flags.

ManualRealigner.Move(direction)

Moves the origin in a given world direction.

Name Description
direction UnityEngine.Vector3
Direction vector (normalized).

ManualRealigner.OnMoveBackward(System.Boolean)

Called to move backward (relative to camera).

ManualRealigner.OnMoveDown(System.Boolean)

Called to move downward.

ManualRealigner.OnMoveForward(System.Boolean)

Called to move forward (relative to camera).

ManualRealigner.OnMoveLeft(System.Boolean)

Called to move left (relative to camera).

ManualRealigner.OnMoveRight(System.Boolean)

Called to move right (relative to camera).

ManualRealigner.OnMoveUp(System.Boolean)

Called to move upward.

ManualRealigner.OnRotateDown(System.Boolean)

Called to rotate downward (pitch).

ManualRealigner.OnRotateLeft(System.Boolean)

Called to rotate left (yaw).

ManualRealigner.OnRotateRight(System.Boolean)

Called to rotate right (yaw).

ManualRealigner.OnRotateUp(System.Boolean)

Called to rotate upward (pitch).

ManualRealigner.RotatePitch(direction)

Rotates the origin vertically (pitch) around the camera’s local X axis.

Name Description
direction System.Single
Rotation direction multiplier.

ManualRealigner.RotateYaw(direction)

Rotates the origin horizontally (yaw) around the global Y axis.

Name Description
direction System.Single
Rotation direction multiplier.

ManualRealigner.Update

Updates movement and rotation logic each frame.

Manages menu UI elements across scenes, enabling or disabling specific buttons or dropdowns depending on the currently active scene.

Remarks

This script ensures consistent UI state management when transitioning between scenes such as “OnMoon”, “MRIRoom”, or others. It automatically configures the availability of scenario selection and settings options based on context. Usage:

Singleton instance of the MenuManager accessible globally.

Adjusts menu UI elements depending on the active scene name.

Initializes the singleton instance and applies menu configuration for the current scene.

Manages game pausing, including time scaling, audio and video state, and displaying an in-VR pause menu in front of the player.

Remarks

This component supports both manual and automatic pauses (e.g., system focus loss). It can:

Coroutine used to delay menu camera activation by one frame.

Hides the pause menu canvas.

Positions the pause menu in front of the player’s current view.

Exits pause mode, resumes game state, and invokes the exit event.

Retrieves the localized Moon Trip pause clip depending on current language.

Returns whether the game is currently paused.

Pauses gameplay time, all non-menu audio sources, and any playing videos.

Toggles between pause and unpause states.

Sets whether the pause occurs during a Moon Trip session.

Marks this pause as triggered by a system (e.g., when pressing the meta pause button or when pressing the sleep button on the headset).

Sets the AudioSource used for menu sound playback.

Controls whether the menu can currently be displayed.

Initializes the menu’s UnityEngineCanvasGroup component used to control interactivity and raycast blocking during pause.

Initiates a pause. Can be called manually or automatically (focus loss, etc.).

Name Description
isAutomaticPause System.Boolean
True if triggered automatically (e.g., by system focus loss).

Resumes gameplay time, audio, and previously paused videos.

AxisSlider

Axis slider is a script to lock a bar across a specific axis.

LateUpdate

Use late update to track the input slider

CapsLockHighlight

This class toggles the Caps Lock image based on the NonNativeKeyboard’s IsCapsLocked state

m_Highlight

The highlight image to turn on and off.

m_Keyboard

The keyboard to check for caps locks

Start

Unity Start method.

Update

Unity update method.

UpdateState

Updates the visual state of the shift highlight.

KeyboardKeyFunc

Represents a key on the keyboard that has a function.

buttonFunction

Designer specified functionality of a keyboard button.

FireFunctionKey

Method injected into the button’s onClick listener.

Function

Possible functionality for a button.

Microsoft.MixedReality.Toolkit.Experimental.UI.KeyboardKeyFunc.Start

Subscribe to the onClick event.

KeyboardValueKey

Represents a key on the keyboard that has a string value for input.

Awake

Get the button component.

FireAppendValue

Method injected into the button’s onClick listener.

m_Button

Reference to the GameObject’s button component.

m_Text

Reference to child text element.

Shift(isShifted)

Called by the Keyboard when the shift key is pressed. Updates the text for this key using the Value and ShiftValue fields.

Name Description
isShifted System.Boolean
Indicates the state of shift, the key needs to be changed to.

ShiftValue

The shifted string value for this key.

Start

Initialize key text, subscribe to the onClick event, and subscribe to keyboard shift event.

Value

The default string value for this key.

NonNativeKeyboard

A simple general use keyboard that is ideal for AR/VR applications that do not provide a native keyboard. NOTE: This keyboard will not automatically appear when you select an InputField in your Canvas. In order for the keyboard to appear you must call Keyboard.Instance.PresentKeyboard(string). To retrieve the input from the Keyboard, subscribe to the OnTextSubmitted event. Note that tapping ‘Close’ on the Keyboard will not fire the OnTextSubmitted event. You must tap ‘Enter’ to get the textEntered event.

_audioSource

User can add an audio source to the keyboard to have a click be heard on tapping a key

_closingTime

Time on which the keyboard should close on inactivity

_defaultColor

The default color of the mike key.

_recordImage

The image on the mike key.

ActivateSpecificKeyboard(keyboardType)

Activates a specific keyboard layout, and any sub keys.

Name Description
keyboardType Microsoft.MixedReality.Toolkit.Experimental.UI.NonNativeKeyboard.LayoutType
The keyboard layout type that should be activated

AlphaKeyboard

The panel that contains the alpha keys.

AlphaMailKeys

References @ bottom panel.

AlphaSubKeys

References abc bottom panel.

AlphaWebKeys

References .com bottom panel.

AppendValue(valueKey)

Primary method for typing individual characters to a text field.

Name Description
valueKey Microsoft.MixedReality.Toolkit.Experimental.UI.KeyboardValueKey
The valueKey of the pressed key.

Awake

Deactivate on Awake.

Backspace

Delete the character before the caret.

CapsLock(newCapsLockState)

Set the keyboard to a permanent shift state.

Name Description
newCapsLockState System.Boolean
Caps lock state the method is switching to

CheckForCloseOnInactivityTimeExpired

Check if the keyboard has been left alone for too long and close

Clear

Clear the text input field.

Close

Close the keyboard. (Clears all event subscriptions.)

CloseOnInactivity

Make the keyboard disappear automatically after a timeout

CloseOnInactivityTime

Inactivity time that makes the keyboard disappear automatically.

DisableAllKeyboards

Disable GameObjects for all keyboard elements.

DoTextUpdated(value)

Intermediary function for text update events. Workaround for strange leftover reference when unsubscribing.

Name Description
value System.String
String value.

Enter

Fire the text entered event for objects listening to keyboard. Immediately closes keyboard.

FunctionKey(functionKey)

Trigger specific keyboard functionality.

Name Description
functionKey Microsoft.MixedReality.Toolkit.Experimental.UI.KeyboardKeyFunc
The functionKey of the pressed key.

IndicateActivity

Respond to keyboard activity: reset timeout timer, play sound

InputField

The InputField that the keyboard uses to show the currently edited text. If you are using the Keyboard prefab you can ignore this field as it will be already assigned.

InputFieldSlide

Move the axis slider based on the camera forward and the keyboard plane projection.

IsCapsLocked

Accessor reporting caps lock state of keyboard.

IsMicrophoneActive

Initialize dictation mode.

IsShifted

Accessor reporting shift state of keyboard.

LateUpdate

Makes sure the input field is always selected while the keyboard is up.

LayoutType

Layout type enum for the type of keyboard layout to use. This is used when spawning to enable the correct keys based on layout type.

Microsoft.MixedReality.Toolkit.Experimental.UI.NonNativeKeyboard.LookAtTargetOrigin

Look at function to have the keyboard face the user

Microsoft.MixedReality.Toolkit.Experimental.UI.NonNativeKeyboard.m_CaretPosition

The position of the caret in the text field.

Microsoft.MixedReality.Toolkit.Experimental.UI.NonNativeKeyboard.m_IsCapslocked

Current caps lock state of keyboard.

Microsoft.MixedReality.Toolkit.Experimental.UI.NonNativeKeyboard.m_IsShifted

Current shift state of keyboard.

Microsoft.MixedReality.Toolkit.Experimental.UI.NonNativeKeyboard.m_MaxDistance

The maximum distance the keyboard should be from the user.

Microsoft.MixedReality.Toolkit.Experimental.UI.NonNativeKeyboard.m_MaxScale

The scale the keyboard should be at its maximum distance.

Microsoft.MixedReality.Toolkit.Experimental.UI.NonNativeKeyboard.m_MinDistance

The minimum distance the keyboard needs to be away from the user.

Microsoft.MixedReality.Toolkit.Experimental.UI.NonNativeKeyboard.m_MinScale

The scale the keyboard should be at its minimum distance.

Microsoft.MixedReality.Toolkit.Experimental.UI.NonNativeKeyboard.m_ObjectBounds

The default bounds of the keyboard.

Microsoft.MixedReality.Toolkit.Experimental.UI.NonNativeKeyboard.m_StartingScale

The starting scale of the keyboard.

Microsoft.MixedReality.Toolkit.Experimental.UI.NonNativeKeyboard.MoveCaretLeft

Move caret to the left.

Microsoft.MixedReality.Toolkit.Experimental.UI.NonNativeKeyboard.MoveCaretRight

Move caret to the right.

Microsoft.MixedReality.Toolkit.Experimental.UI.NonNativeKeyboard.Next

Send the “next” event.

Microsoft.MixedReality.Toolkit.Experimental.UI.NonNativeKeyboard.OnClosed

Fired every time the close button is pressed. (Cleared when keyboard is closed.)

Microsoft.MixedReality.Toolkit.Experimental.UI.NonNativeKeyboard.OnDestroy

Destroy unmanaged memory links.

Microsoft.MixedReality.Toolkit.Experimental.UI.NonNativeKeyboard.OnDisable

Called whenever the keyboard is disabled or deactivated.

Microsoft.MixedReality.Toolkit.Experimental.UI.NonNativeKeyboard.OnKeyboardFunctionKeyPressed

Event fired when function key on keyboard is pressed. Fires before internal keyboard state is updated.

Microsoft.MixedReality.Toolkit.Experimental.UI.NonNativeKeyboard.OnKeyboardShifted

Event fired when shift key on keyboard is pressed.

Microsoft.MixedReality.Toolkit.Experimental.UI.NonNativeKeyboard.OnKeyboardValueKeyPressed

Event fired when char key on keyboard is pressed.

Microsoft.MixedReality.Toolkit.Experimental.UI.NonNativeKeyboard.OnNext

Sent when the ‘Next’ button is pressed. Ideally you would use this event to set your targeted text input to the next text field in your document. (Cleared when keyboard is closed.)

Microsoft.MixedReality.Toolkit.Experimental.UI.NonNativeKeyboard.OnPlacement

Sent when the keyboard is placed. This allows listener to know when someone else is co-opting the keyboard.

Microsoft.MixedReality.Toolkit.Experimental.UI.NonNativeKeyboard.OnPrevious

Sent when the ‘Previous’ button is pressed. Ideally you would use this event to set your targeted text input to the previous text field in your document. (Cleared when keyboard is closed.)

Microsoft.MixedReality.Toolkit.Experimental.UI.NonNativeKeyboard.OnTextSubmitted

Sent when the ‘Enter’ button is pressed. To retrieve the text from the event, cast the sender to ‘Keyboard’ and get the text from the TextInput field. (Cleared when keyboard is closed.)

Microsoft.MixedReality.Toolkit.Experimental.UI.NonNativeKeyboard.OnTextUpdated

Fired every time the text in the InputField changes. (Cleared when keyboard is closed.)

Microsoft.MixedReality.Toolkit.Experimental.UI.NonNativeKeyboard.PresentKeyboard

Present the default keyboard to the camera.

Microsoft.MixedReality.Toolkit.Experimental.UI.NonNativeKeyboard.PresentKeyboard(keyboardType)

Presents a specific keyboard to the camera.

Name Description
keyboardType Microsoft.MixedReality.Toolkit.Experimental.UI.NonNativeKeyboard.LayoutType
Specify the keyboard type.

Microsoft.MixedReality.Toolkit.Experimental.UI.NonNativeKeyboard.PresentKeyboard(startText, keyboardType)

Presents a specific keyboard to the camera, with start text.

Name Description
startText System.String
The initial text to show in the keyboard’s input field.
keyboardType Microsoft.MixedReality.Toolkit.Experimental.UI.NonNativeKeyboard.LayoutType
Specify the keyboard type.

Microsoft.MixedReality.Toolkit.Experimental.UI.NonNativeKeyboard.PresentKeyboard(startText)

Presents the default keyboard to the camera, with start text.

Name Description
startText System.String
The initial text to show in the keyboard’s input field.

Microsoft.MixedReality.Toolkit.Experimental.UI.NonNativeKeyboard.Previous

Send the “previous” event.

Microsoft.MixedReality.Toolkit.Experimental.UI.NonNativeKeyboard.RepositionKeyboard(objectTransform, aCollider, verticalOffset)

Function to reposition the keyboard based on target transform and collider information

Name Description
objectTransform UnityEngine.Transform
Transform of target object to remain relative to
aCollider UnityEngine.BoxCollider
Optional collider information for offset placement
verticalOffset System.Single
Optional vertical offset from the target

Microsoft.MixedReality.Toolkit.Experimental.UI.NonNativeKeyboard.RepositionKeyboard(kbPos, verticalOffset)

Function to reposition the Keyboard based on target position and vertical offset

Name Description
kbPos UnityEngine.Vector3
World position for keyboard
verticalOffset System.Single
Optional vertical offset of keyboard

Microsoft.MixedReality.Toolkit.Experimental.UI.NonNativeKeyboard.ResetClosingTime

Reset inactivity closing timer

Microsoft.MixedReality.Toolkit.Experimental.UI.NonNativeKeyboard.ResetKeyboardState

Reset temporary states of keyboard.

Microsoft.MixedReality.Toolkit.Experimental.UI.NonNativeKeyboard.ScaleToSize

Function to scale keyboard to the appropriate size based on distance

Microsoft.MixedReality.Toolkit.Experimental.UI.NonNativeKeyboard.SetScaleSizeValues(minScale, maxScale, minDistance, maxDistance)

Method to set the sizes by code, as the properties are private. Useful for scaling ‘from the outside’, for instance taking care of differences between immersive headsets and HoloLens

Name Description
minScale System.Single
Min scale factor
maxScale System.Single
Max scale factor
minDistance System.Single
Min distance from camera
maxDistance System.Single
Max distance from camera

Microsoft.MixedReality.Toolkit.Experimental.UI.NonNativeKeyboard.Shift(newShiftState)

Set the keyboard to a single action shift state.

Name Description
newShiftState System.Boolean
value the shift key should have after calling the method

Microsoft.MixedReality.Toolkit.Experimental.UI.NonNativeKeyboard.ShowAlphaKeyboard

Enable the alpha keyboard.

Microsoft.MixedReality.Toolkit.Experimental.UI.NonNativeKeyboard.ShowSymbolKeyboard

Enable the symbol keyboard.

Microsoft.MixedReality.Toolkit.Experimental.UI.NonNativeKeyboard.SliderEnabled

Bool for toggling the slider being enabled.

Microsoft.MixedReality.Toolkit.Experimental.UI.NonNativeKeyboard.Space

Insert a space character.

Microsoft.MixedReality.Toolkit.Experimental.UI.NonNativeKeyboard.Start

Set up Dictation, CanvasEX, and automatically select the TextInput object.

Microsoft.MixedReality.Toolkit.Experimental.UI.NonNativeKeyboard.SubmitOnEnter

Bool to flag submitting on enter

Microsoft.MixedReality.Toolkit.Experimental.UI.NonNativeKeyboard.SymbolKeyboard

The panel that contains the number and symbol keys.

Microsoft.MixedReality.Toolkit.Experimental.UI.NonNativeKeyboard.Tab

Insert a tab character.

Microsoft.MixedReality.Toolkit.Experimental.UI.NonNativeKeyboard.TryToShowAlphaSubkeys

Show the default subkeys only on the Alphanumeric keyboard.

Returns

Returns true if default subkeys were activated, false if alphanumeric keyboard isn’t active

Microsoft.MixedReality.Toolkit.Experimental.UI.NonNativeKeyboard.TryToShowEmailSubkeys

Show the email subkeys only on the Alphanumeric keyboard.

Returns

Returns true if the email subkey was activated, false if alphanumeric keyboard is not active and key can’t be activated

Microsoft.MixedReality.Toolkit.Experimental.UI.NonNativeKeyboard.TryToShowURLSubkeys

Show the URL subkeys only on the Alphanumeric keyboard.

Returns

Returns true if the URL subkey was activated, false if alphanumeric keyboard is not active and key can’t be activated

SymbolDisableHighlight

Updates the visual state of the text based on the buttons state

m_Button

The button to check for disabled/enabled.

m_DisabledColor

The color to switch to when the button is disabled.

m_ImageField

The text field to update.

m_StartingColor

The color the text field starts as.

m_TextField

The text field to update.

Start

Standard Unity start.

Update

Standard Unity update.

UpdateState

Updates the visual state of the text based on the buttons state.

SymbolKeyboard

This class switches back and forth between two symbol boards that otherwise do not fit on the keyboard entirely

UICollection

This component represents and ordered collection of UI elements. You can add to the UICollection by either dropping UI elements in the UI element this component is attached to in the Editor or by calling the AddItem(RectTransform) method. UI elements that are added to this collection via the Editor will be automatically arranged when this component executes. To use this component attach it to a UI element (a GameObject with a RectTransform component) such as an Image or Panel.

AddItem(item)

Adds a UI element to the collection. This will cause the collection layout to update immediately. NOTE: The added item’s RectTransform will get modified in order to layout properly in this collection.

Name Description
item UnityEngine.RectTransform
The UI element to add to the collection.

horizontalSpacing

The amount of horizontal spacing (in pixels) to use between items in this collection.

Items

A list of items in this collection. This list should not be modified directly. Instead use AddItem(RectTransform) and RemoveItem(RectTransform).

maxHeight

The maximum height that the collection should expand to. If the value is -1.0 then it will use the height specified by the RectTransform of this component’s GameObject.

maxWidth

The maximum width that the collection should expand to. If the value is -1.0 then it will use the width specified by the RectTransform of this component’s GameObject.

rectTransform

Cached rect transform to use for collection

RemoveAllItems

Removes all UI elements added to the collection. This will cause the collection layout to update immediately. NOTE: This method does not call Destroy removed items.

RemoveItem(item)

Removes a UI element from the collection. This will cause the collection layout to update immediately. NOTE: This method does not call Destroy removed items.

Name Description
item UnityEngine.RectTransform
The UI element to remove from the collection.

verticalSpacing

The amount of vertical spacing (in pixels) to use between items in this collection.

MTQuadTreeBuildNode

utility classes

MightyTerrainMesh.RuntimeBakeTexture.fullscreenMesh

Returns a mesh that you can use with UnityEngine.Rendering.CommandBuffer.DrawMesh(UnityEngine.Mesh,UnityEngine.Matrix4x4,UnityEngine.Material) to render full-screen effects.

MoonMovement

Handles the animated movement, scaling, and rotation of a “moon” object between two positions over a specified duration.

Remarks

This component interpolates the moon’s position, scale, and rotation speed from a defined start state to an end state. It also dynamically scales a target collider so its visual size remains consistent despite the moon’s scaling. Typical usage:

MoonMovement.GetDuration

Returns the current movement duration.

MoonMovement.OnFinish

Stops the moon’s movement and triggers the completion event.

MoonMovement.ResetPositionAndScale

Resets the moon’s position and scale to the defined starting state.

MoonMovement.SetDuration(newDuration)

Sets the duration of the movement.

Name Description
newDuration System.Single
The new duration, in seconds.

MoonMovement.SetMoving(System.Boolean)

Manually enables or disables the movement animation.

MoonMovement.StartMovement

Starts the moon movement animation sequence.

MoonMovement.Update

Updates the moon’s position, scale, rotation, and target collider size every frame while the movement animation is active.

MoonTripDurationController

Controls the configurable duration of the moon trip via UI buttons, updates the display text, and synchronizes the duration with MoonMovement.

Remarks

This component allows the user to adjust the total duration of the moon’s movement (in seconds) within a specified range using increment/decrement buttons. It automatically updates the text display and applies the new value to the linked MoonMovement instance.

MoonTripDurationController.DecreaseDuration

Decreases the total duration by one step if above the minimum.

MoonTripDurationController.IncreaseDuration

Increases the total duration by one step if below the maximum.

MoonTripDurationController.Start

Initializes button listeners and sets the default duration display.

MoonTripDurationController.UpdateDisplay

Updates the on-screen duration text and applies the value to MoonTripDurationControllermoonMovement.

Remarks

The duration is displayed in minutes, but passed to the MoonMovement script in seconds.

Provides a simple method to open a web link from a UI button or event in Unity.

Remarks

This script can be attached to a GameObject and linked to UI Button events. When the button is pressed, it will open the specified URL in the system’s default web browser.

OpenWebLink.OpenLink(url)

Opens the given URL in the default web browser.

Name Description
url System.String
The web address to open (must start with “http://” or “https://”).

PlaySoundLoopSimple

Plays looping background sounds or ambient audio through a configured UnityEngineAudioSource.

Remarks

This script allows simple playback of looping audio clips, such as ambient background sounds, machine hums, or environmental effects. It assumes that the UnityEngineAudioSource component is already configured in the Inspector.

PlaySoundLoopSimple.PlaySound(clip)

Plays a specified audio clip in a continuous loop.

Name Description
clip UnityEngine.AudioClip
The audio clip to be played.

PlaySoundLoopSimple.Start

Initializes the AudioSource and ensures that it loops continuously.

PlaySoundLoopSimple.StopSound

Stops the currently playing sound if the AudioSource is active.

ReticleController

Controls the position, orientation, and scale of a reticle (crosshair) based on an UnityEngineXR.Interaction.Toolkit.Interactors.XRRayInteractor.

Remarks

This component dynamically positions the reticle at the ray intersection point or, if no hit is detected, extends it forward toward the camera’s far clip plane. It also scales the reticle proportionally to the distance to maintain visual consistency and optionally allows alignment toward a specific target.

ReticleController.AdjustReticleToTarget

Adjusts the ray interactor to face the assigned ReticleControllertarget, if active.

ReticleController.DisableIfGOEnabled

Disables the reticle object if currently active, and remembers this state for reactivation.

ReticleController.EnableIfGOEnabled

Re-enables the reticle object only if it was previously deactivated by ReticleControllerDisableIfGOEnabled.

ReticleController.ResetReticleToCenter

Reorients the ray interactor so that the reticle is centered in front of the camera.

ReticleController.Update

Continuously updates the reticle position, scale, and rotation based on the ray interactor.

SceneController

Handles scene-level camera transitions and optional screen fade effects.

Remarks

This component can switch between two cameras after a delay and perform fade-in / fade-out effects on a UI Image used as a blackout overlay. Attach it to an empty GameObject in your scene and assign references in the Inspector.

SceneController.FadeBlackOutSquare

Gradually fades the assigned SceneControllerblackOutSquare image to or from black.

Returns

Coroutine that yields during the fade process.

Remarks

SceneController.SwitchCameras

Disables SceneControllercamera1 and activates SceneControllercamera2.

ScenePrewarmer

Prewarms shaders, materials, and UI canvases to eliminate stutters during the first few frames of scene rendering.

Remarks

This script forces Unity to compile and load all shader variants used in a scene by briefly rendering small invisible quads using each material. It also initializes all UnityEngineCanvas and TMProTMP_InputField components to ensure UI meshes and layouts are built before the scene becomes interactive.

ScenePrewarmer.DestroyAfterDelay(System.Single)

Destroys all prewarm quads after a short delay to ensure all materials are loaded.

ScenePrewarmer.PrewarmAllCanvases

Forces all active and inactive canvases in the scene to build their geometry and layout data.

Remarks

ScenePrewarmer.Start

Coroutine that gathers all unique materials under ScenePrewarmerparentRoot, renders them briefly using mini-quads, then destroys them after a short delay.

Remarks

This effectively “pre-compiles” shaders and loads all required GPU states, reducing hitches and stalls when these materials are used later during gameplay.

SceneSwitcher

Handles scene transitions with optional fade effects and pause cleanup.

Remarks

This script provides asynchronous scene loading with fade in/out support, ensuring smooth transitions without freezing the main thread. It also interacts with the MenuPauser component to exit pause mode before switching scenes.

SceneSwitcher.LoadSceneAsyncByIndex(sceneIndex)

Asynchronously loads a scene by index with a fade-out transition.

Name Description
sceneIndex System.Int32
The build index of the target scene.

Returns

Coroutine that performs the transition.

SceneSwitcher.LoadSceneAsyncByName(sceneName)

Asynchronously loads a scene by name with a fade-out transition.

Name Description
sceneName System.String
The name of the scene to load.

Returns

Coroutine that performs the transition.

Remarks

The scene is preloaded until asyncLoad.progress reaches 0.9f, then activated after the fade-out completes. Uses UnityEngineWaitForSecondsRealtime to remain unaffected by Time.timeScale.

SceneSwitcher.LoadSceneByIndex(sceneIndex)

Initiates a scene load by build index, exiting pause mode if active.

Name Description
sceneIndex System.Int32
The index of the scene in Build Settings.

SceneSwitcher.LoadSceneByName(sceneName)

Initiates a scene load by name, exiting pause mode if active.

Name Description
sceneName System.String
The name of the target scene to load.

Example

Example usage:


            SceneSwitcher.Instance.LoadSceneByName("MainMenu");
            

SecretButtonClicker

Allows triggering specific UI buttons “secretly” via controller input combos, without requiring direct UI ray interaction.

Remarks

This component is designed for XR environments where hidden or debug actions can be triggered using controller button combinations (e.g. Y + joystick left/right). It checks the visibility, interactivity, and proximity of buttons before invoking them, preventing accidental activation of inactive or distant UI elements.

SecretButtonClicker.IsButtonActuallyVisible(btn)

Checks if a button is both active, visible, and part of an enabled canvas hierarchy.

Name Description
btn UnityEngine.UI.Button
Button to validate.

Returns

True if the button is active, visible, and interactable; false otherwise.

SecretButtonClicker.IsButtonNearWorld(btn, maxDistance)

Checks if a given button is within a certain world-space distance from the player’s head.

Name Description
btn UnityEngine.UI.Button
Button to test.
maxDistance System.Single
Maximum allowed distance in meters.

Returns

True if the button is within range; false otherwise.

SecretButtonClicker.TriggerLeftButton

Triggers the first valid “left” button when the combo (e.g. Y + left stick) is detected.

Remarks

The button must be:

SecretButtonClicker.TriggerRightButton

Triggers the first valid “right” button when the combo (e.g. Y + right stick) is detected.

Remarks

Similar to SecretButtonClickerTriggerLeftButton, but operates on SecretButtonClickerrightButtons.

Segment

Represents a single text segment containing a title, a short statement, and an optional associated button group.

TextDisplayer

Displays text-based segments (title + short statement + optional button set) and allows navigation through them sequentially or directly.

Remarks

The system supports bilingual content using LanguageManager: English segments are stored in TextDisplayersegments, and French segments in TextDisplayersegmentsFR.

TextDisplayer.ChangeSegment(index)

Core method to change the displayed segment, updating all UI elements.

Name Description
index System.Int32
The index of the new segment.

TextDisplayer.DisableGO

Hides UI components that are empty (text and button set).

TextDisplayer.DisplaySpecificSegment(index)

Displays a specific segment by index, if it exists.

Name Description
index System.Int32
The segment index to display.

TextDisplayer.GetCurrentSegments

Returns the segment array corresponding to the current language.

Returns

The active segment array (English or French).

TextDisplayer.InitText

Initializes the text display by showing the first segment (index 0).

TextDisplayer.NextSegment

Advances to the next segment if available.

TextDisplayer.SetIndex(index)

Sets the current segment index manually (without immediately updating the UI).

Name Description
index System.Int32
The index of the segment to select.

TextDisplayer.Start

Unity lifecycle method called on the first frame. Initializes the text display automatically if TextDisplayerDisplayOnStart is enabled.

TextDisplayer.UpdateSegment

Updates the displayed text and button set based on the current segment.

TMPro.Examples.SkewTextExample.WarpText

Method to curve text along a Unity animation curve.

Name Description
textComponent Unknown type

Returns

TMPro.Examples.TextConsoleSimulator.RevealCharacters(TMPro.TMP_Text)

Method revealing the text one character at a time.

Returns

TMPro.Examples.TextConsoleSimulator.RevealWords(TMPro.TMP_Text)

Method revealing the text one word at a time.

Returns

TMPro.Examples.TMP_TextInfoDebugTool.DrawBounds

Draw Rectangle around the bounds of the text object.

TMPro.Examples.TMP_TextInfoDebugTool.DrawCharactersBounds

Method to draw a rectangle around each character.

Name Description
text Unknown type

TMPro.Examples.TMP_TextInfoDebugTool.DrawLineBounds

Draw Rectangles around each lines of the text.

Name Description
text Unknown type

TMPro.Examples.TMP_TextInfoDebugTool.DrawLinkBounds

Draw rectangle around each of the links contained in the text.

Name Description
text Unknown type

TMPro.Examples.TMP_TextInfoDebugTool.DrawWordBounds

Method to draw rectangles around each word of the text.

Name Description
text Unknown type

TMPro.Examples.VertexColorCycler.AnimateVertexColors

Method to animate vertex colors of a TMP Text object.

Returns

TMPro.Examples.VertexJitter.AnimateVertexColors

Method to animate vertex colors of a TMP Text object.

Returns

VertexAnim

Structure to hold pre-computed animation data.

TMPro.Examples.VertexShakeA.AnimateVertexColors

Method to animate vertex colors of a TMP Text object.

Returns

TMPro.Examples.VertexShakeB.AnimateVertexColors

Method to animate vertex colors of a TMP Text object.

Returns

TMPro.Examples.VertexZoom.AnimateVertexColors

Method to animate vertex colors of a TMP Text object.

Returns

TMPro.Examples.WarpTextExample.WarpText

Method to curve text along a Unity animation curve.

Name Description
textComponent Unknown type

Returns

TMP_DigitValidator

EXample of a Custom Character Input Validator to only allow digits from 0 to 9.

TMP_PhoneNumberValidator

Example of a Custom Character Input Validator to only allow phone number in the (800) 555-1212 format.

TMPro.TMP_TextEventHandler.onCharacterSelection

Event delegate triggered when pointer is over a character.

TMPro.TMP_TextEventHandler.onLineSelection

Event delegate triggered when pointer is over a line.

TMPro.TMP_TextEventHandler.onLinkSelection

Event delegate triggered when pointer is over a link.

TMPro.TMP_TextEventHandler.onSpriteSelection

Event delegate triggered when pointer is over a sprite.

TMPro.TMP_TextEventHandler.onWordSelection

Event delegate triggered when pointer is over a word.

TrackOriginChanges

Detects when the XR tracking origin (or reference space) is updated — typically when the user manually recenters their view (e.g., “Reset View” or recenter event).

Remarks

This component listens for UnityEngineXR.XRInputSubsystem.trackingOriginUpdated and triggers a UnityEvent when a recenter action is detected.

TrackOriginChanges.GetXRInputSubsystem

Locates the active UnityEngineXR.XRInputSubsystem from the current XR setup.

Remarks

This is necessary to access tracking-related events such as recentering or origin changes.

TrackOriginChanges.OnDestroy

Unity lifecycle method — ensures event unsubscription when the object is destroyed.

TrackOriginChanges.OnTrackingOriginUpdated(inputSubsystem)

Callback invoked when the XR system detects a tracking origin update (i.e., recentering).

Name Description
inputSubsystem UnityEngine.XR.XRInputSubsystem
The XR input subsystem that triggered the event.

TrackOriginChanges.Start

Unity lifecycle method — called on the first frame. Initializes the XR input subsystem and subscribes to tracking origin updates.

TrackOriginChanges.SubscribeToTrackingChanges

Subscribes to tracking origin change events from the XR input subsystem.

Dwyer

Builds a delaunay triangulation using the divide-and-conquer algorithm.

Remarks

The divide-and-conquer bounding box I originally implemented the divide-and-conquer and incremental Delaunay triangulations using the edge-based data structure presented by Guibas and Stolfi. Switching to a triangle-based data structure doubled the speed. However, I had to think of a few extra tricks to maintain the elegance of the original algorithms. The “bounding box” used by my variant of the divide-and-conquer algorithm uses one triangle for each edge of the convex hull of the triangulation. These bounding triangles all share a common apical vertex, which is represented by NULL and which represents nothing. The bounding triangles are linked in a circular fan about this NULL vertex, and the edges on the convex hull of the triangulation appear opposite the NULL vertex. You might find it easiest to imagine that the NULL vertex is a point in 3D space behind the center of the triangulation, and that the bounding triangles form a sort of cone. This bounding box makes it easy to represent degenerate cases. For instance, the triangulation of two vertices is a single edge. This edge is represented by two bounding box triangles, one on each “side” of the edge. These triangles are also linked together in a fan about the NULL vertex. The bounding box also makes it easy to traverse the convex hull, as the divide-and-conquer algorithm needs to do.

AlternateAxes(left, right, axis)

Sorts the vertices as appropriate for the divide-and-conquer algorithm with alternating cuts.

Name Description
left System.Int32
right System.Int32
axis System.Int32

Remarks

Partitions by x-coordinate if axis == 0; by y-coordinate if axis == 1. For the base case, subsets containing only two or three vertices are always sorted by x-coordinate.

DivconqRecurse(left, right, axis, farleft, farright)

Recursively form a Delaunay triangulation by the divide-and-conquer method.

Name Description
left System.Int32
right System.Int32
axis System.Int32
farleft TriangleNet.Data.Otri@
farright TriangleNet.Data.Otri@

Remarks

Recursively breaks down the problem into smaller pieces, which are knitted together by mergehulls(). The base cases (problems of two or three vertices) are handled specially here. On completion, ‘farleft’ and ‘farright’ are bounding triangles such that the origin of ‘farleft’ is the leftmost vertex (breaking ties by choosing the highest leftmost vertex), and the destination of ‘farright’ is the rightmost vertex (breaking ties by choosing the lowest rightmost vertex).

MergeHulls(farleft, innerleft, innerright, farright, axis)

Merge two adjacent Delaunay triangulations into a single Delaunay triangulation.

Name Description
farleft TriangleNet.Data.Otri@
Bounding triangles of the left triangulation.
innerleft TriangleNet.Data.Otri@
Bounding triangles of the left triangulation.
innerright TriangleNet.Data.Otri@
Bounding triangles of the right triangulation.
farright TriangleNet.Data.Otri@
Bounding triangles of the right triangulation.
axis System.Int32

Remarks

This is similar to the algorithm given by Guibas and Stolfi, but uses a triangle-based, rather than edge-based, data structure. The algorithm walks up the gap between the two triangulations, knitting them together. As they are merged, some of their bounding triangles are converted into real triangles of the triangulation. The procedure pulls each hull’s bounding triangles apart, then knits them together like the teeth of two gears. The Delaunay property determines, at each step, whether the next “tooth” is a bounding triangle of the left hull or the right. When a bounding triangle becomes real, its apex is changed from NULL to a real vertex. Only two new triangles need to be allocated. These become new bounding triangles at the top and bottom of the seam. They are used to connect the remaining bounding triangles (those that have not been converted into real triangles) into a single fan. On entry, ‘farleft’ and ‘innerleft’ are bounding triangles of the left triangulation. The origin of ‘farleft’ is the leftmost vertex, and the destination of ‘innerleft’ is the rightmost vertex of the triangulation. Similarly, ‘innerright’ and ‘farright’ are bounding triangles of the right triangulation. The origin of ‘innerright’ and destination of ‘farright’ are the leftmost and rightmost vertices. On completion, the origin of ‘farleft’ is the leftmost vertex of the merged triangulation, and the destination of ‘farright’ is the rightmost vertex.

RemoveGhosts(startghost)

Removes ghost triangles.

Name Description
startghost TriangleNet.Data.Otri@

Returns

Number of vertices on the hull.

Triangulate(TriangleNet.Mesh)

Form a Delaunay triangulation by the divide-and-conquer method.

Returns

Remarks

Sorts the vertices, calls a recursive procedure to triangulate them, and removes the bounding box, setting boundary markers as appropriate.

VertexMedian(left, right, median, axis)

An order statistic algorithm, almost. Shuffles an array of vertices so that the first ‘median’ vertices occur lexicographically before the remaining vertices.

Name Description
left System.Int32
right System.Int32
median System.Int32
axis System.Int32

Remarks

Uses the x-coordinate as the primary key if axis == 0; the y-coordinate if axis == 1. Very similar to the vertexsort() procedure, but runs in randomized linear time.

VertexSort(left, right)

Sort an array of vertices by x-coordinate, using the y-coordinate as a secondary key.

Name Description
left System.Int32
right System.Int32

Remarks

Uses quicksort. Randomized O(n log n) time. No, I did not make any of the usual quicksort mistakes.

Incremental

Builds a delaunay triangulation using the incremental algorithm.

GetBoundingBox

Form an “infinite” bounding triangle to insert vertices into.

Remarks

The vertices at “infinity” are assigned finite coordinates, which are used by the point location routines, but (mostly) ignored by the Delaunay edge flip routines.

RemoveBox

Remove the “infinite” bounding triangle, setting boundary markers as appropriate.

Returns

Returns the number of edges on the convex hull of the triangulation.

Remarks

The triangular bounding box has three boundary triangles (one for each side of the bounding box), and a bunch of triangles fanning out from the three bounding box vertices (one triangle for each edge of the convex hull of the inner mesh). This routine removes these triangles.

Triangulate(TriangleNet.Mesh)

Form a Delaunay triangulation by incrementally inserting vertices.

Returns

Returns the number of edges on the convex hull of the triangulation.

ITriangulator

TODO: Update summary.

SweepLine

Builds a delaunay triangulation using the sweepline algorithm.

RemoveGhosts(startghost)

Removes ghost triangles.

Name Description
startghost TriangleNet.Data.Otri@

Returns

Number of vertices on the hull.

SplayNode

A node in the splay tree.

Remarks

Only used in the sweepline algorithm. Each node holds an oriented ghost triangle that represents a boundary edge of the growing triangulation. When a circle event covers two boundary edges with a triangle, so that they are no longer boundary edges, those edges are not immediately deleted from the tree; rather, they are lazily deleted when they are next encountered. (Since only a random sample of boundary edges are kept in the tree, lazy deletion is faster.) ‘keydest’ is used to verify that a triangle is still the same as when it entered the splay tree; if it has been rotated (due to a circle event), it no longer represents a boundary edge and should be deleted.

SweepEvent

A node in a heap used to store events for the sweepline Delaunay algorithm.

Remarks

Only used in the sweepline algorithm. Nodes do not point directly to their parents or children in the heap. Instead, each node knows its position in the heap, and can look up its parent and children in a separate array. To distinguish site events from circle events, all circle events are given an invalid (smaller than ‘xmin’) x-coordinate ‘xkey’.

SweepEventVertex

Introducing a new class which aggregates a sweep event is the easiest way to handle the pointer magic of the original code (casting a sweep event to vertex etc.).

TriangleNet.BadTriQueue.Dequeue

Remove a triangle from the front of the queue.

Returns

TriangleNet.BadTriQueue.Enqueue(badtri)

Add a bad triangle data structure to the end of a queue.

Name Description
badtri TriangleNet.Data.BadTriangle
The bad triangle to enqueue.

TriangleNet.BadTriQueue.Enqueue(enqtri, minedge, enqapex, enqorg, enqdest)

Add a bad triangle to the end of a queue.

Name Description
enqtri TriangleNet.Data.Otri@
minedge System.Single
enqapex TriangleNet.Data.Vertex
enqorg TriangleNet.Data.Vertex
enqdest TriangleNet.Data.Vertex

Behavior

Controls the behavior of the meshing software.

Constructor(System.Boolean,System.Single)

Creates an instance of the Behavior class.

Algorithm

Algorithm to use for triangulation.

ConformingDelaunay

Conforming Delaunay (all triangles are truly Delaunay).

Convex

Enclose the convex hull with segments.

Jettison

Jettison unused vertices from output.

MaxAngle

Maximum angle constraint.

MaxArea

Maximum area constraint.

MinAngle

Minimum angle constraint.

NoBisect

Suppresses boundary segment splitting.

Remarks

0 = split segments 1 = no new vertices on the boundary 2 = prevent all segment splitting, including internal boundaries

NoExact

No exact arithmetic.

NoHoles

Ignores holes in polygons.

Poly

Input is a Planar Straight Line Graph.

Quality

Quality mesh generation.

SteinerPoints

Use maximum number of Steiner points.

Update

Update quality options dependencies.

UseBoundaryMarkers

Compute boundary information.

Usertest

Apply a user-defined triangle constraint.

VarArea

Apply a maximum triangle area constraint.

Verbose

Log detailed information.

Carver

Carves holes into the triangulation.

CarveHoles

Find the holes and infect them. Find the area constraints and infect them. Infect the convex hull. Spread the infection and kill triangles. Spread the area constraints.

InfectHull

Virally infect all of the triangles of the convex hull that are not protected by subsegments. Where there are subsegments, set boundary markers as appropriate.

Plague

Spread the virus from all infected triangles to any neighbors not protected by subsegments. Delete all infected triangles.

Remarks

This is the procedure that actually creates holes and concavities. This procedure operates in two phases. The first phase identifies all the triangles that will die, and marks them as infected. They are marked to ensure that each triangle is added to the virus pool only once, so the procedure will terminate. The second phase actually eliminates the infected triangles. It also eliminates orphaned vertices.

BadSubseg

A queue used to store encroached subsegments.

Remarks

Each subsegment’s vertices are stored so that we can check whether a subsegment is still the same.

BadTriangle

A queue used to store bad triangles.

Remarks

The key is the square of the cosine of the smallest angle of the triangle. Each triangle’s vertices are stored so that one can check whether a triangle is still the same.

Osub

An oriented subsegment.

Remarks

Iincludes a pointer to a subsegment and an orientation. The orientation denotes a side of the edge. Hence, there are two possible orientations. By convention, the edge is always directed so that the “side” denoted is the right side of the edge.

Bond(TriangleNet.Data.Osub@)

Bond two subsegments together. [bond(abc, ba)]

Copy(TriangleNet.Data.Osub@)

Copy a subsegment.

Dest

Get the destination of a subsegment

Dissolve

Dissolve a subsegment bond (from one side).

Remarks

Note that the other subsegment will still think it’s connected to this subsegment.

Equal(TriangleNet.Data.Osub)

Test for equality of subsegments.

IsDead(TriangleNet.Data.Segment)

Check a subsegment’s deallocation.

Kill(TriangleNet.Data.Segment)

Set a subsegment’s deallocation.

Mark

Read a boundary marker.

Remarks

Boundary markers are used to hold user-defined tags for setting boundary conditions in finite element solvers.

Next(TriangleNet.Data.Osub@)

Find next subsegment in sequence. [next(ab) -> b*]

Remarks

snext() finds the next subsegment (from the same segment) in sequence; one whose origin is the input subsegment’s destination.

NextSelf

Find next subsegment in sequence. [next(ab) -> b*]

Org

Get the origin of a subsegment

Pivot(TriangleNet.Data.Osub@)

Find adjoining subsegment with the same origin. [pivot(ab) -> a*]

Remarks

spivot() finds the other subsegment (from the same segment) that shares the same origin.

PivotSelf

Find adjoining subsegment with the same origin. [pivot(ab) -> a*]

SegDest

Get the destination of the segment that includes the subsegment.

SegOrg

Get the origin of the segment that includes the subsegment.

SetDest(TriangleNet.Data.Vertex)

Set destination of a subsegment.

SetMark(System.Int32)

Set a boundary marker.

SetOrg(TriangleNet.Data.Vertex)

Set the origin or destination of a subsegment.

SetSegDest(TriangleNet.Data.Vertex)

Set the destination of the segment that includes the subsegment.

SetSegOrg(TriangleNet.Data.Vertex)

Set the origin of the segment that includes the subsegment.

Sym(TriangleNet.Data.Osub@)

Reverse the orientation of a subsegment. [sym(ab) -> ba]

Remarks

ssym() toggles the orientation of a subsegment.

SymSelf

Reverse the orientation of a subsegment. [sym(ab) -> ba]

TriDissolve

Dissolve a bond (from the subsegment side).

TriPivot(TriangleNet.Data.Otri@)

Finds a triangle abutting a subsegment.

Otri

An oriented triangle.

Remarks

Includes a pointer to a triangle and orientation. The orientation denotes an edge of the triangle. Hence, there are three possible orientations. By convention, each edge always points counterclockwise about the corresponding triangle.

Apex

Apex [apex(abc) -> c]

Bond(TriangleNet.Data.Otri@)

Bond two triangles together at the resepective handles. [bond(abc, bad)]

Copy(TriangleNet.Data.Otri@)

Copy an oriented triangle.

Dest

Destination [dest(abc) -> b]

Dissolve

Dissolve a bond (from one side).

Remarks

Note that the other triangle will still think it’s connected to this triangle. Usually, however, the other triangle is being deleted entirely, or bonded to another triangle, so it doesn’t matter.

Dnext(TriangleNet.Data.Otri@)

Find the next edge counterclockwise with the same destination. [dnext(abc) -> *ba]

Remarks

dnext() spins counterclockwise around a vertex; that is, it finds the next edge with the same destination in the counterclockwise direction. This edge is part of a different triangle.

DnextSelf

Find the next edge counterclockwise with the same destination. [dnext(abc) -> *ba]

Dprev(TriangleNet.Data.Otri@)

Find the next edge clockwise with the same destination. [dprev(abc) -> cb*]

Remarks

dprev() spins clockwise around a vertex; that is, it finds the next edge with the same destination in the clockwise direction. This edge is part of a different triangle.

DprevSelf

Find the next edge clockwise with the same destination. [dprev(abc) -> cb*]

Equal(TriangleNet.Data.Otri)

Test for equality of oriented triangles.

Infect

Infect a triangle with the virus.

IsDead(TriangleNet.Data.Triangle)

Check a triangle’s deallocation.

IsInfected

Test a triangle for viral infection.

Kill(TriangleNet.Data.Triangle)

Set a triangle’s deallocation.

Lnext(TriangleNet.Data.Otri@)

Find the next edge (counterclockwise) of a triangle. [lnext(abc) -> bca]

LnextSelf

Find the next edge (counterclockwise) of a triangle. [lnext(abc) -> bca]

Lprev(TriangleNet.Data.Otri@)

Find the previous edge (clockwise) of a triangle. [lprev(abc) -> cab]

LprevSelf

Find the previous edge (clockwise) of a triangle. [lprev(abc) -> cab]

Onext(TriangleNet.Data.Otri@)

Find the next edge counterclockwise with the same origin. [onext(abc) -> ac*]

Remarks

onext() spins counterclockwise around a vertex; that is, it finds the next edge with the same origin in the counterclockwise direction. This edge is part of a different triangle.

OnextSelf

Find the next edge counterclockwise with the same origin. [onext(abc) -> ac*]

Oprev(TriangleNet.Data.Otri@)

Find the next edge clockwise with the same origin. [oprev(abc) -> a*b]

Remarks

oprev() spins clockwise around a vertex; that is, it finds the next edge with the same origin in the clockwise direction. This edge is part of a different triangle.

OprevSelf

Find the next edge clockwise with the same origin. [oprev(abc) -> a*b]

Org

Origin [org(abc) -> a]

Rnext(TriangleNet.Data.Otri@)

Find the next edge (counterclockwise) of the adjacent triangle. [rnext(abc) -> a]

Remarks

rnext() moves one edge counterclockwise about the adjacent triangle. (It’s best understood by reading Guibas and Stolfi. It involves changing triangles twice.)

RnextSelf

Find the next edge (counterclockwise) of the adjacent triangle. [rnext(abc) -> a]

Rprev(TriangleNet.Data.Otri@)

Find the previous edge (clockwise) of the adjacent triangle. [rprev(abc) -> b**]

Remarks

rprev() moves one edge clockwise about the adjacent triangle. (It’s best understood by reading Guibas and Stolfi. It involves changing triangles twice.)

RprevSelf

Find the previous edge (clockwise) of the adjacent triangle. [rprev(abc) -> b**]

SegBond(TriangleNet.Data.Osub@)

Bond a triangle to a subsegment.

SegDissolve

Dissolve a bond (from the triangle side).

SegPivot(TriangleNet.Data.Osub@)

Finds a subsegment abutting a triangle.

SetApex(TriangleNet.Data.Vertex)

Set Apex

SetDest(TriangleNet.Data.Vertex)

Set Destination

SetOrg(TriangleNet.Data.Vertex)

Set Origin

Sym(TriangleNet.Data.Otri@)

Find the abutting triangle; same edge. [sym(abc) -> ba*]

Remarks

Note that the edge direction is necessarily reversed, because the handle specified by an oriented triangle is directed counterclockwise around the triangle.

SymSelf

Find the abutting triangle; same edge. [sym(abc) -> ba*]

Uninfect

Cure a triangle from the virus.

Segment

The subsegment data structure.

Remarks

Each subsegment contains two pointers to adjoining subsegments, plus four pointers to vertices, plus two pointers to adjoining triangles, plus one boundary marker.

Boundary

Gets the segment boundary mark.

GetTriangle(System.Int32)

Gets an adjoining triangle.

GetVertex(System.Int32)

Gets the segments endpoint.

P0

Gets the first endpoints vertex id.

P1

Gets the seconds endpoints vertex id.

Triangle

The triangle data structure.

Remarks

Each triangle contains three pointers to adjoining triangles, plus three pointers to vertices, plus three pointers to subsegments (declared below; these pointers are usually ‘dummysub’). It may or may not also contain user-defined attributes and/or a floating-point “area constraint”.

Area

Gets the triangle area constraint.

GetNeighbor(index)

Gets a triangles’ neighbor.

Name Description
index System.Int32
The neighbor index (0, 1 or 2).

Returns

The neigbbor opposite of vertex with given index.

GetSegment(index)

Gets a triangles segment.

Name Description
index System.Int32
The vertex index (0, 1 or 2).

Returns

The segment opposite of vertex with given index.

GetVertex(System.Int32)

Gets the specified corners vertex.

ID

Gets the triangle id.

N0

Gets the first neighbors id.

N1

Gets the second neighbors id.

N2

Gets the third neighbors id.

P0

Gets the first corners vertex id.

P1

Gets the seconds corners vertex id.

P2

Gets the third corners vertex id.

Region

Region ID the triangle belongs to.

Vertex

The vertex data structure.

Constructor

Initializes a new instance of the Vertex class.

Constructor(x, y, mark, attribs)

Initializes a new instance of the Vertex class.

Name Description
x System.Single
The x coordinate of the vertex.
y System.Single
The y coordinate of the vertex.
mark System.Int32
The boundary mark.
attribs System.Int32
The number of point attributes.

Constructor(x, y, mark)

Initializes a new instance of the Vertex class.

Name Description
x System.Single
The x coordinate of the vertex.
y System.Single
The y coordinate of the vertex.
mark System.Int32
The boundary mark.

Constructor(x, y)

Initializes a new instance of the Vertex class.

Name Description
x System.Single
The x coordinate of the vertex.
y System.Single
The y coordinate of the vertex.

Item(System.Int32)

Gets the specified coordinate of the vertex.

Name Description
i Unknown type
Coordinate index.

Returns

X coordinate, if index is 0, Y coordinate, if index is 1.

Type

Gets the vertex type.

FindDirectionResult

Labels that signify the result of direction finding.

Remarks

The result indicates that a segment connecting the two query points falls within the direction triangle, along the left edge of the direction triangle, or along the right edge of the direction triangle.

BoundingBox

A simple bounding box class.

Constructor

Initializes a new instance of the BoundingBox class.

Constructor(xmin, ymin, xmax, ymax)

Initializes a new instance of the BoundingBox class with predefined bounds.

Name Description
xmin System.Single
Minimum x value.
ymin System.Single
Minimum y value.
xmax System.Single
Maximum x value.
ymax System.Single
Maximum y value.

Contains(pt)

Check if given point is inside bounding box.

Name Description
pt TriangleNet.Geometry.Point
Point to check.

Returns

Return true, if bounding box contains given point.

Height

Gets the height of the bounding box.

Scale(dx, dy)

Scale bounds.

Name Description
dx System.Single
Add dx to left and right bounds.
dy System.Single
Add dy to top and bottom bounds.

Update(x, y)

Update bounds.

Name Description
x System.Single
X coordinate.
y System.Single
Y coordinate.

Width

Gets the width of the bounding box.

Xmax

Gets the maximum x value (right boundary).

Xmin

Gets the minimum x value (left boundary).

Ymax

Gets the maximum y value (top boundary).

Ymin

Gets the minimum y value (bottom boundary).

Edge

Represents a straight line segment in 2D space.

Constructor(System.Int32,System.Int32,System.Int32)

Initializes a new instance of the Edge class.

Constructor(System.Int32,System.Int32)

Initializes a new instance of the Edge class.

Boundary

Gets the segments boundary mark.

P0

Gets the first endpoints index.

P1

Gets the second endpoints index.

EdgeEnumerator

Enumerates the edges of a triangulation.

Constructor(TriangleNet.Mesh)

Initializes a new instance of the EdgeEnumerator class.

InputGeometry

The input geometry which will be triangulated. May represent a pointset or a planar straight line graph.

Constructor

Initializes a new instance of the InputGeometry class.

Constructor(capacity)

Initializes a new instance of the InputGeometry class. The point list will be initialized with a given capacity.

Name Description
capacity System.Int32
Point list capacity.

AddHole(x, y)

Adds a hole location to the geometry.

Name Description
x System.Single
X coordinate of the hole.
y System.Single
Y coordinate of the hole.

AddPoint(x, y, boundary, attribute)

Adds a point to the geometry.

Name Description
x System.Single
X coordinate.
y System.Single
Y coordinate.
boundary System.Int32
Boundary marker.
attribute System.Single
Point attribute.

AddPoint(x, y, boundary, attribs)

Adds a point to the geometry.

Name Description
x System.Single
X coordinate.
y System.Single
Y coordinate.
boundary System.Int32
Boundary marker.
attribs System.Single[]
Point attributes.

AddPoint(x, y, boundary)

Adds a point to the geometry.

Name Description
x System.Single
X coordinate.
y System.Single
Y coordinate.
boundary System.Int32
Boundary marker.

AddPoint(x, y)

Adds a point to the geometry.

Name Description
x System.Single
X coordinate.
y System.Single
Y coordinate.

AddRegion(x, y, id)

Adds a hole location to the geometry.

Name Description
x System.Single
X coordinate of the hole.
y System.Single
Y coordinate of the hole.
id System.Int32
The region id.

AddSegment(p0, p1, boundary)

Adds a segment to the geometry.

Name Description
p0 System.Int32
First endpoint.
p1 System.Int32
Second endpoint.
boundary System.Int32
Segment marker.

AddSegment(p0, p1)

Adds a segment to the geometry.

Name Description
p0 System.Int32
First endpoint.
p1 System.Int32
Second endpoint.

Bounds

Gets the bounding box of the input geometry.

Clear

Clear input geometry.

Count

Gets the number of points.

HasSegments

Indicates, whether the geometry should be treated as a PSLG.

Holes

Gets the list of input holes.

Points

Gets the list of input points.

Regions

Gets the list of regions.

Segments

Gets the list of input segments.

ISegment

Interface for segment geometry.

Boundary

Gets the segment boundary mark.

GetTriangle(index)

Gets an adjoining triangle.

Name Description
index System.Int32
The triangle index (0 or 1).

GetVertex(index)

Gets the segments endpoint.

Name Description
index System.Int32
The vertex index (0 or 1).

P0

Gets the first endpoints vertex id.

P1

Gets the seconds endpoints vertex id.

ITriangle

Triangle interface.

Area

Triangle area constraint.

GetNeighbor(index)

Gets a triangles neighbor.

Name Description
index System.Int32
The vertex index (0, 1 or 2).

Returns

The neigbbor opposite of vertex with given index.

GetSegment(index)

Gets a triangles segment.

Name Description
index System.Int32
The vertex index (0, 1 or 2).

Returns

The segment opposite of vertex with given index.

GetVertex(index)

Gets a triangles vertex.

Name Description
index System.Int32
The vertex index (0, 1 or 2).

Returns

The vertex of the specified corner index.

ID

The triangle id.

N0

First neighbor.

N1

Second neighbor.

N2

Third neighbor.

P0

First vertex id of the triangle.

P1

Second vertex id of the triangle.

P2

Third vertex id of the triangle.

Region

Region ID the triangle belongs to.

SupportsNeighbors

True if the triangle implementation contains neighbor information.

Point

Represents a 2D point.

Attributes

Gets the vertex attributes (may be null).

Boundary

Gets the vertex boundary mark.

ID

Gets the vertex id.

X

Gets the vertex x coordinate.

Y

Gets the vertex y coordinate.

RegionPointer

Pointer to a region in the mesh geometry. A region is a well-defined subset of the geomerty (enclosed by subsegments).

Constructor(x, y, id)

Initializes a new instance of the RegionPointer class.

Name Description
x System.Single
X coordinate of the region.
y System.Single
Y coordinate of the region.
id System.Int32
Region id.

InsertVertexResult

Labels that signify the result of vertex insertion.

Remarks

The result indicates that the vertex was inserted with complete success, was inserted but encroaches upon a subsegment, was not inserted because it lies on a segment, or was not inserted because another vertex occupies the same location.

DataReader

The DataReader class provides methods for mesh reconstruction.

Reconstruct(mesh, input)

Reconstruct a triangulation from its raw data representation.

Name Description
mesh TriangleNet.Mesh
input TriangleNet.Geometry.InputGeometry

Returns

Remarks

Reads an .ele file and reconstructs the original mesh. If the -p switch is used, this procedure will also read a .poly file and reconstruct the subsegments of the original mesh. If the -a switch is used, this procedure will also read an .area file and set a maximum area constraint on each triangle. Vertices that are not corners of triangles, such as nodes on edges of subparametric elements, are discarded. This routine finds the adjacencies between triangles (and subsegments) by forming one stack of triangles for each vertex. Each triangle is on three different stacks simultaneously. Each triangle’s subsegment pointers are used to link the items in each stack. This memory-saving feature makes the code harder to read. The most important thing to keep in mind is that each triangle is removed from a stack precisely when the corresponding pointer is adjusted to refer to a subsegment rather than the next triangle of the stack.

DebugWriter

Writes a the current mesh into a text file.

Remarks

File format: num_nodes id_1 nx ny mark … id_n nx ny mark num_segs id_1 p1 p2 mark … id_n p1 p2 mark num_tris id_1 p1 p2 p3 n1 n2 n3 … id_n p1 p2 p3 n1 n2 n3

Finish

Finish this session.

Start(name)

Start a new session with given name.

Name Description
name System.String
Name of the session (and output files).

Write(TriangleNet.Mesh,System.Boolean)

Write complete mesh to file.

FileReader

Helper methods for reading Triangle file formats.

Read(System.String,TriangleNet.Geometry.InputGeometry@,System.Collections.Generic.List{TriangleNet.Geometry.ITriangle}@)

Reads a mesh from .node, .poly or .ele files.

Read(System.String,TriangleNet.Geometry.InputGeometry@)

Reads geometry information from .node or .poly files.

Read(System.String)

Reads geometry information from .node or .poly files.

ReadAreaFile(areafilename, intriangles, data)

Read the area constraints from an .area file.

Name Description
areafilename System.String
intriangles System.Int32
data Unknown type

ReadEdgeFile(edgeFile, invertices)

Read an .edge file.

Name Description
edgeFile System.String
The file name.
invertices System.Int32
The number of input vertices (read from a .node or .poly file).

Returns

A List of edges.

ReadEleFile(elefilename, data, readArea)

Read the elements from an .ele file.

Name Description
elefilename System.String
data System.Boolean
readArea Unknown type

ReadEleFile(elefilename)

Read elements from an .ele file.

Name Description
elefilename System.String
The file name.

Returns

A list of triangles.

ReadNodeFile(nodefilename, readElements)

Read the vertices from a file, which may be a .node or .poly file.

Name Description
nodefilename System.String
readElements System.Boolean

ReadNodeFile(nodefilename)

Read the vertices from a file, which may be a .node or .poly file.

Name Description
nodefilename System.String

Remarks

Will NOT read associated .ele by default.

ReadPolyFile(polyfilename, readElements, readElements)

Read the vertices and segments from a .poly file.

Name Description
polyfilename System.String
readElements System.Boolean
If true, look for an associated .ele file.
readElements System.Boolean
If true, look for an associated .area file.

ReadPolyFile(polyfilename, readElements)

Read the vertices and segments from a .poly file.

Name Description
polyfilename System.String
readElements System.Boolean
If true, look for an associated .ele file.

Remarks

Will NOT read associated .area by default.

ReadPolyFile(polyfilename)

Read the vertices and segments from a .poly file.

Name Description
polyfilename System.String

Remarks

Will NOT read associated .ele by default.

ReadVertex(data, index, line, attributes, marks)

Read vertex information of the given line.

Name Description
data TriangleNet.Geometry.InputGeometry
The input geometry.
index System.Int32
The current vertex index.
line System.String[]
The current line.
attributes System.Int32
Number of point attributes
marks System.Int32
Number of point markers (0 or 1)

FileWriter

Helper methods for writing Triangle file formats.

Write(mesh, filename)

Number the vertices and write them to a .node file.

Name Description
mesh TriangleNet.Mesh
filename System.String

WriteEdges(mesh, filename)

Write the edges to an .edge file.

Name Description
mesh TriangleNet.Mesh
filename System.String

WriteElements(mesh, filename)

Write the triangles to an .ele file.

Name Description
mesh TriangleNet.Mesh
filename System.String

WriteNeighbors(mesh, filename)

Write the triangle neighbors to a .neigh file.

Name Description
mesh TriangleNet.Mesh
filename System.String

Remarks

WARNING: Be sure WriteElements has been called before, so the elements are numbered right!

WriteNodes(nodes, writer)

Write the vertices to a stream.

Name Description
nodes System.IO.StreamWriter
writer System.Collections.Generic.IEnumerable{TriangleNet.Data.Vertex}

WriteNodes(System.IO.StreamWriter,TriangleNet.Mesh)

Number the vertices and write them to a .node file.

WriteNodes(mesh, filename)

Number the vertices and write them to a .node file.

Name Description
mesh TriangleNet.Mesh
filename System.String

WriteOffFile(mesh, filename)

Write the triangulation to an .off file.

Name Description
mesh TriangleNet.Mesh
filename System.String

Remarks

OFF stands for the Object File Format, a format used by the Geometry Center’s Geomview package.

WritePoly(mesh, filename, writeNodes)

Write the segments and holes to a .poly file.

Name Description
mesh TriangleNet.Mesh
Data source.
filename System.String
File name.
writeNodes System.Boolean
Write nodes into this file.

Remarks

If the nodes should not be written into this file, make sure a .node file was written before, so that the nodes are numbered right.

WritePoly(mesh, filename)

Write the segments and holes to a .poly file.

Name Description
mesh TriangleNet.Mesh
filename System.String

WriteVoronoi(mesh, filename)

Write the Voronoi diagram to a .voro file.

Name Description
mesh TriangleNet.Mesh
filename System.String

Returns

Remarks

The Voronoi diagram is the geometric dual of the Delaunay triangulation. Hence, the Voronoi vertices are listed by traversing the Delaunay triangles, and the Voronoi edges are listed by traversing the Delaunay edges. WARNING: In order to assign numbers to the Voronoi vertices, this procedure messes up the subsegments or the extra nodes of every element. Hence, you should call this procedure last.

IGeometryFormat

Interface for geometry input.

Read(filename)

Read a file containing geometry information.

Name Description
filename System.String
The path of the file to read.

Returns

An instance of the TriangleNet.Geometry.InputGeometry class.

IMeshFormat

Interface for mesh I/O.

Import(filename)

Read a file containing a mesh.

Name Description
filename System.String
The path of the file to read.

Returns

An instance of the TriangleNet.Mesh class.

Write(mesh, filename)

Save a mesh to disk.

Name Description
mesh TriangleNet.Mesh
An instance of the TriangleNet.Mesh class.
filename System.String
The path of the file to save.

InputTriangle

Simple triangle class for input.

Area

Gets the triangle area constraint.

GetVertex(System.Int32)

Gets the specified corners vertex.

ID

Gets the triangle id.

P0

Gets the first corners vertex id.

P1

Gets the seconds corners vertex id.

P2

Gets the third corners vertex id.

Region

Region ID the triangle belongs to.

TriangleFormat

Implements geometry and mesh file formats of the the original Triangle code.

LocateResult

Labels that signify the result of point location.

Remarks

The result of a search indicates that the point falls in the interior of a triangle, on an edge, on a vertex, or outside the mesh.

ILog`1

A basic log interface.

ILogItem

A basic log item interface.

SimpleLog

A simple logger, which logs messages to a List.

Remarks

Using singleton pattern as proposed by Jon Skeet. http://csharpindepth.com/Articles/General/Singleton.aspx

SimpleLogItem

Represents an item stored in the log.

Mesh

Mesh data structure.

Constructor

Initializes a new instance of the Mesh class.

Constructor(TriangleNet.Behavior)

Initializes a new instance of the Mesh class.

Behavior

Gets the mesh behavior instance.

Bounds

Gets the mesh bounding box.

Check(isConsistent, isDelaunay)

Check mesh consistency and (constrained) Delaunay property.

Name Description
isConsistent System.Boolean@
Value indicating if mesh topology is consistent.
isDelaunay System.Boolean@
Value indicating if mesh is Delaunay.

ConstrainedEdge(starttri, endpoint2, newmark)

Force a segment into a constrained Delaunay triangulation by deleting the triangles it intersects, and triangulating the polygons that form on each side of it.

Name Description
starttri TriangleNet.Data.Otri@
endpoint2 TriangleNet.Data.Vertex
newmark System.Int32

Remarks

Generates a single subsegment connecting ‘endpoint1’ to ‘endpoint2’. The triangle ‘starttri’ has ‘endpoint1’ as its origin. ‘newmark’ is the boundary marker of the segment. To insert a segment, every triangle whose interior intersects the segment is deleted. The union of these deleted triangles is a polygon (which is not necessarily monotone, but is close enough), which is divided into two polygons by the new segment. This routine’s task is to generate the Delaunay triangulation of these two polygons. You might think of this routine’s behavior as a two-step process. The first step is to walk from endpoint1 to endpoint2, flipping each edge encountered. This step creates a fan of edges connected to endpoint1, including the desired edge to endpoint2. The second step enforces the Delaunay condition on each side of the segment in an incremental manner: proceeding along the polygon from endpoint1 to endpoint2 (this is done independently on each side of the segment), each vertex is “enforced” as if it had just been inserted, but affecting only the previous vertices. The result is the same as if the vertices had been inserted in the order they appear on the polygon, so the result is Delaunay. In truth, ConstrainedEdge() interleaves these two steps. The procedure walks from endpoint1 to endpoint2, and each time an edge is encountered and flipped, the newly exposed vertex (at the far end of the flipped edge) is “enforced” upon the previously flipped edges, usually affecting only one side of the polygon (depending upon which side of the segment the vertex falls on). The algorithm is complicated by the need to handle polygons that are not convex. Although the polygon is not necessarily monotone, it can be triangulated in a manner similar to the stack-based algorithms for monotone polygons. For each reflex vertex (local concavity) of the polygon, there will be an inverted triangle formed by one of the edge flips. (An inverted triangle is one with negative area - that is, its vertices are arranged in clockwise order - and is best thought of as a wrinkle in the fabric of the mesh.) Each inverted triangle can be thought of as a reflex vertex pushed on the stack, waiting to be fixed later. A reflex vertex is popped from the stack when a vertex is inserted that is visible to the reflex vertex. (However, if the vertex behind the reflex vertex is not visible to the reflex vertex, a new inverted triangle will take its place on the stack.) These details are handled by the DelaunayFixup() routine above.

CurrentNumbering

Gets the current node numbering.

Delaunay

Form a Delaunay triangulation.

Returns

The number of points on the hull.

DelaunayFixup(fixuptri, leftside)

Enforce the Delaunay condition at an edge, fanning out recursively from an existing vertex. Pay special attention to stacking inverted triangles.

Name Description
fixuptri TriangleNet.Data.Otri@
leftside System.Boolean
Indicates whether or not fixuptri is to the left of the segment being inserted. (Imagine that the segment is pointing up from endpoint1 to endpoint2.)

Remarks

This is a support routine for inserting segments into a constrained Delaunay triangulation. The origin of fixuptri is treated as if it has just been inserted, and the local Delaunay condition needs to be enforced. It is only enforced in one sector, however, that being the angular range defined by fixuptri. This routine also needs to make decisions regarding the “stacking” of triangles. (Read the description of ConstrainedEdge() below before reading on here, so you understand the algorithm.) If the position of the new vertex (the origin of fixuptri) indicates that the vertex before it on the polygon is a reflex vertex, then “stack” the triangle by doing nothing. (fixuptri is an inverted triangle, which is how stacked triangles are identified.) Otherwise, check whether the vertex before that was a reflex vertex. If so, perform an edge flip, thereby eliminating an inverted triangle (popping it off the stack). The edge flip may result in the creation of a new inverted triangle, depending on whether or not the new vertex is visible to the vertex three edges behind on the polygon. If neither of the two vertices behind the new vertex are reflex vertices, fixuptri and fartri, the triangle opposite it, are not inverted; hence, ensure that the edge between them is locally Delaunay.

DeleteVertex(deltri)

Delete a vertex from a Delaunay triangulation, ensuring that the triangulation remains Delaunay.

Name Description
deltri TriangleNet.Data.Otri@

Remarks

The origin of ‘deltri’ is deleted. The union of the triangles adjacent to this vertex is a polygon, for which the Delaunay triangulation is found. Two triangles are removed from the mesh. Only interior vertices that do not lie on segments or boundaries may be deleted.

Edges

Gets the mesh edges.

FindDirection(searchtri, searchpoint)

Find the first triangle on the path from one point to another.

Name Description
searchtri TriangleNet.Data.Otri@
searchpoint TriangleNet.Data.Vertex

Returns

The return value notes whether the destination or apex of the found triangle is collinear with the two points in question.

Remarks

Finds the triangle that intersects a line segment drawn from the origin of ‘searchtri’ to the point ‘searchpoint’, and returns the result in ‘searchtri’. The origin of ‘searchtri’ does not change, even though the triangle returned may differ from the one passed in. This routine is used to find the direction to move in to get from one point to another.

Flip(flipedge)

Transform two triangles to two different triangles by flipping an edge counterclockwise within a quadrilateral.

Name Description
flipedge TriangleNet.Data.Otri@
Handle to the edge that will be flipped.

Remarks

Imagine the original triangles, abc and bad, oriented so that the shared edge ab lies in a horizontal plane, with the vertex b on the left and the vertex a on the right. The vertex c lies below the edge, and the vertex d lies above the edge. The ‘flipedge’ handle holds the edge ab of triangle abc, and is directed left, from vertex a to vertex b. The triangles abc and bad are deleted and replaced by the triangles cdb and dca. The triangles that represent abc and bad are NOT deallocated; they are reused for dca and cdb, respectively. Hence, any handles that may have held the original triangles are still valid, although not directed as they were before. Upon completion of this routine, the ‘flipedge’ handle holds the edge dc of triangle dca, and is directed down, from vertex d to vertex c. (Hence, the two triangles have rotated counterclockwise.) WARNING: This transformation is geometrically valid only if the quadrilateral adbc is convex. Furthermore, this transformation is valid only if there is not a subsegment between the triangles abc and bad. This routine does not check either of these preconditions, and it is the responsibility of the calling routine to ensure that they are met. If they are not, the streets shall be filled with wailing and gnashing of teeth. Terminology A “local transformation” replaces a small set of triangles with another set of triangles. This may or may not involve inserting or deleting a vertex. The term “casing” is used to describe the set of triangles that are attached to the triangles being transformed, but are not transformed themselves. Think of the casing as a fixed hollow structure inside which all the action happens. A “casing” is only defined relative to a single transformation; each occurrence of a transformation will involve a different casing.

FormSkeleton(segmentlist, segmentmarkerlist, numberofsegments)

Create the segments of a triangulation, including PSLG segments and edges on the convex hull.

Name Description
segmentlist TriangleNet.Geometry.InputGeometry
segmentmarkerlist Unknown type
numberofsegments Unknown type

Holes

Gets the mesh holes.

InsertSegment(endpoint1, endpoint2, newmark)

Insert a PSLG segment into a triangulation.

Name Description
endpoint1 TriangleNet.Data.Vertex
endpoint2 TriangleNet.Data.Vertex
newmark System.Int32

InsertSubseg(tri, subsegmark)

Create a new subsegment and inserts it between two triangles. Its vertices are properly initialized.

Name Description
tri TriangleNet.Data.Otri@
The new subsegment is inserted at the edge described by this handle.
subsegmark System.Int32
The marker ‘subsegmark’ is applied to the subsegment and, if appropriate, its vertices.

InsertVertex(newvertex, searchtri, splitseg, segmentflaws, triflaws)

Insert a vertex into a Delaunay triangulation, performing flips as necessary to maintain the Delaunay property.

Name Description
newvertex TriangleNet.Data.Vertex
The point to be inserted.
searchtri TriangleNet.Data.Otri@
The triangle to start the search.
splitseg TriangleNet.Data.Osub@
Segment to split.
segmentflaws System.Boolean
Check for creation of encroached subsegments.
triflaws System.Boolean
Check for creation of bad quality triangles.

Returns

If a duplicate vertex or violated segment does not prevent the vertex from being inserted, the return value will be ENCROACHINGVERTEX if the vertex encroaches upon a subsegment (and checking is enabled), or SUCCESSFULVERTEX otherwise. In either case, ‘searchtri’ is set to a handle whose origin is the newly inserted vertex.

Remarks

The point ‘newvertex’ is located. If ‘searchtri.triangle’ is not NULL, the search for the containing triangle begins from ‘searchtri’. If ‘searchtri.triangle’ is NULL, a full point location procedure is called. If ‘insertvertex’ is found inside a triangle, the triangle is split into three; if ‘insertvertex’ lies on an edge, the edge is split in two, thereby splitting the two adjacent triangles into four. Edge flips are used to restore the Delaunay property. If ‘insertvertex’ lies on an existing vertex, no action is taken, and the value DUPLICATEVERTEX is returned. On return, ‘searchtri’ is set to a handle whose origin is the existing vertex. InsertVertex() does not use flip() for reasons of speed; some information can be reused from edge flip to edge flip, like the locations of subsegments. Param ‘splitseg’: Normally, the parameter ‘splitseg’ is set to NULL, implying that no subsegment should be split. In this case, if ‘insertvertex’ is found to lie on a segment, no action is taken, and the value VIOLATINGVERTEX is returned. On return, ‘searchtri’ is set to a handle whose primary edge is the violated subsegment. If the calling routine wishes to split a subsegment by inserting a vertex in it, the parameter ‘splitseg’ should be that subsegment. In this case, ‘searchtri’ MUST be the triangle handle reached by pivoting from that subsegment; no point location is done. Param ‘segmentflaws’: Flags that indicate whether or not there should be checks for the creation of encroached subsegments. If a newly inserted vertex encroaches upon subsegments, these subsegments are added to the list of subsegments to be split if ‘segmentflaws’ is set. Param ‘triflaws’: Flags that indicate whether or not there should be checks for the creation of bad quality triangles. If bad triangles are created, these are added to the queue if ‘triflaws’ is set.

IsPolygon

Indicates whether the input is a PSLG or a point set.

Load(System.String)

Load a mesh from file (.node/poly and .ele).

Load(TriangleNet.Geometry.InputGeometry,System.Collections.Generic.List{TriangleNet.Geometry.ITriangle})

Reconstructs a mesh from raw input data.

MakeSegment(newsubseg)

Create a new subsegment with orientation zero.

Name Description
newsubseg TriangleNet.Data.Osub@
Reference to the new subseg.

MakeTriangle(newotri)

Create a new triangle with orientation zero.

Name Description
newotri TriangleNet.Data.Otri@
Reference to the new triangle.

MakeVertexMap

Construct a mapping from vertices to triangles to improve the speed of point location for segment insertion.

Remarks

Traverses all the triangles, and provides each corner of each triangle with a pointer to that triangle. Of course, pointers will be overwritten by other pointers because (almost) each vertex is a corner of several triangles, but in the end every vertex will point to some triangle that contains it.

MarkHull

Cover the convex hull of a triangulation with subsegments.

NumberOfEdges

Gets the number of mesh edges.

NumberOfInputPoints

Gets the number of input vertices.

Refine

Refines the current mesh.

Refine(System.Boolean)

Refines the current mesh by finding the maximum triangle area and setting the a global area constraint to half its size.

Refine(areaConstraint)

Refines the current mesh by setting a global area constraint.

Name Description
areaConstraint System.Single
Global area constraint.

Renumber

Renumber vertex and triangle id’s.

Renumber(TriangleNet.NodeNumbering)

Renumber vertex and triangle id’s.

Reset

Reset the mesh triangulation state.

ResetData

Reset all the mesh data. This method will also wipe out all mesh data.

ScoutSegment(searchtri, endpoint2, newmark)

Scout the first triangle on the path from one endpoint to another, and check for completion (reaching the second endpoint), a collinear vertex, or the intersection of two segments.

Name Description
searchtri TriangleNet.Data.Otri@
endpoint2 TriangleNet.Data.Vertex
newmark System.Int32

Returns

Returns true if the entire segment is successfully inserted, and false if the job must be finished by ConstrainedEdge().

Remarks

If the first triangle on the path has the second endpoint as its destination or apex, a subsegment is inserted and the job is done. If the first triangle on the path has a destination or apex that lies on the segment, a subsegment is inserted connecting the first endpoint to the collinear vertex, and the search is continued from the collinear vertex. If the first triangle on the path has a subsegment opposite its origin, then there is a segment that intersects the segment being inserted. Their intersection vertex is inserted, splitting the subsegment.

SegmentIntersection(splittri, splitsubseg, endpoint2)

Find the intersection of an existing segment and a segment that is being inserted. Insert a vertex at the intersection, splitting an existing subsegment.

Name Description
splittri TriangleNet.Data.Otri@
splitsubseg TriangleNet.Data.Osub@
endpoint2 TriangleNet.Data.Vertex

Remarks

The segment being inserted connects the apex of splittri to endpoint2. splitsubseg is the subsegment being split, and MUST adjoin splittri. Hence, endpoints of the subsegment being split are the origin and destination of splittri. On completion, splittri is a handle having the newly inserted intersection point as its origin, and endpoint1 as its destination.

Segments

Gets the mesh segments.

Smooth

Smooth the current mesh.

SubsegDealloc(dyingsubseg)

Deallocate space for a subsegment, marking it dead.

Name Description
dyingsubseg TriangleNet.Data.Segment

TransferNodes(data)

Read the vertices from memory.

Name Description
data TriangleNet.Geometry.InputGeometry
The input data.

TriangleDealloc(dyingtriangle)

Deallocate space for a triangle, marking it dead.

Name Description
dyingtriangle TriangleNet.Data.Triangle

Triangles

Gets the mesh triangles.

Triangulate(input)

Triangulate given input file (.node or .poly).

Name Description
input System.String

Triangulate(input)

Triangulate given input data.

Name Description
input TriangleNet.Geometry.InputGeometry

UndoVertex

Undo the most recent vertex insertion.

Remarks

Walks through the list of transformations (flips and a vertex insertion) in the reverse of the order in which they were done, and undoes them. The inserted vertex is removed from the triangulation and deallocated. Two triangles (possibly just one) are also deallocated.

Unflip(flipedge)

Transform two triangles to two different triangles by flipping an edge clockwise within a quadrilateral. Reverses the flip() operation so that the data structures representing the triangles are back where they were before the flip().

Name Description
flipedge TriangleNet.Data.Otri@

Remarks

See above Flip() remarks for more information. Upon completion of this routine, the ‘flipedge’ handle holds the edge cd of triangle cdb, and is directed up, from vertex c to vertex d. (Hence, the two triangles have rotated clockwise.)

VertexDealloc(dyingvertex)

Deallocate space for a vertex, marking it dead.

Name Description
dyingvertex TriangleNet.Data.Vertex

Vertices

Gets the mesh vertices.

NewLocation

Find new Steiner Point locations.

Remarks

http://www.cise.ufl.edu/~ungor/aCute/index.html

ChooseCorrectPoint(x1, y1, x2, y2, x3, y3, isObtuse)

Given three points, check if the point is the correct point that we are looking for.

Name Description
x1 System.Single
P1 coordinates (bisector point of dual edge on triangle)
y1 System.Single
P1 coordinates (bisector point of dual edge on triangle)
x2 System.Single
P2 coordinates (intersection point)
y2 System.Single
P2 coordinates (intersection point)
x3 System.Single
P3 coordinates (circumcenter point)
y3 System.Single
P3 coordinates (circumcenter point)
isObtuse System.Boolean

Returns

Returns true, if given point is the correct one otherwise return false.

CircleLineIntersection(x1, y1, x2, y2, x3, y3, r, p)

Given two points representing a line and a radius together with a center point representing a circle, returns the intersection points.

Name Description
x1 System.Single
y1 System.Single
x2 System.Single
y2 System.Single
x3 System.Single
y3 System.Single
r System.Single
p System.Single[]@
Pointer to list of intersection points

Remarks

referenced to: http://local.wasp.uwa.edu.au/~pbourke/geometry/sphereline/

DoSmoothing(badotri, torg, tdest, tapex, newloc)

Checks if smothing is possible for a given bad triangle.

Name Description
badotri TriangleNet.Data.Otri
torg TriangleNet.Data.Vertex
tdest TriangleNet.Data.Vertex
tapex TriangleNet.Data.Vertex
newloc System.Single[]@
The new location for the point, if somothing is possible.

Returns

Returns 1, 2 or 3 if smoothing will work, 0 otherwise.

FindLocation(torg, tdest, tapex, xi, eta, offcenter, badotri)

Find a new location for a Steiner point.

Name Description
torg TriangleNet.Data.Vertex
tdest TriangleNet.Data.Vertex
tapex TriangleNet.Data.Vertex
xi System.Single@
eta System.Single@
offcenter System.Boolean
badotri TriangleNet.Data.Otri

Returns

FindNewLocation(torg, tdest, tapex, circumcenter, xi, eta, offcenter, badotri)

Find a new location for a Steiner point.

Name Description
torg TriangleNet.Data.Vertex
tdest TriangleNet.Data.Vertex
tapex TriangleNet.Data.Vertex
circumcenter System.Single@
xi System.Single@
eta System.Boolean
offcenter TriangleNet.Data.Otri
badotri Unknown type

FindNewLocationWithoutMaxAngle(torg, tdest, tapex, circumcenter, xi, eta, offcenter, badotri)

Find a new location for a Steiner point.

Name Description
torg TriangleNet.Data.Vertex
tdest TriangleNet.Data.Vertex
tapex TriangleNet.Data.Vertex
circumcenter System.Single@
xi System.Single@
eta System.Boolean
offcenter TriangleNet.Data.Otri
badotri Unknown type

FindPolyCentroid(numpoints, points, centroid)

Returns the centroid of a given polygon

Name Description
numpoints System.Int32
points System.Single[]
centroid System.Single[]@
Centroid of a given polygon

GetNeighborsVertex(badotri, first_x, first_y, second_x, second_y, thirdpoint, neighotri)

Gets a neighbours vertex.

Name Description
badotri TriangleNet.Data.Otri
first_x System.Single
first_y System.Single
second_x System.Single
second_y System.Single
thirdpoint System.Single[]@
Neighbor’s third vertex incident to given edge.
neighotri TriangleNet.Data.Otri@
Pointer for the neighbor triangle.

Returns

Returns true if vertex was found.

GetStarPoints(badotri, p, q, r, whichPoint, points)

Finds the star of a given point.

Name Description
badotri TriangleNet.Data.Otri
p TriangleNet.Data.Vertex
q TriangleNet.Data.Vertex
r TriangleNet.Data.Vertex
whichPoint System.Int32
points System.Single[]@
List of points on the star of the given point.

Returns

Number of points on the star of the given point.

GetWedgeIntersection(numpoints, points, newloc)

Find a new point location by wedge intersection.

Name Description
numpoints System.Int32
points System.Single[]
newloc System.Single[]@
A new location for the point according to surrounding points.

Returns

Returns true if new location found

GetWedgeIntersectionWithoutMaxAngle(numpoints, points, newloc)

Find a new point location by wedge intersection.

Name Description
numpoints System.Int32
points System.Single[]
newloc System.Single[]@
A new location for the point according to surrounding points.

Returns

Returns true if new location found

HalfPlaneIntersection(numvertices, convexPoly, x1, y1, x2, y2)

Returns the convex polygon which is the intersection of the given convex polygon with the halfplane on the left side (regarding the directional vector) of the given line.

Name Description
numvertices System.Int32
convexPoly System.Single[]@
x1 System.Single
y1 System.Single
x2 System.Single
y2 System.Single

Returns

Remarks

http://www.mathematik.uni-ulm.de/stochastik/lehre/ws03_04/rt/Geometry2D.ps

IsBadPolygonAngle(x1, y1, x2, y2, x3, y3)

Given three coordinates of a polygon, tests to see if it satisfies the minimum angle condition for relocation.

Name Description
x1 System.Single
y1 System.Single
x2 System.Single
y2 System.Single
x3 System.Single
y3 System.Single

Returns

Returns true, if it is a BAD polygon corner, returns false if it is a GOOD polygon corner

IsBadTriangleAngle(x1, y1, x2, y2, x3, y3)

Given three coordinates of a triangle, tests a triangle to see if it satisfies the minimum and/or maximum angle condition.

Name Description
x1 System.Single
y1 System.Single
x2 System.Single
y2 System.Single
x3 System.Single
y3 System.Single

Returns

Returns true, if it is a BAD triangle, returns false if it is a GOOD triangle.

LineLineSegmentIntersection(x1, y1, x2, y2, x3, y3, x4, y4, p)

Given four points representing one line and a line segment, returns the intersection point

Name Description
x1 System.Single
y1 System.Single
x2 System.Single
y2 System.Single
x3 System.Single
y3 System.Single
x4 System.Single
y4 System.Single
p System.Single[]@

Remarks

referenced to: http://local.wasp.uwa.edu.au/~pbourke/geometry/

LinePointLocation(x1, y1, x2, y2, x, y)

Determines on which side (relative to the direction) of the given line and the point lies (regarding the directional vector) of the given line.

Name Description
x1 System.Single
y1 System.Single
x2 System.Single
y2 System.Single
x System.Single
y System.Single

Returns

Remarks

http://www.mathematik.uni-ulm.de/stochastik/lehre/ws03_04/rt/Geometry2D.ps

MinDistanceToNeighbor(newlocX, newlocY, searchtri)

Given the triangulation, and a vertex returns the minimum distance to the vertices of the triangle where the given vertex located.

Name Description
newlocX System.Single
newlocY System.Single
searchtri TriangleNet.Data.Otri@

Returns

PointBetweenPoints(x1, y1, x2, y2, x, y, p)

This function returns a pointer array which first index indicates the whether the point is in between the other points, followed by coordinate pairs.

Name Description
x1 System.Single
P1 coordinates [point of line] (point on Voronoi edge - intersection)
y1 System.Single
P1 coordinates [point of line] (point on Voronoi edge - intersection)
x2 System.Single
P2 coordinates [point of line] (circumcenter)
y2 System.Single
P2 coordinates [point of line] (circumcenter)
x System.Single
P3 coordinates [point to be compared] (neighbor’s circumcenter)
y System.Single
P3 coordinates [point to be compared] (neighbor’s circumcenter)
p System.Single[]@

SplitConvexPolygon(numvertices, convexPoly, x1, y1, x2, y2, polys)

Splits a convex polygons into one or two polygons through the intersection with the given line (regarding the directional vector of the given line).

Name Description
numvertices System.Int32
convexPoly System.Single[]
x1 System.Single
y1 System.Single
x2 System.Single
y2 System.Single
polys System.Single[][]@

Returns

Remarks

http://www.mathematik.uni-ulm.de/stochastik/lehre/ws03_04/rt/Geometry2D.ps

ValidPolygonAngles(numpoints, points)

Check polygon for min angle.

Name Description
numpoints System.Int32
points System.Single[]

Returns

Returns true if the polygon has angles greater than 2*minangle.

NodeNumbering

Node renumbering algorithms.

Primitives

Provides some primitives regularly used in computational geometry.

CounterClockwise(pa, pb, pc)

Check, if the three points appear in counterclockwise order. The result is also a rough approximation of twice the signed area of the triangle defined by the three points.

Name Description
pa TriangleNet.Geometry.Point
Point a.
pb TriangleNet.Geometry.Point
Point b.
pc TriangleNet.Geometry.Point
Point c.

Returns

Return a positive value if the points pa, pb, and pc occur in counterclockwise order; a negative value if they occur in clockwise order; and zero if they are collinear.

Remarks

Uses exact arithmetic if necessary to ensure a correct answer. The result returned is the determinant of a matrix. This determinant is computed adaptively, in the sense that exact arithmetic is used only to the degree it is needed to ensure that the returned value has the correct sign. Hence, this function is usually quite fast, but will run more slowly when the input points are collinear or nearly so. See Robust Predicates paper for details.

ExactInit

Initialize the variables used for exact arithmetic.

Remarks

‘epsilon’ is the largest power of two such that 1.0 + epsilon = 1.0 in floating-point arithmetic. ‘epsilon’ bounds the relative roundoff error. It is used for floating-point error analysis. ‘splitter’ is used to split floating-point numbers into two half- length significands for exact multiplication. I imagine that a highly optimizing compiler might be too smart for its own good, and somehow cause this routine to fail, if it pretends that floating-point arithmetic is too much like real arithmetic. Don’t change this routine unless you fully understand it.

FindCircumcenter(torg, tdest, tapex, xi, eta, offconstant)

Find the circumcenter of a triangle.

Name Description
torg TriangleNet.Geometry.Point
Triangle point.
tdest TriangleNet.Geometry.Point
Triangle point.
tapex TriangleNet.Geometry.Point
Triangle point.
xi System.Single@
Relative coordinate of new location.
eta System.Single@
Relative coordinate of new location.
offconstant System.Single
Off-center constant.

Returns

Coordinates of the circumcenter (or off-center)

FindCircumcenter(torg, tdest, tapex, xi, eta)

Find the circumcenter of a triangle.

Name Description
torg TriangleNet.Geometry.Point
Triangle point.
tdest TriangleNet.Geometry.Point
Triangle point.
tapex TriangleNet.Geometry.Point
Triangle point.
xi System.Single@
Relative coordinate of new location.
eta System.Single@
Relative coordinate of new location.

Returns

Coordinates of the circumcenter

Remarks

The result is returned both in terms of x-y coordinates and xi-eta (barycentric) coordinates. The xi-eta coordinate system is defined in terms of the triangle: the origin of the triangle is the origin of the coordinate system; the destination of the triangle is one unit along the xi axis; and the apex of the triangle is one unit along the eta axis. This procedure also returns the square of the length of the triangle’s shortest edge.

InCircle(pa, pb, pc, pd)

Check if the point pd lies inside the circle passing through pa, pb, and pc. The points pa, pb, and pc must be in counterclockwise order, or the sign of the result will be reversed.

Name Description
pa TriangleNet.Geometry.Point
Point a.
pb TriangleNet.Geometry.Point
Point b.
pc TriangleNet.Geometry.Point
Point c.
pd TriangleNet.Geometry.Point
Point d.

Returns

Return a positive value if the point pd lies inside the circle passing through pa, pb, and pc; a negative value if it lies outside; and zero if the four points are cocircular.

Remarks

Uses exact arithmetic if necessary to ensure a correct answer. The result returned is the determinant of a matrix. This determinant is computed adaptively, in the sense that exact arithmetic is used only to the degree it is needed to ensure that the returned value has the correct sign. Hence, this function is usually quite fast, but will run more slowly when the input points are cocircular or nearly so. See Robust Predicates paper for details.

NonRegular(pa, pb, pc, pd)

Return a positive value if the point pd is incompatible with the circle or plane passing through pa, pb, and pc (meaning that pd is inside the circle or below the plane); a negative value if it is compatible; and zero if the four points are cocircular/coplanar. The points pa, pb, and pc must be in counterclockwise order, or the sign of the result will be reversed.

Name Description
pa TriangleNet.Geometry.Point
Point a.
pb TriangleNet.Geometry.Point
Point b.
pc TriangleNet.Geometry.Point
Point c.
pd TriangleNet.Geometry.Point
Point d.

Returns

Return a positive value if the point pd lies inside the circle passing through pa, pb, and pc; a negative value if it lies outside; and zero if the four points are cocircular.

Quality

Provides methods for mesh quality enforcement and testing.

AddBadSubseg(badseg)

Add a bad subsegment to the queue.

Name Description
badseg TriangleNet.Data.BadSubseg
Bad subsegment.

CheckDelaunay

Ensure that the mesh is (constrained) Delaunay.

CheckMesh

Test the mesh for topological consistency.

CheckSeg4Encroach(testsubseg)

Check a subsegment to see if it is encroached; add it to the list if it is.

Name Description
testsubseg TriangleNet.Data.Osub@
The subsegment to check.

Returns

Returns a nonzero value if the subsegment is encroached.

Remarks

A subsegment is encroached if there is a vertex in its diametral lens. For Ruppert’s algorithm (-D switch), the “diametral lens” is the diametral circle. For Chew’s algorithm (default), the diametral lens is just big enough to enclose two isosceles triangles whose bases are the subsegment. Each of the two isosceles triangles has two angles equal to ‘b.minangle’. Chew’s algorithm does not require diametral lenses at all–but they save time. Any vertex inside a subsegment’s diametral lens implies that the triangle adjoining the subsegment will be too skinny, so it’s only a matter of time before the encroaching vertex is deleted by Chew’s algorithm. It’s faster to simply not insert the doomed vertex in the first place, which is why I use diametral lenses with Chew’s algorithm.

EnforceQuality

Remove all the encroached subsegments and bad triangles from the triangulation.

SplitEncSegs(triflaws)

Split all the encroached subsegments.

Name Description
triflaws System.Boolean
A flag that specifies whether one should take note of new bad triangles that result from inserting vertices to repair encroached subsegments.

Remarks

Each encroached subsegment is repaired by splitting it - inserting a vertex at or near its midpoint. Newly inserted vertices may encroach upon other subsegments; these are also repaired.

SplitTriangle(badtri)

Inserts a vertex at the circumcenter of a triangle. Deletes the newly inserted vertex if it encroaches upon a segment.

Name Description
badtri TriangleNet.Data.BadTriangle

TallyEncs

Traverse the entire list of subsegments, and check each to see if it is encroached. If so, add it to the list.

TallyFaces

Test every triangle in the mesh for quality measures.

TestTriangle(testtri)

Test a triangle for quality and size.

Name Description
testtri TriangleNet.Data.Otri@
Triangle to check.

Remarks

Tests a triangle to see if it satisfies the minimum angle condition and the maximum area condition. Triangles that aren’t up to spec are added to the bad triangle queue.

Sampler

Used for triangle sampling in the Mesh.Locate method.

GetSamples(TriangleNet.Mesh)

Get a random sample set of triangle keys.

Returns

Array of triangle keys.

Reset

Reset the sampler.

Update(mesh)

Update sampling parameters if mesh changed.

Name Description
mesh TriangleNet.Mesh
Current mesh.

Update(mesh)

Update sampling parameters if mesh changed.

Name Description
mesh TriangleNet.Mesh
Current mesh.

ISmoother

Interface for mesh smoothers.

SimpleSmoother

Simple mesh smoother implementation.

Remarks

Vertices wich should not move (e.g. segment vertices) MUST have a boundary mark greater than 0.

Rebuild

Rebuild the input geometry.

Step

Smooth all free nodes.

AdjacencyMatrix

The adjacency matrix of the mesh.

AdjacencyCount(TriangleNet.Mesh)

Counts adjacencies in a triangulation.

Remarks

This routine is called to count the adjacencies, so that the appropriate amount of memory can be set aside for storage when the adjacency structure is created. The triangulation is assumed to involve 3-node triangles. Two nodes are “adjacent” if they are both nodes in some triangle. Also, a node is considered to be adjacent to itself. Diagram: 3 s \ i \ d \ e \ side 1 \ 2 \ \ 1——-2 side 3

AdjacencySet(TriangleNet.Mesh,System.Int32[])

Sets adjacencies in a triangulation.

Remarks

This routine can be used to create the compressed column storage for a linear triangle finite element discretization of Poisson’s equation in two dimensions.

Bandwidth

Computes the bandwidth of an adjacency matrix.

Returns

Bandwidth of the adjacency matrix.

CreateHeap(size, a)

Reorders an array of integers into a descending heap.

Name Description
size System.Int32[]
the size of the input array.
a System.Int32
an unsorted array.

Remarks

A heap is an array A with the property that, for every index J, A[J] >= A[2J+1] and A[J] >= A[2J+2], (as long as the indices 2J+1 and 2J+2 are legal). Diagram: A(0) / \ A(1) A(2) / \ / \ A(3) A(4) A(5) A(6) / \ / \ A(7) A(8) A(9) A(10)

HeapSort(size, a)

ascending sorts an array of integers using heap sort.

Name Description
size System.Int32[]
Number of entries in the array.
a System.Int32
Array to be sorted;

BoundedVoronoi

The Bounded Voronoi Diagram is the dual of a PSLG triangulation.

Remarks

2D Centroidal Voronoi Tessellations with Constraints, 2010, Jane Tournois, Pierre Alliez and Olivier Devillers

Constructor(mesh)

Initializes a new instance of the BoundedVoronoi class.

Name Description
mesh TriangleNet.Mesh
Mesh instance.

Constructor(mesh)

Initializes a new instance of the BoundedVoronoi class.

Name Description
mesh TriangleNet.Mesh
Mesh instance.

Generate

Computes the bounded voronoi diagram.

Points

Gets the list of Voronoi vertices.

Regions

Gets the list of Voronoi regions.

SegmentsIntersect(seg, pc, pd, p, strictIntersect)

Determines the intersection point of the line segment defined by points A and B with the line segment defined by points C and D.

Name Description
seg TriangleNet.Geometry.Point
The first segment AB.
pc TriangleNet.Geometry.Point
Endpoint C of second segment.
pd TriangleNet.Geometry.Point
Endpoint D of second segment.
p TriangleNet.Geometry.Point
Reference to the intersection point.
strictIntersect TriangleNet.Geometry.Point@
If false, pa and pb represent a line.

Returns

Returns true if the intersection point was found, and stores that point in X,Y. Returns false if there is no determinable intersection point, in which case X,Y will be unmodified.

TagBlindTriangles

Tag all blind triangles.

Remarks

A triangle is said to be blind if the triangle and its circumcenter lie on two different sides of a constrained edge.

TriangleIsBlinded(tri, seg)

Check if given triangle is blinded by given segment.

Name Description
tri TriangleNet.Data.Otri@
Triangle.
seg TriangleNet.Data.Osub@
Segments

Returns

Returns true, if the triangle is blinded.

CuthillMcKee

Applies the Cuthill and McKee renumbering algorithm to reduce the bandwidth of the adjacency matrix associated with the mesh.

Remarks

Some useful slides: http://bobbyness.net/NerdyStuff/node%20ordering/node_ordering.html

Degree(root, mask, deg, iccsze, ls, node_num)

Computes the degrees of the nodes in the connected component.

Name Description
root System.Int32
the node that defines the connected component.
mask System.Int32[]
MASK[NODE_NUM], is nonzero for those nodes which are to be considered.
deg System.Int32[]
Output, int DEG[NODE_NUM], contains, for each node in the connected component, its degree.
iccsze System.Int32@
Output, int ICCSIZE, the number of nodes in the connected component.
ls System.Int32[]
Output, int LS[NODE_NUM], stores in entries 1 through ICCSIZE the nodes in the connected component, starting with ROOT, and proceeding by levels.
node_num System.Int32
the number of nodes.

Remarks

The connected component is specified by MASK and ROOT. Nodes for which MASK is zero are ignored. Reference: Alan George, Joseph Liu, Computer Solution of Large Sparse Positive Definite Systems, Prentice Hall, 1981.

FindRoot(root, mask, level_num, level_row, level, node_num)

Finds a pseudo-peripheral node.

Name Description
root System.Int32@
On input, ROOT is a node in the the component of the graph for which a pseudo-peripheral node is sought. On output, ROOT is the pseudo-peripheral node obtained.
mask System.Int32[]
MASK[NODE_NUM], specifies a section subgraph. Nodes for which MASK is zero are ignored by FNROOT.
level_num System.Int32@
Output, int LEVEL_NUM, is the number of levels in the level structure rooted at the node ROOT.
level_row System.Int32[]
Output, int LEVEL_ROW(NODE_NUM+1), the level structure array pair containing the level structure found.
level System.Int32[]
Output, int LEVEL(NODE_NUM), the level structure array pair containing the level structure found.
node_num System.Int32
the number of nodes.

Remarks

The diameter of a graph is the maximum distance (number of edges) between any two nodes of the graph. The eccentricity of a node is the maximum distance between that node and any other node of the graph. A peripheral node is a node whose eccentricity equals the diameter of the graph. A pseudo-peripheral node is an approximation to a peripheral node; it may be a peripheral node, but all we know is that we tried our best. The routine is given a graph, and seeks pseudo-peripheral nodes, using a modified version of the scheme of Gibbs, Poole and Stockmeyer. It determines such a node for the section subgraph specified by MASK and ROOT. The routine also determines the level structure associated with the given pseudo-peripheral node; that is, how far each node is from the pseudo-peripheral node. The level structure is returned as a list of nodes LS, and pointers to the beginning of the list of nodes that are at a distance of 0, 1, 2, …, NODE_NUM-1 from the pseudo-peripheral node. Reference: Alan George, Joseph Liu, Computer Solution of Large Sparse Positive Definite Systems, Prentice Hall, 1981. Norman Gibbs, William Poole, Paul Stockmeyer, An Algorithm for Reducing the Bandwidth and Profile of a Sparse Matrix, SIAM Journal on Numerical Analysis, Volume 13, pages 236-250, 1976. Norman Gibbs, Algorithm 509: A Hybrid Profile Reduction Algorithm, ACM Transactions on Mathematical Software, Volume 2, pages 378-387, 1976.

GenerateRcm

Finds the reverse Cuthill-Mckee ordering for a general graph.

Returns

The RCM ordering.

Remarks

For each connected component in the graph, the routine obtains an ordering by calling RCM.

GetLevelSet(root, mask, level_num, level_row, level, node_num)

Generates the connected level structure rooted at a given node.

Name Description
root System.Int32@
the node at which the level structure is to be rooted.
mask System.Int32[]
MASK[NODE_NUM]. On input, only nodes with nonzero MASK are to be processed. On output, those nodes which were included in the level set have MASK set to 1.
level_num System.Int32@
Output, int LEVEL_NUM, the number of levels in the level structure. ROOT is in level 1. The neighbors of ROOT are in level 2, and so on.
level_row System.Int32[]
Output, int LEVEL_ROW[NODE_NUM+1], the rooted level structure.
level System.Int32[]
Output, int LEVEL[NODE_NUM], the rooted level structure.
node_num System.Int32
the number of nodes.

Remarks

Only nodes for which MASK is nonzero will be considered. The root node chosen by the user is assigned level 1, and masked. All (unmasked) nodes reachable from a node in level 1 are assigned level 2 and masked. The process continues until there are no unmasked nodes adjacent to any node in the current level. The number of levels may vary between 2 and NODE_NUM. Reference: Alan George, Joseph Liu, Computer Solution of Large Sparse Positive Definite Systems, Prentice Hall, 1981.

PermBandwidth(perm, perm_inv)

Computes the bandwidth of a permuted adjacency matrix.

Name Description
perm System.Int32[]
The permutation.
perm_inv System.Int32[]
The inverse permutation.

Returns

Bandwidth of the permuted adjacency matrix.

Remarks

The matrix is defined by the adjacency information and a permutation. The routine also computes the bandwidth and the size of the envelope.

PermInverse(n, perm)

Produces the inverse of a given permutation.

Name Description
n System.Int32
Number of items permuted.
perm System.Int32[]
PERM[N], a permutation.

Returns

The inverse permutation.

Rcm(root, mask, perm, iccsze, node_num)

RCM renumbers a connected component by the reverse Cuthill McKee algorithm.

Name Description
root System.Int32
the node that defines the connected component. It is used as the starting point for the RCM ordering.
mask System.Int32[]
Input/output, int MASK(NODE_NUM), a mask for the nodes. Only those nodes with nonzero input mask values are considered by the routine. The nodes numbered by RCM will have their mask values set to zero.
perm System.Int32[]
Output, int PERM(NODE_NUM), the RCM ordering.
iccsze System.Int32
Output, int ICCSZE, the size of the connected component that has been numbered.
node_num System.Int32@
the number of nodes.

Remarks

The connected component is specified by a node ROOT and a mask. The numbering starts at the root node. An outline of the algorithm is as follows: X(1) = ROOT. for ( I = 1 to N-1) Find all unlabeled neighbors of X(I), assign them the next available labels, in order of increasing degree. When done, reverse the ordering.

Renumber(mesh)

Gets the permutation vector for the Reverse Cuthill-McKee numbering.

Name Description
mesh TriangleNet.Mesh
The mesh.

Returns

Permutation vector.

ReverseVector(size, a)

Reverses the elements of an integer vector.

Name Description
size System.Int32[]
number of entries in the array.
a System.Int32
the array to be reversed.

Example

Input: N = 5, A = ( 11, 12, 13, 14, 15 ). Output: A = ( 15, 14, 13, 12, 11 ).

IVoronoi

TODO: Update summary.

Points

Gets the list of Voronoi vertices.

Regions

Gets the list of Voronoi regions.

QuadNode

A node of the quadtree.

QuadTree

A Quadtree implementation optimised for triangles.

Constructor(mesh, maxDepth, sizeBound)

Initializes a new instance of the QuadTree class.

Name Description
mesh TriangleNet.Mesh
Mesh containing triangles.
maxDepth System.Int32
The maximum depth of the tree.
sizeBound System.Int32
The maximum number of triangles contained in a leaf.

Remarks

The quadtree does not track changes of the mesh. If a mesh is refined or changed in any other way, a new quadtree has to be built to make the point location work. A node of the tree will be split, if its level if less than the max depth parameter AND the number of triangles in the node is greater than the size bound.

IsPointInTriangle(p, t0, t1, t2)

Test, if a given point lies inside a triangle.

Name Description
p TriangleNet.Geometry.Point
Point to locate.
t0 TriangleNet.Geometry.Point
Corner point of triangle.
t1 TriangleNet.Geometry.Point
Corner point of triangle.
t2 TriangleNet.Geometry.Point
Corner point of triangle.

Returns

True, if point is inside or on the edge of this triangle.

QualityMeasure

Provides mesh quality information.

Remarks

Given a triangle abc with points A (ax, ay), B (bx, by), C (cx, cy). The side lengths are given as a = sqrt((cx - bx)^2 + (cy - by)^2) – side BC opposite of A b = sqrt((cx - ax)^2 + (cy - ay)^2) – side CA opposite of B c = sqrt((ax - bx)^2 + (ay - by)^2) – side AB opposite of C The angles are given as ang_a = acos((b^2 + c^2 - a^2) / (2 * b * c)) – angle at A ang_b = acos((c^2 + a^2 - b^2) / (2 * c * a)) – angle at B ang_c = acos((a^2 + b^2 - c^2) / (2 * a * b)) – angle at C The semiperimeter is given as s = (a + b + c) / 2 The area is given as D = abs(ax * (by - cy) + bx * (cy - ay) + cx * (ay - by)) / 2 = sqrt(s * (s - a) * (s - b) * (s - c)) The inradius is given as r = D / s The circumradius is given as R = a * b * c / (4 * D) The altitudes are given as alt_a = 2 * D / a – altitude above side a alt_b = 2 * D / b – altitude above side b alt_c = 2 * D / c – altitude above side c The aspect ratio may be given as the ratio of the longest to the shortest edge or, more commonly as the ratio of the circumradius to twice the inradius ar = R / (2 * r) = a * b * c / (8 * (s - a) * (s - b) * (s - c)) = a * b * c / ((b + c - a) * (c + a - b) * (a + b - c))

AlphaArea

Average angle weighted by area.

AlphaAverage

Average angle.

AlphaMaximum

Maximum smallest angle.

AlphaMeasure

The alpha measure determines the triangulated pointset quality.

Remarks

The alpha measure evaluates the uniformity of the shapes of the triangles defined by a triangulated pointset. We compute the minimum angle among all the triangles in the triangulated dataset and divide by the maximum possible value (which, in degrees, is 60). The best possible value is 1, and the worst 0. A good triangulation should have an alpha score close to 1.

Measure(ab, bc, ca, area)

Compute q value of given triangle.

Name Description
ab System.Single
Side length ab.
bc System.Single
Side length bc.
ca System.Single
Side length ca.
area System.Single
Triangle area.

Returns

Normalize(System.Int32,System.Single)

Normalize values.

Reset

Reset all values.

TriangleNet.Tools.QualityMeasure.AlphaMinimum

Smallest angle.

TriangleNet.Tools.QualityMeasure.AreaMaximum

Maximum triangle area.

TriangleNet.Tools.QualityMeasure.AreaMeasure.Measure(a, b, c)

Compute the area of given triangle.

Name Description
a TriangleNet.Geometry.Point
Triangle corner a.
b TriangleNet.Geometry.Point
Triangle corner b.
c TriangleNet.Geometry.Point
Triangle corner c.

Returns

Triangle area.

TriangleNet.Tools.QualityMeasure.AreaMeasure.Reset

Reset all values.

TriangleNet.Tools.QualityMeasure.AreaMinimum

Minimum triangle area.

TriangleNet.Tools.QualityMeasure.AreaRatio

Ratio of maximum and minimum triangle area.

TriangleNet.Tools.QualityMeasure.Bandwidth

Determines the bandwidth of the coefficient matrix.

Returns

Bandwidth of the coefficient matrix.

Remarks

The quantity computed here is the “geometric” bandwidth determined by the finite element mesh alone. If a single finite element variable is associated with each node of the mesh, and if the nodes and variables are numbered in the same way, then the geometric bandwidth is the same as the bandwidth of a typical finite element matrix. The bandwidth M is defined in terms of the lower and upper bandwidths: M = ML + 1 + MU where ML = maximum distance from any diagonal entry to a nonzero entry in the same row, but earlier column, MU = maximum distance from any diagonal entry to a nonzero entry in the same row, but later column. Because the finite element node adjacency relationship is symmetric, we are guaranteed that ML = MU.

TriangleNet.Tools.QualityMeasure.Q_Area

Average aspect ratio weighted by area.

TriangleNet.Tools.QualityMeasure.Q_Average

Average aspect ratio.

TriangleNet.Tools.QualityMeasure.Q_Maximum

Largest aspect ratio.

Q_Measure

The Q measure determines the triangulated pointset quality.

Remarks

The Q measure evaluates the uniformity of the shapes of the triangles defined by a triangulated pointset. It uses the aspect ratio 2 * (incircle radius) / (circumcircle radius) In an ideally regular mesh, all triangles would have the same equilateral shape, for which Q = 1. A good mesh would have 0.5 < Q.

Measure(ab, bc, ca, area)

Compute q value of given triangle.

Name Description
ab System.Single
Side length ab.
bc System.Single
Side length bc.
ca System.Single
Side length ca.
area System.Single
Triangle area.

Returns

Normalize(System.Int32,System.Single)

Normalize values.

Reset

Reset all values.

TriangleNet.Tools.QualityMeasure.Q_Minimum

Smallest aspect ratio.

RegionIterator

Iterates the region a given triangle belongs to and applies an action to each connected trianlge in that region. Default action is to set the region id.

Process(TriangleNet.Data.Triangle,System.Action{TriangleNet.Data.Triangle})

Process all trianlges connected to given triangle and apply given action.

Process(TriangleNet.Data.Triangle)

Set the region attribute of all trianlges connected to given triangle.

ProcessRegion(attribute, area)

Spread regional attributes and/or area constraints (from a .poly file) throughout the mesh.

Name Description
attribute System.Action{TriangleNet.Data.Triangle}
area Unknown type

Remarks

This procedure operates in two phases. The first phase spreads an attribute and/or an area constraint through a (segment-bounded) region. The triangles are marked to ensure that each triangle is added to the virus pool only once, so the procedure will terminate. The second phase uninfects all infected triangles, returning them to normal.

Statistic

Gather mesh statistics.

AngleHistogram

Gets the angle histogram.

BoundaryEdges

Gets the number of exterior boundary edges.

CircleTopCount

Number of circle top calculations performed.

CircumcenterCount

// Number of circumcenter calculations performed.

ConstrainedEdges

Gets the number of constrained edges.

CounterClockwiseCount

Number of counterclockwise tests performed.

Edges

Gets the number of mesh edges.

HyperbolaCount

Number of right-of-hyperbola tests performed.

InCircleCount

Number of incircle tests performed.

InputHoles

Gets the number of input holes.

InputSegments

Gets the number of input segments.

InputTriangles

Gets the number of input triangles.

InputVertices

Gets the number of input vertices.

InteriorBoundaryEdges

Gets the number of interior boundary edges.

LargestAngle

Gets the largest angle.

LargestArea

Gets the largest area.

LargestAspectRatio

Gets the largest aspect ratio.

LongestEdge

Gets the longest edge.

MaxAngleHistogram

Gets the max angles histogram.

MinAngleHistogram

Gets the min angles histogram.

Orient3dCount

Number of 3D orientation tests performed.

RelocationCount

Number of vertex relocations.

ShortestAltitude

Gets the shortest altitude.

ShortestEdge

Gets the shortest edge.

SmallestAngle

Gets the smallest angle.

SmallestArea

Gets the smallest area.

Triangles

Gets the number of mesh triangles.

Update(mesh)

Update statistics about the quality of the mesh.

Name Description
mesh TriangleNet.Mesh

Vertices

Gets the number of mesh vertices.

Voronoi

The Voronoi Diagram is the dual of a pointset triangulation.

Constructor(mesh)

Initializes a new instance of the Voronoi class.

Name Description
mesh TriangleNet.Mesh

Remarks

Be sure MakeVertexMap has been called (should always be the case).

ConstructVoronoiRegion(vertex)

Construct Voronoi region for given vertex.

Name Description
vertex TriangleNet.Data.Vertex

Returns

The circumcenter indices which make up the cell.

Generate

Gets the Voronoi diagram as raw output data.

Name Description
mesh TriangleNet.Mesh

Returns

Remarks

The Voronoi diagram is the geometric dual of the Delaunay triangulation. Hence, the Voronoi vertices are listed by traversing the Delaunay triangles, and the Voronoi edges are listed by traversing the Delaunay edges.

Points

Gets the list of Voronoi vertices.

Regions

Gets the list of Voronoi regions.

VoronoiRegion

Represents a region in the Voronoi diagram.

Bounded

Gets or sets whether the Voronoi region is bounded.

Generator

Gets the Voronoi regions generator.

ID

Gets the Voronoi region id (which is the same as the generators vertex id).

Vertices

Gets the Voronoi vertices on the regions boundary.

TriangleLocator

TODO: Update summary.

Locate(searchpoint, searchtri)

Find a triangle or edge containing a given point.

Name Description
searchpoint TriangleNet.Geometry.Point
The point to locate.
searchtri TriangleNet.Data.Otri@
The triangle to start the search at.

Returns

Location information.

Remarks

Searching begins from one of: the input ‘searchtri’, a recently encountered triangle ‘recenttri’, or from a triangle chosen from a random sample. The choice is made by determining which triangle’s origin is closest to the point we are searching for. Normally, ‘searchtri’ should be a handle on the convex hull of the triangulation. Details on the random sampling method can be found in the Mucke, Saias, and Zhu paper cited in the header of this code. On completion, ‘searchtri’ is a triangle that contains ‘searchpoint’. Returns ONVERTEX if the point lies on an existing vertex. ‘searchtri’ is a handle whose origin is the existing vertex. Returns ONEDGE if the point lies on a mesh edge. ‘searchtri’ is a handle whose primary edge is the edge on which the point lies. Returns INTRIANGLE if the point lies strictly within a triangle. ‘searchtri’ is a handle on the triangle that contains the point. Returns OUTSIDE if the point lies outside the mesh. ‘searchtri’ is a handle whose primary edge the point is to the right of. This might occur when the circumcenter of a triangle falls just slightly outside the mesh due to floating-point roundoff error. It also occurs when seeking a hole or region point that a foolish user has placed outside the mesh. WARNING: This routine is designed for convex triangulations, and will not generally work after the holes and concavities have been carved.

PreciseLocate(searchpoint, searchtri, stopatsubsegment)

Find a triangle or edge containing a given point.

Name Description
searchpoint TriangleNet.Geometry.Point
The point to locate.
searchtri TriangleNet.Data.Otri@
The triangle to start the search at.
stopatsubsegment System.Boolean
If ‘stopatsubsegment’ is set, the search will stop if it tries to walk through a subsegment, and will return OUTSIDE.

Returns

Location information.

Remarks

Begins its search from ‘searchtri’. It is important that ‘searchtri’ be a handle with the property that ‘searchpoint’ is strictly to the left of the edge denoted by ‘searchtri’, or is collinear with that edge and does not intersect that edge. (In particular, ‘searchpoint’ should not be the origin or destination of that edge.) These conditions are imposed because preciselocate() is normally used in one of two situations: (1) To try to find the location to insert a new point. Normally, we know an edge that the point is strictly to the left of. In the incremental Delaunay algorithm, that edge is a bounding box edge. In Ruppert’s Delaunay refinement algorithm for quality meshing, that edge is the shortest edge of the triangle whose circumcenter is being inserted. (2) To try to find an existing point. In this case, any edge on the convex hull is a good starting edge. You must screen out the possibility that the vertex sought is an endpoint of the starting edge before you call preciselocate(). On completion, ‘searchtri’ is a triangle that contains ‘searchpoint’. This implementation differs from that given by Guibas and Stolfi. It walks from triangle to triangle, crossing an edge only if ‘searchpoint’ is on the other side of the line containing that edge. After entering a triangle, there are two edges by which one can leave that triangle. If both edges are valid (‘searchpoint’ is on the other side of both edges), one of the two is chosen by drawing a line perpendicular to the entry edge (whose endpoints are ‘forg’ and ‘fdest’) passing through ‘fapex’. Depending on which side of this perpendicular ‘searchpoint’ falls on, an exit edge is chosen. This implementation is empirically faster than the Guibas and Stolfi point location routine (which I originally used), which tends to spiral in toward its target. Returns ONVERTEX if the point lies on an existing vertex. ‘searchtri’ is a handle whose origin is the existing vertex. Returns ONEDGE if the point lies on a mesh edge. ‘searchtri’ is a handle whose primary edge is the edge on which the point lies. Returns INTRIANGLE if the point lies strictly within a triangle. ‘searchtri’ is a handle on the triangle that contains the point. Returns OUTSIDE if the point lies outside the mesh. ‘searchtri’ is a handle whose primary edge the point is to the right of. This might occur when the circumcenter of a triangle falls just slightly outside the mesh due to floating-point roundoff error. It also occurs when seeking a hole or region point that a foolish user has placed outside the mesh. WARNING: This routine is designed for convex triangulations, and will not generally work after the holes and concavities have been carved. However, it can still be used to find the circumcenter of a triangle, as long as the search is begun from the triangle in question.

TriangulationAlgorithm

Implemented triangulation algorithms.

VertexType

The type of the mesh vertex.

UIUtils

Utility class providing helper functions for UI interactions.

UIUtils.SimulateClick(button)

Simulates a user click on a given UnityEngineUI.Button by invoking its UnityEngineUI.Button.onClick event.

Name Description
button UnityEngine.UI.Button
Target button.

UpdateDropdownOptions

Dynamically updates a UnityEngineUI.Dropdown’s options.

Remarks

This script supports both English and French options and preserves the last selected index when the dropdown is disabled or the language is changed.

UpdateDropdownOptions.GetCurrentLanguageOptions

Retrieves the list of options corresponding to the current language.

Returns

A list of option strings in the selected language.

UpdateDropdownOptions.OnDisable

Unity lifecycle method — called on the first frame. Initializes the dropdown options based on the dropdown value.

UpdateDropdownOptions.OnDropdownValueChanged(newIndex)

Called when the dropdown value changes. Should be linked to UnityEngineUI.Dropdown.onValueChanged via the Inspector.

Name Description
newIndex System.Int32
The newly selected option index.

UpdateDropdownOptions.OnEnable

Called when the GameObject becomes enabled again. Updates the dropdown only if the value has changed, otherwise restores the last known selection.

UpdateDropdownOptions.Start

Unity lifecycle method — called on the first frame. Initializes the dropdown options based on the current language.

UpdateDropdownOptions.UpdateDropdown

Updates the dropdown options based on the current language and restores the previous selection if possible.