using Polyhedra, CDDLib P1 = polyhedron(vrep(randn(15, 2)), CDDLib.Library()) P2 = polyhedron(vrep(randn(15, 2)), CDDLib.Library()) Pint = intersect(P1, P2) hrepiscomputed(P1), vrepiscomputed(P1) hrepiscomputed(P2), vrepiscomputed(P2) hrepiscomputed(Pint), vrepiscomputed(Pint) npoints(Pint) hrepiscomputed(Pint), vrepiscomputed(Pint) using Plots plot(P1, alpha=0.2, color="blue") plot!(P2, color="red", alpha=0.2) plot!(Pint, color="yellow", alpha=0.6) Pch = convexhull(P1, P2) npoints(Pch) plot(P1, alpha=0.2, color="blue") plot!(P2, color="red", alpha=0.2) plot!(Pch, color="green", alpha=0.1) hrepiscomputed(P1), hrepiscomputed(P2), hrepiscomputed(Pint) # each of Q1 and Q2 has 15 vertices Q1 = polyhedron(vrep(randn(15, 2)), CDDLib.Library()) Q2 = polyhedron(vrep(randn(15, 2)), CDDLib.Library()) # check that their convex hull has 30 vertices Qch = convexhull(Q1, Q2) npoints(Qch) removevredundancy!(Qch) npoints(Qch)