The new NodeBox forum is live! Everything from support.nodebox.net moved here: sign in with the same email to pick up your old posts. Something not working? Write to forum-support@nodebox.net.

NodeBox 1ArchiveFrom the old forum

Matching drawpath to cornu.path dimensions using cornu.fit

1 reply Last reply

  1. Hi there, first of all: i'm a newbie to NodeBox (and Python) ... here's what i'm trying to do:

    1. Draw a textpath via drawpath
    2. Modify point info from that path and draw it via cornu.path

    Canvas size is 1024x1024 for example, fontsize 100, textpath x,y are 200.

    How to calculate the corresponding cornu.fit values to match the drawpath result?

    Thanks: Lars

    Copy link
  2. NodeBox team

    Hi,

    I've looked at it and I couldn't find an easy way to match the original path and cornu path.

    You've probably already seen the Cornucopia example. Here's some code that might get you started:

    cornu = ximport("cornu")
    
    background(.5, .6, .5)
    
    fontsize(1.0)
    pt = textpath("hello", 0,0)
    
    points = [[pt.x,pt.y] for pt in pt.points(200)]
    
    transform(CORNER)
    scale(0.4)
    translate(35, 800)
    
    nofill()
    stroke(1)
    strokewidth(2)
    
    cornu.drawpath(points)
    

    Cornu

    Copy link

Know something that helps?

Sign in with your email address to reply. No password needed.

Sign in to reply