Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mesh on 3D-surface #1

Closed
shengdie opened this issue Jun 24, 2019 · 7 comments
Closed

Mesh on 3D-surface #1

shengdie opened this issue Jun 24, 2019 · 7 comments

Comments

@shengdie
Copy link

Hello,

Thank you for your work, could you please implement the 3d-surface mesh like sphere? I tried by myself, but I am not familiar with matlab. Thank you.

@gdmcbain
Copy link

Interesting but I suspect nontrivial. Meanwhile, there are a couple of routines for the sphere in meshzoo.

@shengdie
Copy link
Author

shengdie commented Jun 24, 2019 via email

@nschloe
Copy link
Collaborator

nschloe commented Jun 24, 2019

Would be nice to have. Link to code?

@shengdie
Copy link
Author

shengdie commented Jun 24, 2019

Would be nice to have. Link to code?

In the official site, distmeshsurface.m
http://persson.berkeley.edu/distmesh/distmesh.zip

@nschloe
Copy link
Collaborator

nschloe commented Jun 24, 2019

Way too complicated for me to dive in like that. PRs welcome.

@nschloe
Copy link
Collaborator

nschloe commented Oct 16, 2019

I knew it, but it is not based on force balance. I like distmesh, because it generates most equilateral triangles

I've improved icosa sphere in meshzoo a bit yesterday. In general, you can't get much better than that.

iso

@nschloe
Copy link
Collaborator

nschloe commented Oct 16, 2019

Alright, it turns out you can actually do a little bit better. I've just added support for surface meshes to optimesh (https://twitter.com/nschloe/status/1184605182396641280), so here's how you get the best spherical mesh:

import meshzoo
import optimesh

points, cells = meshzoo.icosa_sphere(10)

class Sphere:
    def f(self, x):
        return 1.0 - (x[0] ** 2 + x[1] ** 2 + x[2] ** 2)

    def grad(self, x):
        return -2 * x

points, cells = optimesh.cvt.quasi_newton_uniform_full(
    points, cells, 1.0e-2, 100, verbose=False,
    implicit_surface=Sphere(),
    # step_filename_format="out{:03d}.vtk"
)

opt

dmsh definitely won't be able to do any better, so let's close this.

@nschloe nschloe closed this as completed Oct 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants