JuliaPolyhedra / Polyhedra.jl

Polyhedral Computation Interface
Other
172 stars 27 forks source link

Default library fails at calculating convex hull #153

Open fa-bien opened 5 years ago

fa-bien commented 5 years ago

In certain cases the default library does not compute the convex hull of a polyhedron correctly. Here is an MWE where only part of the convex hull is properly displayed:

using Polyhedra
using Makie

points = [[0.707107, -0.5, -0.5], [0.440874, 0.241093, -0.864583], [-0.157346, 0.800639, -0.578118], [-0.637081, 0.757287, 0.143682], [-0.637081, 0.143682, 0.757287], [-0.157346, -0.578118, 0.800639], [0.440874, -0.864583, 0.241093], [1.0, 1.0, 1.0]]

poly1 = polyhedron(vrep(points))
mesh1 = Polyhedra.Mesh(poly1)
scene = Scene()
mesh!(scene, mesh1, color=:white, alpha=0.4, transparency=true)
scatter!(scene, [ Tuple(p) for p in points ])
scatter!(scene, [ Tuple(p) for p in points ],
         marker=['1','2','3','4','5','6','7','8'],
         markersize=.2, marker_offset=Point3f0(0, 0, 30.0))

The incorrect behaviour also happens when visualising with MeshCat; it disappears when using CDDLib.