bug: polygon

30 views
Skip to first unread message

Devil may Cry

unread,
Jan 3, 2013, 8:45:01 AM1/3/13
to haskel...@googlegroups.com
I believe I have stumbled upon another bug. This time in polygon function.

Try drawing this:
star = polygon [   -- line [ works fine
  (0,50),
  (10,30),  -- bug or feature? it reads point, but shows it incorrectly
  (40,20),
  (20,0),
  (30,-30),
  (0,-10),
  (-30,-30),
  (-20,0),
  (-40,20),
  (-10,20)
--  (0,50)
  ]


It's easiest to spot if you add point by point:

  translate 0 (-100) $ color red $ line my_star,
  translate 0 (100) $ color blue $ polygon my_star
  ]
 
my_star = [
  (0,50),
-- (10,30),
-- (40,20),    -- line is ok, but polygon creates triangle surface, disregarding next points
--(20,0)
  ]

Chris Smith

unread,
Jan 3, 2013, 10:59:14 PM1/3/13
to haskel...@googlegroups.com

Gloss requires that your polygons are convex. If they are not, they often will not be drawn correctly.

--
 
 

Ben Lippmeier

unread,
Jan 3, 2013, 11:05:26 PM1/3/13
to haskel...@googlegroups.com, Chris Smith
On 04/01/2013, at 2:59 PM, Chris Smith wrote:

Gloss requires that your polygons are convex. If they are not, they often will not be drawn correctly.

Yeah, I just added this to the wiki. Someone needs to write a triangulation function. 

It would be a GOOD holiday project...

Ben.

Reply all
Reply to author
Forward
0 new messages