computational-geometry

3D Connected Points Labeling based on Euclidean distances

别来无恙 提交于 2019-12-04 12:29:21
Currently, I am working on a project that is trying to group 3d points from a dataset by specifying connectivity as a minimum euclidean distance. My algorithm right now is simply a 3d adaptation of the naive flood fill. size_t PointSegmenter::growRegion(size_t & seed, size_t segNumber) { size_t numPointsLabeled = 0; //alias for points to avoid retyping vector<Point3d> & points = _img.points; deque<size_t> ptQueue; ptQueue.push_back(seed); points[seed].setLabel(segNumber); while (!ptQueue.empty()) { size_t currentIdx = ptQueue.front(); ptQueue.pop_front(); points[currentIdx].setLabel(segNumber)

Boost Geometry and exact point types

北城余情 提交于 2019-12-04 11:56:33
I am currently working on a project which deals with geometric problems. Since this project will be used commercially I cannot use libraries like CGAL. I am currently using boost::geometry with inexact types but I encountered numeric issues. I tried to simply use an exact point type from boost::multiprecision but it doesn't compile when I call boost::geometry functions. I found this page which shows how to use a numeric_adaptor to use boost::geometry with exact number types. However, it seems outdated and I wasn't able to make it work. Can boost::geometry be used with exact number types ? How

How to find a random point in a quadrangle?

左心房为你撑大大i 提交于 2019-12-04 11:17:56
问题 I have to be able to set a random location for a waypoint for a flight sim. The maths challenge is straightforward: "To find a single random location within a quadrangle, where there's an equal chance of the point being at any location." Visually like this: An example ABCD quadrangle is: A:[21417.78 37105.97] B:[38197.32 24009.74] C:[1364.19 2455.54] D:[1227.77 37378.81] Thanks in advance for any help you can provide. :-) EDIT Thanks all for your replies. I'll be taking a look at this at the

Adaptive implicit surface polygonization

瘦欲@ 提交于 2019-12-04 11:15:50
问题 I've been using one of the older implicit surface algorithms, due to Bloomenthal, as found here, basically the tetrahedral-based algorithm. This works fairly well, but has a shortcoming. Since it uses a fixed grid, it either wastes polygons or ignores detail, depending on the grid size selected. So my question is, what are my options for improving this? Are there any freely available (source or good description) implicit surface algorithms which are more adaptive to the curvature of the model

Finding near neighbors

谁说胖子不能爱 提交于 2019-12-04 10:12:36
问题 I need to find "near" neighbors among a set of points. There are 10 points in the above image. Red lines are edges from the Delaunay Triangulation, black stars mark the mid-lines of the edges, blue lines are the Voronoi tesselation. Point 1 has three "near" neighbors, i.e. 4, 6, and 7, but not 2 and 3, who are almost in line with the edge 1-7, but much further away. What is a good way to identify the near neighbors (or "good" edges)? Looking at the figure, it seems to me that either selecting

How to find the nearest line segment to a specific point more efficently?

 ̄綄美尐妖づ 提交于 2019-12-04 09:39:54
This is a problem I came across frequently and I'm searching a more effective way to solve it. Take a look at this pics: Let's say you want to find the shortest distance from the red point to a line segment a n . Assume you only know the start/end point (x,y) of the segments and the point. Now this can be done in O(n), where n are the line segments, by checking every distance from the point to a line segment. This is IMO not effective, because in the worst case there have to be n-1 distance checks till the right one is found. This can be a real performance issue for n = 1000 f.e. (which is a

Identifying the original edge of a union polygon

我们两清 提交于 2019-12-04 09:12:51
I have a lot of polygons, and after I do a union of all these polygons, I get a new, big polygon. The union algorithm is a black box and using third-party-library process, which I couldn't control, and neither can I hope to extract any information out kind of progress. Is there efficient way for me to know, for every edge of that big gigantic unionized polygon, which of it is belonging to which edge of the smaller polygon? A brute force way to solve this problem is to compare every edge of the unionized polygon with each of the smaller polygons, but this is going to be very inefficient. Any

Given two (large) sets of points, how can I efficiently find pairs that are nearest to each other?

空扰寡人 提交于 2019-12-04 08:03:57
问题 This question was migrated from Software Engineering Stack Exchange because it can be answered on Stack Overflow. Migrated 8 years ago . I need to solve a computational problem that boils down to searching for reciprocally-nearest pairs of points between two sets. The problem goes something like this: Given a set of points A and a set of points B in euclidean space, find all pairs (a,b) such that b is the closest point in B to a and a is the closest point in A to b. The sets A and B are of

Surface reconstruction from 2 planar contours [closed]

时光毁灭记忆、已成空白 提交于 2019-12-04 07:46:25
There is a class of algorithms for triangulation between two planar contours. These algorithms try to make a "good triangulation" to fill a space between these contours: One of them ( Optimal surface reconstruction from planar contours ) is based on the dynamic programming technique and uses a cost function for determining which triangulation is acceptable according to the minimum cost. A minimal triangle area as a cost function makes a good result in most of cases ( Triangulation of Branching Contours using Area Minimization ), but, unfortunately, not in all of them. For example when you have

AS3 How to create double sided MovieClip which when rotation shows the other side as well?

好久不见. 提交于 2019-12-04 06:46:37
问题 I have a movie clip which has two frames. On the first frame I have the front side and on the second I have the back. I am rotating the MovieClip by rotationX, rotationY, rotationZ properties. I want to display the frame 2 when the MovieClip rotates. Please help. I dont want to use PaperVision class. Also, please consider the Perspective View of the scene. Sometimes, the MovieClip might not only be dependent on rotation. It is also equally dependent on the position (only in Perspective View).