1
1
using Test
2
2
using LinearAlgebra
3
3
using .. DelaunayTriangulation
4
- const DT = DelaunayTriangulation. DT
4
+ const DT = DelaunayTriangulation
5
5
using CairoMakie
6
6
using DataStructures
7
7
8
+ include (" ../test_setup.jl" )
9
+
8
10
include (" ../helper_functions.jl" )
9
11
10
12
save_path = basename (pwd ()) == " test" ? " figures" : " test/figures"
@@ -1055,7 +1057,7 @@ lines!(ax, nodes[:, boundary_nodes[4][4]]; color=:orange, linewidth=6)
1055
1057
1056
1058
lines! (ax, nodes[:, boundary_nodes[5 ][1 ]]; color= :red , linewidth= 6 )
1057
1059
1058
- save (" $save_path /sparse_example_triangulation.png" , fig)
1060
+ SAVE_FIGURE && save (" $save_path /sparse_example_triangulation.png" , fig)
1059
1061
1060
1062
# # A square
1061
1063
x = [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;
1082
1084
ax = Axis (fig[2 , 2 ])
1083
1085
mesh! (ax, nodes4, elements4' )
1084
1086
1085
- save (" $save_path /square_triangulation.png" , fig)
1087
+ SAVE_FIGURE && save (" $save_path /square_triangulation.png" , fig)
1086
1088
1087
1089
@test elements1 == elements3
1088
1090
@test nodes1 == nodes3
@@ -1596,7 +1598,7 @@ ax = Axis(fig[1, 2], xlabel=L"x", ylabel=L"y", width=300, height=300,
1596
1598
title= L " (b):$ $ Coarse mesh" , titlealign= :left )
1597
1599
triplot! (ax, tri2)
1598
1600
resize_to_layout! (fig)
1599
- save (" $save_path /gmsh_example_1.png" , fig)
1601
+ SAVE_FIGURE && save (" $save_path /gmsh_example_1.png" , fig)
1600
1602
1601
1603
# ## Another specific example with multiple segments
1602
1604
# The first segment
@@ -1633,7 +1635,7 @@ for (i, segment_index) in enumerate(values(bn_map))
1633
1635
lines! (ax, get_points (tri)[:, bn_nodes], color= colors[i], linewidth= 4 )
1634
1636
end
1635
1637
resize_to_layout! (fig)
1636
- save (" $save_path /gmsh_example_2.png" , fig)
1638
+ SAVE_FIGURE && save (" $save_path /gmsh_example_2.png" , fig)
1637
1639
1638
1640
# ## For the docs
1639
1641
x1 = [collect (LinRange (0 , 2 , 4 )),
@@ -1670,4 +1672,4 @@ tri = generate_mesh(x, y, 0.2)
1670
1672
fig, ax, sc = triplot (tri; show_ghost_edges= true , convex_hull_linestyle= :solid , convex_hull_linewidth= 4 )
1671
1673
xlims! (ax, - 0.5 , 2.5 )
1672
1674
ylims! (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