mesh <- fm_mesh_2d(
boundary = fm_segm(
rbind(c(0, 0), c(1, 0), c(1, 1), c(0, 1)),
is.bnd = TRUE
)
)
splitter <- fm_segm(rbind(c(0.8, 0.2), c(0.2, 0.8)))
segm_split <- fm_split_lines(mesh, splitter)
plot(mesh)
lines(splitter)
points(segm_split$loc)
Run the code above in your browser using DataLab