Skip to content

Feat/delaunay3d#61

Draft
Raild3x wants to merge 15 commits into
mainfrom
feat/Delaunay3d
Draft

Feat/delaunay3d#61
Raild3x wants to merge 15 commits into
mainfrom
feat/Delaunay3d

Conversation

@Raild3x

@Raild3x Raild3x commented May 14, 2026

Copy link
Copy Markdown
Owner

No description provided.

Raild3x added 11 commits May 14, 2026 03:44
Introduce a full 3D Delaunay triangulation module and associated test/visual tooling. Adds a Bowyer–Watson based Delaunay3d implementation with robust geometric predicates (orient3d, in-sphere/circumsphere), numeric canonicalization utilities, bounding/super-tetrahedron logic, and an incremental class API (Add/Remove/Move/Clear, zero-alloc iterators, queries). Adds a comprehensive test suite (delaunay3d.spec) with deterministic and randomized stress tests, a runtime story/visualizer (delaunay3d.story) that renders triangles/edges using DrawTriangle3d, plus DrawTriangle3d helper, a placeholder delaunay2d module, module init, and wally.toml project config. 2D triangulation is currently a placeholder for testing purposes.
Add Geometric3dUtils.luau providing det3/det4, orient3d, inSphereRaw and circumSphereContains (Shewchuk-style predicates) and import them into delaunay3d. Remove duplicate inline geometric predicates and consolidate hull-building logic into a single _buildHullFlatData. Replace small append helpers with table.move for flat array operations and simplify Triangulate to build boxed return arrays directly. Add caching for boxed edges/triangles/tetrahedra accessors and restore hull accessors to use the consolidated builder to avoid repeated work.
Add Luau documentation and examples for DrawTriangle3d, including a DrawTriangle3d class block and a StyleConfig interface. Standardize triangle point types to explicit { Vector3 } annotations across functions (create, render, calculateCFramesAndSizes, updateTriangle) and clarify behavior when config.Anchored is false. Comment out runtime assertions in assertTriangleModel for performance while preserving type signatures. Rename bulkRender to bulkRenderViaIterator and update its iterator shape; improve render to reuse existing models. Also change WEDGE_TEMPLATE.CastShadow to true and add various inline clarifications and examples.
Restructure the Delaunay3d implementation to support queued/batched mutations and incremental flushes. Introduces pending operation types, pending-unique counters, and candidate add-point buffers; AddPoint/RemovePoint/MovePoint now enqueue operations and update pending state. Internal caches were reorganized into nested tables (_Flat, _Boxed, _Hull, _Super) and helper utilities added (bounds/super-tetrahedron, point-in-tetrahedron, rebuildAll, incremental Flush path, and various small helpers). Updated accessors and mesh-building to use the new layout and added tests and story changes (module require capitalization and a couple type annotations) to cover queued add/remove behavior and flushing semantics.
Add lib/delaunay/src/init.luau as the main module for the Delaunay library. The file enables strict mode, documents the module, requires Delaunay2d and Delaunay3d, exports those modules (including a Delaunay3d export type) and provides a placeholder for a constrained 2D implementation that is not yet implemented.
Add Luau --!native annotations to 3D utilities and Delaunay module. Replace several table.move calls with explicit element assignments to avoid overhead and make copying behavior explicit, and collapse repeated ensurePosId calls into a single combined assignment. Also add a small "Private Methods" header for clarity. Changes touch lib/delaunay/src/3d/Geometric3dUtils.luau and lib/delaunay/src/3d/delaunay3d.luau.
Reorganize and clean up hull-related helpers in delaunay3d.luau: move boxHullTrianglesFlat/boxHullEdgesFlat next to buildHullFlatData, rename _buildHullFlatData to buildHullFlatData, and update all hull accessor calls accordingly. Also simplify GetEdges/GetTriangles/GetTetrahedrons by inlining table construction for each boxed element (remove some intermediate typed local vars). These changes are mostly refactors to reduce duplication and improve readability without changing external behavior.
Introduce a per-test context system to the tiniest test runner.

- Add new module test/tiniest/tiniest_context.luau to manage a stack of labeled context entries (push, set, get, get_all, pop, clear). Supports anonymous entries via unique symbols and lazily-evaluated function values.
- Extend ErrorReport type to include an optional context field.
- Wire the context plugin into runtimes: expose t.context and register the plugin in tiniest_for_lune and tiniest_for_roblox.
- Enhance expect to capture resolved context on failure and add tests.with_context(...) to limit which context ids are shown for a given expectation.
- Update pretty printer to render context entries alongside error output.
- Update types/tiniest_lib.d.luau with context API and new with_context on expect chains.

This enables richer failure diagnostics by showing per-test contextual information in test output.
Replace the hardcoded PACKAGE_TO_TEST from "quadtree" to "delaunay", introduce folderToSearch to hold the package folder, and add an assert to fail early if the package folder is not found. Collect tests from the resolved folder to improve error reporting when the target package is missing.
Remove leftover merge conflict markers and select the 'delaunay' package for tests. Replace the previous 'quadtree' reference with PACKAGE_TO_TEST = 'delaunay', introduce folderToSearch and an assert to ensure the package exists, then collect and run tests from that folder.
Import datetime.date and append a "Last Modified" line to the generated README (formatted as "%B %d, %Y"). Also print the README content after writing for visibility/debugging and adjust the readme_content append indentation.
@Raild3x Raild3x self-assigned this May 14, 2026
@Raild3x Raild3x added enhancement New feature or request Minor Added functionality in a backward compatible manner labels May 14, 2026
Raild3x added 4 commits May 14, 2026 19:24
Introduce a complete ConstrainedDelaunayTriangulation implementation and supporting infrastructure. Adds core class ConstrainedDelaunayTriangulation with point normalization, supertriangle handling, Delaunay edge swaps, constrained-edge insertion, tessellation and hole support. Also adds internal types (DelaunayTriangle, DelaunayTriangleEdge, DelaunayTriangleSet, PointBinGrid), NavMesh integration, various geometry utilities (Triangle2d, DelaunayUtil, Triangle2dUtil, GrahamScan, Polygon utilities), debug drawing helpers, and basic test/story scaffolding for CDT.
Introduce a Luau port of a Constrained Delaunay Triangulation (CDT) library. Adds core implementation (Delaunay2dConstrained.luau), triangle topology/utils (CDTUtils.luau), geometric predicates (Predicates.luau), KD-locator (KDLocator.luau), NavMesh2d support, and accompanying specs/stories for testing. Implements super-triangle initialization, vertex insertion, constrained edge handling (fixed edges, splits), Lawson edge flips, pseudo-polygon triangulation, and finalization bookkeeping (fixed edges, piece mapping).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request Minor Added functionality in a backward compatible manner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant