11using Test
22using LinearAlgebra
33using .. DelaunayTriangulation
4- const DT = DelaunayTriangulation. DT
4+ const DT = DelaunayTriangulation
55using CairoMakie
66using DataStructures
77
8+ include (" ../test_setup.jl" )
9+
810include (" ../helper_functions.jl" )
911
1012save_path = basename (pwd ()) == " test" ? " figures" : " test/figures"
@@ -1055,7 +1057,7 @@ lines!(ax, nodes[:, boundary_nodes[4][4]]; color=:orange, linewidth=6)
10551057
10561058lines! (ax, nodes[:, boundary_nodes[5 ][1 ]]; color= :red , linewidth= 6 )
10571059
1058- save (" $save_path /sparse_example_triangulation.png" , fig)
1060+ SAVE_FIGURE && save (" $save_path /sparse_example_triangulation.png" , fig)
10591061
10601062# # A square
10611063x = [0.0 , 2.0 , 2.0 , 0.0 , 0.0 ]
@@ -1082,7 +1084,7 @@ elements4, nodes4, boundary_nodes4 = generate_mesh(0.0, 2.0, 0.0, 2.0, 0.5;
10821084ax = Axis (fig[2 , 2 ])
10831085mesh! (ax, nodes4, elements4' )
10841086
1085- save (" $save_path /square_triangulation.png" , fig)
1087+ SAVE_FIGURE && save (" $save_path /square_triangulation.png" , fig)
10861088
10871089@test elements1 == elements3
10881090@test nodes1 == nodes3
@@ -1596,7 +1598,7 @@ ax = Axis(fig[1, 2], xlabel=L"x", ylabel=L"y", width=300, height=300,
15961598 title= L " (b):$ $ Coarse mesh" , titlealign= :left )
15971599triplot! (ax, tri2)
15981600resize_to_layout! (fig)
1599- save (" $save_path /gmsh_example_1.png" , fig)
1601+ SAVE_FIGURE && save (" $save_path /gmsh_example_1.png" , fig)
16001602
16011603# ## Another specific example with multiple segments
16021604# The first segment
@@ -1633,7 +1635,7 @@ for (i, segment_index) in enumerate(values(bn_map))
16331635 lines! (ax, get_points (tri)[:, bn_nodes], color= colors[i], linewidth= 4 )
16341636end
16351637resize_to_layout! (fig)
1636- save (" $save_path /gmsh_example_2.png" , fig)
1638+ SAVE_FIGURE && save (" $save_path /gmsh_example_2.png" , fig)
16371639
16381640# ## For the docs
16391641x1 = [collect (LinRange (0 , 2 , 4 )),
@@ -1670,4 +1672,4 @@ tri = generate_mesh(x, y, 0.2)
16701672fig, ax, sc = triplot (tri; show_ghost_edges= true , convex_hull_linestyle= :solid , convex_hull_linewidth= 4 )
16711673xlims! (ax, - 0.5 , 2.5 )
16721674ylims! (ax, - 0.5 , 6.5 )
1673- save (" $save_path /gmsh_example_3.png" , fig)
1675+ SAVE_FIGURE && save (" $save_path /gmsh_example_3.png" , fig)
0 commit comments