-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathgraphics.html
111 lines (83 loc) · 4.57 KB
/
graphics.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<html>
<head>
<title>MathCell - Graphics</title>
<link rel="stylesheet" type="text/css" href="style.css">
<style></style>
</head>
<body>
<p>Options for graphics objects are specified as JavaScript dictionaries. Unless stated otherwise, common default options are</p>
<table style="margin-left: 1in"><tr><td style="width: 1in">
<code>color</code></td><td>rgb(0,127,255) - rich azure blue
</td></tr><tr><td>
<code>opacity</code></td><td>1
</td></tr></table>
<p>Colors are specified using standard HTML color code strings. Predefined <a href="colormaps.html">colormaps</a> are also available.</p>
<p>Objects composed of lines have an additional option of <code>thickness</code> that defaults to 1.5 in two dimensions. Due to limitations of WebGL, in three dimensions it renders as 1 on most platforms regardless of the setting: a numeric option of <code>radius</code> should be used instead.</p>
<p>The <code>axis</code> for three-dimensional objects is rotated from the <i>z</i>-axis. This can produce unexpected behavior for objects that do not have rotational symmetry. The utility function <code>rotateObject</code> is available for further adjustment.</p>
<p>Additional object-specific options are listed below each.</p>
<br/><p><b>arrow( begin, end, options )</b> — two- or three-dimensional arrow from beginning to end</p>
<table style="margin-left: 1in"><tr><td style="width: 1in">
<code>size</code></td><td>1
</td></tr></table>
<p><b>box( width, depth, height, options )</b> — box of specified dimensions</p>
<table style="margin-left: 1in"><tr><td style="width: 1in">
<code>axis</code></td><td>arbitrary vector direction, default [0,0,1]
</td></tr><tr><td>
<code>center</code></td><td>vector position, default [0,0,0]
</td></tr></table>
<p><b>cone( radius, height, options )</b> — cone of specified dimensions</p>
<table style="margin-left: 1in"><tr><td style="width: 1in">
<code>axis</code></td><td>arbitrary vector direction, default [0,0,1]
</td></tr><tr><td>
<code>center</code></td><td>vector position, default [0,0,0]
</td></tr><tr><td>
<code>steps</code></td><td>integer determining surface smoothness, default 20
</td></tr></table>
<p><b>cylinder( radius, height, options )</b> — cylinder of specified dimensions</p>
<table style="margin-left: 1in"><tr><td style="width: 1in">
<code>axis</code></td><td>arbitrary vector direction, default [0,0,1]
</td></tr><tr><td>
<code>center</code></td><td>vector position, default [0,0,0]
</td></tr><tr><td>
<code>openEnded</code></td><td>Boolean to draw cylinder ends, default <code>true</code>
</td></tr><tr><td>
<code>steps</code></td><td>integer determining surface smoothness, default 20
</td></tr></table>
<p><b>ellipsoid( <i>a</i>, <i>b</i>, <i>c</i>, options )</b> — ellipsoid of specified parameters</p>
<table style="margin-left: 1in"><tr><td style="width: 1in">
<code>axis</code></td><td>arbitrary vector direction, default [0,0,1]
</td></tr><tr><td>
<code>center</code></td><td>vector position, default [0,0,0]
</td></tr><tr><td>
<code>steps</code></td><td>integer determining surface smoothness, default 20
</td></tr></table>
<p><b>line( points, options )</b> — two- or three-dimensional line joining an array of points</p>
<table style="margin-left: 1in"><tr><td style="width: 1in">
<code>endcaps</code></td><td>Boolean to include spheres to smooth joints, default <code>false</code>
</td></tr><tr><td>
<code>radius</code></td><td>float for drawing the line as an extended cylinder
</td></tr></table>
<p><b>plane( width, depth, options )</b> — plane of specified dimensions</p>
<table style="margin-left: 1in"><tr><td style="width: 1in">
<code>normal</code></td><td>arbitrary vector direction, default [0,0,1]
</td></tr><tr><td>
<code>center</code></td><td>vector position, default [0,0,0]
</td></tr></table>
<p><b>point( point, options )</b> — two- or three-dimensional point</p>
<table style="margin-left: 1in"><tr><td style="width: 1in">
<code>size</code></td><td>1
</td></tr></table>
<p><b>sphere( radius, options )</b> — sphere of specified radius</p>
<table style="margin-left: 1in"><tr><td style="width: 1in">
<code>center</code></td><td>vector position, default [0,0,0]
</td></tr><tr><td>
<code>steps</code></td><td>integer determining surface smoothness, default 20
</td></tr></table>
<p><b>text( string, point, options )</b> — string of text at the two- or three-dimensional point</p>
<table style="margin-left: 1in"><tr><td style="width: 1in">
<code>color</code></td><td>black
</td></tr><tr><td>
<code>fontSize</code></td><td>14
</td></tr></table>
</body>
</html>