computational-geometry

How can I test if a point lies within a 3d shape with its surface defined by a point cloud?

纵然是瞬间 提交于 2020-01-10 18:45:09
问题 I have a collection of points which describe the surface of a shape that should be roughly spherical, and I need a method with which to determine if any other given point lies within this shape. I've previously been approximating the shape as an exact sphere, but this has proven too inaccurate and I need a more accurate method. Simplicity and speed is favourable over complete accuracy, a good approximation will suffice. I've come across techniques for converting a point cloud to a 3d mesh,

determine if line segment is inside polygon

流过昼夜 提交于 2020-01-09 10:57:20
问题 suppose we have convex polygon with vertices (v0,v1,....vn) my aim is to determine if for given point p(x,y) any line segment connecting this point and any vertices of polygon is inside polygon or even for given two point p(x0,y0) `p(x1,y1)` line segment connecting these two point is inside polygon? i have searched many sites about this ,but i am still confused,generally i think we have to compare coordinates of vertices and by determing coordinates of which point is less or greater to

Maps api: check if a marker falls to the left or right of a polyline

扶醉桌前 提交于 2020-01-07 06:40:06
问题 I'm currently developing an app using maps API, I have a polyline that is that start as LatLnt one and ends at LatLng two creating a straight line. If I have a Marker that falls somewhere close to this polyline how would I tell if the marker is to the left or to the right of the polyline? Are there any API utils that handles such geometric calculations? 回答1: You have coordinates L0, L1 for starting and ending points of line and marker coordinate P. Find azimuths for directions L0-L1 and L0-P

compute slope of a 3D plane

≯℡__Kan透↙ 提交于 2020-01-06 04:27:10
问题 I have a set of (X,Y,Z) points representing different planar features. I need to calculate the slope of each plane using normal vectors. i think slope is given by the angle between normal vector (NV) of each plane and NV of imaginary horizontal plane. Assume, the plane equation that I use is; Ax+By+c=z. Then i guess the normal vector of my plane is (a,b, -1). For my plane equation, what should be the equation of imaginary horizontal plane? I think equation of horizontal plane is z=c. Hence,

Priority Search Tree confusion

前提是你 提交于 2020-01-06 02:49:15
问题 The only reasonable slide set I found is this, which in page 15 says, for building: Sort all points by their x coordinate value and store them in the leaf nodes of a balanced binary tree (i.e., a range tree) Starting at the root, each node contains the point in its subtree with the maximum value for its y coordinate that has not been stored at a shallower depth in the tree; if no such node exists, then node is empty I implemented a Range Tree just before, so based on the example I used there,

Find indices of polygon vertices nearest to a point

我的梦境 提交于 2020-01-06 01:25:17
问题 Heading I need to find the indices of the polygon nearest to a point So in this case the ouput would be 4 and 0. Such that if the red point is added I know to where to place the vertex in the array. Does anyone know where to start? (Sorry if the title is misleading, I wasnt sure how to phrase it properly) In this case the ouput would be 0 and 1, rather than the closest 4. 回答1: Point P lies on the segment AB , if two simple conditions are met together: AP x PB = 0 //cross product, vectors are

Intersection of 2 polyhedra using intersectn() R

一世执手 提交于 2020-01-05 04:21:10
问题 I have 2 polyhedra generated by the following extreme points: df1 = structure(c(3, 5, 8, 6), .Dim = c(2L, 2L)) df2 = structure(c(2, 4, 9, 7), .Dim = c(2L, 2L)) Those points, taken as constraint inequalities, create a space. I would like to select the hull formed by the intersection of those 2 polyhedra. The use of the function intersectn() from the geometry package, but I get the following error. Error in convhulln(ps1, "n FA") : Received error code 1 from qhull. Qhull error: QH6214 qhull

How to “average” two or more geography linestrings using C#/SQL Server 2008 spatial

大憨熊 提交于 2020-01-03 17:01:20
问题 Suppose I've got a set of results from a study into the behaviour of a particular migratory bird. The bird has been tagged, and a GPS receiver records the migration path it follows each year over a five year period. The results are stored in a SQL Server table that contains one geography linestring for each year's path. How would you go about defining the linestring representing the "average" path followed over the five year period? Note that each sample linestring may contain a different

Efficiently checking Euclidean distance for a large number of objects in Python

这一生的挚爱 提交于 2020-01-03 09:03:27
问题 In a route planning algorithm, I'm trying to perform a filter on a list of nodes based on distance to another node. I'm actually pulling the lists from a crude scene graph. I use the term "cell" to refer to a volume within a simple scenegraph from which we've fetched a list of nodes that are close to each other. Right now, I'm implementing this as: # SSCCE version of the core function def nodes_in_range(src, cell, maxDist): srcX, srcY, srcZ = src.x, src.y, src.z maxDistSq = maxDist ** 2 for

Check if CGRect is contained within another (transformed) rect

一曲冷凌霜 提交于 2020-01-03 04:32:51
问题 I'm implementing a cropping feature and I'm trying to figure out how to test whether the crop rectangle is fully contained within the transformed image view. i.e. there should be no whitespace in the cropped portion of the image. I've tried to copy the behavior as implemented in this component: https://github.com/heitorfr/ios-image-editor, which implements a similar check (see below), but I can't get it to work for my situation. - (void)checkBoundsWithTransform:(CGAffineTransform)transform {