Skip to content

2D convex hull problem #22

@mkostrun

Description

@mkostrun

I am using GTS to model 3D objects, say cones or balls or cubes.
I have an observer looking at an object, and I calculate projection of the object to observer sensor plane. The object is now 2D collection of points, say [x,y].
I want to find 2D convex hull of those points: convhull_nd_build fails.

Consider projection of a pyramid with 6 points:
point 1 - tip
points 2:5 - along circumference of base
point 6 - center of the base

when i submit these points to conhull to do its bidding, the result is nonsensical:

face idx[1] = 1
face idx[2] = 2
face idx[3] = 2
face idx[4] = 0
face idx[5] = 0
face idx[6] = 3
face idx[7] = 4
face idx[8] = 1
face idx[9] = 3
face idx[10] = 4
face idx[11] = 33
face idx[12] = 0
face idx[13] = 43461056
face idx[14] = 0
face idx[15] = 43462416
convex hull: npts=6, dim=2, n=5
face 1: idxs=[2,3,3]
face 2: idxs=[1,1,4]
face 3: idxs=[5,2,4]
face 4: idxs=[5,34,1]

firstly, faceindices should be triplets of different points. Obviously they are not.
secondly, the indices of points contained in faceindices triplet should be in 0...(npoints-1) but it is all over the place.

am I doing something wrong, or is the code for 3+ dimensions?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions