{"id":50765308,"url":"https://github.com/greenm01/octave-cdt","last_synced_at":"2026-06-11T13:02:05.348Z","repository":{"id":363919675,"uuid":"1265550501","full_name":"greenm01/octave-cdt","owner":"greenm01","description":"Constrained Delaunay Triangulation (CDT) for Octave","archived":false,"fork":false,"pushed_at":"2026-06-11T00:00:01.000Z","size":101,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-11T00:09:32.645Z","etag":null,"topics":["cdt","constrained","delaunay","octave","triangulation"],"latest_commit_sha":null,"homepage":"","language":"MATLAB","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/greenm01.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS","contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-10T21:56:56.000Z","updated_at":"2026-06-11T00:00:05.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/greenm01/octave-cdt","commit_stats":null,"previous_names":["greenm01/octave-cdt"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/greenm01/octave-cdt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greenm01%2Foctave-cdt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greenm01%2Foctave-cdt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greenm01%2Foctave-cdt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greenm01%2Foctave-cdt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/greenm01","download_url":"https://codeload.github.com/greenm01/octave-cdt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greenm01%2Foctave-cdt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34199516,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-11T02:00:06.485Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cdt","constrained","delaunay","octave","triangulation"],"created_at":"2026-06-11T13:02:05.254Z","updated_at":"2026-06-11T13:02:05.331Z","avatar_url":"https://github.com/greenm01.png","language":"MATLAB","funding_links":[],"categories":[],"sub_categories":[],"readme":"# octave-cdt\n\nConstrained Delaunay Triangulation (CDT) for GNU Octave.\n\n![Dude with holes CDT example](docs/assets/dude-cdt-holes.png)\n\n`octave-cdt` gives Octave a small polygon-oriented `cdt` function backed by\n[`p2t`](https://github.com/greenm01/p2t)'s native CDT engine. The expensive\ntriangulation work runs in compiled code; Octave handles ordinary matrices in\nand ordinary matrices out.\n\n```octave\nouter = [0 0; 1 0; 1 1; 0 1];\n[tri, vertices] = cdt (outer);\ntriplot (tri, vertices(:, 1), vertices(:, 2));\naxis equal;\n```\n\nContours are closed for you. Do not repeat the first point at the end. Returned\ntriangle and edge indices are 1-based, as Octave users expect.\n\n## Input\n\nPass the outer contour as an `N x 2` matrix:\n\n```octave\nouter = [0 0; 4 0; 4 4; 0 4];\n[tri, vertices] = cdt (outer);\n```\n\nAdd holes with a cell array:\n\n```octave\nhole = [1 1; 1 2; 2 2; 2 1];\n[tri, vertices] = cdt (outer, {hole});\n```\n\nOr use the common Octave convention of `NaN NaN` rows to separate rings. The\nfirst ring is the outer boundary; later rings are holes.\n\n```octave\npolygon = [outer; NaN NaN; hole];\n[tri, vertices] = cdt (polygon);\n```\n\nSteiner points are optional:\n\n```octave\nsteiner = [3 3];\n[tri, vertices] = cdt (outer, {hole}, steiner);\n```\n\nBoundary edges are available when you ask for a third output:\n\n```octave\n[tri, vertices, boundary_edges] = cdt (outer, {hole}, [], ...\n                                      struct (\"keep_boundary_edges\", true));\n```\n\nADMESH-style domain masks are available through `cdt_points_in_domain`, which\naccepts the same `PTS.Poly(k).x` / `PTS.Poly(k).y` structure used by ADMESH's\n`PointsInDomain.m` helper:\n\n```octave\nPTS.Poly(1).x = [0; 4; 4; 0; 0];\nPTS.Poly(1).y = [0; 0; 4; 4; 0];\nPTS.Poly(2).x = [1; 1; 2; 2; 1];\nPTS.Poly(2).y = [1; 2; 2; 1; 1];\nIN = cdt_points_in_domain ([0.5; 1.5], [0.5; 1.5], PTS);\n```\n\nA thin `PointsInDomain` wrapper is also installed for ADMESH compatibility. Put\n`octave-cdt/inst` before ADMESH's `12_In_Polygon` directory on Octave's path to\nshadow ADMESH's MATLAB-only implementation without editing ADMESH itself.\n\n`octave-cdt` also includes a small ADMESH-oriented MATLAB compatibility surface\nfor GNU Octave:\n\n- `delaunayTriangulation(p)` and `delaunayTriangulation(p, C)`\n- `pointLocation(dt, query)` and `isInterior(dt)`\n- `griddedInterpolant` and `scatteredInterpolant` for 2-D query patterns\n- `triangulation`, `freeBoundary`, `edgeAttachments`, and `edges`\n- `KDTreeSearcher` and `knnsearch` with Euclidean distance\n- `uiprogressdlg` as a headless no-op progress object\n\nThese shims are intentionally scoped to the call patterns ADMESH uses. They are\nnot complete MATLAB replacements.\n\n## Build\n\nYou need Octave, `mkoctfile`, Nim, and a C/C++ toolchain. Build the\n[`p2t`](https://github.com/greenm01/p2t) C ABI first:\n\n```sh\ncd ../p2t\nnimble buildCAbi\n```\n\nThen build the Octave module:\n\n```sh\ncd ../octave-cdt\nmake\n```\n\nIf `p2t` is somewhere else:\n\n```sh\nmake P2T_DIR=/path/to/p2t\n```\n\nBy default, the Makefile looks for the shared `p2t` library produced by the\ncurrent `p2t` nimble task:\n\n- macOS: `/tmp/libp2t.dylib`\n- Linux: `/tmp/libp2t.so`\n- Windows: `/tmp/p2t.dll`\n\nIf your library is somewhere else, pass `P2T_LIB` and `P2T_LDFLAGS` explicitly:\n\n```sh\nmake P2T_DIR=/path/to/p2t \\\n     P2T_LIB=/path/to/libp2t.so \\\n     P2T_LDFLAGS=\"-L/path/to -lp2t\"\n```\n\n## Install\n\nFor a local Unix-style install:\n\n```sh\nmake install PREFIX=$HOME/.local\n```\n\nThen load the package paths from Octave:\n\n```octave\nsource (fullfile (getenv (\"HOME\"), \".local\", \"share\", \"octave-cdt\", \"cdt_setup.m\"));\n```\n\nOn Windows, install to any directory you control and source the generated\n`cdt_setup.m` from Octave:\n\n```octave\nsource (\"C:/path/to/octave-cdt/cdt_setup.m\");\n```\n\nPackaging notes for Homebrew are in\n[packaging/homebrew](packaging/homebrew). Homebrew is only one distribution\npath; it is not required by the library itself.\n\n## Test\n\n```sh\nmake test\n```\n\n## Examples\n\n```sh\noctave --path inst --path examples --path examples/fixtures --eval \"demo_star\"\noctave --path inst --path examples --path examples/fixtures --eval \"demo_polygon_with_hole\"\noctave --path inst --path examples --path examples/fixtures --eval \"check_fixtures\"\n```\n\n`demo_star` and `demo_polygon_with_hole` draw the triangulation. `check_fixtures`\nruns the included fixtures without opening a graphics window.\n\n## API\n\n```octave\n[tri, vertices] = cdt (outer)\n[tri, vertices] = cdt (outer, holes)\n[tri, vertices] = cdt (outer, holes, steiner)\n[tri, vertices, boundary_edges] = cdt (outer, holes, steiner, options)\n```\n\nArguments:\n\n- `outer`: an `N x 2` numeric matrix, or a NaN-separated `N x 2` matrix whose first ring is the outer contour and whose later rings are holes.\n- `holes`: a cell array of `N x 2` matrices, one `N x 2` matrix, a NaN-separated `N x 2` matrix, or `{}`.\n- `steiner`: an `N x 2` numeric matrix, or `[]`.\n\nOptions:\n\n- `epsilon`: geometric tolerance. Default: `1e-9`.\n- `clean_input`: remove adjacent duplicates, a repeated closing point, and collinear contour points. Default: `true`.\n- `validate`: validate contours before triangulation. Default: `true`.\n- `keep_boundary_edges`: return boundary edges. Default: `nargout \u003e= 3`.\n- `mode`: `\"checked\"`, `\"trusted\"`, or `\"normalized_trusted\"`. Default: `\"checked\"`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreenm01%2Foctave-cdt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgreenm01%2Foctave-cdt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreenm01%2Foctave-cdt/lists"}