/
index.html
158 lines (152 loc) · 39 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Plot · Polyhedra</title><link href="https://fonts.googleapis.com/css?family=Lato|Roboto+Mono" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.0/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.0/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.0/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.11.1/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../assets/documenter.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-dark.css" data-theme-name="documenter-dark"/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit">Polyhedra</span></div><form class="docs-search" action="../search/"><input class="docs-search-query" id="documenter-search-query" name="q" type="text" placeholder="Search docs"/></form><ul class="docs-menu"><li><a class="tocitem" href="../">Index</a></li><li><a class="tocitem" href="../installation/">Installation</a></li><li><a class="tocitem" href="../representation/">Representation</a></li><li><a class="tocitem" href="../polyhedron/">Polyhedron</a></li><li class="is-active"><a class="tocitem" href>Plot</a><ul class="internal"><li><a class="tocitem" href="#D-plotting-with-Plots"><span>2D plotting with Plots</span></a></li><li><a class="tocitem" href="#D-plotting-with-Plots-2"><span>3D plotting with Plots</span></a></li></ul></li><li><a class="tocitem" href="../redundancy/">Containment/Redundancy</a></li><li><a class="tocitem" href="../projection/">Projection/Elimination</a></li><li><a class="tocitem" href="../optimization/">Optimization</a></li><li><a class="tocitem" href="../utilities/">Utilities</a></li><li><span class="tocitem">Examples</span><ul><li><a class="tocitem" href="../generated/Convex hull and intersection/">Convex hull and intersection</a></li><li><a class="tocitem" href="../generated/Extended Formulation/">Extended Formulation</a></li><li><a class="tocitem" href="../generated/Minimal Robust Positively Invariant Set/">Minimal Robust Positively Invariant Set</a></li></ul></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href>Plot</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Plot</a></li></ul></nav><div class="docs-right"><a class="docs-edit-link" href="https://github.com/JuliaPolyhedra/Polyhedra.jl/blob/master/docs/src/plot.md" title="Edit on GitHub"><span class="docs-icon fab"></span><span class="docs-label is-hidden-touch">Edit on GitHub</span></a><a class="docs-settings-button fas fa-cog" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-sidebar-button fa fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a></div></header><article class="content" id="documenter-page"><h1 id="Plot"><a class="docs-heading-anchor" href="#Plot">Plot</a><a id="Plot-1"></a><a class="docs-heading-anchor-permalink" href="#Plot" title="Permalink"></a></h1><p>Polyhedra contains utilities to visualize either a 2-dimensional or a 3-dimensional polyhedron, see <a href="../polyhedron/#Polyhedron">Polyhedron</a> for how to construct a polyhedron, e.g. from its H- or V-representation.</p><h2 id="D-plotting-with-Plots"><a class="docs-heading-anchor" href="#D-plotting-with-Plots">2D plotting with Plots</a><a id="D-plotting-with-Plots-1"></a><a class="docs-heading-anchor-permalink" href="#D-plotting-with-Plots" title="Permalink"></a></h2><p>A 2-dimensional polytope, i.e. <em>bounded</em> polyhedron, can be visualized with <a href="https://github.com/JuliaPlots/Plots.jl">Plots</a>. Suppose for instance that we want to visualize the polyhedron having the following H-representation:</p><pre><code class="language-julia">using Polyhedra
h = HalfSpace([1, 1], 1) ∩ HalfSpace([-1, 0], 0) ∩ HalfSpace([0, -1], 0)</code></pre><pre class="documenter-example-output">H-representation Polyhedra.Intersection{Int64,Array{Int64,1},Int64}:
3-element iterator of HalfSpace{Int64,Array{Int64,1}}:
HalfSpace([1, 1], 1)
HalfSpace([-1, 0], 0)
HalfSpace([0, -1], 0)</pre><p>The H-representation cannot be given to Plots directly, it first need to be transformed into a polyhedron:</p><pre><code class="language-julia">p = polyhedron(h)</code></pre><pre class="documenter-example-output">Polyhedron DefaultPolyhedron{Rational{BigInt},Polyhedra.Intersection{Rational{BigInt},Array{Rational{BigInt},1},Int64},Polyhedra.Hull{Rational{BigInt},Array{Rational{BigInt},1},Int64}}:
3-element iterator of HalfSpace{Rational{BigInt},Array{Rational{BigInt},1}}:
HalfSpace(Rational{BigInt}[1//1, 1//1], 1//1)
HalfSpace(Rational{BigInt}[-1//1, 0//1], 0//1)
HalfSpace(Rational{BigInt}[0//1, -1//1], 0//1)</pre><p>The polyhedron can be given to Plots as follows. We use <code>ratio=:equal</code> so that the horizontal and vertical axis have the same scale.</p><pre><code class="language-julia">using Plots
plot(p, ratio=:equal)</code></pre><?xml version="1.0" encoding="utf-8"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="600" height="400" viewBox="0 0 2400 1600">
<defs>
<clipPath id="clip840">
<rect x="0" y="0" width="2400" height="1600"/>
</clipPath>
</defs>
<path clip-path="url(#clip840)" d="
M0 1600 L2400 1600 L2400 0 L0 0 Z
" fill="#ffffff" fill-rule="evenodd" fill-opacity="1"/>
<defs>
<clipPath id="clip841">
<rect x="480" y="0" width="1681" height="1600"/>
</clipPath>
</defs>
<path clip-path="url(#clip840)" d="
M86.9921 1521.01 L2352.76 1521.01 L2352.76 47.2441 L86.9921 47.2441 Z
" fill="#ffffff" fill-rule="evenodd" fill-opacity="1"/>
<defs>
<clipPath id="clip842">
<rect x="86" y="47" width="2267" height="1475"/>
</clipPath>
</defs>
<polyline clip-path="url(#clip842)" style="stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none" points="
246.634,1521.01 246.634,47.2441
"/>
<polyline clip-path="url(#clip842)" style="stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none" points="
524.702,1521.01 524.702,47.2441
"/>
<polyline clip-path="url(#clip842)" style="stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none" points="
802.771,1521.01 802.771,47.2441
"/>
<polyline clip-path="url(#clip842)" style="stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none" points="
1080.84,1521.01 1080.84,47.2441
"/>
<polyline clip-path="url(#clip842)" style="stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none" points="
1358.91,1521.01 1358.91,47.2441
"/>
<polyline clip-path="url(#clip842)" style="stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none" points="
1636.98,1521.01 1636.98,47.2441
"/>
<polyline clip-path="url(#clip842)" style="stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none" points="
1915.05,1521.01 1915.05,47.2441
"/>
<polyline clip-path="url(#clip842)" style="stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none" points="
2193.11,1521.01 2193.11,47.2441
"/>
<polyline clip-path="url(#clip840)" style="stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none" points="
86.9921,1521.01 2352.76,1521.01
"/>
<polyline clip-path="url(#clip840)" style="stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none" points="
246.634,1521.01 246.634,1503.32
"/>
<polyline clip-path="url(#clip840)" style="stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none" points="
524.702,1521.01 524.702,1503.32
"/>
<polyline clip-path="url(#clip840)" style="stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none" points="
802.771,1521.01 802.771,1503.32
"/>
<polyline clip-path="url(#clip840)" style="stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none" points="
1080.84,1521.01 1080.84,1503.32
"/>
<polyline clip-path="url(#clip840)" style="stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none" points="
1358.91,1521.01 1358.91,1503.32
"/>
<polyline clip-path="url(#clip840)" style="stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none" points="
1636.98,1521.01 1636.98,1503.32
"/>
<polyline clip-path="url(#clip840)" style="stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none" points="
1915.05,1521.01 1915.05,1503.32
"/>
<polyline clip-path="url(#clip840)" style="stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none" points="
2193.11,1521.01 2193.11,1503.32
"/>
<path clip-path="url(#clip840)" d="M 0 0 M200.604 1564.85 L230.28 1564.85 L230.28 1568.79 L200.604 1568.79 L200.604 1564.85 Z" fill="#000000" fill-rule="evenodd" fill-opacity="1" /><path clip-path="url(#clip840)" d="M 0 0 M245.349 1550.2 Q241.738 1550.2 239.909 1553.76 Q238.104 1557.31 238.104 1564.43 Q238.104 1571.54 239.909 1575.11 Q241.738 1578.65 245.349 1578.65 Q248.983 1578.65 250.789 1575.11 Q252.618 1571.54 252.618 1564.43 Q252.618 1557.31 250.789 1553.76 Q248.983 1550.2 245.349 1550.2 M245.349 1546.49 Q251.159 1546.49 254.215 1551.1 Q257.293 1555.68 257.293 1564.43 Q257.293 1573.16 254.215 1577.77 Q251.159 1582.35 245.349 1582.35 Q239.539 1582.35 236.46 1577.77 Q233.405 1573.16 233.405 1564.43 Q233.405 1555.68 236.46 1551.1 Q239.539 1546.49 245.349 1546.49 Z" fill="#000000" fill-rule="evenodd" fill-opacity="1" /><path clip-path="url(#clip840)" d="M 0 0 M262.363 1575.8 L267.247 1575.8 L267.247 1581.68 L262.363 1581.68 L262.363 1575.8 Z" fill="#000000" fill-rule="evenodd" fill-opacity="1" /><path clip-path="url(#clip840)" d="M 0 0 M276.344 1577.74 L292.664 1577.74 L292.664 1581.68 L270.719 1581.68 L270.719 1577.74 Q273.381 1574.99 277.965 1570.36 Q282.571 1565.71 283.752 1564.37 Q285.997 1561.84 286.877 1560.11 Q287.779 1558.35 287.779 1556.66 Q287.779 1553.9 285.835 1552.17 Q283.914 1550.43 280.812 1550.43 Q278.613 1550.43 276.159 1551.19 Q273.729 1551.96 270.951 1553.51 L270.951 1548.79 Q273.775 1547.65 276.229 1547.07 Q278.682 1546.49 280.719 1546.49 Q286.09 1546.49 289.284 1549.18 Q292.478 1551.87 292.478 1556.36 Q292.478 1558.49 291.668 1560.41 Q290.881 1562.3 288.775 1564.9 Q288.196 1565.57 285.094 1568.79 Q281.992 1571.98 276.344 1577.74 Z" fill="#000000" fill-rule="evenodd" fill-opacity="1" /><path clip-path="url(#clip840)" d="M 0 0 M506.219 1550.2 Q502.608 1550.2 500.779 1553.76 Q498.973 1557.31 498.973 1564.43 Q498.973 1571.54 500.779 1575.11 Q502.608 1578.65 506.219 1578.65 Q509.853 1578.65 511.659 1575.11 Q513.487 1571.54 513.487 1564.43 Q513.487 1557.31 511.659 1553.76 Q509.853 1550.2 506.219 1550.2 M506.219 1546.49 Q512.029 1546.49 515.084 1551.1 Q518.163 1555.68 518.163 1564.43 Q518.163 1573.16 515.084 1577.77 Q512.029 1582.35 506.219 1582.35 Q500.409 1582.35 497.33 1577.77 Q494.274 1573.16 494.274 1564.43 Q494.274 1555.68 497.33 1551.1 Q500.409 1546.49 506.219 1546.49 Z" fill="#000000" fill-rule="evenodd" fill-opacity="1" /><path clip-path="url(#clip840)" d="M 0 0 M523.233 1575.8 L528.117 1575.8 L528.117 1581.68 L523.233 1581.68 L523.233 1575.8 Z" fill="#000000" fill-rule="evenodd" fill-opacity="1" /><path clip-path="url(#clip840)" d="M 0 0 M543.186 1550.2 Q539.575 1550.2 537.746 1553.76 Q535.941 1557.31 535.941 1564.43 Q535.941 1571.54 537.746 1575.11 Q539.575 1578.65 543.186 1578.65 Q546.82 1578.65 548.626 1575.11 Q550.455 1571.54 550.455 1564.43 Q550.455 1557.31 548.626 1553.76 Q546.82 1550.2 543.186 1550.2 M543.186 1546.49 Q548.996 1546.49 552.052 1551.1 Q555.13 1555.68 555.13 1564.43 Q555.13 1573.16 552.052 1577.77 Q548.996 1582.35 543.186 1582.35 Q537.376 1582.35 534.297 1577.77 Q531.242 1573.16 531.242 1564.43 Q531.242 1555.68 534.297 1551.1 Q537.376 1546.49 543.186 1546.49 Z" fill="#000000" fill-rule="evenodd" fill-opacity="1" /><path clip-path="url(#clip840)" d="M 0 0 M785.086 1550.2 Q781.475 1550.2 779.646 1553.76 Q777.841 1557.31 777.841 1564.43 Q777.841 1571.54 779.646 1575.11 Q781.475 1578.65 785.086 1578.65 Q788.72 1578.65 790.526 1575.11 Q792.354 1571.54 792.354 1564.43 Q792.354 1557.31 790.526 1553.76 Q788.72 1550.2 785.086 1550.2 M785.086 1546.49 Q790.896 1546.49 793.952 1551.1 Q797.03 1555.68 797.03 1564.43 Q797.03 1573.16 793.952 1577.77 Q790.896 1582.35 785.086 1582.35 Q779.276 1582.35 776.197 1577.77 Q773.142 1573.16 773.142 1564.43 Q773.142 1555.68 776.197 1551.1 Q779.276 1546.49 785.086 1546.49 Z" fill="#000000" fill-rule="evenodd" fill-opacity="1" /><path clip-path="url(#clip840)" d="M 0 0 M802.1 1575.8 L806.984 1575.8 L806.984 1581.68 L802.1 1581.68 L802.1 1575.8 Z" fill="#000000" fill-rule="evenodd" fill-opacity="1" /><path clip-path="url(#clip840)" d="M 0 0 M816.081 1577.74 L832.401 1577.74 L832.401 1581.68 L810.456 1581.68 L810.456 1577.74 Q813.118 1574.99 817.702 1570.36 Q822.308 1565.71 823.489 1564.37 Q825.734 1561.84 826.614 1560.11 Q827.516 1558.35 827.516 1556.66 Q827.516 1553.9 825.572 1552.17 Q823.651 1550.43 820.549 1550.43 Q818.35 1550.43 815.896 1551.19 Q813.465 1551.96 810.688 1553.51 L810.688 1548.79 Q813.512 1547.65 815.965 1547.07 Q818.419 1546.49 820.456 1546.49 Q825.826 1546.49 829.021 1549.18 Q832.215 1551.87 832.215 1556.36 Q832.215 1558.49 831.405 1560.41 Q830.618 1562.3 828.512 1564.9 Q827.933 1565.57 824.831 1568.79 Q821.729 1571.98 816.081 1577.74 Z" fill="#000000" fill-rule="evenodd" fill-opacity="1" /><path clip-path="url(#clip840)" d="M 0 0 M1062.11 1550.2 Q1058.5 1550.2 1056.67 1553.76 Q1054.87 1557.31 1054.87 1564.43 Q1054.87 1571.54 1056.67 1575.11 Q1058.5 1578.65 1062.11 1578.65 Q1065.75 1578.65 1067.55 1575.11 Q1069.38 1571.54 1069.38 1564.43 Q1069.38 1557.31 1067.55 1553.76 Q1065.75 1550.2 1062.11 1550.2 M1062.11 1546.49 Q1067.92 1546.49 1070.98 1551.1 Q1074.06 1555.68 1074.06 1564.43 Q1074.06 1573.16 1070.98 1577.77 Q1067.92 1582.35 1062.11 1582.35 Q1056.3 1582.35 1053.22 1577.77 Q1050.17 1573.16 1050.17 1564.43 Q1050.17 1555.68 1053.22 1551.1 Q1056.3 1546.49 1062.11 1546.49 Z" fill="#000000" fill-rule="evenodd" fill-opacity="1" /><path clip-path="url(#clip840)" d="M 0 0 M1079.13 1575.8 L1084.01 1575.8 L1084.01 1581.68 L1079.13 1581.68 L1079.13 1575.8 Z" fill="#000000" fill-rule="evenodd" fill-opacity="1" /><path clip-path="url(#clip840)" d="M 0 0 M1101.93 1551.19 L1090.12 1569.64 L1101.93 1569.64 L1101.93 1551.19 M1100.7 1547.12 L1106.58 1547.12 L1106.58 1569.64 L1111.51 1569.64 L1111.51 1573.53 L1106.58 1573.53 L1106.58 1581.68 L1101.93 1581.68 L1101.93 1573.53 L1086.33 1573.53 L1086.33 1569.02 L1100.7 1547.12 Z" fill="#000000" fill-rule="evenodd" fill-opacity="1" /><path clip-path="url(#clip840)" d="M 0 0 M1340.34 1550.2 Q1336.73 1550.2 1334.9 1553.76 Q1333.1 1557.31 1333.1 1564.43 Q1333.1 1571.54 1334.9 1575.11 Q1336.73 1578.65 1340.34 1578.65 Q1343.98 1578.65 1345.78 1575.11 Q1347.61 1571.54 1347.61 1564.43 Q1347.61 1557.31 1345.78 1553.76 Q1343.98 1550.2 1340.34 1550.2 M1340.34 1546.49 Q1346.15 1546.49 1349.21 1551.1 Q1352.29 1555.68 1352.29 1564.43 Q1352.29 1573.16 1349.21 1577.77 Q1346.15 1582.35 1340.34 1582.35 Q1334.53 1582.35 1331.45 1577.77 Q1328.4 1573.16 1328.4 1564.43 Q1328.4 1555.68 1331.45 1551.1 Q1334.53 1546.49 1340.34 1546.49 Z" fill="#000000" fill-rule="evenodd" fill-opacity="1" /><path clip-path="url(#clip840)" d="M 0 0 M1357.36 1575.8 L1362.24 1575.8 L1362.24 1581.68 L1357.36 1581.68 L1357.36 1575.8 Z" fill="#000000" fill-rule="evenodd" fill-opacity="1" /><path clip-path="url(#clip840)" d="M 0 0 M1377.89 1562.54 Q1374.74 1562.54 1372.89 1564.69 Q1371.06 1566.84 1371.06 1570.59 Q1371.06 1574.32 1372.89 1576.49 Q1374.74 1578.65 1377.89 1578.65 Q1381.04 1578.65 1382.87 1576.49 Q1384.72 1574.32 1384.72 1570.59 Q1384.72 1566.84 1382.87 1564.69 Q1381.04 1562.54 1377.89 1562.54 M1387.17 1547.88 L1387.17 1552.14 Q1385.41 1551.31 1383.61 1550.87 Q1381.82 1550.43 1380.07 1550.43 Q1375.44 1550.43 1372.98 1553.56 Q1370.55 1556.68 1370.2 1563 Q1371.57 1560.99 1373.63 1559.92 Q1375.69 1558.83 1378.17 1558.83 Q1383.38 1558.83 1386.39 1562 Q1389.42 1565.15 1389.42 1570.59 Q1389.42 1575.92 1386.27 1579.13 Q1383.12 1582.35 1377.89 1582.35 Q1371.89 1582.35 1368.72 1577.77 Q1365.55 1573.16 1365.55 1564.43 Q1365.55 1556.24 1369.44 1551.38 Q1373.33 1546.49 1379.88 1546.49 Q1381.64 1546.49 1383.42 1546.84 Q1385.23 1547.19 1387.17 1547.88 Z" fill="#000000" fill-rule="evenodd" fill-opacity="1" /><path clip-path="url(#clip840)" d="M 0 0 M1618.54 1550.2 Q1614.93 1550.2 1613.1 1553.76 Q1611.29 1557.31 1611.29 1564.43 Q1611.29 1571.54 1613.1 1575.11 Q1614.93 1578.65 1618.54 1578.65 Q1622.17 1578.65 1623.98 1575.11 Q1625.81 1571.54 1625.81 1564.43 Q1625.81 1557.31 1623.98 1553.76 Q1622.17 1550.2 1618.54 1550.2 M1618.54 1546.49 Q1624.35 1546.49 1627.41 1551.1 Q1630.48 1555.68 1630.48 1564.43 Q1630.48 1573.16 1627.41 1577.77 Q1624.35 1582.35 1618.54 1582.35 Q1612.73 1582.35 1609.65 1577.77 Q1606.6 1573.16 1606.6 1564.43 Q1606.6 1555.68 1609.65 1551.1 Q1612.73 1546.49 1618.54 1546.49 Z" fill="#000000" fill-rule="evenodd" fill-opacity="1" /><path clip-path="url(#clip840)" d="M 0 0 M1635.55 1575.8 L1640.44 1575.8 L1640.44 1581.68 L1635.55 1581.68 L1635.55 1575.8 Z" fill="#000000" fill-rule="evenodd" fill-opacity="1" /><path clip-path="url(#clip840)" d="M 0 0 M1655.51 1565.27 Q1652.17 1565.27 1650.25 1567.05 Q1648.35 1568.83 1648.35 1571.96 Q1648.35 1575.08 1650.25 1576.87 Q1652.17 1578.65 1655.51 1578.65 Q1658.84 1578.65 1660.76 1576.87 Q1662.68 1575.06 1662.68 1571.96 Q1662.68 1568.83 1660.76 1567.05 Q1658.86 1565.27 1655.51 1565.27 M1650.83 1563.28 Q1647.82 1562.54 1646.13 1560.48 Q1644.47 1558.42 1644.47 1555.45 Q1644.47 1551.31 1647.41 1548.9 Q1650.37 1546.49 1655.51 1546.49 Q1660.67 1546.49 1663.61 1548.9 Q1666.55 1551.31 1666.55 1555.45 Q1666.55 1558.42 1664.86 1560.48 Q1663.19 1562.54 1660.21 1563.28 Q1663.59 1564.06 1665.46 1566.36 Q1667.36 1568.65 1667.36 1571.96 Q1667.36 1576.98 1664.28 1579.67 Q1661.22 1582.35 1655.51 1582.35 Q1649.79 1582.35 1646.71 1579.67 Q1643.66 1576.98 1643.66 1571.96 Q1643.66 1568.65 1645.55 1566.36 Q1647.45 1564.06 1650.83 1563.28 M1649.12 1555.89 Q1649.12 1558.58 1650.78 1560.08 Q1652.47 1561.59 1655.51 1561.59 Q1658.52 1561.59 1660.21 1560.08 Q1661.92 1558.58 1661.92 1555.89 Q1661.92 1553.21 1660.21 1551.7 Q1658.52 1550.2 1655.51 1550.2 Q1652.47 1550.2 1650.78 1551.7 Q1649.12 1553.21 1649.12 1555.89 Z" fill="#000000" fill-rule="evenodd" fill-opacity="1" /><path clip-path="url(#clip840)" d="M 0 0 M1886.94 1577.74 L1894.58 1577.74 L1894.58 1551.38 L1886.27 1553.05 L1886.27 1548.79 L1894.54 1547.12 L1899.21 1547.12 L1899.21 1577.74 L1906.85 1577.74 L1906.85 1581.68 L1886.94 1581.68 L1886.94 1577.74 Z" fill="#000000" fill-rule="evenodd" fill-opacity="1" /><path clip-path="url(#clip840)" d="M 0 0 M1911.92 1575.8 L1916.8 1575.8 L1916.8 1581.68 L1911.92 1581.68 L1911.92 1575.8 Z" fill="#000000" fill-rule="evenodd" fill-opacity="1" /><path clip-path="url(#clip840)" d="M 0 0 M1931.87 1550.2 Q1928.26 1550.2 1926.43 1553.76 Q1924.63 1557.31 1924.63 1564.43 Q1924.63 1571.54 1926.43 1575.11 Q1928.26 1578.65 1931.87 1578.65 Q1935.51 1578.65 1937.31 1575.11 Q1939.14 1571.54 1939.14 1564.43 Q1939.14 1557.31 1937.31 1553.76 Q1935.51 1550.2 1931.87 1550.2 M1931.87 1546.49 Q1937.68 1546.49 1940.74 1551.1 Q1943.82 1555.68 1943.82 1564.43 Q1943.82 1573.16 1940.74 1577.77 Q1937.68 1582.35 1931.87 1582.35 Q1926.06 1582.35 1922.99 1577.77 Q1919.93 1573.16 1919.93 1564.43 Q1919.93 1555.68 1922.99 1551.1 Q1926.06 1546.49 1931.87 1546.49 Z" fill="#000000" fill-rule="evenodd" fill-opacity="1" /><path clip-path="url(#clip840)" d="M 0 0 M2165.81 1577.74 L2173.45 1577.74 L2173.45 1551.38 L2165.14 1553.05 L2165.14 1548.79 L2173.4 1547.12 L2178.08 1547.12 L2178.08 1577.74 L2185.72 1577.74 L2185.72 1581.68 L2165.81 1581.68 L2165.81 1577.74 Z" fill="#000000" fill-rule="evenodd" fill-opacity="1" /><path clip-path="url(#clip840)" d="M 0 0 M2190.79 1575.8 L2195.67 1575.8 L2195.67 1581.68 L2190.79 1581.68 L2190.79 1575.8 Z" fill="#000000" fill-rule="evenodd" fill-opacity="1" /><path clip-path="url(#clip840)" d="M 0 0 M2204.77 1577.74 L2221.09 1577.74 L2221.09 1581.68 L2199.14 1581.68 L2199.14 1577.74 Q2201.81 1574.99 2206.39 1570.36 Q2211 1565.71 2212.18 1564.37 Q2214.42 1561.84 2215.3 1560.11 Q2216.2 1558.35 2216.2 1556.66 Q2216.2 1553.9 2214.26 1552.17 Q2212.34 1550.43 2209.24 1550.43 Q2207.04 1550.43 2204.58 1551.19 Q2202.15 1551.96 2199.38 1553.51 L2199.38 1548.79 Q2202.2 1547.65 2204.65 1547.07 Q2207.11 1546.49 2209.14 1546.49 Q2214.51 1546.49 2217.71 1549.18 Q2220.9 1551.87 2220.9 1556.36 Q2220.9 1558.49 2220.09 1560.41 Q2219.31 1562.3 2217.2 1564.9 Q2216.62 1565.57 2213.52 1568.79 Q2210.42 1571.98 2204.77 1577.74 Z" fill="#000000" fill-rule="evenodd" fill-opacity="1" /><polyline clip-path="url(#clip842)" style="stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none" points="
86.9921,1479.3 2352.76,1479.3
"/>
<polyline clip-path="url(#clip842)" style="stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none" points="
86.9921,1131.71 2352.76,1131.71
"/>
<polyline clip-path="url(#clip842)" style="stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none" points="
86.9921,784.126 2352.76,784.126
"/>
<polyline clip-path="url(#clip842)" style="stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none" points="
86.9921,436.54 2352.76,436.54
"/>
<polyline clip-path="url(#clip842)" style="stroke:#000000; stroke-width:2; stroke-opacity:0.1; fill:none" points="
86.9921,88.9544 2352.76,88.9544
"/>
<polyline clip-path="url(#clip840)" style="stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none" points="
86.9921,1521.01 86.9921,47.2441
"/>
<polyline clip-path="url(#clip840)" style="stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none" points="
86.9921,1479.3 114.181,1479.3
"/>
<polyline clip-path="url(#clip840)" style="stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none" points="
86.9921,1131.71 114.181,1131.71
"/>
<polyline clip-path="url(#clip840)" style="stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none" points="
86.9921,784.126 114.181,784.126
"/>
<polyline clip-path="url(#clip840)" style="stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none" points="
86.9921,436.54 114.181,436.54
"/>
<polyline clip-path="url(#clip840)" style="stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none" points="
86.9921,88.9544 114.181,88.9544
"/>
<path clip-path="url(#clip840)" d="M 0 0 M-24.9334 1465.1 Q-28.5445 1465.1 -30.3732 1468.66 Q-32.1787 1472.2 -32.1787 1479.33 Q-32.1787 1486.44 -30.3732 1490 Q-28.5445 1493.55 -24.9334 1493.55 Q-21.2992 1493.55 -19.4936 1490 Q-17.6649 1486.44 -17.6649 1479.33 Q-17.6649 1472.2 -19.4936 1468.66 Q-21.2992 1465.1 -24.9334 1465.1 M-24.9334 1461.39 Q-19.1232 1461.39 -16.0677 1466 Q-12.989 1470.58 -12.989 1479.33 Q-12.989 1488.06 -16.0677 1492.67 Q-19.1232 1497.25 -24.9334 1497.25 Q-30.7435 1497.25 -33.8222 1492.67 Q-36.8778 1488.06 -36.8778 1479.33 Q-36.8778 1470.58 -33.8222 1466 Q-30.7435 1461.39 -24.9334 1461.39 Z" fill="#000000" fill-rule="evenodd" fill-opacity="1" /><path clip-path="url(#clip840)" d="M 0 0 M-7.9196 1490.7 L-3.03536 1490.7 L-3.03536 1496.58 L-7.9196 1496.58 L-7.9196 1490.7 Z" fill="#000000" fill-rule="evenodd" fill-opacity="1" /><path clip-path="url(#clip840)" d="M 0 0 M12.034 1465.1 Q8.42291 1465.1 6.59422 1468.66 Q4.78867 1472.2 4.78867 1479.33 Q4.78867 1486.44 6.59422 1490 Q8.42291 1493.55 12.034 1493.55 Q15.6682 1493.55 17.4738 1490 Q19.3025 1486.44 19.3025 1479.33 Q19.3025 1472.2 17.4738 1468.66 Q15.6682 1465.1 12.034 1465.1 M12.034 1461.39 Q17.8442 1461.39 20.8997 1466 Q23.9784 1470.58 23.9784 1479.33 Q23.9784 1488.06 20.8997 1492.67 Q17.8442 1497.25 12.034 1497.25 Q6.22385 1497.25 3.14516 1492.67 Q0.089621 1488.06 0.089621 1479.33 Q0.089621 1470.58 3.14516 1466 Q6.22385 1461.39 12.034 1461.39 Z" fill="#000000" fill-rule="evenodd" fill-opacity="1" /><path clip-path="url(#clip840)" d="M 0 0 M39.0477 1465.1 Q35.4367 1465.1 33.608 1468.66 Q31.8024 1472.2 31.8024 1479.33 Q31.8024 1486.44 33.608 1490 Q35.4367 1493.55 39.0477 1493.55 Q42.682 1493.55 44.4875 1490 Q46.3162 1486.44 46.3162 1479.33 Q46.3162 1472.2 44.4875 1468.66 Q42.682 1465.1 39.0477 1465.1 M39.0477 1461.39 Q44.8579 1461.39 47.9134 1466 Q50.9921 1470.58 50.9921 1479.33 Q50.9921 1488.06 47.9134 1492.67 Q44.8579 1497.25 39.0477 1497.25 Q33.2376 1497.25 30.1589 1492.67 Q27.1034 1488.06 27.1034 1479.33 Q27.1034 1470.58 30.1589 1466 Q33.2376 1461.39 39.0477 1461.39 Z" fill="#000000" fill-rule="evenodd" fill-opacity="1" /><path clip-path="url(#clip840)" d="M 0 0 M-22.3408 1117.51 Q-25.9519 1117.51 -27.7806 1121.08 Q-29.5861 1124.62 -29.5861 1131.75 Q-29.5861 1138.85 -27.7806 1142.42 Q-25.9519 1145.96 -22.3408 1145.96 Q-18.7066 1145.96 -16.901 1142.42 Q-15.0723 1138.85 -15.0723 1131.75 Q-15.0723 1124.62 -16.901 1121.08 Q-18.7066 1117.51 -22.3408 1117.51 M-22.3408 1113.81 Q-16.5307 1113.81 -13.4751 1118.41 Q-10.3964 1123 -10.3964 1131.75 Q-10.3964 1140.47 -13.4751 1145.08 Q-16.5307 1149.66 -22.3408 1149.66 Q-28.151 1149.66 -31.2297 1145.08 Q-34.2852 1140.47 -34.2852 1131.75 Q-34.2852 1123 -31.2297 1118.41 Q-28.151 1113.81 -22.3408 1113.81 Z" fill="#000000" fill-rule="evenodd" fill-opacity="1" /><path clip-path="url(#clip840)" d="M 0 0 M-5.32702 1143.11 L-0.442784 1143.11 L-0.442784 1148.99 L-5.32702 1148.99 L-5.32702 1143.11 Z" fill="#000000" fill-rule="evenodd" fill-opacity="1" /><path clip-path="url(#clip840)" d="M 0 0 M8.65439 1145.06 L24.9737 1145.06 L24.9737 1148.99 L3.02942 1148.99 L3.02942 1145.06 Q5.69144 1142.3 10.2748 1137.67 Q14.8812 1133.02 16.0618 1131.68 Q18.3071 1129.15 19.1867 1127.42 Q20.0895 1125.66 20.0895 1123.97 Q20.0895 1121.21 18.1451 1119.48 Q16.2238 1117.74 13.122 1117.74 Q10.9229 1117.74 8.46921 1118.51 Q6.03866 1119.27 3.2609 1120.82 L3.2609 1116.1 Q6.08496 1114.96 8.53865 1114.39 Q10.9923 1113.81 13.0294 1113.81 Q18.3997 1113.81 21.5941 1116.49 Q24.7886 1119.18 24.7886 1123.67 Q24.7886 1125.8 23.9784 1127.72 Q23.1913 1129.62 21.0849 1132.21 Q20.5062 1132.88 17.4043 1136.1 Q14.3025 1139.29 8.65439 1145.06 Z" fill="#000000" fill-rule="evenodd" fill-opacity="1" /><path clip-path="url(#clip840)" d="M 0 0 M30.0895 1114.43 L48.4458 1114.43 L48.4458 1118.37 L34.3718 1118.37 L34.3718 1126.84 Q35.3904 1126.49 36.4089 1126.33 Q37.4274 1126.14 38.4459 1126.14 Q44.2329 1126.14 47.6125 1129.32 Q50.9921 1132.49 50.9921 1137.9 Q50.9921 1143.48 47.5199 1146.58 Q44.0477 1149.66 37.7283 1149.66 Q35.5524 1149.66 33.2839 1149.29 Q31.0385 1148.92 28.6311 1148.18 L28.6311 1143.48 Q30.7145 1144.62 32.9367 1145.17 Q35.1589 1145.73 37.6357 1145.73 Q41.6403 1145.73 43.9783 1143.62 Q46.3162 1141.51 46.3162 1137.9 Q46.3162 1134.29 43.9783 1132.19 Q41.6403 1130.08 37.6357 1130.08 Q35.7607 1130.08 33.8857 1130.5 Q32.0339 1130.91 30.0895 1131.79 L30.0895 1114.43 Z" fill="#000000" fill-rule="evenodd" fill-opacity="1" /><path clip-path="url(#clip840)" d="M 0 0 M-23.938 769.925 Q-27.5491 769.925 -29.3778 773.489 Q-31.1834 777.031 -31.1834 784.161 Q-31.1834 791.267 -29.3778 794.832 Q-27.5491 798.374 -23.938 798.374 Q-20.3038 798.374 -18.4982 794.832 Q-16.6695 791.267 -16.6695 784.161 Q-16.6695 777.031 -18.4982 773.489 Q-20.3038 769.925 -23.938 769.925 M-23.938 766.221 Q-18.1279 766.221 -15.0723 770.827 Q-11.9936 775.411 -11.9936 784.161 Q-11.9936 792.888 -15.0723 797.494 Q-18.1279 802.077 -23.938 802.077 Q-29.7482 802.077 -32.8269 797.494 Q-35.8824 792.888 -35.8824 784.161 Q-35.8824 775.411 -32.8269 770.827 Q-29.7482 766.221 -23.938 766.221 Z" fill="#000000" fill-rule="evenodd" fill-opacity="1" /><path clip-path="url(#clip840)" d="M 0 0 M-6.92423 795.526 L-2.04 795.526 L-2.04 801.406 L-6.92423 801.406 L-6.92423 795.526 Z" fill="#000000" fill-rule="evenodd" fill-opacity="1" /><path clip-path="url(#clip840)" d="M 0 0 M3.07572 766.846 L21.4321 766.846 L21.4321 770.781 L7.3581 770.781 L7.3581 779.253 Q8.37661 778.906 9.39513 778.744 Q10.4136 778.559 11.4322 778.559 Q17.2192 778.559 20.5988 781.73 Q23.9784 784.901 23.9784 790.318 Q23.9784 795.897 20.5062 798.999 Q17.034 802.077 10.7146 802.077 Q8.53865 802.077 6.27014 801.707 Q4.02479 801.337 1.61739 800.596 L1.61739 795.897 Q3.70071 797.031 5.92292 797.587 Q8.14513 798.142 10.622 798.142 Q14.6266 798.142 16.9645 796.036 Q19.3025 793.929 19.3025 790.318 Q19.3025 786.707 16.9645 784.601 Q14.6266 782.494 10.622 782.494 Q8.74698 782.494 6.87199 782.911 Q5.02015 783.327 3.07572 784.207 L3.07572 766.846 Z" fill="#000000" fill-rule="evenodd" fill-opacity="1" /><path clip-path="url(#clip840)" d="M 0 0 M39.0477 769.925 Q35.4367 769.925 33.608 773.489 Q31.8024 777.031 31.8024 784.161 Q31.8024 791.267 33.608 794.832 Q35.4367 798.374 39.0477 798.374 Q42.682 798.374 44.4875 794.832 Q46.3162 791.267 46.3162 784.161 Q46.3162 777.031 44.4875 773.489 Q42.682 769.925 39.0477 769.925 M39.0477 766.221 Q44.8579 766.221 47.9134 770.827 Q50.9921 775.411 50.9921 784.161 Q50.9921 792.888 47.9134 797.494 Q44.8579 802.077 39.0477 802.077 Q33.2376 802.077 30.1589 797.494 Q27.1034 792.888 27.1034 784.161 Q27.1034 775.411 30.1589 770.827 Q33.2376 766.221 39.0477 766.221 Z" fill="#000000" fill-rule="evenodd" fill-opacity="1" /><path clip-path="url(#clip840)" d="M 0 0 M-23.0353 422.339 Q-26.6463 422.339 -28.475 425.904 Q-30.2806 429.445 -30.2806 436.575 Q-30.2806 443.681 -28.475 447.246 Q-26.6463 450.788 -23.0353 450.788 Q-19.401 450.788 -17.5955 447.246 Q-15.7668 443.681 -15.7668 436.575 Q-15.7668 429.445 -17.5955 425.904 Q-19.401 422.339 -23.0353 422.339 M-23.0353 418.635 Q-17.2251 418.635 -14.1696 423.242 Q-11.0909 427.825 -11.0909 436.575 Q-11.0909 445.302 -14.1696 449.908 Q-17.2251 454.491 -23.0353 454.491 Q-28.8454 454.491 -31.9241 449.908 Q-34.9796 445.302 -34.9796 436.575 Q-34.9796 427.825 -31.9241 423.242 Q-28.8454 418.635 -23.0353 418.635 Z" fill="#000000" fill-rule="evenodd" fill-opacity="1" /><path clip-path="url(#clip840)" d="M 0 0 M-6.02146 447.941 L-1.13722 447.941 L-1.13722 453.82 L-6.02146 453.82 L-6.02146 447.941 Z" fill="#000000" fill-rule="evenodd" fill-opacity="1" /><path clip-path="url(#clip840)" d="M 0 0 M2.75164 419.26 L24.9737 419.26 L24.9737 421.251 L12.4275 453.82 L7.54328 453.82 L19.3488 423.195 L2.75164 423.195 L2.75164 419.26 Z" fill="#000000" fill-rule="evenodd" fill-opacity="1" /><path clip-path="url(#clip840)" d="M 0 0 M30.0895 419.26 L48.4458 419.26 L48.4458 423.195 L34.3718 423.195 L34.3718 431.668 Q35.3904 431.32 36.4089 431.158 Q37.4274 430.973 38.4459 430.973 Q44.2329 430.973 47.6125 434.144 Q50.9921 437.316 50.9921 442.732 Q50.9921 448.311 47.5199 451.413 Q44.0477 454.491 37.7283 454.491 Q35.5524 454.491 33.2839 454.121 Q31.0385 453.751 28.6311 453.01 L28.6311 448.311 Q30.7145 449.445 32.9367 450.001 Q35.1589 450.556 37.6357 450.556 Q41.6403 450.556 43.9783 448.45 Q46.3162 446.343 46.3162 442.732 Q46.3162 439.121 43.9783 437.015 Q41.6403 434.908 37.6357 434.908 Q35.7607 434.908 33.8857 435.325 Q32.0339 435.742 30.0895 436.621 L30.0895 419.26 Z" fill="#000000" fill-rule="evenodd" fill-opacity="1" /><path clip-path="url(#clip840)" d="M 0 0 M-32.8963 102.299 L-25.2575 102.299 L-25.2575 75.9336 L-33.5676 77.6003 L-33.5676 73.341 L-25.3038 71.6744 L-20.6279 71.6744 L-20.6279 102.299 L-12.989 102.299 L-12.989 106.234 L-32.8963 106.234 L-32.8963 102.299 Z" fill="#000000" fill-rule="evenodd" fill-opacity="1" /><path clip-path="url(#clip840)" d="M 0 0 M-7.9196 100.355 L-3.03536 100.355 L-3.03536 106.234 L-7.9196 106.234 L-7.9196 100.355 Z" fill="#000000" fill-rule="evenodd" fill-opacity="1" /><path clip-path="url(#clip840)" d="M 0 0 M12.034 74.7531 Q8.42291 74.7531 6.59422 78.3179 Q4.78867 81.8595 4.78867 88.9891 Q4.78867 96.0956 6.59422 99.6604 Q8.42291 103.202 12.034 103.202 Q15.6682 103.202 17.4738 99.6604 Q19.3025 96.0956 19.3025 88.9891 Q19.3025 81.8595 17.4738 78.3179 Q15.6682 74.7531 12.034 74.7531 M12.034 71.0494 Q17.8442 71.0494 20.8997 75.6559 Q23.9784 80.2392 23.9784 88.9891 Q23.9784 97.7159 20.8997 102.322 Q17.8442 106.906 12.034 106.906 Q6.22385 106.906 3.14516 102.322 Q0.089621 97.7159 0.089621 88.9891 Q0.089621 80.2392 3.14516 75.6559 Q6.22385 71.0494 12.034 71.0494 Z" fill="#000000" fill-rule="evenodd" fill-opacity="1" /><path clip-path="url(#clip840)" d="M 0 0 M39.0477 74.7531 Q35.4367 74.7531 33.608 78.3179 Q31.8024 81.8595 31.8024 88.9891 Q31.8024 96.0956 33.608 99.6604 Q35.4367 103.202 39.0477 103.202 Q42.682 103.202 44.4875 99.6604 Q46.3162 96.0956 46.3162 88.9891 Q46.3162 81.8595 44.4875 78.3179 Q42.682 74.7531 39.0477 74.7531 M39.0477 71.0494 Q44.8579 71.0494 47.9134 75.6559 Q50.9921 80.2392 50.9921 88.9891 Q50.9921 97.7159 47.9134 102.322 Q44.8579 106.906 39.0477 106.906 Q33.2376 106.906 30.1589 102.322 Q27.1034 97.7159 27.1034 88.9891 Q27.1034 80.2392 30.1589 75.6559 Q33.2376 71.0494 39.0477 71.0494 Z" fill="#000000" fill-rule="evenodd" fill-opacity="1" /><path clip-path="url(#clip842)" d="
M524.702 1479.3 L524.702 88.9544 L1915.05 1479.3 L524.702 1479.3 L524.702 1479.3 Z
" fill="#009af9" fill-rule="evenodd" fill-opacity="1"/>
<polyline clip-path="url(#clip842)" style="stroke:#000000; stroke-width:4; stroke-opacity:1; fill:none" points="
524.702,1479.3 524.702,88.9544 1915.05,1479.3 524.702,1479.3
"/>
</svg>
<p>See <a href="https://github.com/JuliaPolyhedra/Polyhedra.jl/blob/master/examples/Polyhedral%20Function.ipynb">Polyhedral Function</a> and <a href="https://github.com/JuliaPolyhedra/Polyhedra.jl/blob/master/examples/3D%20Plotting%20a%20projection%20of%20the%204D%20permutahedron.ipynb">3D Plotting a projection of the 4D permutahedron</a> for example notebooks.</p><h2 id="D-plotting-with-Plots-2"><a class="docs-heading-anchor" href="#D-plotting-with-Plots-2">3D plotting with Plots</a><a class="docs-heading-anchor-permalink" href="#D-plotting-with-Plots-2" title="Permalink"></a></h2><p>A 3-dimensional polyhedron can be visualized with either <a href="https://github.com/rdeits/MeshCat.jl">MeshCat</a> or <a href="https://github.com/JuliaPlots/Makie.jl">Makie</a>. Unbounded polyhedron are supported by truncating the polyhedron into a polytope and not triangularizing the faces in the directions of unbounded rays.</p><p>Suppose for instance that we want to visualize the polyhedron having the following H-representation:</p><pre><code class="language-julia-repl">julia> using Polyhedra
julia> v = convexhull([0, 0, 0]) + conichull([1, 0, 0], [0, 1, 0], [0, 0, 1])
V-representation Polyhedra.Hull{Int64,Array{Int64,1},Int64}:
1-element iterator of Array{Int64,1}:
[0, 0, 0],
3-element iterator of Ray{Int64,Array{Int64,1}}:
Ray([1, 0, 0])
Ray([0, 1, 0])
Ray([0, 0, 1])</code></pre><p>The V-representation cannot be given to <a href="https://github.com/rdeits/MeshCat.jl">MeshCat</a> or <a href="https://github.com/JuliaPlots/Makie.jl">Makie</a> directly, it first need to be transformed into a polyhedron:</p><pre><code class="language-julia-repl">julia> p = polyhedron(v)
Polyhedron DefaultPolyhedron{Rational{BigInt},Polyhedra.Intersection{Rational{BigInt},Array{Rational{BigInt},1},Int64},Polyhedra.Hull{Rational{BigInt},Array{Rational{BigInt},1},Int64}}:
1-element iterator of Array{Rational{BigInt},1}:
Rational{BigInt}[0//1, 0//1, 0//1],
3-element iterator of Ray{Rational{BigInt},Array{Rational{BigInt},1}}:
Ray(Rational{BigInt}[1//1, 0//1, 0//1])
Ray(Rational{BigInt}[0//1, 1//1, 0//1])
Ray(Rational{BigInt}[0//1, 0//1, 1//1])</code></pre><p>Then, we need to create a mess from the polyhedron:</p><pre><code class="language-julia-repl">julia> m = Polyhedra.Mesh(p)
Polyhedra.Mesh{3,Rational{BigInt},DefaultPolyhedron{Rational{BigInt},Polyhedra.Intersection{Rational{BigInt},Array{Rational{BigInt},1},Int64},Polyhedra.Hull{Rational{BigInt},Array{Rational{BigInt},1},Int64}}}(convexhull([0//1, 0//1, 0//1]) + convexhull(Ray(Rational{BigInt}[1//1, 0//1, 0//1]), Ray(Rational{BigInt}[0//1, 1//1, 0//1]), Ray(Rational{BigInt}[0//1, 0//1, 1//1])), nothing, nothing, nothing)</code></pre><article class="docstring"><header><a class="docstring-binding" id="Polyhedra.Mesh" href="#Polyhedra.Mesh"><code>Polyhedra.Mesh</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia">struct Mesh{N, T, PT <: Polyhedron{T}} <: GeometryBasics.GeometryPrimitive{N, T}
polyhedron::PT
coordinates::Union{Nothing, Vector{GeometryBasics.Point{3, T}}}
faces::Union{Nothing, Vector{GeometryBasics.TriangleFace{Int}}}
normals::Union{Nothing, Vector{GeometryBasics.Point{3, T}}}
end</code></pre><p>Mesh wrapper type that inherits from <code>GeometryPrimitive</code> to be used for plotting a polyhedron. Note that <code>Mesh(p)</code> is type unstable but one can use <code>Mesh{3}(p)</code> instead if it is known that <code>p</code> is defined in a 3-dimensional space.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/JuliaPolyhedra/Polyhedra.jl/blob/b6490a256f0b56e11f01431a953f892c03af03d2/src/decompose.jl#L3-L14">source</a></section></article><p>The polyhedron can be plotted with <a href="https://github.com/rdeits/MeshCat.jl">MeshCat</a> as follows</p><pre><code class="language-julia">julia> using MeshCat
julia> vis = Visualizer()
julia> setobject!(vis, m)
julia> open(vis)</code></pre><p>To plot it in a notebook, replace <code>open(vis)</code> with <code>IJuliaCell(vis)</code>.</p><p>To plot it with <a href="https://github.com/JuliaPlots/Makie.jl">Makie</a> instead, you can use for instance <code>mesh</code> or <code>wireframe</code>.</p><pre><code class="language-julia">julia> import Makie
julia> Makie.mesh(m, color=:blue)
julia> Makie.wireframe(m)</code></pre><p>See <a href="https://github.com/JuliaPolyhedra/Polyhedra.jl/blob/master/examples/3D%20Plotting%20a%20projection%20of%20the%204D%20permutahedron.ipynb">3D Plotting a projection of the 4D permutahedron</a> for an example notebook.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../polyhedron/">« Polyhedron</a><a class="docs-footer-nextpage" href="../redundancy/">Containment/Redundancy »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> on <span class="colophon-date" title="Wednesday 30 December 2020 11:55">Wednesday 30 December 2020</span>. Using Julia version 1.5.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>