if (do_name() != 'Home') : ?>
endif ?>
Posted by Lucas on Mar 31, 2009
You can make your curve fit to whatever rectangle, like this:
size(500,500) ximport("cornu") font("American Typewriter", 100) path = textpath("2009", 0, 0) ptlist = [] d = 6.15 for i in range(3): for pt in path: if pt.cmd == LINETO or pt.cmd == CURVETO: ptlist.append((pt.x+random(-d, d), pt.y+random(-d, d))) nofill() stroke(0) cp = cornu.path(ptlist) cp.fit(-100, -100, 700, 700) cp.draw()hope this helps,
Posted by Tom De Smedt on Apr 16, 2009
include("util/comment.php"); ?>
The hypotenuse is the distance between two points in 2D, or the length of a line on a triangle based on the length of the other two lines (Pythagorean theorem: C = sqrt(A*A+B*B) ). The crash occurs when two points are at the same position and their distance is 0. Actually your fix is quite acceptable so I released an update of the library with the fix included.
Best, Tom
cornu and negative coordinates
Posted by lastfuture on Mar 30, 2009I noticed that cornu has a problem with points with negative coordinates. The culprit seems to be this line:
which gets divisions by zero.my very newbish solution to the problem is this: It's working just fine for me. All I wanted was the cornu paths ending outside the art board in all directions and now they do, as far as I can tell with all my wild randomness going on.
I'm wondering if there is a more elegant solution though as my solution is quite brutal. I was unable to find how hypot operates. Any of you python gurus have a hint?