Skip to content

Commit

Permalink
enable mesh plot of vector of simplices
Browse files Browse the repository at this point in the history
  • Loading branch information
krcools committed Dec 5, 2024
1 parent 49f3e6d commit a7d09ad
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/plotlyjs_glue.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ function __init__()
return s
end

@eval function patch(a::Vector{<:Simplex}; kwargs...)
vertices = reduce(vcat, [v.vertices for v in a])
faces = collect(SVector(3*(i-1)+1, 3*(i-1)+2, 3*(i-1)+3) for i in 1:length(a))
# faces = reduce(vcat, SVector(3*(i-1)+1, 3*(i-1)+2, 3*(i-1)+3) for i in 1:length(a))
mesh = Mesh(vertices, faces)
return patch(mesh; kwargs...)
end

@eval function cones(mesh, arrows; sizeref=2, kwargs...)
# normals = [normal(chart(mesh,cell)) for cell in mesh]
centers = [cartesian(center(chart(mesh,cell))) for cell in mesh]
Expand Down

0 comments on commit a7d09ad

Please sign in to comment.