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

bezier.length()

Syntax

length(path, segmented=False)

Description

Returns the length of the given path. To do this, the length of each individual segment (curve or line) in the path is calculated. When segmented is True, the return value is a list containing the individual length of each segment as values between 0.0 and 1.0, defining the percentual length of each segment in relation to the total path length.

Example

bezier = ximport("bezier")
beginpath(100,100)
curveto(150,200, 200,450, 300,300)
path = endpath()
print bezier.length(path)
>>>370.721998681