[FIX] [ENH] NewCurves-wiz ( [er][et] Looks nice. Should be renamed. Suitable for base inclusion. )

cdshaffer at acm.org cdshaffer at acm.org
Sat Jul 24 19:12:39 CEST 2004


I loaded this code into 3.7g (5976) and put a few NewCurveMorph's
through their paces.  All of the CurveMorph features worked: adding and
removing vertices, dragging control points, changing border line
properties etc.  I definitely like the smooth curves.

My benchmark of /drawing/ shows that at least in a small number of cases
NewCurveMorph is faster than its predecessor.  I have included an
example below.  I tried a few other shapes, even one that felt sluggish
in Morphic but NewCurveMorph performed at worst still better than
CurveMorph.

I don't think that this should replace the existing CurveMorph since
many people use that morph and expect its current behavior.  I'd rather
see NewCurveMorph renamed to SmootherCurveMorph or something.


Benchmark workspace (times reproducable to within 10% through multiple
runs):

verts _ {59 at 40. 74 at 54. 79 at 74. 77 at 93. 57 at 97. 37 at 97. 22 at 83. 15 at 67. 22 at 50.
33 at 35. 47 at 33}.

canvas1 _ FormCanvas extent: 200 at 200.
canvas1 fillColor: (Color black).
m1 _ (CurveMorph new vertices: verts color: Color blue borderWidth: 1
borderColor: Color black).
Time millisecondsToRun: [1000 timesRepeat: [m1 drawOn: canvas1]]  ----->
2930

canvas2 _ FormCanvas extent: 200 at 200.
canvas2 fillColor: (Color black).
m2 _ (NewCurveMorph new vertices: verts color: Color blue borderWidth: 1
borderColor: Color black).
Time millisecondsToRun: [1000 timesRepeat: [m2 drawOn: canvas2]] ----->
1780


More information about the Squeak-harvest mailing list