Meshing.jl icon indicating copy to clipboard operation
Meshing.jl copied to clipboard

Any breaking changes/API differences from 0.6 to 0.7?

Open thchr opened this issue 1 year ago • 3 comments

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!

thchr avatar Sep 17 '24 08:09 thchr

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)))

ferrolho avatar Oct 10 '24 15:10 ferrolho

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

nhz2 avatar Nov 21 '24 00:11 nhz2

Looking at this now, I think it would've been nice to avoid a change as breaking as this, or to have used it as an occasion to fork and rename. Many things were removed, e.g., the function sampling interface. Many keywords to methods were removed (origin, widths). Keywords to algorithms were removed (eps for MarchingCubes e.g., contrary to the docs). Algorithms were removed.

Additionally, the online docs do not seem to have been refreshed to the v0.7 version: they still refer to version 0.5.6.

The fact that Makie.jl has transitioned to Meshing.jl v0.7 means that one is stuck on an old Makie version if one does not update Meshing.jl to this rather different package.

thchr avatar Feb 07 '25 20:02 thchr