New arrows for ConnectorMorph

Andreas Raab andreas.raab at gmx.de
Thu Sep 7 23:22:57 UTC 2006


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"
   }

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"
   }

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
> ------------------------------------------------------------------
> 
> 
> 
> 
> 




More information about the Squeak-dev mailing list