plane

Fast plane fitting to many points

落爺英雄遲暮 提交于 2019-11-27 22:28:36
问题 I'm looking to fit a plane to a set of ~ 6-10k 3D points. I'm looking to do this as fast as possible, and accuracy is not the highest concern (frankly the plane can be off by +-10 degrees in any of the cardinal axes). My current approach is to use best of best fit, but it's incredibly slow (I'm hoping to extract planes at a rate of about 10-50k times each time I run the algorithm, and at this rate it would finish in weeks, as opposed to hours) as it works on all possible combinations of 6000

Generate a plane with triangle strips

ぐ巨炮叔叔 提交于 2019-11-27 17:08:25
What would be the best algorithm to generate a list of vertices to draw a plane using triangle strips? I'm looking for a function which receives the plane's width and height and returns a float array containing correctly indexed vertices. width represents the number of vertices per row. height represents the number of vertices per column. float* getVertices( int width, int height ) { ... } void render() { glEnableClientState(GL_VERTEX_ARRAY); glVertexPointer(3, GL_FLOAT, 0, getVertices(width,heigth)); glDrawArrays(GL_TRIANGLE_STRIP, 0, width*height); glDisableClientState(GL_VERTEX_ARRAY); }

Matplotlib - Plot a plane and points in 3D simultaneously

早过忘川 提交于 2019-11-27 08:55:36
I m trying to plot simultaneously a plane and some points in 3D with Matplotlib. I have no errors just the point will not appear. I can plot at different times some points and planes but never at same time. The part of the code looks like : import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D point = np.array([1, 2, 3]) normal = np.array([1, 1, 2]) point2 = np.array([10, 50, 50]) # a plane is a*x+b*y+c*z+d=0 # [a,b,c] is the normal. Thus, we have to calculate # d and we're set d = -point.dot(normal) # create x,y xx, yy = np.meshgrid(range(10), range(10)) #

Line of intersection between two planes

﹥>﹥吖頭↗ 提交于 2019-11-27 07:29:06
How can I find the line of intersection between two planes? I know the mathematics idea, and I did the cross product between the the planes normal vectors but how to get the line from the resulted vector programmatically Adding this answer for completeness, since at time of writing, none of the answers here contain a working code-example which directly addresses the question. Though other answers here already covered the principles . Finding the line between two planes can be calculated using a simplified version of the 3-plane intersection algorithm. The 2'nd, "more robust method" from

Matplotlib - Plot a plane and points in 3D simultaneously

不问归期 提交于 2019-11-27 04:00:50
问题 I m trying to plot simultaneously a plane and some points in 3D with Matplotlib. I have no errors just the point will not appear. I can plot at different times some points and planes but never at same time. The part of the code looks like : import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D point = np.array([1, 2, 3]) normal = np.array([1, 1, 2]) point2 = np.array([10, 50, 50]) # a plane is a*x+b*y+c*z+d=0 # [a,b,c] is the normal. Thus, we have to

Projecting 3D points to 2D plane [closed]

混江龙づ霸主 提交于 2019-11-27 03:24:17
Let A be a point for which I have the 3D coordinates x, y, z and I want to transform them into 2D coordinates: x, y. The projection shall be orthogonal on a plane defined by a given normal. The trivial case, where the normal is actually one of the axes, it's easy to solve, simply eliminating a coordinate, but how about the other cases, which are more likely to happen? ja72 If you have your target point P with coordinates r_P = (x,y,z) and a plane with normal n=(nx,ny,nz) you need to define an origin on the plane, as well as two orthogonal directions for x and y . For example if your origin is

Fast algorithm to find the x closest points to a given point on a plane

安稳与你 提交于 2019-11-27 01:40:47
问题 I would like to find a fast algorithm in order to find the x closest points to a given point on a plane. We are actually dealing with not too many points (between 1,000 and 100,000), but I need the x closest points for every of these points. (where x usually will be between 5 and 20.) I need to write it in C#. A bit more context about the use case: These points are coordinates on a map. (I know, this means we are not exactly talking about a plane, but I hope to avoid dealing with projection

Line of intersection between two planes

五迷三道 提交于 2019-11-26 22:16:28
问题 How can I find the line of intersection between two planes? I know the mathematics idea, and I did the cross product between the the planes normal vectors but how to get the line from the resulted vector programmatically 回答1: Adding this answer for completeness, since at time of writing, none of the answers here contain a working code-example which directly addresses the question. Though other answers here already covered the principles. Finding the line between two planes can be calculated

Generate a plane with triangle strips

走远了吗. 提交于 2019-11-26 18:49:51
问题 What would be the best algorithm to generate a list of vertices to draw a plane using triangle strips? I'm looking for a function which receives the plane's width and height and returns a float array containing correctly indexed vertices. width represents the number of vertices per row. height represents the number of vertices per column. float* getVertices( int width, int height ) { ... } void render() { glEnableClientState(GL_VERTEX_ARRAY); glVertexPointer(3, GL_FLOAT, 0, getVertices(width

3D Line-Plane Intersection

最后都变了- 提交于 2019-11-26 12:39:34
问题 If given a line (represented by either a vector or two points on the line) how do I find the point at which the line intersects a plane? I\'ve found loads of resources on this but I can\'t understand the equations there (they don\'t seem to be standard algebraic). I would like an equation (no matter how long) that can be interpreted by a standard programming language (I\'m using Java). 回答1: Here is a method in Java that finds the intersection between a line and a plane. There are vector