JuliaGeometry / MeshViz.jl

Makie.jl recipes for visualization of Meshes.jl

Home Page:https://github.com/JuliaGeometry/Meshes.jl

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Plotting meshes without viz

ga72kud opened this issue · comments

I would like to use the plot function (using Plots) for some meshes

points = Point2[(0,0), (1,0), (0,1), (1,1), (0.25,0.5), (0.75,0.5)]
    tris  = connect.([(1,5,3), (4,6,2)], Triangle)
    quads = connect.([(1,2,6,5), (4,3,5,6)], Quadrangle)
    mesh = SimpleMesh(points, [tris; quads])
    plot!(mesh, showfacets = true)

I want to adapt the visual appearance and changing the facet width for bigger dimensions.

points = Point2[(300,-220), (440,-220), (300,-140), (440,-140), (330,-180), (360,-180)]
    tris  = connect.([(1,5,3), (4,6,2)], Triangle)
    quads = connect.([(1,2,6,5), (4,3,5,6)], Quadrangle)
    mesh = SimpleMesh(points, [tris; quads])
    plot!(mesh, showfacets = true, linewidth=5)

@ga72kud this packages exports a single function called viz and its variant viz!. Can you try use that instead. The examples you showed should work except for the linewidth option.

I figured it out alpha=.2

I use plot! instead of viz! and works fine. What is the difference? What is better to use viz!

@ga72kud plot is the default command in Makie to plot objects. viz is a recipe for Meshes.jl objects. You are probably confusing these two.

If you are using Meshes.jl already then it makes sense to use MeshViz.jl

Yes I know and I want to use both in one application. I figured out it works. So I was wondering

Yes, you can combine different plotting commands in Makie to make your final scene. The MeshViz.jl project only knows how to plot objects from Meshes.jl using viz. I don't think plot will work with the objects therein.