-
Notifications
You must be signed in to change notification settings - Fork 39
/
terrain2stl.html
191 lines (176 loc) · 8.16 KB
/
terrain2stl.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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
<html>
<head>
<title>Terrain2STL</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="//jthatch.com/bootstrap-custom.css">
<script type="text/javascript" src="terrain2stl.js"></script>
<!-- <script type="text/javascript" src="moonmaps.js"></script> -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<script type="text/javascript" src="bootstrap.min.js"></script>
</head>
<body>
<div class="container-fluid">
<div class="page-header">
<h1>Terrain2STL <small>Create STL models of the surface of Earth</small></h1>
</div>
<div class="row">
<div class="col-md-8"><div style="height:75%" id="gmap"><center><h1><small>Map didn't load! Is the Google Maps API key correct?</small></h1></center></div></div>
<div class="col-md-4" id="controlbox">
<center><h1>STL Generator</h1></center>
<center><i>Now with adjustable rectangle shapes!</i></center></br>
<form id="paramForm" class="form-horizontal" action="gen" method="post" onsubmit="ga('send', 'event', 'Terrain2STL', 'Model');">
<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
<div class="panel panel-default">
<div class="panel-heading" role="tab" id="headingOne">
<h4 class="panel-title">
<a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseZero" aria-expanded="true" aria-controls="collapseZero">
Location
</a>
</h4>
</div>
<div id="collapseZero" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingZero">
<div class="panel-body">
<h4>Northwest Corner Coordinates</h4>
<div class="form-group">
<label class="col-sm-3 control-label">Latitude: </label>
<div class="col-sm-4">
<input class="form-control" value=44.2 name="lat" id="c-lat" onchange="updateLatLng()">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">Longitude: </label>
<div class="col-sm-4">
<input class="form-control" value=-69.09 name="lng" id="c-lng" onchange="updateLatLng()"></br>
</div>
</div>
<input type="button" class="btn btn-small" onclick="centerToView()" value="Center to View">
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading" role="tab" id="headingOne">
<h4 class="panel-title">
<a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
Model Details
</a>
</h4>
</div>
<div id="collapseOne" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingOne">
<div class="panel-body">
<div class="form-group">
<label class="control-label col-sm-6">Box Width:</label>
<div class="col-sm-4">
<input name="boxWidth" type="range" min="60" max="2700" step="60" value="120" onchange="changeSize()">
</div>
<div class="col-sm-2" id="boxWidthLabel">0.05°</div>
</div>
<div class="form-group">
<label class="control-label col-sm-6">Box Height:</label>
<div class="col-sm-4">
<input name="boxHeight" type="range" min="60" max="2700" step="60" value="120" onchange="changeSize()">
</div>
<div class="col-sm-2" id="boxHeightLabel">0.05°</div>
</div>
<div class="form-group">
<label class="control-label col-sm-6">Box Scaling Factor:</label>
<div class="col-sm-4">
<input name="boxScale" type="range" min="1" max="12" step="1" value="1" onchange="changeSize()">
</div>
<div class="col-sm-2" id="boxScaleLabel">1</div>
</div>
<div class="form-group">
<label class="control-label col-sm-6">Box Rotation (degrees)</label>
<div class="col-sm-4">
<input name="rotation" type="range" min="-90" max="90" step="1" value="0" onchange="changeRotation()">
</div>
<div class="col-sm-2" id="rotationLabel">0</div>
</div>
<div class="form-group">
<label class="control-label col-sm-6">Vertical Scaling</label>
<div class="col-sm-4">
<input name="vScale" type="range" min=".5" max="4" step=".1" value="1" onchange="changeVScale()">
</div>
<div class="col-sm-2" id="vScaleLabel">1</div>
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading" role="tab" id="headingFive">
<h4 class="panel-title">
<a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseFive" aria-expanded="false" aria-controls="collapseFive">
Water and Base Settings
</a>
</h4>
</div>
<div id="collapseFive" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingFive">
<div class="panel-body">
<div class="form-group">
<label class="control-label col-sm-6">Water Drop (mm):</label>
<div class="col-sm-4">
<input name="waterDrop" type="range" min="0" max="5" step="1" value="0" onchange="changeWaterDrop()">
</div>
<div class="col-sm-2" id="waterDropLabel">0</div>
</div>
<div class="form-group">
<label class="control-label col-sm-6">Base Height (mm):</label>
<div class="col-sm-4">
<input name="baseHeight" type="range" min="1" max="10" step="1" value="1" onchange="changeBaseHeight()">
</div>
<div class="col-sm-2" id="baseHeightLabel">2</div>
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-heading" role="tab" id="headingThree">
<h4 class="panel-title">
<a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseFour" aria-expanded="false" aria-controls="collapseFour">
Instructions
</a>
</h4>
</div>
<div id="collapseFour" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingOne">
<div class="panel-body">
<div id="inst">
<h2 align='center' style="margin-top:-10">Instructions</h2></br>
<ul style="margin-top:-20">
<li>Select the area you want an STL of using the red box</li>
<li>'Center to View' will move the box. It's also draggable</li>
<li>Rotate and resize the box as needed</li>
<li>Z-Scale exaggerates the vertical scale of models</li>
<li>Water drop lowers the height of the oceans for emphasis</li>
<li>Don't worry about the box skewing with rotations - the model will be accurate to the real terrain</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<button type="submit" id="genButton" class="btn btn-default">Generate Model</button>
<a id="downloadbtn" style="visibility:hidden" role="button" class="btn btn-default" href="stls/rawmodel-0.stl">Download</a>
</form>
<center><small>Terrain2STL is a free-to-use service, but if you want to help <a href="/support.html">support</a> the site, donations are welcome.</small></center>
</div>
</div>
<div class="row">
</br>
<center>
<small><i>
Terrain2STL creates STL files using the <a href='https://cgiarcsi.community/data/srtm-90m-digital-elevation-database-v4-1/'>SRTM3 dataset</a> from 2000,
which has a resolution of about 90 meters on the equator.
</i></small>
</center>
</div>
<div class="row">
</br>
<center>
<small>
<a href="/">Home</a> | Terrain2STL | <a href="mailto:[email protected]">Contact</a></br>
</small>
</center>
</div>
</div>
<script async defer src="include-maps.js"></script>
</body>
</html>