TriangleMesh.jl icon indicating copy to clipboard operation
TriangleMesh.jl copied to clipboard

`refine_rg` introduces boundary points into the interior

Open jlchan opened this issue 3 years ago • 4 comments

Love the package and am using it for a class, but I observed something odd aboutrefine_rg. I can usually extract boundary points using mesh.point_marker

using Plots
mesh = create_mesh(polygon_unitSquare(), quality_meshing=true, add_switches="penva0.05q") # switches
x,y = mesh.point[1,:],mesh.point[2,:]
scatter(x,y)
scatter!(x[mesh.point_marker .== 1],y[mesh.point_marker .== 1],leg=false,mark=:square,ms=3)

which gives the following Screen Shot 2021-04-15 at 3 16 51 PM

If I refine the mesh once using refine_rg

mesh = refine_rg(mesh)
x,y = mesh.point[1,:],mesh.point[2,:]
scatter(x,y)
scatter!(x[mesh.point_marker .== 1],y[mesh.point_marker .== 1],leg=false,mark=:square,ms=3)

mesh.point_marker seems to introduce extra interior boundary points. Screen Shot 2021-04-15 at 3 19 14 PM

I noticed that refine_rg does most of the setup in Julia - is it known why mesh.point_marker includes interior points in addition to boundary points?

jlchan avatar Apr 15 '21 20:04 jlchan