1. NodeBox 1
    1. Homepage
    2. NodeBox 3Node-based app for generative design and data visualization
    3. NodeBox OpenGLHardware-accelerated cross-platform graphics library
    4. NodeBox 1Generate 2D visuals using Python code (Mac OS X only)
  2. Gallery
  3. Documentation
  4. Forum
  5. Blog

Stroke properties

Posted by Dimitre on Oct 25, 2009

Is it possible to define stroke terminations (butt,round,square) and corners (miter,round,bevel)?
Thanks


 
Posted by Josh Caswell on Oct 29, 2009

Well, the code that Tom shared a few posts earlier could get you started. You can also access your NodeBox path's underlying NSBezierPath and do this:

from AppKit import NSRoundLineCapStyle
 
autoclosepath(False)
beginpath(100, 500)
curveto(200,250, 600,600, 400,300)
path = endpath(draw=False)
 
nofill()
stroke(0)
strokewidth(12)
 
path._nsBezierPath.setLineCapStyle_(NSRoundLineCapStyle)
 
drawpath(path)



Posted by Tom De Smedt on Oct 29, 2009

And there's some more documentation on linecaps by Giorgio here.



Posted by Dimitre Lima on Nov 05, 2009

Thanks Tom and Josh!