Replies: 1 comment 6 replies
-
@ivicajan, Jigsaw has the capability to specify initial nodes that should not be touch. It doesn't prevent it from adding more nodes, but maybe that's good enough for your usecase. OCSMesh doesn't directly support it, but if in the last step instead of calling geom = ... # Like before
hfun = ... # Like before
geom_jig = geom.msh_t()
hfun_jig = hfun.msh_t()
# TODO: Make sure geom_jig.crs and hfun_jig.crs are the same
opts = jigsawpy.jigsaw_jig_t()
opts.hfun_scal = "absolute"
opts.hfun_hmin = np.min(hfun_jig.value)
opts.hfun_hmax = np.max(hfun_jig.value)
opts.mesh_dims = +2
# Initial mesh (e.g. points you'd like to embed in final mesh)
embedding_points_xy = ... # List of (x,y) values for the points of interest, e.g. boundary nodes.
init_jig = jigsawpy.jigsaw_msh_t()
init_jig.mshID = 'euclidean-mesh'
init_jig.ndims = 2
init_jig.crs = init_jig.crs
init_jig.vert2 = np.array(
[(coord, -1) for id, coord in embedding_points_xy],
dtype=jigsawpy.jigsaw_msh_t.VERT2_t
)
# Empty mesh object
mesh_jig= jigsawpy.jigsaw_msh_t()
mesh_jig.mshID = 'euclidean-mesh'
mesh_jig.ndims = 2
mesh_jig.crs = init_jig.crs
jigsawpy.lib.jigsaw(
opts, geom_jig, mesh_jig,
init=init_jig,
hfun=hfun_jig)
ocsmesh.utils.finalize_mesh(mesh_jig, sieve=None)
mesh = ocsmesh.Mesh(mesh_jig)
mesh.write(...) I usually used this approach with a whole |
Beta Was this translation helpful? Give feedback.
-
Dear all,
is it possible to add (or use) feature similar to
hfun.add_feature which would enforce that nodes are exactly on the "line"?
In other words, I am trying to create mesh which will have nodes (hence sides of the triangles) along the coastline. It is important as I have river and would like to capture exactly river bank as well as some man-made structures. Seems to me it is softly imposed and not in a hard way. Would then another approach of generating the grid using "roi" exactly following the coastline as "wet" grid and then another grid from the coastline up to dry region (i.e. isoline). At the end option to merge those 2 grids might result in the perfectly aligned nodes (sides) along the wet/dry "coastline"?
Thanks in advance
Ivica
Beta Was this translation helpful? Give feedback.
All reactions