473,382 Members | 1,421 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

How to find duplicate 3d points?

I have a large data file of upto 1 million x,y,z coordinates of
points. I want to identify which points are within 0.01 mm from each
other. I can compare the distance from each point to every other
point , but this takes 1 million * 1 million operations, or forever!

Any quick way to do it, perhaps by inserting just the integer portion
of the coordinates into an array, and checking if the integer has
already been defined before inserting a new point?
Jun 27 '08 #1
2 2399
On Jun 11, 11:35*am, oprah.cho...@gmail.com wrote:
I have a large data file of upto 1 million x,y,z coordinates of
points. I want to identify which points are within 0.01 mm from each
other. I can compare the distance from each point to every other
point , but this takes 1 million * 1 million operations, or forever!

Any quick way to do it, perhaps by inserting just the integer portion
of the coordinates into an array, and checking if the integer has
already been defined before inserting a new point?
what many people do when doing collision detection in 3d games in
instead of having one massive list of the vertices will break the
field into bounding boxes. in the 2d situation that would look like
this.

|----|----|----|----|
|. . | | .| |
|----|----|----|----|
|. |. | . |. |
|----|----|----|----|
| | . | . | |
|----|----|----|----|
| | | | . .|
|----|----|----|----|

That so instead of comparing all points against all other points
instead sort them into bounding cubes. that should make doing the
comparisons more reasonable. now the only sticky bit will be comparing
two vertices that are in two different boxes but so close to the edges
that they are under .01mm from each other. in this situation if a
point is less that .01mm from any edge of its bounding cube you must
compare it against the points in the adjacent cubes.

hope this helps a bit.

cheers
Tim Henderson
Jun 27 '08 #2
op**********@gmail.com wrote:
I have a large data file of upto 1 million x,y,z coordinates of
points. I want to identify which points are within 0.01 mm from each
other. I can compare the distance from each point to every other
point , but this takes 1 million * 1 million operations, or forever!

Any quick way to do it, perhaps by inserting just the integer portion
of the coordinates into an array, and checking if the integer has
already been defined before inserting a new point?
--
http://mail.python.org/mailman/listinfo/python-list
There is a whole field of Math/CS research on problems like this called
Computational Geometry. It provides many algorithms for many geometric
problems, including things like this.

In particular, to categorize a list of points and find the
NearestNeighbor, I'd suggest a KD-tree. I believe this would turn your
problem from O(N^2) to O(N log n) or so.

Happy google-ing and good luck.

Gary Herron

Jun 27 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: F C | last post by:
I have http://localhost/myweb1 who redirect me to my pages. I would like to have http://localhost/myweb2 which I would like to use the same exact set of pages, except a different global.asa...
2
by: Richard | last post by:
Hi Everyone, I have a table in which their is record which is exactly same. I want to delete all the duplicate keeping ony 1 record in a table. Example Table A Empid currentmonth ...
6
by: nick4soup | last post by:
I have read the CGI FAQ 'How can I avoid users hitting "submit" twice' (on http://www.htmlhelp.org/faq/cgifaq.3.html#19 ) which essentially says you have to detect it at the server, using a...
3
by: deko | last post by:
I'm using Access 2003 on WinXP-SP2. I open mydb.mdb from Windows Explorer, or from a shortcut that points to the mdb. The problem is every time I open mydb.mdb, a duplicate is created -...
1
by: aknoch | last post by:
My basic situation is this - I ONLY want duplicates, so the opposite of DISTINCT: I have two tables. Ordinarily, Table1ColumnA corresponds in a one to one ratio with Table2ColumnB through a...
5
by: JD | last post by:
Hi, There are about 10+ 3-D points on the same line. I want to find the two end points from these points. The efficiency is not an issue because there are only 10 points or so. I just need a...
5
by: Sheol | last post by:
Hello everyone! Can somebody please help me with this... I have a VB program that inputs Name and Address. I've made a database in MS Access using ADO Control: Table Name: Contacts Fields are:...
2
by: raphael001 | last post by:
In my Visual Basic program I'm just trying to find duplicate values entered into an array from an inputbox, but i can't seem to get the coding right on the final part to check for duplicate values...
0
by: =?Utf-8?B?UGF1bCBIYWdlcg==?= | last post by:
I've been trying to solve this issue for the better part of a month. My attempts to get an answer on the MSDN groups proved to no avail. Here is the situation/problem. I am migrating an old...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.