Click here to Skip to main content
15,891,529 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
QuestionRe: What's the most challenging algorithm you've ever faced Pin
Randor 30-May-21 0:45
professional Randor 30-May-21 0:45 
AnswerRe: What's the most challenging algorithm you've ever faced Pin
honey the codewitch30-May-21 1:13
mvahoney the codewitch30-May-21 1:13 
AnswerRe: What's the most challenging algorithm you've ever faced Pin
honey the codewitch30-May-21 1:30
mvahoney the codewitch30-May-21 1:30 
GeneralRe: What's the most challenging algorithm you've ever faced Pin
Randor 30-May-21 18:34
professional Randor 30-May-21 18:34 
GeneralRe: What's the most challenging algorithm you've ever faced Pin
honey the codewitch30-May-21 18:49
mvahoney the codewitch30-May-21 18:49 
GeneralRe: What's the most challenging algorithm you've ever faced Pin
Randor 30-May-21 19:08
professional Randor 30-May-21 19:08 
GeneralRe: What's the most challenging algorithm you've ever faced Pin
honey the codewitch30-May-21 19:30
mvahoney the codewitch30-May-21 19:30 
GeneralRe: What's the most challenging algorithm you've ever faced Pin
honey the codewitch30-May-21 19:39
mvahoney the codewitch30-May-21 19:39 
Okay, so I implemented it and what jumps out to me (and I feel like I'm missing something here) is that for me to use even-odd requires a nasty brute force when trying to fill.

here's rough C++ psuedocode i just typed to illustrate:
C++
for(int y=0;y<height;++y) {
   for(int x=0;x<width;++x) {
      if(even_odd_is_point_in_poly(x,y,path,path_size)) {
         draw_pixel(x,y,color);
      }
   }
}


Does that look right to you? It seems heavy handed to me. The wiki entry only shows how to determine if the point is in the polygon though, not how to quickly determine the extents by say, scanline. I feel like there has to be a faster way.


I just figured it out I think.
Real programmers use butterflies


modified 31-May-21 1:51am.

GeneralRe: What's the most challenging algorithm you've ever faced Pin
Randor 30-May-21 19:56
professional Randor 30-May-21 19:56 
GeneralRe: What's the most challenging algorithm you've ever faced Pin
honey the codewitch30-May-21 21:30
mvahoney the codewitch30-May-21 21:30 
PraiseRe: What's the most challenging algorithm you've ever faced Pin
Randor 30-May-21 22:02
professional Randor 30-May-21 22:02 
GeneralRe: What's the most challenging algorithm you've ever faced Pin
honey the codewitch31-May-21 3:02
mvahoney the codewitch31-May-21 3:02 
JokeRe: What's the most challenging algorithm you've ever faced Pin
Randor 31-May-21 4:04
professional Randor 31-May-21 4:04 
GeneralRe: What's the most challenging algorithm you've ever faced Pin
honey the codewitch31-May-21 4:15
mvahoney the codewitch31-May-21 4:15 
AnswerRe: What's the most challenging algorithm you've ever faced Pin
Greg Utas30-May-21 6:54
professionalGreg Utas30-May-21 6:54 
GeneralRe: What's the most challenging algorithm you've ever faced Pin
honey the codewitch30-May-21 7:02
mvahoney the codewitch30-May-21 7:02 
AnswerRe: What's the most challenging algorithm you've ever faced Pin
Clumpco30-May-21 20:20
Clumpco30-May-21 20:20 
GeneralRe: What's the most challenging algorithm you've ever faced Pin
honey the codewitch30-May-21 21:33
mvahoney the codewitch30-May-21 21:33 
AnswerRe: What's the most challenging algorithm you've ever faced Pin
ormonds31-May-21 1:52
ormonds31-May-21 1:52 
AnswerRe: What's the most challenging algorithm you've ever faced Pin
ElectronProgrammer31-May-21 2:08
ElectronProgrammer31-May-21 2:08 
AnswerRe: What's the most challenging algorithm you've ever faced Pin
BDieser31-May-21 3:37
BDieser31-May-21 3:37 
GeneralRe: What's the most challenging algorithm you've ever faced Pin
honey the codewitch31-May-21 4:22
mvahoney the codewitch31-May-21 4:22 
AnswerRe: What's the most challenging algorithm you've ever faced Pin
obermd31-May-21 4:50
obermd31-May-21 4:50 
AnswerRe: What's the most challenging algorithm you've ever faced Pin
Matt McGuire1-Jun-21 5:39
professionalMatt McGuire1-Jun-21 5:39 
GeneralWhy do lazy students assume everyone else is dumber than them? Pin
OriginalGriff29-May-21 3:12
mveOriginalGriff29-May-21 3:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.