diff --git a/LICENSE.md b/LICENSE.md index 931e5e9..880d0ea 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ The TRIANGLE.jl package is licensed under the MIT "Expat" License: -> Copyright (c) 2017: +> Copyright (c) 2017-2018: > * Francesco Furiani > > Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/README.md b/README.md index beebafd..f404b2f 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ [![Build Status](https://travis-ci.org/cvdlab/TRIANGLE.jl.svg?branch=master)](https://travis-ci.org/cvdlab/TRIANGLE.jl) [![Coverage Status](https://coveralls.io/repos/github/cvdlab/TRIANGLE.jl/badge.svg)](https://coveralls.io/github/cvdlab/TRIANGLE.jl) [![DOI](https://zenodo.org/badge/doi/10.1007/BFb0014497.svg)](http://dx.doi.org/10.1007/BFb0014497) +[![Read the Docs](https://img.shields.io/readthedocs/pip.svg)](https://cvdlab.github.io/TRIANGLE.jl/) A Julia interface to Jonathan Richard Shewchuk [Triangle](https://www.cs.cmu.edu/~quake/triangle.html). @@ -31,79 +32,4 @@ The build proces uses [VC++ for Python](https://www.microsoft.com/en-us/download Include the module (`using TRIANGLE`). -You can use Julia `?TRIANGLE.methodname` for inline documentation, here a short summary: - - -`TRIANGLE.basic_triangulation_vertices(vertices::Array{Float64,2})` -* *vertices* containing the list of your vertices in the form of _[x1 y1; x2 y2; ... ; xn yn]_ - -Returns: -* __Array{Array{Float64,2},1}__ an array of array of 3-vertices lists (a triangle). Each triangle is properly order in the whole mesh. - -`TRIANGLE.basic_triangulation(vertices::Array{Float64,2}, vertices_map::Array{Int64,1})` -* *vertices* containing the list of your vertices in the form of _[x1 y1; x2 y2; ... ; xn yn]_ -* *vertices_map* a list of custom integer identifier for the vertices - -Returns: -* __Array{Array{Int64,1},1}__ an array of array of 3-vertices marker lists (a triangle). Each triangle is properly order in the whole mesh. - -`TRIANGLE.basic_triangulation_vertices(vertices::Array{Float64,2}, vertices_map::Array{Int64,1})` -* *vertices* containing the list of your vertices in the form of _[x1 y1; x2 y2; ... ; xn yn]_ -* *vertices_map* a list of custom integer identifier for the vertices - -Returns: -* __Array{Array{Float64,2},1}__ an array of array of 3-vertices lists (a triangle). Each triangle is properly order in the whole mesh. - -`TRIANGLE.constrained_triangulation(vertices::Array{Float64,2}, vertices_map::Array{Int64,1}, edges_list::Array{Int64,2})` -* *vertices* containing the list of your vertices in the form of _[x1 y1; x2 y2; ... ; xn yn]_ -* *vertices_map* a list of custom integer identifier for the vertices -* *edges_list* a list of edges in the form of _[ vertex-identifier-1 vertex-identifier-2; vertex-identifier-1 vertex-identifier-3; ... ; vertex-identifier-N vertex-identifier-M ]_ that will be retaied during the constrained Delaunay triangulation - -Returns: -* __Array{Array{Int64,1},1}__ an array of array of 3-vertices marker lists (a triangle). Each triangle is properly order in the whole mesh. - -`TRIANGLE.constrained_triangulation_vertices(vertices::Array{Float64,2}, vertices_map::Array{Int64,1}, edges_list::Array{Int64,2})` -* *vertices* containing the list of your vertices in the form of _[x1 y1; x2 y2; ... ; xn yn]_ -* *vertices_map* a list of custom integer identifier for the vertices -* *edges_list* a list of edges in the form of _[ vertex-identifier-1 vertex-identifier-2; vertex-identifier-1 vertex-identifier-3; ... ; vertex-identifier-N vertex-identifier-M ]_ that will be retaied during the constrained Delaunay triangulation - -Returns: -* __Array{Array{Float64,2},1}__ an array of array of 3-vertices lists (a triangle). Each triangle is properly order in the whole mesh. - -`TRIANGLE.constrained_triangulation(vertices::Array{Float64,2}, vertices_map::Array{Int64,1}, edges_list::Array{Int64,2}, edges_boundary::Array{Bool,1})` -* *vertices* containing the list of your vertices in the form of _[x1 y1; x2 y2; ... ; xn yn]_ -* *vertices_map* a list of custom integer identifier for the vertices -* *edges_list* a list of edges in the form of _[ vertex-identifier-1 vertex-identifier-2; vertex-identifier-1 vertex-identifier-3; ... ; vertex-identifier-N vertex-identifier-M ]_ that will be retaied during the constrained Delaunay triangulation -* *edges_boundary* a list of booleans that tells TRIANGLE if the edge is on the boundary or not (the indexing is the same of *edges_list*) - -Returns: -* __Array{Array{Int64,1},1}__ an array of array of 3-vertices marker lists (a triangle). Each triangle is properly order in the whole mesh. - -`TRIANGLE.constrained_triangulation_vertices(vertices::Array{Float64,2}, vertices_map::Array{Int64,1}, edges_list::Array{Int64,2}, edges_boundary::Array{Bool,1})` -* *vertices* containing the list of your vertices in the form of _[x1 y1; x2 y2; ... ; xn yn]_ -* *vertices_map* a list of custom integer identifier for the vertices -* *edges_list* a list of edges in the form of _[ vertex-identifier-1 vertex-identifier-2; vertex-identifier-1 vertex-identifier-3; ... ; vertex-identifier-N vertex-identifier-M ]_ that will be retaied during the constrained Delaunay triangulation -* *edges_boundary* a list of booleans that tells TRIANGLE if the edge is on the boundary or not (the indexing is the same of *edges_list*) - -Returns: -* __Array{Array{Float64,2},1}__ an array of array of 3-vertices lists (a triangle). Each triangle is properly order in the whole mesh. - -`TRIANGLE.constrained_triangulation(vertices::Array{Float64,2}, vertices_map::Array{Int64,1}, edges_list::Array{Int64,2}, edges_boundary::Array{Bool,1}, holes::Array{Float64,2})` -* *vertices* containing the list of your vertices in the form of _[x1 y1; x2 y2; ... ; xn yn]_ -* *vertices_map* a list of custom integer identifier for the vertices -* *edges_list* a list of edges in the form of _[ vertex-identifier-1 vertex-identifier-2; vertex-identifier-1 vertex-identifier-3; ... ; vertex-identifier-N vertex-identifier-M ]_ that will be retaied during the constrained Delaunay triangulation -* *edges_boundary* a list of booleans that tells TRIANGLE if the edge is on the boundary or not (the indexing is the same of *edges_list*) -* *holes* containing the list of your holes in the form of _[x1 y1; x2 y2; ... ; xn yn]_ they will be used as marker to remove pieces of the mesh - -Returns: -* __Array{Array{Int64,1},1}__ an array of array of 3-vertices marker lists (a triangle). Each triangle is properly order in the whole mesh. - -`TRIANGLE.constrained_triangulation_vertices(vertices::Array{Float64,2}, vertices_map::Array{Int64,1}, edges_list::Array{Int64,2}, edges_boundary::Array{Bool,1}, holes::Array{Float64,2})` -* *vertices* containing the list of your vertices in the form of _[x1 y1; x2 y2; ... ; xn yn]_ -* *vertices_map* a list of custom integer identifier for the vertices -* *edges_list* a list of edges in the form of _[ vertex-identifier-1 vertex-identifier-2; vertex-identifier-1 vertex-identifier-3; ... ; vertex-identifier-N vertex-identifier-M ]_ that will be retaied during the constrained Delaunay triangulation -* *edges_boundary* a list of booleans that tells TRIANGLE if the edge is on the boundary or not (the indexing is the same of *edges_list*) -* *holes* containing the list of your holes in the form of _[x1 y1; x2 y2; ... ; xn yn]_ they will be used as marker to remove pieces of the mesh - -Returns: -* __Array{Array{Float64,2},1}__ an array of array of 3-vertices lists (a triangle). Each triangle is properly order in the whole mesh. +You can use Julia `?TRIANGLE.methodname` for inline documentation. Documentation can be read on https://cvdlab.github.io/TRIANGLE.jl/ . \ No newline at end of file diff --git a/REQUIRE b/REQUIRE index cbde710..a5fb135 100644 --- a/REQUIRE +++ b/REQUIRE @@ -1,2 +1,2 @@ -julia 0.5 -BinDeps 0.4.7 \ No newline at end of file +julia 0.6 +BinDeps 0.6.0 \ No newline at end of file diff --git a/docs/src/index.md b/docs/src/index.md index b777e36..b1f1a6c 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -1,7 +1,8 @@ # TRIANGLE.jl Documentation -```@contents -``` +A Julia interface to Jonathan Richard Shewchuk [Triangle](https://www.cs.cmu.edu/~quake/triangle.html). + +The library builds the C version and then expose methods to calculate CDTs. ## Functions diff --git a/src/NativeInterface/native_remapper.jl b/src/NativeInterface/native_remapper.jl index 328638f..602f261 100644 --- a/src/NativeInterface/native_remapper.jl +++ b/src/NativeInterface/native_remapper.jl @@ -1,4 +1,4 @@ -type TriangulateInputMapper +mutable struct TriangulateInputMapper originalVerticesMarkers::Vector{Cint} remappedVerticesMarkers::Vector{Cint} originalEdgesList::Vector{Cint} diff --git a/src/NativeInterface/options_structure.jl b/src/NativeInterface/options_structure.jl index 95a0b4a..5b3cdea 100644 --- a/src/NativeInterface/options_structure.jl +++ b/src/NativeInterface/options_structure.jl @@ -43,7 +43,7 @@ /* eliminates Triangle's -r, -q, -a, -u, -D, -Y, -S, and -s switches. */ =# -type TriangulateOptions +mutable struct TriangulateOptions pslg::Bool #p regionattrib::Bool # A convex::Bool # c diff --git a/src/NativeInterface/triangle_structure.jl b/src/NativeInterface/triangle_structure.jl index be6114c..54ad213 100644 --- a/src/NativeInterface/triangle_structure.jl +++ b/src/NativeInterface/triangle_structure.jl @@ -1,6 +1,6 @@ # REAL = double = Cdouble -type TriangulateIO +mutable struct TriangulateIO pointlist::Ptr{Cdouble} pointattributelist::Ptr{Cdouble} pointmarkerlist::Ptr{Cint} diff --git a/src/TRIANGLE.jl b/src/TRIANGLE.jl index e2da391..f15059a 100644 --- a/src/TRIANGLE.jl +++ b/src/TRIANGLE.jl @@ -13,19 +13,21 @@ include("common.jl") """ basic_triangulation_vertices(vertices::Array{Float64,2}) -Compute a Delaunay triangulation for a list of `vertices` in the form of _[x1 y1; x2 y2; ... ; xn yn]_ +Compute a Delaunay triangulation for a list of `vertices` in the form of `[x1 y1; x2 y2; ... ; xn yn]` The function will return an array of array of 3-vertices lists (triangles with the correct vertices order) using the vertex coordinates in each triangle definition. # Example ```jldoctest +julia> using TRIANGLE + julia> points = Array{Float64,2}([0. 0.; 1. 0.; 0. 1.]) 3×2 Array{Float64,2}: 0.0 0.0 1.0 0.0 0.0 1.0 -julia> basic_triangulation_vertices(points) +julia> TRIANGLE.basic_triangulation_vertices(points) 1-element Array{Array{Float64,2},1}: [0.0 0.0; 1.0 0.0; 0.0 1.0] ``` @@ -37,7 +39,7 @@ end """ basic_triangulation(vertices::Array{Float64,2},vertices_map::Array{Int64,1}) -Compute a Delaunay triangulation for a list of `vertices` in the form of _[x1 y1; x2 y2; ... ; xn yn]_ +Compute a Delaunay triangulation for a list of `vertices` in the form of `[x1 y1; x2 y2; ... ; xn yn]` A list of indexes is provided in `vertices_map` so that each vertex can have a custom integer identifier. @@ -46,6 +48,8 @@ The function will return an array of array of 3-vertices lists (triangles with t # Example ```jldoctest +julia> using TRIANGLE + julia> points = Array{Float64,2}([0. 0.; 1. 0.; 0. 1.]) 3×2 Array{Float64,2}: 0.0 0.0 @@ -58,9 +62,9 @@ julia> points_map = [1, 2, 3] 2 3 -julia> basic_triangulation(points,points_map) +julia> TRIANGLE.basic_triangulation(points,points_map) 1-element Array{Array{Int64,1},1}: - [1,2,3] + [1, 2, 3] ``` """ function basic_triangulation(vertices::Array{Float64,2}, vertices_map::Array{Int64,1}) @@ -71,7 +75,7 @@ end """ basic_triangulation_vertices(vertices::Array{Float64,2},vertices_map::Array{Int64,1}) -Compute a Delaunay triangulation for a list of `vertices` in the form of _[x1 y1; x2 y2; ... ; xn yn]_ +Compute a Delaunay triangulation for a list of `vertices` in the form of `[x1 y1; x2 y2; ... ; xn yn]` A list of indexes is provided in `vertices_map` so that each vertex can have a custom integer identifier. @@ -79,6 +83,8 @@ The function will return an array of array of 3-vertices lists (triangles with t # Example ```jldoctest +julia> using TRIANGLE + julia> points = Array{Float64,2}([0. 0.; 1. 0.; 0. 1.]) 3×2 Array{Float64,2}: 0.0 0.0 @@ -91,7 +97,7 @@ julia> points_map = [1, 2, 3] 2 3 -julia> basic_triangulation_vertices(points,points_map) +julia> TRIANGLE.basic_triangulation_vertices(points,points_map) 1-element Array{Array{Float64,2},1}: [0.0 0.0; 1.0 0.0; 0.0 1.0] ``` @@ -103,17 +109,19 @@ end """ constrained_triangulation(vertices::Array{Float64,2}, vertices_map::Array{Int64,1}, edges_list::Array{Int64,2}) -Compute a Constrained Delaunay triangulation for a list of `vertices` in the form of _[x1 y1; x2 y2; ... ; xn yn]_ and a list of edges that will be kept. +Compute a Constrained Delaunay triangulation for a list of `vertices` in the form of `[x1 y1; x2 y2; ... ; xn yn]` and a list of edges that will be kept. A list of indexes is provided in `vertices_map` so that each vertex can have a custom integer identifier. -A list of edges (to be included in the final triangulation) is passed in `edges_list` in the form of _[ vertex-identifier-1 vertex-identifier-2; vertex-identifier-1 vertex-identifier-3; ... ; vertex-identifier-N vertex-identifier-M ]_ +A list of edges (to be included in the final triangulation) is passed in `edges_list` in the form of `[ vertex-identifier-1 vertex-identifier-2; vertex-identifier-1 vertex-identifier-3; ... ; vertex-identifier-N vertex-identifier-M ]` The function will return an array of array of 3-vertices lists (triangles with the correct vertices order) using the vertex identifiers in each triangle definition. # Example ```jldoctest +julia> using TRIANGLE + julia> points = [0. 0.; 0. 3.; 1. 3.; 1. 1.; 2. 1.; 2. 0.] 6×2 Array{Float64,2}: 0.0 0.0 @@ -141,13 +149,12 @@ julia> edges_list = Array{Int64,2}([1 2; 2 3; 3 4; 4 5; 5 6; 6 1]) 5 6 6 1 -julia> constrained_triangulation(points,points_map,edges_list) -5-element Array{Array{Int64,1},1}: - [1,4,2] - [4,1,6] - [2,4,3] - [4,5,3] - [5,4,6] +julia> TRIANGLE.constrained_triangulation(points,points_map,edges_list) +4-element Array{Array{Int64,1},1}: + [1, 4, 2] + [4, 1, 6] + [2, 4, 3] + [5, 4, 6] ``` """ function constrained_triangulation(vertices::Array{Float64,2}, vertices_map::Array{Int64,1}, edges_list::Array{Int64,2}) @@ -157,17 +164,19 @@ end """ constrained_triangulation_vertices(vertices::Array{Float64,2}, vertices_map::Array{Int64,1}, edges_list::Array{Int64,2}) -Compute a Constrained Delaunay triangulation for a list of `vertices` in the form of _[x1 y1; x2 y2; ... ; xn yn]_ and a list of edges that will be kept. +Compute a Constrained Delaunay triangulation for a list of `vertices` in the form of `[x1 y1; x2 y2; ... ; xn yn]` and a list of edges that will be kept. A list of indexes is provided in `vertices_map` so that each vertex can have a custom integer identifier. -A list of edges (to be included in the final triangulation) is passed in `edges_list` in the form of _[ vertex-identifier-1 vertex-identifier-2; vertex-identifier-1 vertex-identifier-3; ... ; vertex-identifier-N vertex-identifier-M ]_ +A list of edges (to be included in the final triangulation) is passed in `edges_list` in the form of `[ vertex-identifier-1 vertex-identifier-2; vertex-identifier-1 vertex-identifier-3; ... ; vertex-identifier-N vertex-identifier-M ]` The function will return an array of array of 3-vertices lists (triangles with the correct vertices order) using the vertex coordinates in each triangle definition. # Example ```jldoctest +julia> using TRIANGLE + julia> points = [0. 0.; 0. 3.; 1. 3.; 1. 1.; 2. 1.; 2. 0.] 6×2 Array{Float64,2}: 0.0 0.0 @@ -195,12 +204,11 @@ julia> edges_list = Array{Int64,2}([1 2; 2 3; 3 4; 4 5; 5 6; 6 1]) 5 6 6 1 -julia> constrained_triangulation_vertices(points,points_map,edges_list) -5-element Array{Array{Float64,2},1}: +julia> TRIANGLE.constrained_triangulation_vertices(points,points_map,edges_list) +4-element Array{Array{Float64,2},1}: [0.0 0.0; 1.0 1.0; 0.0 3.0] [1.0 1.0; 0.0 0.0; 2.0 0.0] [0.0 3.0; 1.0 1.0; 1.0 3.0] - [1.0 1.0; 2.0 1.0; 1.0 3.0] [2.0 1.0; 1.0 1.0; 2.0 0.0] ``` """ @@ -211,11 +219,11 @@ end """ constrained_triangulation(vertices::Array{Float64,2}, vertices_map::Array{Int64,1}, edges_list::Array{Int64,2}, edges_boundary::Array{Bool,1}) -Compute a Constrained Delaunay triangulation for a list of `vertices` in the form of _[x1 y1; x2 y2; ... ; xn yn]_ and a list of edges that will be kept. Some of those edges can be marked as the boundary of the mesh. +Compute a Constrained Delaunay triangulation for a list of `vertices` in the form of `[x1 y1; x2 y2; ... ; xn yn]` and a list of edges that will be kept. Some of those edges can be marked as the boundary of the mesh. A list of indexes is provided in `vertices_map` so that each vertex can have a custom integer identifier. -A list of edge (to be included in the final triangulation) is passed in `edges_list` in the form of _[ vertex-identifier-1 vertex-identifier-2; vertex-identifier-1 vertex-identifier-3; ... ; vertex-identifier-N vertex-identifier-M ]_ +A list of edge (to be included in the final triangulation) is passed in `edges_list` in the form of `[ vertex-identifier-1 vertex-identifier-2; vertex-identifier-1 vertex-identifier-3; ... ; vertex-identifier-N vertex-identifier-M ]` A list of boundary markers passed in `edges_boundary` in the form of booleans that tell the triangulator if the edge is on the boundary or not (the indexing is the same of `edges_list`). @@ -224,6 +232,8 @@ The function will return an array of array of 3-vertices lists (triangles with t # Example ```jldoctest +julia> using TRIANGLE + julia> points = [0. 0.; 0. 3.; 1. 3.; 1. 1.; 2. 1.; 2. 0.] 6×2 Array{Float64,2}: 0.0 0.0 @@ -260,12 +270,12 @@ julia> edge_boundary = [false, false, true, true, false, false] false false -julia> constrained_triangulation(points,points_map,edges_list,edge_boundary) +julia> TRIANGLE.constrained_triangulation(points,points_map,edges_list,edge_boundary) 4-element Array{Array{Int64,1},1}: - [1,4,2] - [4,1,6] - [2,4,3] - [5,4,6] + [1, 4, 2] + [4, 1, 6] + [2, 4, 3] + [5, 4, 6] ``` """ function constrained_triangulation(vertices::Array{Float64,2}, vertices_map::Array{Int64,1}, edges_list::Array{Int64,2}, edges_boundary::Array{Bool,1}) @@ -275,11 +285,11 @@ end """ constrained_triangulation_vertices(vertices::Array{Float64,2}, vertices_map::Array{Int64,1}, edges_list::Array{Int64,2}, edges_boundary::Array{Bool,1}) -Compute a Constrained Delaunay triangulation for a list of `vertices` in the form of _[x1 y1; x2 y2; ... ; xn yn]_ and a list of edges that will be kept. Some of those edges can be marked as the boundary of the mesh. +Compute a Constrained Delaunay triangulation for a list of `vertices` in the form of `[x1 y1; x2 y2; ... ; xn yn]` and a list of edges that will be kept. Some of those edges can be marked as the boundary of the mesh. A list of indexes is provided in `vertices_map` so that each vertex can have a custom integer identifier. -A list of edge (to be included in the final triangulation) is passed in `edges_list` in the form of _[ vertex-identifier-1 vertex-identifier-2; vertex-identifier-1 vertex-identifier-3; ... ; vertex-identifier-N vertex-identifier-M ]_ +A list of edge (to be included in the final triangulation) is passed in `edges_list` in the form of `[ vertex-identifier-1 vertex-identifier-2; vertex-identifier-1 vertex-identifier-3; ... ; vertex-identifier-N vertex-identifier-M ]` A list of boundary markers passed in `edges_boundary` in the form of booleans that tell the triangulator if the edge is on the boundary or not (the indexing is the same of `edges_list`). @@ -288,6 +298,8 @@ The function will return an array of array of 3-vertices lists (triangles with t # Example ```jldoctest +julia> using TRIANGLE + julia> points = [0. 0.; 0. 3.; 1. 3.; 1. 1.; 2. 1.; 2. 0.] 6×2 Array{Float64,2}: 0.0 0.0 @@ -324,7 +336,7 @@ julia> edge_boundary = [false, false, true, true, false, false] false false -julia> constrained_triangulation_vertices(points,points_map,edges_list,edge_boundary) +julia> TRIANGLE.constrained_triangulation_vertices(points,points_map,edges_list,edge_boundary) 4-element Array{Array{Float64,2},1}: [0.0 0.0; 1.0 1.0; 0.0 3.0] [1.0 1.0; 0.0 0.0; 2.0 0.0] @@ -339,13 +351,13 @@ end """ constrained_triangulation(vertices::Array{Float64,2}, vertices_map::Array{Int64,1}, edges_list::Array{Int64,2}, edges_boundary::Array{Bool,1}, holes::Array{Float64,2}) -Compute a Constrained Delaunay triangulation for a list of `vertices` in the form of _[x1 y1; x2 y2; ... ; xn yn]_ and a list of edges that will be kept. Some of those edges can be marked as the boundary of the mesh. +Compute a Constrained Delaunay triangulation for a list of `vertices` in the form of `[x1 y1; x2 y2; ... ; xn yn]` and a list of edges that will be kept. Some of those edges can be marked as the boundary of the mesh. A list of `holes` in the form of _[x1 y1; x2 y2; ... ; xn yn]_ can be passed to avoid triangulation in that part of the mesh. A list of indexes is provided in `vertices_map` so that each vertex can have a custom integer identifier. -A list of edge (to be included in the final triangulation) is passed in `edges_list` in the form of _[ vertex-identifier-1 vertex-identifier-2; vertex-identifier-1 vertex-identifier-3; ... ; vertex-identifier-N vertex-identifier-M ]_ +A list of edge (to be included in the final triangulation) is passed in `edges_list` in the form of `[ vertex-identifier-1 vertex-identifier-2; vertex-identifier-1 vertex-identifier-3; ... ; vertex-identifier-N vertex-identifier-M ]` A list of boundary markers passed in `edges_boundary` in the form of booleans that tell the triangulator if the edge is on the boundary or not (the indexing is the same of `edges_list`). @@ -354,6 +366,8 @@ The function will return an array of array of 3-vertices lists (triangles with t # Example ```jldoctest +julia> using TRIANGLE + julia> points = Array{Float64,2}([0. 0.; 4. 0.; 2. 3.; 8. 0.; 6. 3.; 4. 6.]) 6×2 Array{Float64,2}: 0.0 0.0 @@ -400,7 +414,7 @@ julia> holes = [4. 2.] 1×2 Array{Float64,2}: 4.0 2.0 -julia> constrained_triangulation(points, points_map, edges_list, edge_boundary, holes) +julia> TRIANGLE.constrained_triangulation(points, points_map, edges_list, edge_boundary, holes) 3-element Array{Array{Int64,1},1}: [1,2,3] [5,6,3] @@ -414,13 +428,13 @@ end """ constrained_triangulation_vertices(vertices::Array{Float64,2}, vertices_map::Array{Int64,1}, edges_list::Array{Int64,2}, edges_boundary::Array{Bool,1}, holes::Array{Float64,2}) -Compute a Constrained Delaunay triangulation for a list of `vertices` in the form of _[x1 y1; x2 y2; ... ; xn yn]_ and a list of edges that will be kept. Some of those edges can be marked as the boundary of the mesh. +Compute a Constrained Delaunay triangulation for a list of `vertices` in the form of `[x1 y1; x2 y2; ... ; xn yn]` and a list of edges that will be kept. Some of those edges can be marked as the boundary of the mesh. A list of `holes` in the form of _[x1 y1; x2 y2; ... ; xn yn]_ can be passed to avoid triangulation in that part of the mesh. A list of indexes is provided in `vertices_map` so that each vertex can have a custom integer identifier. -A list of edge (to be included in the final triangulation) is passed in `edges_list` in the form of _[ vertex-identifier-1 vertex-identifier-2; vertex-identifier-1 vertex-identifier-3; ... ; vertex-identifier-N vertex-identifier-M ]_ +A list of edge (to be included in the final triangulation) is passed in `edges_list` in the form of `[ vertex-identifier-1 vertex-identifier-2; vertex-identifier-1 vertex-identifier-3; ... ; vertex-identifier-N vertex-identifier-M ]` A list of boundary markers passed in `edges_boundary` in the form of booleans that tell the triangulator if the edge is on the boundary or not (the indexing is the same of `edges_list`). @@ -429,6 +443,8 @@ The function will return an array of array of 3-vertices lists (triangles with t # Example ```jldoctest +julia> using TRIANGLE + julia> points = Array{Float64,2}([0. 0.; 4. 0.; 2. 3.; 8. 0.; 6. 3.; 4. 6.]) 6×2 Array{Float64,2}: 0.0 0.0 @@ -475,7 +491,7 @@ julia> holes = [4. 2.] 1×2 Array{Float64,2}: 4.0 2.0 -julia> constrained_triangulation_vertices(points, points_map, edges_list, edge_boundary, holes) +julia> TRIANGLE.constrained_triangulation_vertices(points, points_map, edges_list, edge_boundary, holes) 3-element Array{Array{Float64,2},1}: [0.0 0.0; 4.0 0.0; 2.0 3.0] [6.0 3.0; 4.0 6.0; 2.0 3.0]