source: main/trunk/model-sites-dev/von-sparql/js/paper/examples/SVG Export/Random Path Testing.html@ 28914

Last change on this file since 28914 was 28914, checked in by ak19, 10 years ago

Supporting javascript libraries and bespoke code written by Steffan to support the von-sparql user interface

File size: 1.1 KB
Line 
1<!DOCTYPE html>
2<html>
3<head>
4 <meta charset="UTF-8">
5 <title>Random Path Testing</title>
6 <link rel="stylesheet" href="../css/style.css">
7 <script type="text/javascript" src="../../dist/paper.js"></script>
8 <script type="text/paperscript" canvas="canvas">
9 var center = new Point(100, 100);
10 var sides = 3;
11 var radius = 50;
12 var triangle = new Path.RegularPolygon(center, sides, radius);
13 triangle.fillColor = 'black';
14 copy = triangle.clone();
15 copy.strokeColor = 'blue';
16 copy.rotate(45);
17
18 var center = new Point(100, 300);
19 var sides = 10;
20 var radius = 50;
21 var decahedron = new Path.RegularPolygon(center, sides, radius);
22 decahedron.fillColor = 'black';
23
24 var center = new Point(100, 400);
25 var points = 6;
26 var radius1 = 20;
27 var radius2 = 50;
28 var path = new Path.Star(center, points, radius1, radius2);
29 path.fillColor = 'black';
30
31 document.getElementById('svg').appendChild(project.exportSVG());
32 </script>
33</head>
34<body>
35 <canvas id="canvas" width="500" height="500"></canvas>
36 <svg id="svg" width="500" height="500"></svg>
37</body>
38</html>
Note: See TracBrowser for help on using the repository browser.