Skip to content

unexpected behavior of compas.geometry.convex_hull? #1430

@chenkasirer

Description

@chenkasirer

Not sure about this one, maybe I'm using it wrong but getting an unexpected result when running convex_hull (the pure python one) on a collection of co-planar points.

To Reproduce

  1. Create planar surface in Rhino with a cutout along one of the edges.
  2. Run following GH code:
from compas.geometry import Point, convex_hull
from compas.scene import Scene

vertex_locations = [Point(*vertex.Location) for vertex in brep.Vertices]

hull = convex_hull(vertex_locations)

scene = Scene()
for face in hull:
    for v_index in face:
        scene.add(vertex_locations[v_index])

a = scene.draw()

I'd expect only the points along the convex outline of the surface to return but two internal points are included:

Image

Desktop (please complete the following information):

  • OS: Windows
  • Python version 3.9

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions