meshpro / dmsh

:spider_web: Simple mesh generator inspired by distmesh.
GNU General Public License v3.0
210 stars 25 forks source link

Defining a geometry using a distance function #45

Closed mchandra closed 3 years ago

mchandra commented 3 years ago

Is it possible to use a distance function to implicitly define a geometry and mesh it (as in PyDishMesh)?

E.g. (from PyDistMesh),

circle = lambda p: np.sqrt((p**2).sum(1))-1.0
points, cells = dmsh.generate(circle, 0.1)

Thanks

nschloe commented 3 years ago

I added a section in the main readme on how to do it. https://github.com/nschloe/dmsh#custom-shapes