Skip to content

Commit 2841358

Browse files
committed
Change deaults, add tooltips
1 parent 6fb82c1 commit 2841358

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

index.html

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
<label for="clipCheck">Clip Plane</label>
1414
<input type="checkbox" id="clipCheck" unchecked />
1515
<label for="opacitySlider0">Background Opacity</label>
16-
<input type="range" min="0" max="255" value="255" class="slider" id="opacitySlider0" />
16+
<input title="Control transparency of grayscale voxel-based image" type="range" min="0" max="255" value="255" class="slider" id="opacitySlider0" />
1717
&nbsp;
1818
<label for="opacitySlider1">Overlay Opacity</label>
19-
<input type="range" min="0" max="255" value="128" class="slider" id="opacitySlider1" />
19+
<input title="Control transparency of colored voxel-based segmentation" type="range" min="0" max="255" value="128" class="slider" id="opacitySlider1" />
2020
&nbsp;
2121
<label for="modelSelect">Segmentation Model</label>
2222
<select id="modelSelect">
@@ -62,7 +62,7 @@
6262
<p>
6363
<label>
6464
Hollow:
65-
<select id="hollowSelect">
65+
<select id="hollowSelect" title="hollow meshes require less material but may be fragile">
6666
<option value="0">False: solid</option>
6767
<option value="-1">1mm</option>
6868
<option value="-2">2mm</option>
@@ -86,14 +86,15 @@
8686
type="range"
8787
min="0"
8888
max="20"
89-
value="5"
89+
value="0"
9090
class="slider"
9191
id="smoothSlide"
92+
title="smoothing makes mesh less jagged, but can create self intersecting triangles"
9293
/>
9394
</p>
9495
<p>
9596
<label>Simplify Percent (1..100)</label>
96-
<input id="shrinkPct" type="number" min="1" value="30" max="100">
97+
<input title="adaptive triangle reduction reduces file size but can introduce defectss" id="shrinkPct" type="number" min="1" value="100" max="100">
9798
</p>
9899
<button id="cancelBtn" formmethod="dialog">Cancel</button>
99100
<button autofocus id="applyBtn" value="default">Apply</button>
@@ -106,8 +107,8 @@
106107
Format:
107108
<select id="formatSelect">
108109
<option>MZ3 small and precise</option>
109-
<option selected>OBJ widely supported</option>
110-
<option>STL popular for printing</option>
110+
<option>OBJ widely supported</option>
111+
<option selected>STL popular for printing</option>
111112
</select>
112113
</label>
113114
</p>

main.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ async function main() {
2929
nv1.updateGLVolume()
3030
}
3131
opacitySlider1.oninput = function () {
32+
if (nv1.volumes.length < 2) return
3233
nv1.setOpacity(1, opacitySlider1.value / 255)
3334
}
3435
async function ensureConformed() {
@@ -218,6 +219,8 @@ async function main() {
218219
}
219220
let reduce = Math.min(Math.max(Number(shrinkPct.value) / 100, 0.01), 1)
220221
ops.r = reduce
222+
let smooth = parseFloat(smoothSlide.value)
223+
ops.s = smooth
221224
if (bubbleCheck.checked) {
222225
ops.b = 1
223226
}

0 commit comments

Comments
 (0)