reader: Reading and writing svg files

Description Usage Arguments Details Note Author(s) See Also Examples

Description

Various utilities for reading and creating svg files for use with inkscape

Usage

1
2
3
4
reader(filename)
write_svg(k, oldfile, safe=TRUE,
    regex1 ='sodipodi:docname=',
    regex2=' *d *= *" *M.*C.*[zZ] *"')

Arguments

filename

Name of a file to be read by reader(); usually an inkscape .svg file

safe

Boolean, with default TRUE meaning to save file “foo.svg” as “foo_smooth.svg” and FALSE meaning to overwrite foo.svg.

k, oldfile, regex1, regex2

Various arguments sent to write_svg(); see the source code for details. Argument k is a knot, oldfile an .svg file for reference.

Details

Function reader() is the way to get started with a new knot. This takes a filename which is an .svg file created with inkscape. Instructions for creating a suitable inkscape file are given in knotR-package.Rd.

Note

Inkscape's default is to use a mixture of absolute and relative coordinates. Function reader() assumes that the .svg file uses only absolute coordinates.

To ensure that only absolute coordinates are used, open the ‘SVG output’ menu in ‘inkscape preferences’ and uncheck the “Allow relative coordinates” option.

The format of .svg file is described in the W3C recommendation (2011) for Scalable Vector Graphics (SVG) 1.1, second edition.

Author(s)

Robin K. S. Hankin

See Also

utilities,knotR-package

Examples

1
2
3
4
5
6
7
## Not run: 
a <- reader("6_3.svg")
b <- getcontrolpoints(a)
knotplot(a)


## End(Not run)

knotR documentation built on May 1, 2019, 9:10 p.m.