Skip to content

Commit

Permalink
Remove plotting
Browse files Browse the repository at this point in the history
  • Loading branch information
bennibolm committed Feb 6, 2024
1 parent 7b0a05a commit 5526dd3
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 64 deletions.
22 changes: 0 additions & 22 deletions examples/build_delaunay_triangulation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,3 @@ data_points = collect([0.0 0.0
vertices = build_delaunay_triangulation(data_points; verbose = true)

neighbors = delaunay_compute_neighbors(data_points, vertices)

### Plotting ###
using Plots; gr()

# Vertices
p = scatter(data_points[1, :], data_points[2, :], legend=false, title="vertices")
display(p)

# Triangles
for element in axes(vertices, 2)
v1 = vertices[1, element]
v2 = vertices[2, element]
v3 = vertices[3, element]
x1 = data_points[:, v1]
x2 = data_points[:, v2]
x3 = data_points[:, v3]
plot!(p, [x1[1], x2[1]], [x1[2], x2[2]])
plot!(p, [x2[1], x3[1]], [x2[2], x3[2]])
plot!(p, [x3[1], x1[1]], [x3[2], x1[2]])
end
plot!(title = "triangles")
display(p)
42 changes: 0 additions & 42 deletions examples/build_polygon_mesh.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,45 +25,3 @@ mesh_type = :standard_voronoi
voronoi_vertices_coordinates, voronoi_vertices, voronoi_vertices_interval = build_polygon_mesh(data_points, vertices, mesh_type=mesh_type)

voronoi_neighbors = voronoi_compute_neighbors(vertices, voronoi_vertices, voronoi_vertices_interval, neighbors)

##### Plotting
using Plots; gr()

# Vertices
p = scatter(data_points[1, :], data_points[2, :], legend=false)

# Triangles
# p = scatter(data_points, legend=false)
for element in axes(vertices, 2)
v1 = vertices[1, element]
v2 = vertices[2, element]
v3 = vertices[3, element]
x1 = data_points[:, v1]
x2 = data_points[:, v2]
x3 = data_points[:, v3]
plot!(p, [x1[1], x2[1]], [x1[2], x2[2]])
plot!(p, [x2[1], x3[1]], [x2[2], x3[2]])
plot!(p, [x3[1], x1[1]], [x3[2], x1[2]])
end
plot!(p, title="vertices and triangles")
display(p)

# Polygon mesh
p1 = scatter(data_points[1, :], data_points[2, :], legend=false)
for element_vor in axes(voronoi_vertices_interval, 2)
vertex_first = voronoi_vertices_interval[1, element_vor]
vertex_last = voronoi_vertices_interval[2, element_vor]
for i in vertex_first:(vertex_last-1)
v1 = voronoi_vertices[i]
v2 = voronoi_vertices[i + 1]
x1 = voronoi_vertices_coordinates[:, v1]
x2 = voronoi_vertices_coordinates[:, v2]
plot!(p1, [x1[1], x2[1]], [x1[2], x2[2]])
end
v1 = voronoi_vertices[vertex_last]
v2 = voronoi_vertices[vertex_first]
x1 = voronoi_vertices_coordinates[:, v1]
x2 = voronoi_vertices_coordinates[:, v2]
plot!(p1, [x1[1], x2[1]], [x1[2], x2[2]], title="mesh type: $mesh_type")
end
display(p1)

0 comments on commit 5526dd3

Please sign in to comment.