Replies: 6 comments
-
Hi @ivicajan, If I understand correctly you don't want to use the DEM as a constrain but instead you want to use a predefined shapefile. Here is a comparison I made trying to replicate your issue: geom = Geom( my final domain_poly will look like (it will keep the original domain shapefile boundaries): if I pass a zmax and the rasters: my final domain_poly will look like: Please let us know if you have any questions or encounter any issues, we will try to get back to you ASAP. |
Beta Was this translation helpful? Give feedback.
-
Perfect, it is exactly what I was looking for. Thanks! |
Beta Was this translation helpful? Give feedback.
-
Closing as resolved |
Beta Was this translation helpful? Give feedback.
-
For the sake of documentation. The definition of the Geom object alone will not ensure that the fixed constrained will be enforced. If I understand your issue correctly, to actually do what you want would require directly using jigsawpy to create the mesh, instead of the:
as you might be doing if you are following on the OCSMesh tech report. instead you would be creating your mesh via: where:
fixed mesh is the empty mesh where your final mesh will be written on:
geom_m and hfun_m are simply:
and init is a copy of geom_m, with 'IDtag' = -1, this will ensure that the vertices of your fixed constrains are treated as gaps:
If I zoom in to the fixed constrains area in red, the resulting mesh looks like: Note that if my resolution is too coarse, it won't guarantee the gaps are respected, e.g.: |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
What you have looks really good, I am glad you found a solution within OCSMesh (without having to call jigsaw directly)! The fact your hfun is patchy should not be a problem, especially if you are creating a mesh for SCHISM. Sure I can provide a notebook, but based on what you have it should be very straight forward for you to run it directly. import jigsawpy:
convert your hfun and geom to msh_t objects:
create an init:
an empty mesh:
and specify your opts:
and finally run jigsawpy directly:
to save the mesh:
Please let me know if that does not work. |
Beta Was this translation helpful? Give feedback.
-
Hi,
Possibly someone already solved the issue and willing to share ideas.
I am wondering if there is an easy way to impose hard constrain to have exact shape of small islands/features (with no elements over the islands, acting as a perfect wall and not getting wet) with exact boundary based on the shape file rather than using (coarse) DEM.
I am having small islands/features that should be left as islands - empty with predefined boundary (see fig 1). I can create perfect ROI shape file (region of interest) capturing exactly what I would like to have in the mesh as hard coast, but during the meshing it is still filled with triangles and not having coastline as should.
I am using something like this (domainm is my ROI in meters):
geom = Geom(
deepcopy(rasters),
zmax=5,
base_shape=domainm.unary_union,
base_shape_crs=domainm.crs,
)
domain_poly = geom.get_multipolygon()
Tried reducing raster zmax values but doesn't help. The resulting geom (domain_poly) looks like:
And the mesh is not what should be.
Any hints are welcome ;)
Thanks,
Ivica
p.s. I can put together working notebook example.
Beta Was this translation helpful? Give feedback.
All reactions