Skip to content

Commit

Permalink
update manifold, fix startup bug (elalish#735)
Browse files Browse the repository at this point in the history
  • Loading branch information
elalish committed Feb 8, 2024
1 parent c6cc977 commit f190c83
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
7 changes: 4 additions & 3 deletions bindings/wasm/examples/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ function switchTo(scriptName) {
isExample = exampleFunctions.get(scriptName) != null;
const code = isExample ? exampleFunctions.get(scriptName).substring(1) :
getScript(scriptName) ?? '';
window.location.hash = `#${scriptName}`;
window.location.search = '';
editor.setValue(code);
}
}
Expand All @@ -129,8 +131,6 @@ function createDropdownItem(name) {

button.onclick = function() {
saveCurrent();
window.location.hash = `#${label.textContent}`;
window.location.search = '';
switchTo(label.textContent);
};
// Stop text input spaces from triggering the button
Expand Down Expand Up @@ -217,7 +217,6 @@ function addEdit(button) {
removeScript(label.textContent);
if (currentFileElement.textContent == label.textContent) {
switchTo('Intro');
window.location.hash = '#Intro';
}
const container = button.parentElement;
container.parentElement.removeChild(container);
Expand Down Expand Up @@ -332,6 +331,8 @@ require(['vs/editor/editor.main'], async function() {
else {
switchTo(name);
}
} else {
switchTo(currentName);
}

if (manifoldInitialized) {
Expand Down
4 changes: 2 additions & 2 deletions bindings/wasm/examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
<div id="editor" class="col"></div>
<div class="col container" style="flex-direction: column;">
<model-viewer camera-controls min-camera-orbit="auto 0deg auto" max-camera-orbit="auto 180deg auto"
shadow-intensity="1" interaction-prompt="none" alt="Editor 3D output">
shadow-intensity="1" tone-mapping="commerce" interaction-prompt="none" alt="Editor 3D output">
<div class="center" slot="poster">
<p id="poster" style="text-align: center; line-height: 36px;"> Loading... </p>
</div>
Expand All @@ -95,6 +95,6 @@
integrity="sha512-iQEIc0rsSDujsfjtD+lfyJ1W23Bh/lbgriubKDAym6VlEIDRj9rrbSIyJRyshOrl8s0yRcQ0+gyrZfSLyjJGWQ=="
crossorigin="anonymous" referrerpolicy="no-referrer">
<script type="module" src="editor.js"></script>
<script type="module" src="https://ajax.googleapis.com/ajax/libs/model-viewer/3.3.0/model-viewer.min.js"></script>
<script type="module" src="https://ajax.googleapis.com/ajax/libs/model-viewer/3.4.0/model-viewer.min.js"></script>

</html>
4 changes: 2 additions & 2 deletions bindings/wasm/examples/make-manifold.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@
<button id="download" disabled>Download manifold GLB</button>
<input type="checkbox" id="viewFinal" disabled>
<label for="viewFinal">View Manifold GLB</label>
<model-viewer camera-controls shadow-intensity="1" alt="Loaded GLB model">
<model-viewer camera-controls shadow-intensity="1" tone-mapping="commerce" alt="Loaded GLB model">
<span id="poster" slot="poster">Drop a GLB here</span>
</model-viewer>
</body>
<script type="module" src="https://ajax.googleapis.com/ajax/libs/model-viewer/3.3.0/model-viewer.min.js"></script>
<script type="module" src="https://ajax.googleapis.com/ajax/libs/model-viewer/3.4.0/model-viewer.min.js"></script>
<script type="module">
import { WebIO } from '@gltf-transform/core';
import { prune } from '@gltf-transform/functions';
Expand Down
5 changes: 3 additions & 2 deletions bindings/wasm/examples/model-viewer.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,10 @@
<option value="union">Union</option>
</select>
<button id="download">Download manifold GLB</button>
<model-viewer camera-controls shadow-intensity="1" alt="Output of mesh Boolean operation"></model-viewer>
<model-viewer camera-controls shadow-intensity="1" tone-mapping="commerce"
alt="Output of mesh Boolean operation"></model-viewer>
</body>
<script type="module" src="https://ajax.googleapis.com/ajax/libs/model-viewer/3.3.0/model-viewer.min.js"></script>
<script type="module" src="https://ajax.googleapis.com/ajax/libs/model-viewer/3.4.0/model-viewer.min.js"></script>
<script type="module">
import { Document, WebIO } from '@gltf-transform/core';
import { clearNodeTransform, flatten, prune } from '@gltf-transform/functions';
Expand Down

0 comments on commit f190c83

Please # to comment.