bernhard: thuban/Extensions/svgexport/test test_svgmapwriter.py, 1.9, 1.10
Bernhard Reiter
bernhard at intevation.de
Tue Dec 7 12:44:59 CET 2004
On Tue, Dec 07, 2004 at 12:37:52PM +0100, Bernhard Herzog wrote:
> cvs at intevation.de writes:
>
> > + def test_drawbezier(self):
> > + '''Test DrawSpline (which actually draws bezier curves).'''
> > + data = ('<path style="stroke-linejoin:round; stroke:#ff00ff; '
> > + 'stroke-width:3; stroke-linecap:round; fill:none" '
> > + 'meta="Object:test; Label:nothing" d="M 10 10 '
> > + 'C 15 12 15 8.0 20 10"/>')
> > + file = StringIO.StringIO()
> > + dc = VirtualDC(file)
> > + dc.SetPen(self.solid_pen)
> > + dc.SetMeta(self.meta)
> > + dc.SetBrush(self.trans_brush)
> > + dc.DrawSpline([ Point(10, 10),
> > + Point(15, 12),
> > + Point(15, 8.0),
> > + Point(20, 10) ])
>
> Looking at the DrawSpline code in wxWidgets, it seems that the
> coordinates of the spline do not translate directly to the coordinates
> of the control points of a cubic bezier curve as you assume here.
Ah, thanks for noticing this.
So it is broken until I understand this better and can fix it.
> Rather a cubic bezier curve derived in some other fashion from the
> parameters to DrawSpline. The docs say that the algorithm was taken
> from XFig, so I'd assume it's what XFig <= 3.1 calls interpolated
> splines. I have no time to analyse this further, though.
Thanks for the hints.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.intevation.de/pipermail/thuban-devel/attachments/20041207/33576112/attachment.bin
More information about the Thuban-devel
mailing list
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)