-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cb73060
commit 0e2d5ab
Showing
9 changed files
with
55 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,17 @@ | ||
[ | ||
{ | ||
"name": "test", | ||
"name": "tetrahedron", | ||
"color": "#bd0d87", | ||
"material": "Standard", | ||
"position": [-5.0, 0.0, 0.0], | ||
"vertices": [0.0, 1.0, 0.0, -1.0, -1.0, 1.0, 1.0, -1.0, 1.0, 1.0, -1.0, -1.0, -1.0, -1.0, -1.0], | ||
"faces": [0, 1, 2, 0, 2, 3, 0, 3, 4, 0, 4, 1, 1, 4, 3, 3, 2, 1] | ||
}, | ||
{ | ||
"name": "cube", | ||
"color": "#ff0000", | ||
"material": "Standard", | ||
"vertices": [-3.0, -3.0, -3.0, -3.0, -3.0, 3.0, -3.0, 3.0, -3.0, -3.0, 3.0, 3.0, 3.0, -3.0, -3.0, 3.0, -3.0, 3.0, 3.0, 3.0, -3.0, 3.0, 3.0, 3.0], | ||
"faces": [0, 1, 2, 1, 3, 2, 4, 6, 5, 6, 7, 5, 4, 5, 0, 5, 1, 0, 6, 2, 7, 2, 3, 7, 0, 2, 4, 2, 6, 4, 1, 5, 3, 5, 7, 3] | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+548 Bytes
(100%)
tests/e2e/gui.spec.js-snapshots/Edit-Object-Rotate-Object-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+573 Bytes
(100%)
tests/e2e/gui.spec.js-snapshots/Edit-Rotate-Atoms-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+101 Bytes
(100%)
tests/e2e/gui.spec.js-snapshots/VectorField-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<title>WEAS Test</title> | ||
</head> | ||
<body> | ||
<div id="viewer" style="position: relative; width: 600px; height: 400px"></div> | ||
|
||
<script type="module"> | ||
import * as weas from "../../dist/weas.mjs"; | ||
|
||
async function fetchFile(filename) { | ||
const response = await fetch(`../../demo/datas/${filename}`); | ||
if (!response.ok) { | ||
throw new Error(`Failed to load file for structure: ${filename}`); | ||
} | ||
return await response.text(); | ||
} | ||
|
||
let domElement = document.getElementById("viewer"); | ||
// read atoms from file | ||
const filename = "any_mesh_settings.json"; | ||
fetchFile(filename).then((fileContent) => { | ||
const data = JSON.parse(fileContent); | ||
let editor = new weas.WEAS({ domElement }); | ||
editor.anyMesh.fromSettings(data); | ||
editor.anyMesh.drawMesh(); | ||
editor.selectionManager.selectedObjects = [editor.anyMesh.meshes[0]]; | ||
editor.render(); | ||
}); | ||
</script> | ||
</body> | ||
</html> |