To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cadOpen lugnet.cad in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / 6354
6353  |  6355
Subject: 
RE: Sorting parts by location
Newsgroups: 
lugnet.cad
Date: 
Tue, 28 Aug 2001 13:09:21 GMT
Reply-To: 
<BRAM@PO.ihatespamCWRU.EDU>
Viewed: 
1137 times
  
Larry Pieniazek writes:
> If you have the formula for euclidian distance that would be
> great too. I am using the approximation of taking the X Y anx Z
> values and summing them. If the viewpoint is in the right place
> that's an excellent approximation.

If the viewpoint is at location (a,b,c) and the part is at (x,y,z), then the
distance between them is:

((a-x)^2 + (b-y)^2 + (c-z)^2)^0.5

Since all you want to do is sort, there's no need to take the square root
after summing the squares.
HTH,
--Bram


Bram Lambrecht
bram@cwru.edu
http://bldesign.org/



Message is in Reply To:
  Re: Sorting parts by location
 
(...) Well I am sort of doing that right now, although not in perl. I chose to use my company's product, sort of as a learning exercise. If someone has perl code that recognises the various line types that would be spiffy. If you have the formula (...) (25 years ago, 28-Aug-01, to lugnet.cad)

7 Messages in This Thread:



Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR