New arrows for ConnectorMorph
Noury Bouraqadi
bouraqadi at ensm-douai.fr
Fri Sep 8 13:27:43 UTC 2006
It looks like Connectors does not map curves directly to balloon
since the two arrays that you provided does not build the same shape.
The first one draws a square, while the second one draws a kind of
triangle (see below).
Noury
Le 8 sept. 06 à 01:22, Andreas Raab a écrit :
> I have no idea how connectors handle this. If it's mapped straight
> into Balloon then it should be the case that you can make up
> arbitrary segments but that they should form closed shapes for
> rendering. E.g., instead of a "regular" set of curves like here:
> {
> 0 at 0. 0 at 0. 1 at 0. "right"
> 1 at 0. 1 at 0. 1 at 1. "down"
> 1 at 1. 1 at 1. 0 at 1. "left"
> 0 at 1. 0 at 1. 0 at 0. "up"
> }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Image 1.png
Type: image/png
Size: 3230 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20060908/43911a58/Image1.png
-------------- next part --------------
> the following would work just as well in Balloon:
>
> {
> 0 at 0. 0 at 0. 1 at 0. "right"
> 1 at 1. 1 at 1. 0 at 1. "left"
> 0 at 1. 0 at 1. 0 at 0. "up"
> 1 at 0. 1 at 0. 1 at 1. "down"
> }
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Image 2.png
Type: image/png
Size: 3296 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20060908/43911a58/Image2.png
-------------- next part --------------
> Since the segments form a closed outline and that is really all
> that is required to draw them.
>
> Cheers,
> - Andreas
>
> Noury Bouraqadi wrote:
>> Thanks Andreas for your help.
>> Do you know if there any constraints/dependencies on/between
>> points belonging to two different segments defined for the same
>> arrow ? Though we know about bezier curves, still we don't fully
>> understand the implementation. We'd like to draw an open symbol,
>> something like a "lower than" (<) symbol.
>> Noury
>> Le 7 sept. 06 à 08:30, Andreas Raab a écrit :
>>> Noury Bouraqadi wrote:
>>>> I'd like to have connectors with new arrow shapes (circles,
>>>> arcs, rhombus...)
>>>> How can do that? Together with Serge, we had a look on class
>>>> methods such as NCAAConnectorMorph class>>#basicArrow (see code
>>>> below).
>>>> But, we could not figure-out how to easily and cleanly change
>>>> the points to have the expected shape.
>>>
>>> This is a quadratic bezier curve. Each segment is made up by
>>> three consecutive points where the first and the third point are
>>> start and end and the intermediate is a control point that
>>> describes how the curve is shaped. To draw straight lines, have
>>> the intermediate point coincide with either start or end. See
>>> also (but for cubic beziers) the description at wikipedia:
>>>
>>> http://en.wikipedia.org/wiki/Bezier_curve
>>>
>>> On a related note, be advised that non-rational bezier curves
>>> cannot truthfully approximate circles and other conic sections.
>>> To approximate ellipses see Bezier2Segment
>>> class>>makeEllipseSegments: in the 3.9 graphics package. The
>>> points you see in Ned's spec are the control points of such
>>> segments (this may be helpful with exploring the exact shape you
>>> are trying to construct).
>>>
>>> Hope this helps,
>>> - Andreas
>>>
>> ------------------------------------------------------------------
>> Dr. Noury Bouraqadi - Enseignant/Chercheur
>> ARMINES - Ecole des Mines de Douai - Dept. I.A.
>> http://csl.ensm-douai.fr/noury
>> European Smalltalk Users Group Board
>> http://www.esug.org
>> Squeak: a Free Smalltalk
>> http://www.squeak.org
>> ------------------------------------------------------------------
>
>
------------------------------------------------------------------
Dr. Noury Bouraqadi - Enseignant/Chercheur
ARMINES - Ecole des Mines de Douai - Dept. I.A.
http://csl.ensm-douai.fr/noury
European Smalltalk Users Group Board
http://www.esug.org
Squeak: a Free Smalltalk
http://www.squeak.org
------------------------------------------------------------------
More information about the Squeak-dev
mailing list
|