@cluesmith/codev 1.5.11 → 1.5.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/templates/3d-viewer.html +5 -5
package/package.json
CHANGED
package/templates/3d-viewer.html
CHANGED
|
@@ -353,7 +353,7 @@
|
|
|
353
353
|
const loader = new STLLoader();
|
|
354
354
|
|
|
355
355
|
loader.load(
|
|
356
|
-
'
|
|
356
|
+
'api/model',
|
|
357
357
|
(geometry) => {
|
|
358
358
|
// Center geometry
|
|
359
359
|
geometry.computeBoundingBox();
|
|
@@ -396,7 +396,7 @@
|
|
|
396
396
|
const loader = new ThreeMFLoader();
|
|
397
397
|
|
|
398
398
|
loader.load(
|
|
399
|
-
'
|
|
399
|
+
'api/model',
|
|
400
400
|
(group) => {
|
|
401
401
|
// 3MFLoader returns a Group with meshes
|
|
402
402
|
// 3MF uses Z-up, Three.js uses Y-up - rotate to match
|
|
@@ -648,7 +648,7 @@
|
|
|
648
648
|
|
|
649
649
|
async function checkForChanges() {
|
|
650
650
|
try {
|
|
651
|
-
const res = await fetch('
|
|
651
|
+
const res = await fetch('api/mtime');
|
|
652
652
|
if (res.ok) {
|
|
653
653
|
const data = await res.json();
|
|
654
654
|
if (lastMtime === null) {
|
|
@@ -702,7 +702,7 @@
|
|
|
702
702
|
|
|
703
703
|
function reloadSTL() {
|
|
704
704
|
const loader = new STLLoader();
|
|
705
|
-
loader.load('
|
|
705
|
+
loader.load('api/model?t=' + Date.now(), (geometry) => {
|
|
706
706
|
// Center geometry
|
|
707
707
|
geometry.computeBoundingBox();
|
|
708
708
|
const center = new THREE.Vector3();
|
|
@@ -745,7 +745,7 @@
|
|
|
745
745
|
|
|
746
746
|
function reload3MF() {
|
|
747
747
|
const loader = new ThreeMFLoader();
|
|
748
|
-
loader.load('
|
|
748
|
+
loader.load('api/model?t=' + Date.now(), (group) => {
|
|
749
749
|
// Z-up to Y-up rotation
|
|
750
750
|
group.rotation.set(-Math.PI / 2, 0, 0);
|
|
751
751
|
|