about containsPoint:
Alexandre Bergel
bergel at iam.unibe.ch
Sun Nov 6 10:05:10 UTC 2005
Right. For instance, if you two triangles with a common edge. Let's
say ABC and BCD. The idea is you want to avoid to have some overlap
between the both.
Cheers,
Alexandre
On Nov 5, 2005, at 7:49 PM, Bert Freudenberg wrote:
>
> Am 05.11.2005 um 18:37 schrieb stéphane ducasse:
>
>
>> testContainsPoint
>> "self run: #testContainsPoint"
>>
>> self assert: ((0 at 0 extent: 300 at 200) containsPoint: 100 at 100).
>> self deny: ((0 at 0 extent: 300 at 200) containsPoint: 0 at 299).
>> self assert: ((0 at 0 extent: 300 at 200) containsPoint: 0 at 199).
>>
>>
>> "strange behavior a rectangle includes a point that is equals to
>> its origin but not its corner"
>> self deny: ((0 at 0 extent: 300 at 200) containsPoint: 0 at 200).
>> self assert: ((0 at 0 extent: 300 at 200) containsPoint: 0 at 0).
>> self deny: ((0 at 0 extent: 300 at 200) containsPoint: 300 at 200).
>>
>> may be this is to make sure that a point cannot belongs to two
>> rectangles that would be just
>> overlapping of one pixel?
>>
>
> Yes. Rasterizing two adjacent rectangles (e.g., "rect1 right =
> rect2 left") should leave no gap and touch every pixel exactly
> once. This is a basic property of all graphics packages (google for
> "rasterization rules" if you want to learn more), but often comes
> as a surprise to graphics newbies, because geometry in school does
> not deal with rasterization.
>
> - Bert -
>
>
>
>
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel http://www.iam.unibe.ch/~bergel
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
More information about the Squeak-dev
mailing list
|