if (do_name() != 'Home') : ?>
endif ?>
Posted by Brendan Dawes on Dec 31, 2006
Posted by Tom De Smedt on Dec 31, 2006
Posted by Brendan Dawes on Dec 31, 2006
Posted by Tom De Smedt on Jan 3, 2007
You may also want to download the latest version of the Core Image library; the layer_path() now lets you define stroke color and width, and the commands for filters have altered slightly.
Posted by brendan Dawes on Jan 3, 2007
include("util/comment.php"); ?>
Posted by Brendan Dawes on Dec 31, 2006
and for the redord I also tried canvas.layer_path!
Posted by Tom De Smedt on Dec 31, 2006
Hi Brendan,
Yes, the cornu.drawpath() command draws directly to the screen. However, it's very easy to fix this. I'll upload a new version of the Cornu library next week so you can use Cornu curves as a layer.
Posted by Brendan Dawes on Dec 31, 2006
That's great Tom and thanks once again for creating an incredibly powerful library.
Posted by Tom De Smedt on Jan 3, 2007
Brendan, there is an update of the Cornu library online. It has a new path() command that returns a path object instead of drawing to the screen. The returned object can be used as input for a Core Image layer.
Here's some example code that draws an S-like Cornu shape as a pixel layer:
size(400,400) coreimage = ximport("coreimage") cornu = ximport("cornu") c = coreimage.canvas(WIDTH, HEIGHT) c.layer_fill(coreimage.color(0)) pts = [(0.5, 0.5), (0.3, 0.1), (0.1, 0.3), (0.1, 0.1)] p = cornu.path(pts, close=False) l = c.layer_path(p, foreground=coreimage.transparent(), stroke=color(1), strokewidth=10) l.rotate(90) c.draw()
You may also want to download the latest version of the Core Image library; the layer_path() now lets you define stroke color and width, and the commands for filters have altered slightly.
Posted by brendan Dawes on Jan 3, 2007
wow! Fantastic - cheers
Cornu and CoreImage
Posted by Brendan Dawes on Dec 31, 2006Love the CoreImage library!
But I've been trying to use draw a Cornu path into a layer and it doesn't seem to work. It seems to get drawn directly to the screen ignoring the canvas.
I tried this:
which draws the Cornu straight to the screen without havibg to use canvas.draw()
Is this in the nature of how Cornu works? If so I'll switch to Beziers - I just like Cornu curves!