What's new? | Help | Directory | Sign in
Google
                
Search
for
Updated Jun 17, 2008 by jpivarski
Labels: Reference, Version1
ClassLine  
Draw a line between two points

(This page applies only to the 1.x branch of SVGFig.)

class Line

Line draws a line between two points, but this line is mutable by coordinate transformations. If the coordinates curve, the line will curve.

Arguments

Line(x1, y1, x2, y2, arrow_start, arrow_end, attribute=value)

x1, y1 required the starting point
x2, y2 required the ending point
arrow_start default=None if an identifier string/Unicode, draw a new arrow object at the beginning of the line; if a marker, draw that marker instead
arrow_end default=None same for the end of the line
attribute=value pairs keyword list SVG attributes

To add arrows to the ends of the line, you need to supply a new identifier. If the identifier references another object (SVG id attribute), the renderer will attempt to place that object instead (if it's a marker).

Adding an arrow changes the structure of the output SVG.

SVG method

Line has an SVG method, as described in General features for all primatives.

Path method

Line has a Path method, as described in General features for all primatives.

Arrows are ignored by the Path method.

Defaults

Line has the same defaults as Curve. Defaults are described in General features for all primatives.

random_sampling True if False, bisect with a point exactly halfway between pairs of points; if True, randomly choose a point between 30% and 70%
recursion_limit 15 number of subdivisions before giving up; if 15, sampling algorithm can visit at most 215 points
linearity_limit 0.05 maximum deviation (in SVG units) from a straight line
discontinuity_limit 5 minimum deviation (in SVG units) between points that is considered continuous


Sign in to add a comment