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

Any breaking changes/API differences from 0.6 to 0.7? #99

Open
thchr opened this issue Sep 17, 2024 · 2 comments
Open

Any breaking changes/API differences from 0.6 to 0.7? #99

thchr opened this issue Sep 17, 2024 · 2 comments

Comments

@thchr
Copy link
Contributor

thchr commented Sep 17, 2024

I'd like to update my compat on Meshing.jl from 0.6 to 0.7, but could not easily figure out what changed in the interim?
Were there significant changes to the API?

Thanks!

@ferrolho
Copy link

I'm also trying to update Meshing.jl from 0.6 to 0.7, but this snippet (from here) is now broken:

# Visualize a mesh from the level set of a function
using Meshing: MarchingTetrahedra
using GeometryBasics: Mesh, HyperRectangle
f = x -> sum(sin, 5 * x)
mesh = Mesh(f, HyperRectangle(Vec(-1, -1, -1), Vec(2, 2, 2)), MarchingTetrahedra())
setobject!(vis, mesh, MeshPhongMaterial(color=RGBA{Float32}(1, 0, 0, 0.5)))

@nhz2
Copy link

nhz2 commented Nov 21, 2024

I fixed this by using:

using Meshing: MarchingTetrahedra, isosurface
using GeometryBasics:
    Mesh,
    TriangleFace,
    Vec,
    Point
xr,yr,zr = ntuple(_->LinRange(-1,1,50),3)
f = x -> sum(sin, 5 * x)
sdf = [f(Vec(x,y,z)) for x in xr, y in yr, z in zr]
vts, fcs = isosurface(sdf, MarchingTetrahedra(), xr, yr, zr)
mesh = Mesh(Point.(vts), TriangleFace.(fcs))
setobject!(vis, mesh, MeshPhongMaterial(color=RGBA{Float32}(1, 0, 0, 0.5)))

v0.7 has a very simple API now with basically just one function: isosurface

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