| | Re: Sorting parts by location Fredrik Glöckner
|
| | (...) No, I don't know of any utility. (...) You could hack up a Perl script which computes the euclidian distance between the viewing point and the origin of each individual part, and concatenates this number to the beginning of each part line. (...) (23 years ago, 28-Aug-01, to lugnet.cad)
|
| | |
| | | | Re: Sorting parts by location Larry Pieniazek
|
| | | | (...) 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 (...) (23 years ago, 28-Aug-01, to lugnet.cad)
|
| | | | |
| | | | | | RE: Sorting parts by location Bram Lambrecht
|
| | | | | | (...) 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, (...) (23 years ago, 28-Aug-01, to lugnet.cad)
|
| | | | | | |
| | | | | | Re: Sorting parts by location Fredrik Glöckner
|
| | | | | (...) Bram Lambrecht gave you the formula. Depending on what you want to do and what kind of viewing transformation (if any) you are using, the euclidian distance _may_ be the wrong kind of measure to use. But it is probably an ok approximation... (...) (23 years ago, 28-Aug-01, to lugnet.cad)
|
| | | | | |
| | | | | | | Re: Sorting parts by location Larry Pieniazek
|
| | | | | (...) Whoops, duh. This thread didn't have any posts for a while and I missed all the other ones, thought yours was the first! (...) Seems to work for me for now. Mostly I am trying to get a rough ordering of a large model so I can refine it to put (...) (23 years ago, 28-Aug-01, to lugnet.cad)
|
| | | | | |
| | | | RE: Sorting parts by location Bram Lambrecht
|
| | | | (...) If an alorithm for this works fast enough, it could have multiple uses: 1) Sort with the parts furthest from the viewpoint first to make instructions as legible as possible and make all parts visible. 2) Sort with the parts closest to the (...) (23 years ago, 28-Aug-01, to lugnet.cad)
|
| | | | |