-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathquickstart.html
More file actions
51 lines (40 loc) · 1.52 KB
/
quickstart.html
File metadata and controls
51 lines (40 loc) · 1.52 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<title>OpenPlans Quick Start</title>
<!-- TRACKING -->
<link rel="stylesheet" href="./shared/example.css">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="OpenPlans quick-start: a wall, door, and window in the browser.">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&display=swap"
rel="stylesheet">
<style>
body {
font-family: "JetBrains Mono", monospace;
}
</style>
</head>
<body>
<div class="example-title">Quick Start — Wall, Door, Window</div>
<div id="app"></div>
<script type="module">
import { CameraMode, OpenPlans } from '@opengeometry/openplans';
const container = document.getElementById('app');
if (!container) throw new Error('Missing app container');
const openPlans = new OpenPlans(container);
// The WebAssembly geometry kernel must be awaited before creating geometry.
await openPlans.setupOpenGeometry();
openPlans.CameraMode = CameraMode.Plan;
const wall = openPlans.singleWall();
wall.position.set(2, 0, 0);
const door = openPlans.door();
door.position.set(2, 0, 1);
const windowElement = openPlans.window();
windowElement.position.set(2, 0, 3);
openPlans.fitToView([wall, door, windowElement]);
</script>
</body>
</html>