Questions tagged [convex-hull]

Convex-hull of a set of points X in a Euclidean space is the convex set with smallest area that contains all points of X.

538 questions
3
votes
1 answer

Javascript 3D convex-hull algorithm similar to Matlab's convhulln

I've been struggling to find a convex-hull library for Javascript that gives the same output as the Matlab convhulln function. I am transcribing some code from Matlab to Javascript and I need to find triangles that make up the convex hull of a set…
Iapetus
  • 119
  • 1
  • 10
3
votes
3 answers

R: Find a shape from a point cloud

I have a point cloud like such below df <- data.frame(x=c(2,3,3,5,6,2,6,7,7,4,3,8,9,10,10,12,11,12,14,15), y=c(6,5,4,4,4,4,3,3,2,3,7,3,2,3,4,6,5,5,4,6)) plot(df,xlab="",ylab="",pch=20) Think of them as gps coordinates of movement by…
mindlessgreen
  • 11,059
  • 16
  • 68
  • 113
3
votes
1 answer

Finding edge from 2d points Python

I have several 2d sets of scattered data that I would like to find the edges of. Some edges may be open lines, others may be polygons. For example, here is one plot that has an open edge that I would like to be able to keep. I would actually like to…
Chris
  • 431
  • 5
  • 16
3
votes
1 answer

Strategy for isolating 3d data points

I have two sets of points, one from an analysis and another that I will use for the results of post-processing on the analysis data. The analysis data, in black, is scattered. The points used for results are red. Here are the two sets on the same…
Chris
  • 431
  • 5
  • 16
3
votes
3 answers

Orthogonal hull algorithm

I am trying to find a way to determine the rectilinear polygon from a set of integer points (indicated by the red dots in the pictures below). The image below shows what I would like to achieve: 1. I need only the minimal set of points that define…
Alex
  • 1,322
  • 1
  • 20
  • 44
3
votes
1 answer

Erroneous points produced on convex hull despite following Graham scan

I've essentially followed the wikipedia entry for Graham scan every step of the way as I've coded this little convex hull visualizer. It generally works as intended, but at much higher input sizes there are often erroneous points. The program starts…
MattDs17
  • 401
  • 1
  • 4
  • 20
3
votes
1 answer

python: scipy.spatial: draw a convex polygon and calculate the area

I am using python. Now I have some coordinates (earth plane coordinates) and I want to draw a convex polygon based on these coordinates. Besides, I need to save the polygon into a GeoJSON format and calculate the polygon area. I heard that…
gladys0313
  • 2,569
  • 6
  • 27
  • 51
3
votes
2 answers

how can you practically solve the convex hull when there are floating precision issues?

Suppose that you have 100000 points on the curve y = x^2. You want to find the convex hull of these points. All the coordinates are floating numbers. In my graham scan implementation the only place where I operate on floating numbers is when I…
jsguy
  • 2,069
  • 1
  • 25
  • 36
3
votes
1 answer

ConvexHull not accurate enough - alternatives?

I have a cluster consistent of about 25k points and I want to find the borders. It works with ConvexHull, but the result is that I only get about 19 coordinates as output. This is definitely too few. Here is the sample code from the SciPy…
FrankTheTank
  • 1,579
  • 4
  • 14
  • 19
3
votes
2 answers

Distance to convexHull

I have been searching for a method to compute a distance to a convexHull/polygon such that the distance is positive if the point is within the hull and negative if outside. For example, given a hull and a set of points, can the positive/negative…
user3685329
  • 81
  • 1
  • 6
3
votes
2 answers

Create convex hull around points with JavaScript

I want to create a hull around images created with KineticJS. 1 - I save all vertices of the images in an array with [x,y]: var points = [[0, 0], [0,350], [170, 0], [170, 300], [135, 135] , [135, 435], [305, 135], [305, 435]]; 2 - I want to create…
sumisu
  • 135
  • 1
  • 4
  • 12
3
votes
2 answers

Why stack in convex hull

I was reserarching about Convex hull and Graham Scan to implement it and It drew my attention that everyone has used stacks. So I wanted to ask why are the stacks used in the algoithm precisely, what's the benefit of using stacks?
Ege
  • 941
  • 4
  • 17
  • 36
3
votes
1 answer

Finding the minimum bounding box of a convex hull

Let's say that I have a n sided convex hull, now how do I get the Right/Left Top/Bottom corners of said convex hull, now let's say that maybe N is 3 and the triangle coordinates are 0,0 50,0 0,50 or something else, we know what the corners are and…
Slymodi
  • 185
  • 3
  • 13
3
votes
1 answer

convex hull code of "competitive programming 1"

I'm trying to understand the "convex hull" algorithm in Steven Halim and Felix Halim's book Competitive Programming. The "convex hull" problem is, given a collection P of n points in a plane, to find a subset CH(P) that forms the vertices of a…
aroup
  • 315
  • 3
  • 13
3
votes
1 answer

Writing ELKI DBSCAN convex hull of clusters to file

I have started using ELKI for data analysis, but one seemingly simple thing I cannot seem to do is output the calculated convex hull of clusters to a file after running DBSCAN. I am able to visualize the convex hulls via the visualization gui, but…
whistler
  • 876
  • 2
  • 15
  • 31