Keeps a world-space canvas facing the VR camera at a fixed distance, with optional horizontal-only rotation and smooth interpolation.
Updates canvas position and rotation each frame to follow the VR camera smoothly.
Provides simple control over an Animator, including the ability to skip directly to the end of a specified animation state.
Instantly jumps the specified animation state to its final frame.
| Name | Description |
|---|---|
| stateName | System.String The name of the animation state to fast-forward. |
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.
Updates the arrow’s rotation each frame to face the target smoothly.
Automatically pauses gameplay and plays audio feedback clips at timed intervals. Handles multilingual audio, text display on pause, and resuming after playback.
Displays the moving text canvas in front of the player and loads its text content.
Returns the appropriate audio list based on the current language.
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).
Plays the next audio clip and triggers pause if necessary.
Sets the index of the next audio clip to play.
Enables or disables automatic pause directly.
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. |
Starts the automatic pause sequence if enabled.
Stops the automatic pause routine, typically called from other scripts to interrupt the sequence.
Resets internal flags when audio playback finishes.
Waits for a given duration in real time before advancing the text segment.
Ensures the attached camera maintains a specified rendering depth, updating automatically both in Play mode and the Unity Editor.
Initializes the camera reference and applies the configured depth.
Called when the script is loaded or a value is changed in the Inspector. Ensures the camera depth is updated in the Editor.
Updates the camera’s rendering depth based on the serialized value.
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).
Disables all currently active canvases except the ignored ones, saving their previous enabled state for later restoration.
Finds all currently active canvases in the scene (enabled and active in hierarchy), excluding those specified in the ignored list.
Represents a canvas to ignore during activation/deactivation, optionally including its child canvases.
Checks if a given transform is a child of another transform.
Restores the enabled state of all canvases previously disabled by DisableAllCanvasesExceptIgnored.
Determines whether a canvas should be ignored based on the ignore list and hierarchy rules.
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.
Initializes references and configures the input field to avoid full selection and unwanted keyboard display.
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. |
Index of the nearest character for caret placement.
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. |
Defines a single collision rule, pairing a specific collider with UnityEvents for OnTriggerEnter, OnTriggerStay, and OnTriggerExit.
Handles trigger-based collision detection for a group of predefined colliders, delegating scanner-related collision events to a LocationTransition script.
TODO: Refactor so the parent object manages collisions for all child colliders automatically.
Handles collision logic when the player interacts with the bottom scanner zone.
Handles logic when the player exits the defined interaction area. (e.g., fade-out, show UI hints, manage re-entry logic.)
Handles collision logic when the player interacts with the top scanner zone.
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. |
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. |
Changes the color of a specified UI UnityEngineUI.Image component. Can be used for visual feedback, UI highlighting, or state indication.
Applies the configured color to the target image, if assigned.
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.
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°). |
Validates the camera reference at startup.
Checks each frame whether the camera is facing the target direction within the specified angle threshold. Invokes the corresponding UnityEvent based on the result.
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.
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. |
Handles hardware controller inputs for both hands.
Handles trigger button hold detection and associated visual/audio feedback.
Handles XR Device Simulator inputs (keyboard/mouse-based testing).
Initializes XR input devices for left and right hands.
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.
True if at least one hand trigger is pressed; otherwise, false.
Invokes the configured UnityEvent when a hold action has been successfully detected. Prevents multiple invocations until all triggers are released.
Enables or disables hold detection behavior globally.
Updates input state each frame. Ensures controllers are initialized and processes input for both real XR devices and the XR Device Simulator.
Manages timed playback of a sequence of audio clips with countdown intervals, looping, language support (French/English), and event-based progression control.
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.
Coroutine that waits for an optional previous clip, then plays the next one after the countdown delay.
Coroutine that loops through audio clips sequentially until manually stopped.
Returns the currently active list of audio clips based on the selected language.
Starts a countdown and plays the next clip in sequence once.
Continuously plays clips in sequence after each countdown, until externally stopped.
Starts a countdown before playing a specific clip once.
| Name | Description |
|---|---|
| clipIndex | System.Int32 The index of the clip to play after the countdown. |
Coroutine handling the countdown and playback of a specific clip.
Starts a countdown, then plays the specified clip in a repeating loop until externally stopped.
Coroutine that loops playback of a single clip after each countdown period, until externally stopped.
Sets the countdown timer duration (in seconds) before the next audio clip plays.
Manually sets the index of the next audio clip to play.
Enables or disables looping playback of audio sequences when reaching the end.
Ensures that an AudioSource is assigned at startup.
Begins automatic clip index scheduling based on trip duration from MoonMovement.
Immediately stops the current audio playback (if any).
Stops any active countdown or looping coroutines immediately.
Stops automatic clip index scheduling.
Monitors audio playback completion, invokes OnFinishPlayback, and handles scheduled index increments.
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.
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. |
Defines a button and its associated hold/release events.
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. |
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. |
Initializes the button state map and sets up pointer event triggers for each button.
Invokes the ButtonAction.onHold event for any button currently being held down.
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/
Disables XR
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.
Coroutine that continuously updates the XR Rig position to follow this object’s movement. Runs every frame until dragging is stopped.
Begins the dragging process and starts the coroutine that updates XR Rig movement.
Initializes the object’s position to match the initial bed position and records it for tracking.
Checks if the object has moved since the last frame and starts dragging if movement is detected.
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.
Starts the sequence on Awake if enabled.
Invokes the onDisable event when disabled.
Restarts the sequence if already started.
Restarts the sequence from the beginning.
Represents a single entry in the event sequence.
Coroutine that processes the sequence entries.
Sets whether to clear triggers after each trigger.
Pauses or resumes the sequence.
Adds or updates a trigger.
Starts the sequence.
Starts the sequence with an optional completion callback.
Associates a trigger string with a tag.
Updates the wait timer if not paused.
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.
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.
Enables the fallback renderer if it exists and is currently inactive.
Updates the alpha bias of the UnityXR.CompositionLayers.Extensions.ColorScaleBiasExtension component.
Activates or disables the proper rendering backend according to the selected mode.
Initializes the fade backend by detecting available components and preparing default textures if needed.
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). |
Determines which fade rendering backend to use.
Smoothly interpolates fade alpha over time using the Composition Layer backend.
Performs a fade-in transition (from black to clear).
Performs a fade-out transition (from clear to black).
Smoothly interpolates fade alpha over time using the Renderer material as fallback.
Returns the current fade duration in seconds.
Displays a simple HUD overlay showing which fade backend is active. Only available in Editor or Development builds.
Performs a fade to a target alpha, detecting the current alpha automatically.
| Name | Description |
|---|---|
| targetAlpha | System.Single Target fade alpha (1 = black, 0 = transparent). |
Sets a new fade duration in seconds.
Determines whether Composition Layers should be used based on the selected backend and component availability.
Automatically fades in at start if fadeOnStart is enabled.
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.
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
Calculates total duration per feedback type (optional).
Represents a single feedback event, containing a type label and a timestamp.
Saves logs when the app loses focus (e.g., user opens system menu or Meta button).
Automatically saves progress when the app is paused (e.g., system interruptions).
Ensures logs are automatically saved when the application quits.
Registers a feedback event if recording is active and enabled.
Saves the feedback log to a CSV file in persistent data path.
Sets the pause context used in the CSV filename.
Sets the record ID used in the CSV filename and file header.
| Name | Description |
|---|---|
| id | System.String The participant or record identifier. |
Sets the record ID from a TextMeshPro input field.
| Name | Description |
|---|---|
| inputField | TMPro.TMP_InputField The TMP_InputField containing the ID text. |
Sets the session identifier used in the CSV filename and file header.
| Name | Description |
|---|---|
| session | System.String A unique session name or number. |
Sets the session identifier from a TextMeshPro input field.
| Name | Description |
|---|---|
| inputField | TMPro.TMP_InputField The TMP_InputField containing the session text. |
Enables or disables logging for this run.
Starts recording feedback events if shouldRecord is enabled.
Stops recording and saves the feedback log to a CSV file.
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:
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.
Scans all scene GameObjects for missing MonoBehaviours and renderers without assigned materials. Removes missing scripts safely and logs detected issues.
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.
Clears cached editor data such as and Inspector settings. This can resolve persistent editor errors without affecting project assets.
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.
Automatically configures graphics and XR settings for optimal performance on Meta Quest headsets, and exposes UnityEvents for pause and focus transitions.
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.
Initializes application-level graphics and XR settings when the scene loads. This method runs before Start() and configures the render pipeline for optimal performance.
Detects the current headset model based on Android device identifiers.
Returns the target URP render scale depending on the detected headset.
Supported headset types used for automatic optimization.
Initializes the XRDisplaySubsystem reference if XR is active.
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. |
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. |
Called when the application is about to quit. Resets graphics settings and clears temporary PlayerPrefs values.
Resets URP render scale to 1.0 (default) when exiting play mode or application quit.
Ensures render scale resets properly after exiting Play Mode in the Editor.
Configures the headset’s foveated rendering level and enables gaze-based foveation.
Adjusts the device refresh rate and texture resolution scale based on the detected headset.
Handles collision detection for a configurable list of target colliders, triggering custom UnityEvents when they enter, stay, or exit the trigger zone.
Disables all collision event detection.
Enables all collision event detection.
Invokes the corresponding OnEnter event when a tracked collider enters the trigger.
Invokes the corresponding OnExit event when a tracked collider leaves the trigger.
Continuously invokes the OnStay event while a tracked collider remains inside the trigger.
Initializes the component with collision detection disabled by default.
Handles feedback (visual, audio, and data logging) when the XR reticle collides with a specific interactable target in the scene.
Handles audio feedback and data logging for correct interactions.
Applies correct visual feedback and triggers corresponding events.
Handles audio feedback and data logging for incorrect interactions.
Applies incorrect visual feedback and triggers corresponding events.
Initializes the components and subscribes to XR interaction events.
Invoked automatically when this component is disabled. Used to trigger exit-related cleanup or events.
Called when the XR ray interactor begins hovering over an interactable object. Provides feedback depending on whether the hovered object is the target.
Called when the XR ray interactor stops hovering over an interactable object. Resets feedback when leaving the correct target.
Enables or disables audio feedback events.
Periodically performs ray-based proximity detection around the head (or camera), checking for nearby obstacles or walls to prevent clipping in VR.
List of currently detected colliders (updated periodically).
Draws gizmos to visualize detection rays and proximity sphere in the Scene view.
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. |
List of detected RaycastHits within the given parameters.
Initializes the first detection when the scene starts.
Periodically updates head collision detection based on the configured delay. Helps avoid unnecessary raycasts every frame.
Applies a physical pushback when the player’s head collides with nearby obstacles, using collision data provided by HeadCollisionDetector.
This prevents the player’s head (and camera) from clipping through walls in VR. The pushback is applied via a UnityEngineCharacterController for smooth movement.
Calculates the overall pushback direction by averaging all detected surface normals.
Continuously checks for nearby obstacles detected by HeadCollisionDetector and applies a small pushback movement via the CharacterController to prevent clipping.
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 |
Performs a radial search.
| Name | Description |
|---|---|
| center | `0[] Center point |
| radius | `0 Radius to find neighbours within |
This constructor will use a default capacity of 4.
Displays and manages a MicrosoftMixedReality.Toolkit.Experimental.UI.NonNativeKeyboard for a TMProTMP_InputField in XR.
Closes the currently open keyboard (if any).
Called when the keyboard is closed, cleaning up listeners and caret visibility.
Closes this keyboard if another input field opens a new one.
Handles text submission (e.g., when the user presses Enter) and closes the keyboard.
Unsubscribes from global events to prevent memory leaks or invalid callbacks when disabled.
Subscribes to global keyboard events when this component is enabled.
Static event fired globally whenever a keyboard is opened, so others can close.
Opens the non-native keyboard and attaches listeners for text input and close events.
Positions the keyboard relative to the given reference transform.
Toggles the caret visibility to make typing feedback clearer.
Initializes keyboard behavior by linking it to the assigned input field. Automatically sets up the listener to open the XR keyboard on selection.
Manages the current language state across the application. Supports persistence using UnityEnginePlayerPrefs and runtime updates triggered by UI elements.
Internal helper that safely converts a string to a LanguageManagerLang enum value.
| Name | Description |
|---|---|
| newLang | System.String Language string to apply. |
The currently active language.
Initializes the LanguageManager and loads the saved preference if available.
Global singleton instance for accessing the current language.
Supported language options.
Automatically applies language changes when modified from the Unity Inspector during Play Mode.
Changes the language and saves the selection to PlayerPrefs.
| Name | Description |
|---|---|
| newLang | System.String Language name as a string (“English” or “French”). |
Controls the progression of a UI Image with a “Filled” type to visually represent a loading or hold duration.
Resets the loading bar immediately to 0%.
Sets a custom duration for the loading process.
| Name | Description |
|---|---|
| duration | System.Single The desired duration (in seconds). |
Starts the loading progression and resets the fill amount.
| Name | Description |
|---|---|
| duration | System.Single Optional custom duration for this loading sequence. |
Updates the fill progression each frame while loading is active and the canvas is visible.
Represents a specific location configuration in the scene, including the transform reference and the objects to enable/disable when transitioning to this location.
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.
Ends the current session, quitting play mode in Editor or exiting the application in a build.
Coroutine that waits before moving to the first location.
| Name | Description |
|---|---|
| waitTime | System.Single Delay before recentering, in seconds. |
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. |
Moves to the next location in the list cyclically.
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. |
Moves the player to a specific location based on a Transform reference.
| Name | Description |
|---|---|
| target | UnityEngine.Transform Transform of the target location. |
A specific method that handles vertical adjustment when colliding with the bottom of the scanner area.
A specific method that handles vertical adjustment when colliding with the top of the scanner area.
Increments the internal location index (used for next-location transitions).
Performs a fade-out before ending the session or quitting the application.
| Name | Description |
|---|---|
| fadeDuration | System.Single Duration of the fade-out before quitting. |
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. |
Re-centers the XR Origin to the current location without moving to a new one.
Saves the current origin rotation and forward direction of the head to maintain consistent alignment between locations.
Sets the current location index manually, without triggering a transition.
| Name | Description |
|---|---|
| index | System.Int32 Target index within the location list. |
Sets a custom duration for future location transitions.
| Name | Description |
|---|---|
| duration | System.Single Transition duration in seconds. |
Initializes reference orientation at startup.
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.
Ensures the AudioSource reference is assigned at runtime.
Returns the array of audio clips corresponding to the currently active language.
An array of UnityEngineAudioClips in the correct language.
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). |
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. |
Plays a specific clip from the Inspector manually.
| Name | Description |
|---|---|
| clip | UnityEngine.AudioClip The UnityEngineAudioClip to play. |
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. |
Stops the current audio playback and invokes ManagedAudioSourceOnFinishPlayback.
Monitors playback state each frame and triggers the end event when audio finishes.
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.
Initializes the component and ensures required references are set.
Unsubscribes from Unity events.
Called automatically when the video reaches its end.
| Name | Description |
|---|---|
| source | UnityEngine.Video.VideoPlayer The VideoPlayer that triggered the event. |
Plays the specified video clip.
| Name | Description |
|---|---|
| clip | UnityEngine.Video.VideoClip The UnityEngineVideo.VideoClip to play. |
Allows triggering playback directly from the Unity Inspector.
| Name | Description |
|---|---|
| clip | UnityEngine.Video.VideoClip The UnityEngineVideo.VideoClip to play. |
Stops the current video playback and invokes the finish event manually.
Runtime checks or updates during playback.
Allows manual repositioning and rotation of a reference Transform (typically the XR Origin) using directional input, relative to the camera’s orientation.
Applies movement and rotation logic based on active directional flags.
Moves the origin in a given world direction.
| Name | Description |
|---|---|
| direction | UnityEngine.Vector3 Direction vector (normalized). |
Called to move backward (relative to camera).
Called to move downward.
Called to move forward (relative to camera).
Called to move left (relative to camera).
Called to move right (relative to camera).
Called to move upward.
Called to rotate downward (pitch).
Called to rotate left (yaw).
Called to rotate right (yaw).
Called to rotate upward (pitch).
Rotates the origin vertically (pitch) around the camera’s local X axis.
| Name | Description |
|---|---|
| direction | System.Single Rotation direction multiplier. |
Rotates the origin horizontally (yaw) around the global Y axis.
| Name | Description |
|---|---|
| direction | System.Single Rotation direction multiplier. |
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.
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.
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.
Axis slider is a script to lock a bar across a specific axis.
Use late update to track the input slider
This class toggles the Caps Lock image based on the NonNativeKeyboard’s IsCapsLocked state
The highlight image to turn on and off.
The keyboard to check for caps locks
Unity Start method.
Unity update method.
Updates the visual state of the shift highlight.
Represents a key on the keyboard that has a function.
Designer specified functionality of a keyboard button.
Method injected into the button’s onClick listener.
Possible functionality for a button.
Subscribe to the onClick event.
Represents a key on the keyboard that has a string value for input.
Get the button component.
Method injected into the button’s onClick listener.
Reference to the GameObject’s button component.
Reference to child text element.
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. |
The shifted string value for this key.
Initialize key text, subscribe to the onClick event, and subscribe to keyboard shift event.
The default string value for this key.
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.
User can add an audio source to the keyboard to have a click be heard on tapping a key
Time on which the keyboard should close on inactivity
The default color of the mike key.
The image on the mike key.
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 |
The panel that contains the alpha keys.
References @ bottom panel.
References abc bottom panel.
References .com bottom panel.
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. |
Deactivate on Awake.
Delete the character before the caret.
Set the keyboard to a permanent shift state.
| Name | Description |
|---|---|
| newCapsLockState | System.Boolean Caps lock state the method is switching to |
Check if the keyboard has been left alone for too long and close
Clear the text input field.
Close the keyboard. (Clears all event subscriptions.)
Make the keyboard disappear automatically after a timeout
Inactivity time that makes the keyboard disappear automatically.
Disable GameObjects for all keyboard elements.
Intermediary function for text update events. Workaround for strange leftover reference when unsubscribing.
| Name | Description |
|---|---|
| value | System.String String value. |
Fire the text entered event for objects listening to keyboard. Immediately closes keyboard.
Trigger specific keyboard functionality.
| Name | Description |
|---|---|
| functionKey | Microsoft.MixedReality.Toolkit.Experimental.UI.KeyboardKeyFunc The functionKey of the pressed key. |
Respond to keyboard activity: reset timeout timer, play sound
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.
Move the axis slider based on the camera forward and the keyboard plane projection.
Accessor reporting caps lock state of keyboard.
Initialize dictation mode.
Accessor reporting shift state of keyboard.
Makes sure the input field is always selected while the keyboard is up.
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.
Look at function to have the keyboard face the user
The position of the caret in the text field.
Current caps lock state of keyboard.
Current shift state of keyboard.
The maximum distance the keyboard should be from the user.
The scale the keyboard should be at its maximum distance.
The minimum distance the keyboard needs to be away from the user.
The scale the keyboard should be at its minimum distance.
The default bounds of the keyboard.
The starting scale of the keyboard.
Move caret to the left.
Move caret to the right.
Send the “next” event.
Fired every time the close button is pressed. (Cleared when keyboard is closed.)
Destroy unmanaged memory links.
Called whenever the keyboard is disabled or deactivated.
Event fired when function key on keyboard is pressed. Fires before internal keyboard state is updated.
Event fired when shift key on keyboard is pressed.
Event fired when char key on keyboard is pressed.
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.)
Sent when the keyboard is placed. This allows listener to know when someone else is co-opting the keyboard.
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.)
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.)
Fired every time the text in the InputField changes. (Cleared when keyboard is closed.)
Present the default keyboard to the camera.
Presents a specific keyboard to the camera.
| Name | Description |
|---|---|
| keyboardType | Microsoft.MixedReality.Toolkit.Experimental.UI.NonNativeKeyboard.LayoutType Specify the keyboard type. |
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. |
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. |
Send the “previous” event.
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 |
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 |
Reset inactivity closing timer
Reset temporary states of keyboard.
Function to scale keyboard to the appropriate size based on distance
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 |
Set the keyboard to a single action shift state.
| Name | Description |
|---|---|
| newShiftState | System.Boolean value the shift key should have after calling the method |
Enable the alpha keyboard.
Enable the symbol keyboard.
Bool for toggling the slider being enabled.
Insert a space character.
Set up Dictation, CanvasEX, and automatically select the TextInput object.
Bool to flag submitting on enter
The panel that contains the number and symbol keys.
Insert a tab character.
Show the default subkeys only on the Alphanumeric keyboard.
Returns true if default subkeys were activated, false if alphanumeric keyboard isn’t active
Show the email subkeys only on the Alphanumeric keyboard.
Returns true if the email subkey was activated, false if alphanumeric keyboard is not active and key can’t be activated
Show the URL subkeys only on the Alphanumeric keyboard.
Returns true if the URL subkey was activated, false if alphanumeric keyboard is not active and key can’t be activated
Updates the visual state of the text based on the buttons state
The button to check for disabled/enabled.
The color to switch to when the button is disabled.
The text field to update.
The color the text field starts as.
The text field to update.
Standard Unity start.
Standard Unity update.
Updates the visual state of the text based on the buttons state.
This class switches back and forth between two symbol boards that otherwise do not fit on the keyboard entirely
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.
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. |
The amount of horizontal spacing (in pixels) to use between items in this collection.
A list of items in this collection. This list should not be modified directly. Instead use AddItem(RectTransform) and RemoveItem(RectTransform).
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.
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.
Cached rect transform to use for collection
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.
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. |
The amount of vertical spacing (in pixels) to use between items in this collection.
utility classes
Returns a mesh that you can use with UnityEngine.Rendering.CommandBuffer.DrawMesh(UnityEngine.Mesh,UnityEngine.Matrix4x4,UnityEngine.Material) to render full-screen effects.
Handles the animated movement, scaling, and rotation of a “moon” object between two positions over a specified duration.
Returns the current movement duration.
Stops the moon’s movement and triggers the completion event.
Resets the moon’s position and scale to the defined starting state.
Sets the duration of the movement.
| Name | Description |
|---|---|
| newDuration | System.Single The new duration, in seconds. |
Manually enables or disables the movement animation.
Starts the moon movement animation sequence.
Updates the moon’s position, scale, rotation, and target collider size every frame while the movement animation is active.
Controls the configurable duration of the moon trip via UI buttons, updates the display text, and synchronizes the duration with MoonMovement.
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.
Decreases the total duration by one step if above the minimum.
Increases the total duration by one step if below the maximum.
Initializes button listeners and sets the default duration display.
Updates the on-screen duration text and applies the value to MoonTripDurationControllermoonMovement.
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.
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.
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://”). |
Plays looping background sounds or ambient audio through a configured UnityEngineAudioSource.
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.
Plays a specified audio clip in a continuous loop.
| Name | Description |
|---|---|
| clip | UnityEngine.AudioClip The audio clip to be played. |
Initializes the AudioSource and ensures that it loops continuously.
Stops the currently playing sound if the AudioSource is active.
Controls the position, orientation, and scale of a reticle (crosshair) based on an UnityEngineXR.Interaction.Toolkit.Interactors.XRRayInteractor.
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.
Adjusts the ray interactor to face the assigned ReticleControllertarget, if active.
Disables the reticle object if currently active, and remembers this state for reactivation.
Re-enables the reticle object only if it was previously deactivated by ReticleControllerDisableIfGOEnabled.
Reorients the ray interactor so that the reticle is centered in front of the camera.
Continuously updates the reticle position, scale, and rotation based on the ray interactor.
Handles scene-level camera transitions and optional screen fade effects.
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.
Gradually fades the assigned SceneControllerblackOutSquare image to or from black.
Coroutine that yields during the fade process.
Disables SceneControllercamera1 and activates SceneControllercamera2.
Prewarms shaders, materials, and UI canvases to eliminate stutters during the first few frames of scene rendering.
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.
Destroys all prewarm quads after a short delay to ensure all materials are loaded.
Forces all active and inactive canvases in the scene to build their geometry and layout data.
Coroutine that gathers all unique materials under ScenePrewarmerparentRoot, renders them briefly using mini-quads, then destroys them after a short delay.
This effectively “pre-compiles” shaders and loads all required GPU states, reducing hitches and stalls when these materials are used later during gameplay.
Handles scene transitions with optional fade effects and pause cleanup.
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.
Asynchronously loads a scene by index with a fade-out transition.
| Name | Description |
|---|---|
| sceneIndex | System.Int32 The build index of the target scene. |
Coroutine that performs the transition.
Asynchronously loads a scene by name with a fade-out transition.
| Name | Description |
|---|---|
| sceneName | System.String The name of the scene to load. |
Coroutine that performs the transition.
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.
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. |
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 usage:
SceneSwitcher.Instance.LoadSceneByName("MainMenu");
Allows triggering specific UI buttons “secretly” via controller input combos, without requiring direct UI ray interaction.
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.
Checks if a button is both active, visible, and part of an enabled canvas hierarchy.
| Name | Description |
|---|---|
| btn | UnityEngine.UI.Button Button to validate. |
True if the button is active, visible, and interactable; false otherwise.
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. |
True if the button is within range; false otherwise.
Triggers the first valid “left” button when the combo (e.g. Y + left stick) is detected.
The button must be:
Triggers the first valid “right” button when the combo (e.g. Y + right stick) is detected.
Similar to SecretButtonClickerTriggerLeftButton, but operates on SecretButtonClickerrightButtons.
Represents a single text segment containing a title, a short statement, and an optional associated button group.
Displays text-based segments (title + short statement + optional button set) and allows navigation through them sequentially or directly.
The system supports bilingual content using LanguageManager: English segments are stored in TextDisplayersegments, and French segments in TextDisplayersegmentsFR.
Core method to change the displayed segment, updating all UI elements.
| Name | Description |
|---|---|
| index | System.Int32 The index of the new segment. |
Hides UI components that are empty (text and button set).
Displays a specific segment by index, if it exists.
| Name | Description |
|---|---|
| index | System.Int32 The segment index to display. |
Returns the segment array corresponding to the current language.
The active segment array (English or French).
Initializes the text display by showing the first segment (index 0).
Advances to the next segment if available.
Sets the current segment index manually (without immediately updating the UI).
| Name | Description |
|---|---|
| index | System.Int32 The index of the segment to select. |
Unity lifecycle method called on the first frame. Initializes the text display automatically if TextDisplayerDisplayOnStart is enabled.
Updates the displayed text and button set based on the current segment.
Method to curve text along a Unity animation curve.
| Name | Description |
|---|---|
| textComponent | Unknown type |
Method revealing the text one character at a time.
Method revealing the text one word at a time.
Draw Rectangle around the bounds of the text object.
Method to draw a rectangle around each character.
| Name | Description |
|---|---|
| text | Unknown type |
Draw Rectangles around each lines of the text.
| Name | Description |
|---|---|
| text | Unknown type |
Draw rectangle around each of the links contained in the text.
| Name | Description |
|---|---|
| text | Unknown type |
Method to draw rectangles around each word of the text.
| Name | Description |
|---|---|
| text | Unknown type |
Method to animate vertex colors of a TMP Text object.
Method to animate vertex colors of a TMP Text object.
Structure to hold pre-computed animation data.
Method to animate vertex colors of a TMP Text object.
Method to animate vertex colors of a TMP Text object.
Method to animate vertex colors of a TMP Text object.
Method to curve text along a Unity animation curve.
| Name | Description |
|---|---|
| textComponent | Unknown type |
EXample of a Custom Character Input Validator to only allow digits from 0 to 9.
Example of a Custom Character Input Validator to only allow phone number in the (800) 555-1212 format.
Event delegate triggered when pointer is over a character.
Event delegate triggered when pointer is over a line.
Event delegate triggered when pointer is over a link.
Event delegate triggered when pointer is over a sprite.
Event delegate triggered when pointer is over a word.
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).
This component listens for UnityEngineXR.XRInputSubsystem.trackingOriginUpdated and triggers a UnityEvent when a recenter action is detected.
Locates the active UnityEngineXR.XRInputSubsystem from the current XR setup.
This is necessary to access tracking-related events such as recentering or origin changes.
Unity lifecycle method — ensures event unsubscription when the object is destroyed.
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. |
Unity lifecycle method — called on the first frame. Initializes the XR input subsystem and subscribes to tracking origin updates.
Subscribes to tracking origin change events from the XR input subsystem.
Builds a delaunay triangulation using the divide-and-conquer algorithm.
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.
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 |
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.
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@ |
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).
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 |
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.
Removes ghost triangles.
| Name | Description |
|---|---|
| startghost | TriangleNet.Data.Otri@ |
Number of vertices on the hull.
Form a Delaunay triangulation by the divide-and-conquer method.
Sorts the vertices, calls a recursive procedure to triangulate them, and removes the bounding box, setting boundary markers as appropriate.
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 |
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.
Sort an array of vertices by x-coordinate, using the y-coordinate as a secondary key.
| Name | Description |
|---|---|
| left | System.Int32 |
| right | System.Int32 |
Uses quicksort. Randomized O(n log n) time. No, I did not make any of the usual quicksort mistakes.
Builds a delaunay triangulation using the incremental algorithm.
Form an “infinite” bounding triangle to insert vertices into.
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.
Remove the “infinite” bounding triangle, setting boundary markers as appropriate.
Returns the number of edges on the convex hull of the triangulation.
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.
Form a Delaunay triangulation by incrementally inserting vertices.
Returns the number of edges on the convex hull of the triangulation.
TODO: Update summary.
Builds a delaunay triangulation using the sweepline algorithm.
Removes ghost triangles.
| Name | Description |
|---|---|
| startghost | TriangleNet.Data.Otri@ |
Number of vertices on the hull.
A node in the splay tree.
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.
A node in a heap used to store events for the sweepline Delaunay algorithm.
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’.
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.).
Remove a triangle from the front of the queue.
Add a bad triangle data structure to the end of a queue.
| Name | Description |
|---|---|
| badtri | TriangleNet.Data.BadTriangle The bad triangle to enqueue. |
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 |
Controls the behavior of the meshing software.
Creates an instance of the Behavior class.
Algorithm to use for triangulation.
Conforming Delaunay (all triangles are truly Delaunay).
Enclose the convex hull with segments.
Jettison unused vertices from output.
Maximum angle constraint.
Maximum area constraint.
Minimum angle constraint.
Suppresses boundary segment splitting.
0 = split segments 1 = no new vertices on the boundary 2 = prevent all segment splitting, including internal boundaries
No exact arithmetic.
Ignores holes in polygons.
Input is a Planar Straight Line Graph.
Quality mesh generation.
Use maximum number of Steiner points.
Update quality options dependencies.
Compute boundary information.
Apply a user-defined triangle constraint.
Apply a maximum triangle area constraint.
Log detailed information.
Carves holes into the triangulation.
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.
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.
Spread the virus from all infected triangles to any neighbors not protected by subsegments. Delete all infected triangles.
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.
A queue used to store encroached subsegments.
Each subsegment’s vertices are stored so that we can check whether a subsegment is still the same.
A queue used to store bad triangles.
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.
An oriented subsegment.
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 two subsegments together. [bond(abc, ba)]
Copy a subsegment.
Get the destination of a subsegment
Dissolve a subsegment bond (from one side).
Note that the other subsegment will still think it’s connected to this subsegment.
Test for equality of subsegments.
Check a subsegment’s deallocation.
Set a subsegment’s deallocation.
Read a boundary marker.
Boundary markers are used to hold user-defined tags for setting boundary conditions in finite element solvers.
Find next subsegment in sequence. [next(ab) -> b*]
snext() finds the next subsegment (from the same segment) in sequence; one whose origin is the input subsegment’s destination.
Find next subsegment in sequence. [next(ab) -> b*]
Get the origin of a subsegment
Find adjoining subsegment with the same origin. [pivot(ab) -> a*]
spivot() finds the other subsegment (from the same segment) that shares the same origin.
Find adjoining subsegment with the same origin. [pivot(ab) -> a*]
Get the destination of the segment that includes the subsegment.
Get the origin of the segment that includes the subsegment.
Set destination of a subsegment.
Set a boundary marker.
Set the origin or destination of a subsegment.
Set the destination of the segment that includes the subsegment.
Set the origin of the segment that includes the subsegment.
Reverse the orientation of a subsegment. [sym(ab) -> ba]
ssym() toggles the orientation of a subsegment.
Reverse the orientation of a subsegment. [sym(ab) -> ba]
Dissolve a bond (from the subsegment side).
Finds a triangle abutting a subsegment.
An oriented triangle.
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(abc) -> c]
Bond two triangles together at the resepective handles. [bond(abc, bad)]
Copy an oriented triangle.
Destination [dest(abc) -> b]
Dissolve a bond (from one side).
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.
Find the next edge counterclockwise with the same destination. [dnext(abc) -> *ba]
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.
Find the next edge counterclockwise with the same destination. [dnext(abc) -> *ba]
Find the next edge clockwise with the same destination. [dprev(abc) -> cb*]
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.
Find the next edge clockwise with the same destination. [dprev(abc) -> cb*]
Test for equality of oriented triangles.
Infect a triangle with the virus.
Check a triangle’s deallocation.
Test a triangle for viral infection.
Set a triangle’s deallocation.
Find the next edge (counterclockwise) of a triangle. [lnext(abc) -> bca]
Find the next edge (counterclockwise) of a triangle. [lnext(abc) -> bca]
Find the previous edge (clockwise) of a triangle. [lprev(abc) -> cab]
Find the previous edge (clockwise) of a triangle. [lprev(abc) -> cab]
Find the next edge counterclockwise with the same origin. [onext(abc) -> ac*]
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.
Find the next edge counterclockwise with the same origin. [onext(abc) -> ac*]
Find the next edge clockwise with the same origin. [oprev(abc) -> a*b]
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.
Find the next edge clockwise with the same origin. [oprev(abc) -> a*b]
Origin [org(abc) -> a]
Find the next edge (counterclockwise) of the adjacent triangle. [rnext(abc) -> a]
rnext() moves one edge counterclockwise about the adjacent triangle. (It’s best understood by reading Guibas and Stolfi. It involves changing triangles twice.)
Find the next edge (counterclockwise) of the adjacent triangle. [rnext(abc) -> a]
Find the previous edge (clockwise) of the adjacent triangle. [rprev(abc) -> b**]
rprev() moves one edge clockwise about the adjacent triangle. (It’s best understood by reading Guibas and Stolfi. It involves changing triangles twice.)
Find the previous edge (clockwise) of the adjacent triangle. [rprev(abc) -> b**]
Bond a triangle to a subsegment.
Dissolve a bond (from the triangle side).
Finds a subsegment abutting a triangle.
Set Apex
Set Destination
Set Origin
Find the abutting triangle; same edge. [sym(abc) -> ba*]
Note that the edge direction is necessarily reversed, because the handle specified by an oriented triangle is directed counterclockwise around the triangle.
Find the abutting triangle; same edge. [sym(abc) -> ba*]
Cure a triangle from the virus.
The subsegment data structure.
Each subsegment contains two pointers to adjoining subsegments, plus four pointers to vertices, plus two pointers to adjoining triangles, plus one boundary marker.
Gets the segment boundary mark.
Gets an adjoining triangle.
Gets the segments endpoint.
Gets the first endpoints vertex id.
Gets the seconds endpoints vertex id.
The triangle data structure.
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”.
Gets the triangle area constraint.
Gets a triangles’ neighbor.
| Name | Description |
|---|---|
| index | System.Int32 The neighbor index (0, 1 or 2). |
The neigbbor opposite of vertex with given index.
Gets a triangles segment.
| Name | Description |
|---|---|
| index | System.Int32 The vertex index (0, 1 or 2). |
The segment opposite of vertex with given index.
Gets the specified corners vertex.
Gets the triangle id.
Gets the first neighbors id.
Gets the second neighbors id.
Gets the third neighbors id.
Gets the first corners vertex id.
Gets the seconds corners vertex id.
Gets the third corners vertex id.
Region ID the triangle belongs to.
The vertex data structure.
Initializes a new instance of the Vertex class.
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. |
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. |
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. |
Gets the specified coordinate of the vertex.
| Name | Description |
|---|---|
| i | Unknown type Coordinate index. |
X coordinate, if index is 0, Y coordinate, if index is 1.
Gets the vertex type.
Labels that signify the result of direction finding.
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.
A simple bounding box class.
Initializes a new instance of the BoundingBox class.
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. |
Check if given point is inside bounding box.
| Name | Description |
|---|---|
| pt | TriangleNet.Geometry.Point Point to check. |
Return true, if bounding box contains given point.
Gets the height of the bounding box.
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 bounds.
| Name | Description |
|---|---|
| x | System.Single X coordinate. |
| y | System.Single Y coordinate. |
Gets the width of the bounding box.
Gets the maximum x value (right boundary).
Gets the minimum x value (left boundary).
Gets the maximum y value (top boundary).
Gets the minimum y value (bottom boundary).
Represents a straight line segment in 2D space.
Initializes a new instance of the Edge class.
Initializes a new instance of the Edge class.
Gets the segments boundary mark.
Gets the first endpoints index.
Gets the second endpoints index.
Enumerates the edges of a triangulation.
Initializes a new instance of the EdgeEnumerator class.
The input geometry which will be triangulated. May represent a pointset or a planar straight line graph.
Initializes a new instance of the InputGeometry class.
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. |
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. |
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. |
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. |
Adds a point to the geometry.
| Name | Description |
|---|---|
| x | System.Single X coordinate. |
| y | System.Single Y coordinate. |
| boundary | System.Int32 Boundary marker. |
Adds a point to the geometry.
| Name | Description |
|---|---|
| x | System.Single X coordinate. |
| y | System.Single Y coordinate. |
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. |
Adds a segment to the geometry.
| Name | Description |
|---|---|
| p0 | System.Int32 First endpoint. |
| p1 | System.Int32 Second endpoint. |
| boundary | System.Int32 Segment marker. |
Adds a segment to the geometry.
| Name | Description |
|---|---|
| p0 | System.Int32 First endpoint. |
| p1 | System.Int32 Second endpoint. |
Gets the bounding box of the input geometry.
Clear input geometry.
Gets the number of points.
Indicates, whether the geometry should be treated as a PSLG.
Gets the list of input holes.
Gets the list of input points.
Gets the list of regions.
Gets the list of input segments.
Interface for segment geometry.
Gets the segment boundary mark.
Gets an adjoining triangle.
| Name | Description |
|---|---|
| index | System.Int32 The triangle index (0 or 1). |
Gets the segments endpoint.
| Name | Description |
|---|---|
| index | System.Int32 The vertex index (0 or 1). |
Gets the first endpoints vertex id.
Gets the seconds endpoints vertex id.
Triangle interface.
Triangle area constraint.
Gets a triangles neighbor.
| Name | Description |
|---|---|
| index | System.Int32 The vertex index (0, 1 or 2). |
The neigbbor opposite of vertex with given index.
Gets a triangles segment.
| Name | Description |
|---|---|
| index | System.Int32 The vertex index (0, 1 or 2). |
The segment opposite of vertex with given index.
Gets a triangles vertex.
| Name | Description |
|---|---|
| index | System.Int32 The vertex index (0, 1 or 2). |
The vertex of the specified corner index.
The triangle id.
First neighbor.
Second neighbor.
Third neighbor.
First vertex id of the triangle.
Second vertex id of the triangle.
Third vertex id of the triangle.
Region ID the triangle belongs to.
True if the triangle implementation contains neighbor information.
Represents a 2D point.
Gets the vertex attributes (may be null).
Gets the vertex boundary mark.
Gets the vertex id.
Gets the vertex x coordinate.
Gets the vertex y coordinate.
Pointer to a region in the mesh geometry. A region is a well-defined subset of the geomerty (enclosed by subsegments).
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. |
Labels that signify the result of vertex insertion.
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.
The DataReader class provides methods for mesh reconstruction.
Reconstruct a triangulation from its raw data representation.
| Name | Description |
|---|---|
| mesh | TriangleNet.Mesh |
| input | TriangleNet.Geometry.InputGeometry |
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.
Writes a the current mesh into a text file.
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 this session.
Start a new session with given name.
| Name | Description |
|---|---|
| name | System.String Name of the session (and output files). |
Write complete mesh to file.
Helper methods for reading Triangle file formats.
Reads a mesh from .node, .poly or .ele files.
Reads geometry information from .node or .poly files.
Reads geometry information from .node or .poly files.
Read the area constraints from an .area file.
| Name | Description |
|---|---|
| areafilename | System.String |
| intriangles | System.Int32 |
| data | Unknown type |
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). |
A List of edges.
Read the elements from an .ele file.
| Name | Description |
|---|---|
| elefilename | System.String |
| data | System.Boolean |
| readArea | Unknown type |
Read elements from an .ele file.
| Name | Description |
|---|---|
| elefilename | System.String The file name. |
A list of triangles.
Read the vertices from a file, which may be a .node or .poly file.
| Name | Description |
|---|---|
| nodefilename | System.String |
| readElements | System.Boolean |
Read the vertices from a file, which may be a .node or .poly file.
| Name | Description |
|---|---|
| nodefilename | System.String |
Will NOT read associated .ele by default.
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. |
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. |
Will NOT read associated .area by default.
Read the vertices and segments from a .poly file.
| Name | Description |
|---|---|
| polyfilename | System.String |
Will NOT read associated .ele by default.
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) |
Helper methods for writing Triangle file formats.
Number the vertices and write them to a .node file.
| Name | Description |
|---|---|
| mesh | TriangleNet.Mesh |
| filename | System.String |
Write the edges to an .edge file.
| Name | Description |
|---|---|
| mesh | TriangleNet.Mesh |
| filename | System.String |
Write the triangles to an .ele file.
| Name | Description |
|---|---|
| mesh | TriangleNet.Mesh |
| filename | System.String |
Write the triangle neighbors to a .neigh file.
| Name | Description |
|---|---|
| mesh | TriangleNet.Mesh |
| filename | System.String |
WARNING: Be sure WriteElements has been called before, so the elements are numbered right!
Write the vertices to a stream.
| Name | Description |
|---|---|
| nodes | System.IO.StreamWriter |
| writer | System.Collections.Generic.IEnumerable{TriangleNet.Data.Vertex} |
Number the vertices and write them to a .node file.
Number the vertices and write them to a .node file.
| Name | Description |
|---|---|
| mesh | TriangleNet.Mesh |
| filename | System.String |
Write the triangulation to an .off file.
| Name | Description |
|---|---|
| mesh | TriangleNet.Mesh |
| filename | System.String |
OFF stands for the Object File Format, a format used by the Geometry Center’s Geomview package.
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. |
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.
Write the segments and holes to a .poly file.
| Name | Description |
|---|---|
| mesh | TriangleNet.Mesh |
| filename | System.String |
Write the Voronoi diagram to a .voro file.
| Name | Description |
|---|---|
| mesh | TriangleNet.Mesh |
| filename | System.String |
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.
Interface for geometry input.
Read a file containing geometry information.
| Name | Description |
|---|---|
| filename | System.String The path of the file to read. |
An instance of the TriangleNet.Geometry.InputGeometry class.
Interface for mesh I/O.
Read a file containing a mesh.
| Name | Description |
|---|---|
| filename | System.String The path of the file to read. |
An instance of the TriangleNet.Mesh class.
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. |
Simple triangle class for input.
Gets the triangle area constraint.
Gets the specified corners vertex.
Gets the triangle id.
Gets the first corners vertex id.
Gets the seconds corners vertex id.
Gets the third corners vertex id.
Region ID the triangle belongs to.
Implements geometry and mesh file formats of the the original Triangle code.
Labels that signify the result of point location.
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.
A basic log interface.
A basic log item interface.
A simple logger, which logs messages to a List.
Using singleton pattern as proposed by Jon Skeet. http://csharpindepth.com/Articles/General/Singleton.aspx
Represents an item stored in the log.
Mesh data structure.
Initializes a new instance of the Mesh class.
Initializes a new instance of the Mesh class.
Gets the mesh behavior instance.
Gets the mesh bounding box.
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. |
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 |
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.
Gets the current node numbering.
Form a Delaunay triangulation.
The number of points on the hull.
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.) |
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.
Delete a vertex from a Delaunay triangulation, ensuring that the triangulation remains Delaunay.
| Name | Description |
|---|---|
| deltri | TriangleNet.Data.Otri@ |
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.
Gets the mesh edges.
Find the first triangle on the path from one point to another.
| Name | Description |
|---|---|
| searchtri | TriangleNet.Data.Otri@ |
| searchpoint | TriangleNet.Data.Vertex |
The return value notes whether the destination or apex of the found triangle is collinear with the two points in question.
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.
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. |
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.
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 |
Gets the mesh holes.
Insert a PSLG segment into a triangulation.
| Name | Description |
|---|---|
| endpoint1 | TriangleNet.Data.Vertex |
| endpoint2 | TriangleNet.Data.Vertex |
| newmark | System.Int32 |
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. |
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. |
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.
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.
Indicates whether the input is a PSLG or a point set.
Load a mesh from file (.node/poly and .ele).
Reconstructs a mesh from raw input data.
Create a new subsegment with orientation zero.
| Name | Description |
|---|---|
| newsubseg | TriangleNet.Data.Osub@ Reference to the new subseg. |
Create a new triangle with orientation zero.
| Name | Description |
|---|---|
| newotri | TriangleNet.Data.Otri@ Reference to the new triangle. |
Construct a mapping from vertices to triangles to improve the speed of point location for segment insertion.
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.
Cover the convex hull of a triangulation with subsegments.
Gets the number of mesh edges.
Gets the number of input vertices.
Refines the current mesh.
Refines the current mesh by finding the maximum triangle area and setting the a global area constraint to half its size.
Refines the current mesh by setting a global area constraint.
| Name | Description |
|---|---|
| areaConstraint | System.Single Global area constraint. |
Renumber vertex and triangle id’s.
Renumber vertex and triangle id’s.
Reset the mesh triangulation state.
Reset all the mesh data. This method will also wipe out all mesh data.
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 true if the entire segment is successfully inserted, and false if the job must be finished by ConstrainedEdge().
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.
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 |
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.
Gets the mesh segments.
Smooth the current mesh.
Deallocate space for a subsegment, marking it dead.
| Name | Description |
|---|---|
| dyingsubseg | TriangleNet.Data.Segment |
Read the vertices from memory.
| Name | Description |
|---|---|
| data | TriangleNet.Geometry.InputGeometry The input data. |
Deallocate space for a triangle, marking it dead.
| Name | Description |
|---|---|
| dyingtriangle | TriangleNet.Data.Triangle |
Gets the mesh triangles.
Triangulate given input file (.node or .poly).
| Name | Description |
|---|---|
| input | System.String |
Triangulate given input data.
| Name | Description |
|---|---|
| input | TriangleNet.Geometry.InputGeometry |
Undo the most recent vertex insertion.
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.
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@ |
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.)
Deallocate space for a vertex, marking it dead.
| Name | Description |
|---|---|
| dyingvertex | TriangleNet.Data.Vertex |
Gets the mesh vertices.
Find new Steiner Point locations.
http://www.cise.ufl.edu/~ungor/aCute/index.html
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 true, if given point is the correct one otherwise return false.
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 |
referenced to: http://local.wasp.uwa.edu.au/~pbourke/geometry/sphereline/
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 1, 2 or 3 if smoothing will work, 0 otherwise.
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 |
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 |
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 |
Returns the centroid of a given polygon
| Name | Description |
|---|---|
| numpoints | System.Int32 |
| points | System.Single[] |
| centroid | System.Single[]@ Centroid of a given polygon |
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 true if vertex was found.
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. |
Number of points on the star of the given point.
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 true if new location found
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 true if new location found
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 |
http://www.mathematik.uni-ulm.de/stochastik/lehre/ws03_04/rt/Geometry2D.ps
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 true, if it is a BAD polygon corner, returns false if it is a GOOD polygon corner
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 true, if it is a BAD triangle, returns false if it is a GOOD triangle.
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[]@ |
referenced to: http://local.wasp.uwa.edu.au/~pbourke/geometry/
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 |
http://www.mathematik.uni-ulm.de/stochastik/lehre/ws03_04/rt/Geometry2D.ps
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@ |
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[]@ |
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[][]@ |
http://www.mathematik.uni-ulm.de/stochastik/lehre/ws03_04/rt/Geometry2D.ps
Check polygon for min angle.
| Name | Description |
|---|---|
| numpoints | System.Int32 |
| points | System.Single[] |
Returns true if the polygon has angles greater than 2*minangle.
Node renumbering algorithms.
Provides some primitives regularly used in computational geometry.
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. |
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.
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.
Initialize the variables used for exact arithmetic.
‘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.
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. |
Coordinates of the circumcenter (or off-center)
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. |
Coordinates of the circumcenter
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.
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. |
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.
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.
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. |
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.
Provides methods for mesh quality enforcement and testing.
Add a bad subsegment to the queue.
| Name | Description |
|---|---|
| badseg | TriangleNet.Data.BadSubseg Bad subsegment. |
Ensure that the mesh is (constrained) Delaunay.
Test the mesh for topological consistency.
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 a nonzero value if the subsegment is encroached.
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.
Remove all the encroached subsegments and bad triangles from the triangulation.
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. |
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.
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 |
Traverse the entire list of subsegments, and check each to see if it is encroached. If so, add it to the list.
Test every triangle in the mesh for quality measures.
Test a triangle for quality and size.
| Name | Description |
|---|---|
| testtri | TriangleNet.Data.Otri@ Triangle to check. |
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.
Used for triangle sampling in the Mesh.Locate method.
Get a random sample set of triangle keys.
Array of triangle keys.
Reset the sampler.
Update sampling parameters if mesh changed.
| Name | Description |
|---|---|
| mesh | TriangleNet.Mesh Current mesh. |
Update sampling parameters if mesh changed.
| Name | Description |
|---|---|
| mesh | TriangleNet.Mesh Current mesh. |
Interface for mesh smoothers.
Simple mesh smoother implementation.
Vertices wich should not move (e.g. segment vertices) MUST have a boundary mark greater than 0.
Rebuild the input geometry.
Smooth all free nodes.
The adjacency matrix of the mesh.
Counts adjacencies in a triangulation.
| 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 |
Sets adjacencies in a triangulation.
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.
Computes the bandwidth of an adjacency matrix.
Bandwidth of the adjacency matrix.
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. |
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)
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; |
The Bounded Voronoi Diagram is the dual of a PSLG triangulation.
2D Centroidal Voronoi Tessellations with Constraints, 2010, Jane Tournois, Pierre Alliez and Olivier Devillers
Initializes a new instance of the BoundedVoronoi class.
| Name | Description |
|---|---|
| mesh | TriangleNet.Mesh Mesh instance. |
Initializes a new instance of the BoundedVoronoi class.
| Name | Description |
|---|---|
| mesh | TriangleNet.Mesh Mesh instance. |
Computes the bounded voronoi diagram.
Gets the list of Voronoi vertices.
Gets the list of Voronoi regions.
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 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.
Tag all blind triangles.
A triangle is said to be blind if the triangle and its circumcenter lie on two different sides of a constrained edge.
Check if given triangle is blinded by given segment.
| Name | Description |
|---|---|
| tri | TriangleNet.Data.Otri@ Triangle. |
| seg | TriangleNet.Data.Osub@ Segments |
Returns true, if the triangle is blinded.
Applies the Cuthill and McKee renumbering algorithm to reduce the bandwidth of the adjacency matrix associated with the mesh.
Some useful slides: http://bobbyness.net/NerdyStuff/node%20ordering/node_ordering.html
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. |
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.
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. |
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.
Finds the reverse Cuthill-Mckee ordering for a general graph.
The RCM ordering.
For each connected component in the graph, the routine obtains an ordering by calling RCM.
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. |
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.
Computes the bandwidth of a permuted adjacency matrix.
| Name | Description |
|---|---|
| perm | System.Int32[] The permutation. |
| perm_inv | System.Int32[] The inverse permutation. |
Bandwidth of the permuted adjacency matrix.
The matrix is defined by the adjacency information and a permutation. The routine also computes the bandwidth and the size of the envelope.
Produces the inverse of a given permutation.
| Name | Description |
|---|---|
| n | System.Int32 Number of items permuted. |
| perm | System.Int32[] PERM[N], a permutation. |
The inverse permutation.
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. |
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.
Gets the permutation vector for the Reverse Cuthill-McKee numbering.
| Name | Description |
|---|---|
| mesh | TriangleNet.Mesh The mesh. |
Permutation vector.
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. |
Input: N = 5, A = ( 11, 12, 13, 14, 15 ). Output: A = ( 15, 14, 13, 12, 11 ).
TODO: Update summary.
Gets the list of Voronoi vertices.
Gets the list of Voronoi regions.
A node of the quadtree.
A Quadtree implementation optimised for triangles.
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. |
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.
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. |
True, if point is inside or on the edge of this triangle.
Provides mesh quality information.
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))
Average angle weighted by area.
Average angle.
Maximum smallest angle.
The alpha measure determines the triangulated pointset quality.
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.
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. |
Normalize values.
Reset all values.
Smallest angle.
Maximum triangle area.
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. |
Triangle area.
Reset all values.
Minimum triangle area.
Ratio of maximum and minimum triangle area.
Determines the bandwidth of the coefficient matrix.
Bandwidth of the coefficient matrix.
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.
Average aspect ratio weighted by area.
Average aspect ratio.
Largest aspect ratio.
The Q measure determines the triangulated pointset quality.
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.
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. |
Normalize values.
Reset all values.
Smallest aspect ratio.
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 all trianlges connected to given triangle and apply given action.
Set the region attribute of all trianlges connected to given triangle.
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 |
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.
Gather mesh statistics.
Gets the angle histogram.
Gets the number of exterior boundary edges.
Number of circle top calculations performed.
// Number of circumcenter calculations performed.
Gets the number of constrained edges.
Number of counterclockwise tests performed.
Gets the number of mesh edges.
Number of right-of-hyperbola tests performed.
Number of incircle tests performed.
Gets the number of input holes.
Gets the number of input segments.
Gets the number of input triangles.
Gets the number of input vertices.
Gets the number of interior boundary edges.
Gets the largest angle.
Gets the largest area.
Gets the largest aspect ratio.
Gets the longest edge.
Gets the max angles histogram.
Gets the min angles histogram.
Number of 3D orientation tests performed.
Number of vertex relocations.
Gets the shortest altitude.
Gets the shortest edge.
Gets the smallest angle.
Gets the smallest area.
Gets the number of mesh triangles.
Update statistics about the quality of the mesh.
| Name | Description |
|---|---|
| mesh | TriangleNet.Mesh |
Gets the number of mesh vertices.
The Voronoi Diagram is the dual of a pointset triangulation.
Initializes a new instance of the Voronoi class.
| Name | Description |
|---|---|
| mesh | TriangleNet.Mesh |
Be sure MakeVertexMap has been called (should always be the case).
Construct Voronoi region for given vertex.
| Name | Description |
|---|---|
| vertex | TriangleNet.Data.Vertex |
The circumcenter indices which make up the cell.
Gets the Voronoi diagram as raw output data.
| Name | Description |
|---|---|
| mesh | TriangleNet.Mesh |
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.
Gets the list of Voronoi vertices.
Gets the list of Voronoi regions.
Represents a region in the Voronoi diagram.
Gets or sets whether the Voronoi region is bounded.
Gets the Voronoi regions generator.
Gets the Voronoi region id (which is the same as the generators vertex id).
Gets the Voronoi vertices on the regions boundary.
TODO: Update summary.
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. |
Location information.
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.
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. |
Location information.
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.
Implemented triangulation algorithms.
The type of the mesh vertex.
Utility class providing helper functions for UI interactions.
Simulates a user click on a given UnityEngineUI.Button by invoking its UnityEngineUI.Button.onClick event.
| Name | Description |
|---|---|
| button | UnityEngine.UI.Button Target button. |
Dynamically updates a UnityEngineUI.Dropdown’s options.
This script supports both English and French options and preserves the last selected index when the dropdown is disabled or the language is changed.
Retrieves the list of options corresponding to the current language.
A list of option strings in the selected language.
Unity lifecycle method — called on the first frame. Initializes the dropdown options based on the dropdown value.
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. |
Called when the GameObject becomes enabled again. Updates the dropdown only if the value has changed, otherwise restores the last known selection.
Unity lifecycle method — called on the first frame. Initializes the dropdown options based on the current language.
Updates the dropdown options based on the current language and restores the previous selection if possible.