weird behavior

Alex Tweedly alex at tweedly.net
Mon Jul 19 17:58:09 EDT 2004


At 20:58 19/07/2004 +0200, Wouter wrote:

>>Not true if you add the polygon in the IDE. You can create a polygon with 3
>>vertices, leaving it to default to opaque. (click at 100,100 - click at
>>200,100 - double-click at 200,200)
>>The result is that two edges are drawn (i.e. NOT the third closing edge),
>>there is no additional (duplicate) point not added to the point list. If
>>you give it a fill colour, you will see that it is filled as though the
>>third closing edge were there - but the edge itself is not drawn.
>
>No not correct, you didn't do the action complete (and please this is no 
>offence).

Wouter - you'd have to try much much harder than that  to cause offence :-)

>You left out following comment:
>
>< Draw a so called open polygon and **add 2 returns for welformed-ness sake**.
>Deselect the polygon and reselect it and have a look at the points: the so 
>called open polygon is closed now, the first point is added.>

I didn't leave them out by mistake - I was creating a different example 
(actually, more like your original example).

The combination of the multiple "snip"s and the number of email message 
left it unclear that the  section preceding my description was specifically 
in regard to your earlier example. I gave that (new) example in direct 
response to a paragraph of yours - disconnected (in my mind) from the 
earlier examples.  (i.e. this thread has gone on so long it has become 
terminally confusing).

>If you draw an "open" ploygon like that and if you look at the points, 
>then it is what you called a *malformed polygon*.
>If you add 2 returns to make it a *welformed polygon* and  then deselect 
>and reselect you will see the engine adds the starting point.
>And yes it will be filled, in both cases if there are enclosed regions.
>(I only looked at the way the engine works)

To review and summarize :
  your example (open polygon, finished with a blank line, opaque)
        engine adds the duplicate first point at end, draws last edge
  my example (un-closed polygon, no blank line, opaque)
        engine does not (immediately) add duplicate point, does not draw 
implicit edge

So I still think there's inconsistency - but it may indeed be only in the 
case of a malformed polygon, and hence arguably irrelevant.

>>In any case, it is not a requirement that all edges exist on an opaque
>>polygon. You can draw an opaque polygon with blank lines in the middle of
>>the point list. This results in those edges being left undrawn, and the
>>fill behaviour is straightforward (though hard to describe in words). It
>>produces a set of non-contiguous shapes; the series of edges between any
>>two blank lines (or the start->blank line, and blank line->end) produces a
>>filled shape, with an implicit edge being used in the fill but not drawn.
>
>Some language problem.
><  it is not a requirement that all edges exist on an opaque polygon >
>
>         the *existence* of en edge

"be drawn" instead of "exist".
It is not a requirement that all edges of a polygon be drawn on an opaque 
polygon ...

> From the point of the viewer: if it is not drawn, it does not exist.
>But from the point of view of the engine, it depends on the order of the 
>points to draw
>the polygon (or any other form) if an edge exists and if it is visible or not.
>If a polygon contains a couple of regions, these do not become individual 
>polygons, though it can look like it.

Right - that was the point of what I was saying.

The engine allows for un-drawn edges in the middle of a list of points. It 
should therefore allow some way for an undrawn edge at the end of the list 
of points.

>>I see it as a real bug. If I create a 20-sided opaque polygon, with the
>>first point not being duplicated at the end, that produces a filled shape,
>>with the last edge not drawn. Then I add a blank line at the other side
>>(i.e. between points 10 and 11) of the polygon, and suddenly the last edge
>>becomes drawn.  Surely that's a bug ?
>
>No. It is the way the engine works with graphics in relation to the opaque 
>property.

"it's not a bug because that's what the engine does"
Sounds like a circular argument to me.

I'd be perfectly happy if the engine always added the duplicate point and 
drew the last edge (on the grounds that an opaque polygon needs to be 
closed - that would be consistent).

I'd be happy if it never did it (also consistent).

But I'm unhappy that the edge between point 19 and point 20 will sometime 
be drawn and sometimes not be - dependent on what happens between points 10 
and 11.

>I like this, so many different ways to look at the same object, thing, 
>problem or whatever.
>I am sorry if what I say is not correct from the point of view of a 
>particular language.
>But there is something like: if your first programming language was C, you 
>tend to look at any other language from the point of view of the first one 
>you learned. And with assembler this tendency is even worse :-))

Yeah, I spent too many years working on CAD-CAE for IC design - I *know* 
you can't define polygons in a way that will satisfy all requirements, and 
I do tend to see everything in terms of what shapes can be etched onto 
silicon :-)

Don't even get me started on how this shape should be filled :-) :-)

                _______
                |      |
    ____________|______|________
    |           |      |        |
    |           |      |        |
    |___________|______|____    |
                |      |    |   |
                |      |____|   |
                |               |
                |_______________|


>For Geoff's famous starbattle:   go stack url 
>"http://www.inspiredlogic.com/rev/starbattle.rev";

Thanks.

>Have fun.
I've been having lots of fun since I discovered Revolution (mixed with just 
enough frustration to keep me busy :-)

-- Alex.
-------------- next part --------------

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.719 / Virus Database: 475 - Release Date: 12/07/2004


More information about the use-livecode mailing list