Skip to content

Commit

Permalink
PolyhedralGeometry: added visualize(::Vector) docu (#4449)
Browse files Browse the repository at this point in the history
  • Loading branch information
YueRen authored Jan 13, 2025
1 parent e9951b9 commit e40f40f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/src/PolyhedralGeometry/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ Lower dimensional polyhedral objects can be visualized through polymake's backen

```@docs
visualize(P::Union{Polyhedron{<:Union{Float64,FieldElem}}, Cone{<:Union{Float64,FieldElem}}, PolyhedralFan{<:Union{Float64,FieldElem}}, PolyhedralComplex{<:Union{Float64,FieldElem}}, SubdivisionOfPoints{<:Union{Float64,FieldElem}}, Graph, SimplicialComplex}; kwargs...)
visualize(::Vector)
```


Expand Down
21 changes: 21 additions & 0 deletions src/PolyhedralGeometry/visualization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,27 @@ function visualize(
Polymake.visual(pmo; kwargs...)
end

@doc raw"""
visualize(P::Vector; kwargs...)
Visualize a vector of polyhedral objects `P`, i.e., all polyhedral objects in `P` in one visualization. See [`visualize`](@ref Oscar.visualize(::Union{SimplicialComplex, Cone{<:Union{Float64, FieldElem}}, Graph, PolyhedralComplex{<:Union{Float64, FieldElem}}, PolyhedralFan{<:Union{Float64, FieldElem}}, Polyhedron, SubdivisionOfPoints{<:Union{Float64, FieldElem}}})) for which polyhedral objects and keyword arguments are possible.
# Examples
```julia
julia> p = simplex(3)
Polytope in ambient dimension 3
julia> P = [p,p+[3,0,0],p+[0,3,0],p+[0,0,3]]
4-element Vector{Polyhedron{QQFieldElem}}:
Polytope in ambient dimension 3
Polytope in ambient dimension 3
Polytope in ambient dimension 3
Polytope in ambient dimension 3
julia> visualize(P)
```
"""
function visualize(P::Vector; kwargs::Dict=Dict{Int,Nothing}())
for p in P
@req p isa visual_supported_types "Can not visualize objects of type $(typeof(P))"
Expand Down

0 comments on commit e40f40f

Please sign in to comment.