Skip to content

Commit

Permalink
remove Plots dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
pmartorell committed Feb 15, 2024
1 parent 5e24cc2 commit 86e1aa5
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 44 deletions.
2 changes: 0 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ GridapEmbedded = "8838a6a3-0006-4405-b874-385995508d5d"
IterativeSolvers = "42fd0dbc-a981-5370-80f2-aaf504508153"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
MeshIO = "7269a6da-0436-5bbc-96c2-40638cbb6118"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca"

[compat]
Expand All @@ -27,7 +26,6 @@ Gridap = "0.17.16"
GridapEmbedded = "0.8"
IterativeSolvers = "0.9"
MeshIO = "0.4"
Plots = "1.11"
ProgressMeter = "1.7"
julia = "1.5"

Expand Down
39 changes: 0 additions & 39 deletions src/Polyhedra.jl
Original file line number Diff line number Diff line change
Expand Up @@ -500,45 +500,6 @@ end

# Printers

function plot(p::Polyhedron,filename=nothing)
vertices = Int32[]
for i in 1:num_vertices(p)
if isactive(p,i)
push!(vertices,i)
end
end
vertex_to_node = Dict( zip( vertices, 1:length(vertices) ) )
g = empty( get_graph(p) )
for (i,vneigs) in enumerate( get_graph(p) )
isactive(p,i) || continue
nodes = Int32[]
for (j,vneig) in enumerate(vneigs)
if vneig (UNSET,OPEN)
push!(vertices,UNSET)
n = length(vertices)
else
n = vertex_to_node[vneig]
end
push!(nodes,n)
end
push!(g,nodes)
end
v_to_pv = p.data.vertex_to_parent_vertex
names = String[]
for v in vertices
if v == UNSET
name = ""
else
name = v_to_pv[v] == v ? "$v" : "$v($(v_to_pv[v]))"
end
push!(names,name)
end
kwargs = (fontsize=10,node_size=0,line=(:dot,0.5,1),thickness_scaling=0.5)
GraphRecipes.graphplot(g,names=names,curves=false;kwargs...)
isnothing(filename) || Plots.savefig(filename)
Plots.plot!()
end

function writevtk(p::Polyhedron,filename;kwargs...)
writevtk(edge_mesh(p),filename;kwargs...)
end
Expand Down
3 changes: 0 additions & 3 deletions test/PolyhedraTests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ using STLCutters: split
using STLCutters: surface, volume
using STLCutters: get_facet_planes
using STLCutters: compute_distances!
using STLCutters: plot
using STLCutters: check_graph
using STLCutters: compute_stl_model
using STLCutters: read_stl
Expand Down Expand Up @@ -44,8 +43,6 @@ p = Polyhedron(HEX)
@test volume(p) 1
@test surface(p) 6

plot(p)

f, = writevtk(p,"p")
rm.(f)

Expand Down

0 comments on commit 86e1aa5

Please sign in to comment.