TheSwamp

Code Red => .NET => Topic started by: Jeff H on February 12, 2011, 04:09:53 PM

Title: {Challenge} Point Sort
Post by: Jeff H on February 12, 2011, 04:09:53 PM
I do not know if this is a good one but I threw together code real quick and created 2 drawings

1. 20,000 random points with x,y,z (-100 to 100, -100 to 100, 0)

2. 20,000 random points with x,y,z (-100 to 100, -100 to 100, -100 to 100)


Any ideas maybe sort by closest to orgin in QI , then closest to orgin QII, then QIII, then QIV then repeat.

I do not know. I sounded like a good idea until i started typing all this.

2 drawings attached I saved them down to 2004
Title: Re: {Challenge} Point Sort
Post by: pkohut on February 12, 2011, 04:40:56 PM
What are QI to QIV in reference to? Otherwise point sorting is relatively easy.
Title: Re: {Challenge} Point Sort
Post by: Kerry on February 12, 2011, 04:46:44 PM

I imagine they'd be geomertic quadrants Paul.

0-90, 90-180 etc
Title: Re: {Challenge} Point Sort
Post by: Jeff H on February 12, 2011, 04:57:57 PM
What are QI to QIV in reference to?
Quadrant 1 , Quadrant 2 , Quadrant 3 .........

Otherwise point sorting is relatively easy.

Yeah I was trying to come up with a idea like sorting points by largest difference between a Points X & Y value, but it still boils down to essentially they same thing.
I was trying to spark an idea.
Title: Re: {Challenge} Point Sort
Post by: gile on February 12, 2011, 05:00:19 PM
Code: [Select]
pts.Sort((p1, p2) => p1.DistanceTo(Point3d.Origin).CompareTo(p2.DistanceTo(Point3d.Origin)));