-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
56 lines (51 loc) · 2.75 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<head>
<title>vertexCull.js</title>
<link rel="stylesheet" href="./src/demo/index.css">
</head>
<body>
<div class="parent-container">
<div class="canvas-container" id="canvas-container-1">
<h3>Base polygon (randomPolys.js)</h3>
<canvas id="canvas1" width="300" height="300"></canvas>
<p id="vertex-count" class="canvas-text"></p>
</div>
<div class="canvas-container" id="canvas-container-2">
<h3>Simplified (vertexCull.js)</h3>
<canvas id="canvas2" width="300" height="300"></canvas>
<p id="culled-vertex-count" class="canvas-text"></p>
</div>
<div class="canvas-container" id="canvas-container-3">
<h3>Simplified (RDP - simplify.js)</h3>
<canvas id="canvas3" width="300" height="300"></canvas>
<p id="dp-vertex-count" class="canvas-text"></p>
</div>
</div><br><br>
<div class="interactive-container">
<div id="checkboxes">
<label class="container">Unculled vertices
<input id="unculled-vertices" type="checkbox" checked="checked">
<span class="checkmark"></span>
</label>
<label class="container">Culled vertices
<input id="culled-vertices" type="checkbox" checked="checked">
<span class="checkmark"></span>
</label>
<button id="new-polygon">New polygon</button>
</div>
<div class="slidecontainer">
<p class="text"><strong>Theta (vertexCull.js):</strong> <span id="theta-value"></span></p>
<input type="range" min="0" max="90" value="10" class="slider" id="theta-range">
<p class="text"><strong>Tolerance (simplify.js):</strong> <span id="tolerance-value"></span></p>
<input type="range" min="0" max="15" value="1" class="slider" id="tolerance-range">
</div>
</div><br>
<p>simplify.js is an awesome RDP generalization library. You can find it here: <a href="https://github.com/mourner/simplify-js">https://github.com/mourner/simplify-js.</a></p>
<p>The polygons for this example are generated by randomPolys.js. You can find it here: <a href="https://github.com/bm13563/randomPolys.js">https://github.com/bm13563/randomPolys.js.</a></p>
</body>
<script src="https://bm13563.github.io/randomPolys.js/build/bundle.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/simplify.min.js"></script>
<script src="./src/demo/bundle.js"></script>
</html>