Skip to content

Commit

Permalink
Merge pull request #28 from gridap/remove_plots
Browse files Browse the repository at this point in the history
Remove `Plots.jl` dependency
  • Loading branch information
pmartorell authored Feb 15, 2024
2 parents 32b46be + 0bb9103 commit 76e9339
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 50 deletions.
4 changes: 0 additions & 4 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,22 @@ AlgebraicMultigrid = "2169fc97-5a83-5252-b627-83903c6c433c"
Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
FillArrays = "1a297f60-69ca-5386-bcde-b61e274b549b"
GraphRecipes = "bd48cda9-67a9-57be-86fa-5b3c104eda73"
Gridap = "56d4f2e9-7ea1-5844-9cf6-b9c51ca7ce8e"
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]
AlgebraicMultigrid = "0.5,0.6"
Downloads = "1.4"
FileIO = "1.6"
FillArrays = "0.11, 0.13, 1"
GraphRecipes = "0.5"
Gridap = "0.17.16"
GridapEmbedded = "0.8, 0.9"
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
4 changes: 0 additions & 4 deletions src/STLCutters.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
module STLCutters

import MeshIO
import Plots
import GraphRecipes
import Downloads

using Gridap
Expand Down Expand Up @@ -58,8 +56,6 @@ import GridapEmbedded.CSG: compatible_geometries
import GridapEmbedded.CSG: similar_geometry
import GridapEmbedded.AgFEM: aggregate

import Plots: plot

import Base: split

export STLGeometry
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 76e9339

Please sign in to comment.