-
Notifications
You must be signed in to change notification settings - Fork 2
/
blog_xkt_utilities_library.html
261 lines (221 loc) · 13 KB
/
blog_xkt_utilities_library.html
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="xeokit - SDK for Browser-Based 3D BIM Visualization">
<meta name="author" content="Lindsay Kay">
<meta name="keywords" content="BIM,IFC,WebGL,JavaScript,Browser,BCF,Web,BIMServer,xeolabs,3D,3D Viewer,Lindsay Kay,xeokit,MedViz,ArchViz,Open Source,Browser,Viewer">
<title>xeokit - 3D Web Programming Toolkit for BIM and Engineering Visualization</title>
<link href="./vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="./css/business-frontpage.css" rel="stylesheet">
<!--<script src="vendor/jquery/jquery.slim.min.js"></script>-->
<link href="https://fonts.googleapis.com/css?family=Rubik" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<!-- Bootstrap core JavaScript -->
<script src="./vendor/jquery/jquery.min.js"></script>
<script src="./vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top ">
<!-- <div class="container">-->
<span style="color: #ffffff;"><a class="navbar-home" href="http://xeolabs.com">xeolabs</a>/<a
class="navbar-brand" href="./index.html">xeokit SDK</a></span>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive"
aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ml-auto">
<li class="nav-item">
<a class="nav-link" href="./index.html?foo=0">Home</a>
</li>
<li class="nav-item dropdown">
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdownLearn">
<a class="dropdown-item" href="./demo.html?projectId=RevitSamples&tab=models">Revit Sample IFC
Model</a>
<a class="dropdown-item" href="./demo.html?projectId=MAPPointCloud">1.6M Point Cloud Model</a>
<a class="dropdown-item" href="./demo.html?projectId=MAP&tab=objects">Full-Precision IFC Model</a>
<a class="dropdown-item" href="./demo.html?projectId=OTCConferenceCenter&tab=storeys">Conference
Center Model</a>
<a class="dropdown-item" href="./demo.html?projectId=Schependomlaan&tab=storeys">Schependomlaan
Model</a>
<a class="dropdown-item" href="./demo.html?projectId=Schependomlaan_selectedStorey&tab=storeys">Schependomlaan
Ground Floor</a>
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="./index.html?foo=1#features">Features</a>
</li>
<li class="nav-item">
<a class="nav-link" href="./index.html?foo=1#faq">FAQ</a>
</li>
<li class="nav-item">
<a class="nav-link" href="./blog.html">Blog</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownExamples" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
Examples
</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdownExamples">
<a class="dropdown-item" href="https://xeokit.github.io/xeokit-sdk/examples/index.html">SDK Examples</a>
<a class="dropdown-item" href="https://xeokit.github.io/xeokit-sdk/examples/bimviewer.html" target="_examples">BIMViewer Examples</a>
</div>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownLearn" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
Developers
</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdownLearn">
<a class="dropdown-item"
href="https://www.notion.so/xeokit/xeokit-Documentation-4598591fcedb4889bf8896750651f74e">Documentation</a>
<a class="dropdown-item" href="https://xeokit.github.io/xeokit-sdk/examples/index.html">SDK Examples</a>
<a class="dropdown-item" href="https://xeokit.github.io/xeokit-sdk/examples/bimviewer.html" target="_examples">BIMViewer Examples</a>
<a class="dropdown-item" href="https://xeokit.github.io/xeokit-sdk/docs/" target="_docs">API
Reference</a>
<a class="dropdown-item" href="https://github.com/xeokit" target="_code">Source Code</a>
<a class="dropdown-item" href="https://xeokit.github.io/xeokit-model-conversion-tests/index.html">Model
Conversion</a>
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="./index.html?foo=2#pricing">Pricing</a>
</li>
<li class="nav-item">
<a class="nav-link" href="./download.html">Download</a>
</li>
<!-- <li class="nav-item">-->
<!-- <a class="nav-link" href="./index.html?foo=3#connect">Connect</a>-->
<!-- </li>-->
</ul>
</div>
<!-- </div>-->
</nav>
<div class="container">
<div class="row mt-5 mb-5">
<div class="col-md-12">
<h1><a href="./blog.html">Blog</a> / A Toolkit for Creating XKT Files</h1>
<hr>
<p>Oct 30, 2020</p>
<hr>
<p class="lead">The new double-precision geometry support in <a href="https://www.npmjs.com/package/@xeokit/xeokit-sdk">xeokit SDK 1.4.8+</a> includes a version
of the <a href="">xeokit-gltf-to-gltf</a> tool that generates a new version of xeokit's XKT geometry format.</p>
<img src="./img/kdtree.jpeg" class="img-fluid rounded mx-auto d-block" alt="...">
</div>
</div>
<div class="row mt-2 mb-5">
<div class="col-md-12">
<h2>A Utilities Library for Creating XKT Files</h2>
<p><b><a href="https://github.com/xeokit/xeokit-convert">xeokit-convert</a></b> is a new npm library of
JavaScript tools for programmatically creating XKT files.
</p>
<p>With this library, we can load, or programmatically build, an in-memory document that represents an XKT model.</p>
<p>We can then validate the model, and serialize it to an XKT binary file, which can be loaded into a xeokit viewer using <a
href="https://xeokit.github.io/xeokit-sdk/docs/class/src/plugins/XKTLoaderPlugin/XKTLoaderPlugin.js~XKTLoaderPlugin.html">XKTLoaderPlugin</a>.
</p>
<p>This library is now used as an external npm dependency by xeokit's <a
href="https://github.com/xeokit/xeokit-convert">xeokit-gltf-to-xkt</a> tool. The library
effectively factors out the tool's internal conversion logic into a public npm library
that we can reuse in own custom XKT tools.</p>
</div>
</div>
<div class="row mt-2 mb-5">
<div class="col-md-12">
<h2>What can we do with it?</h2>
<p></p><br>
<ul>
<li><p><b>Convert a glTF file into an XKT file.</b></p></li>
<li><p><b>Programmatically generate an XKT file.</b></p></li>
<li><p><b>Write custom converters for other source file formats.</b></p></li>
</ul>
<a href="#example1"><h4>Programmatically Generate an XKT File</h4></a>
</div>
</div>
<hr>
<div class="row mt-2 mb-5">
<div class="col-md-12">
<h2>Usage Examples</h2>
<a name="example1"><h5>Example 1: Convert a glTF Model into XKT</h5></a>
<a name="example1"><h5>Example 2: Programmatically Generate an XKT File</h5></a>
<script src="https://gist.github.com/xeolabs/6dbe8107dc14ab5aee6e887bf5afd91e.js"></script>
</div>
</div>
<hr>
</div>
<footer class="py-5 bg-dark xeokit-footer">
<div class="container pt-5">
<div class="row">
<div class="col-md-4 col-sm-12 mb-3 text-left">
<h2>xeokit SDK</h2>
<p>Powering Engineering Graphics on the Web</p>
<img src="./img/xeokitLogoAlphaBG.png">
</div>
<div class="col-md-8 col-sm-12">
<div class="col-md-4 col-sm-6 col-6 p-0 float-left mb-3">
<h5 class="mb-4 font-weight-bold text-uppercase ">Learn</h5>
<ul class="list-group">
<li class="list-group-item bg-transparent border-0 p-0 mb-2"><a
href="./index.html#features">Features</a></li>
<li class="list-group-item bg-transparent border-0 p-0 mb-2 "><a
href="./demo.html?projectId=OTCConferenceCenter&tab=storeys">Demo</a></li>
<li class="list-group-item bg-transparent border-0 p-0 mb-2 "><a
href="./blog.html">Blog</a></li>
<li class="list-group-item bg-transparent border-0 p-0 mb-2"><a
href="./index.html#pricing">Pricing</a></li>
<li class="list-group-item bg-transparent border-0 p-0 mb-2"><a
href="./index.html#faq">FAQ</a></li>
</ul>
</div>
<div class="col-md-4 col-sm-6 col-6 p-0 mb-3 float-left">
<h5 class="mb-4 font-weight-bold text-uppercase ">Develop</h5>
<ul class="list-group">
<li class="list-group-item bg-transparent border-0 p-0 mb-2"><a
href="./download.html">Download</a></li>
<li class="list-group-item bg-transparent border-0 p-0 mb-2"><a
href="https://xeokit.github.io/xeokit-sdk/examples/">Examples</a></li>
<li class="list-group-item bg-transparent border-0 p-0 mb-2"><a
href="https://xeokit.github.io/xeokit-sdk/docs/">API Docs</a></li>
<li class="list-group-item bg-transparent border-0 p-0 mb-2"><a
href="https://github.com/xeokit">Source Code</a></li>
<li class="list-group-item bg-transparent border-0 p-0 mb-2"><a
href="https://www.notion.so/xeokit">Tutorials</a></li>
<li class="list-group-item bg-transparent border-0 p-0 mb-2"><a
href="https://xeokit.github.io/xeokit-model-conversion-tests/index.html">Model
Conversion</a></li>
<li class="list-group-item bg-transparent border-0 p-0 mb-2"><a
href="https://github.com/xeokit/xeokit-sdk/issues">Issues</a></li>
</ul>
</div>
<div class="col-md-4 col-sm-6 col-6 mb-3 p-0 float-left">
<h5 class="mb-4 font-weight-bold text-uppercase ">Connect</h5>
<ul class="list-group">
<li class="list-group-item bg-transparent border-0 p-0 mb-2">
<a href="http://www.xeolabs.com"><i class="fa fa-globe mr-1"></i>
xeolabs.com</a>
</li>
<li class="list-group-item bg-transparent border-0 p-0 mb-2">
<a href="https://www.linkedin.com/company/xeolabs"><i class="fa fa-linkedin mr-1"></i>
LinkedIn</a>
</li>
<li class="list-group-item bg-transparent border-0 p-0 mb-2">
<a href="https://twitter.com/xeolabs"><i class="fa fa-twitter mr-1"></i> Twitter</a>
</li>
<li class="list-group-item bg-transparent border-0 p-0 mb-2">
<a href="https://github.com/xeolabs" target="_code"><i class="fa fa-github mr-1"></i>
Github</a>
</li>
</ul>
</div>
</div>
<div class="col-md-12">
<div class="py-4 d-flex justify-content-center align-items-center">
<p class="m-0 text-center">Copyright © <a href="http://xeolabs.com">xeolabs</a> 2021</p>
</div>
</div>
</div>
</div>
</footer>
</body>
</html>