Matching drawpath to cornu.path dimensions using cornu.fit

Lars's Avatar

Lars

23 Nov, 2012 10:40 AM

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

  1. Support Staff 1 Posted by Frederik De Ble... on 26 Nov, 2012 09:05 AM

    Frederik De Bleser's Avatar

    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

  2. Frederik De Bleser closed this discussion on 26 Nov, 2012 09:05 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

21 Apr, 2025 10:47 AM
21 Apr, 2025 10:41 AM
21 Apr, 2025 05:56 AM
20 Apr, 2025 10:11 AM
19 Apr, 2025 07:17 PM

 

18 Apr, 2025 12:04 AM
14 Apr, 2025 10:18 PM
13 Apr, 2025 11:09 PM
10 Apr, 2025 11:30 PM
10 Apr, 2025 10:16 PM
10 Apr, 2025 10:02 PM