x_ite 8.6.1 → 8.6.3

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.
Files changed (73) hide show
  1. package/dist/assets/components/Annotation.js +13 -13
  2. package/dist/assets/components/Annotation.min.js +1 -1
  3. package/dist/assets/components/CADGeometry.js +13 -13
  4. package/dist/assets/components/CADGeometry.min.js +1 -1
  5. package/dist/assets/components/CubeMapTexturing.js +25 -25
  6. package/dist/assets/components/CubeMapTexturing.min.js +1 -1
  7. package/dist/assets/components/DIS.js +13 -13
  8. package/dist/assets/components/DIS.min.js +1 -1
  9. package/dist/assets/components/EventUtilities.js +9 -9
  10. package/dist/assets/components/EventUtilities.min.js +1 -1
  11. package/dist/assets/components/Geometry2D.js +19 -19
  12. package/dist/assets/components/Geometry2D.min.js +1 -1
  13. package/dist/assets/components/Geospatial.js +33 -33
  14. package/dist/assets/components/Geospatial.min.js +1 -1
  15. package/dist/assets/components/HAnim.js +18 -18
  16. package/dist/assets/components/HAnim.min.js +1 -1
  17. package/dist/assets/components/KeyDeviceSensor.js +8 -8
  18. package/dist/assets/components/KeyDeviceSensor.min.js +1 -1
  19. package/dist/assets/components/Layout.js +27 -27
  20. package/dist/assets/components/Layout.min.js +1 -1
  21. package/dist/assets/components/NURBS.js +24 -24
  22. package/dist/assets/components/NURBS.min.js +1 -1
  23. package/dist/assets/components/ParticleSystems.js +23 -23
  24. package/dist/assets/components/ParticleSystems.min.js +1 -1
  25. package/dist/assets/components/Picking.js +19 -19
  26. package/dist/assets/components/Picking.min.js +1 -1
  27. package/dist/assets/components/RigidBodyPhysics.js +18 -18
  28. package/dist/assets/components/RigidBodyPhysics.min.js +1 -1
  29. package/dist/assets/components/Scripting.js +28 -28
  30. package/dist/assets/components/Scripting.min.js +1 -1
  31. package/dist/assets/components/Text.js +33 -36
  32. package/dist/assets/components/Text.min.js +1 -1
  33. package/dist/assets/components/TextureProjector.js +14 -14
  34. package/dist/assets/components/TextureProjector.min.js +1 -1
  35. package/dist/assets/components/Texturing3D.js +30 -30
  36. package/dist/assets/components/Texturing3D.min.js +1 -1
  37. package/dist/assets/components/VolumeRendering.js +19 -19
  38. package/dist/assets/components/VolumeRendering.min.js +1 -1
  39. package/dist/assets/components/X_ITE.js +9 -9
  40. package/dist/assets/components/X_ITE.min.js +1 -1
  41. package/dist/x_ite.css +1 -1
  42. package/dist/x_ite.js +221 -186
  43. package/dist/x_ite.min.js +1 -1
  44. package/dist/x_ite.zip +0 -0
  45. package/docs/_config.yml +2 -2
  46. package/docs/_posts/getting-started.md +1 -1
  47. package/docs/_posts/laboratory/x3d-file-converter.md +183 -0
  48. package/docs/laboratory/3d-l-system-generator.html +1 -1
  49. package/docs/laboratory/gltf-sample-viewer.html +1 -1
  50. package/docs/laboratory/online-dicom-and-nrrd-file-viewer.html +1 -1
  51. package/docs/laboratory/real-time-earth-quake-information.html +1 -1
  52. package/docs/laboratory/x3d-visual-blend-mode-editor.html +1 -1
  53. package/package.json +1 -1
  54. package/src/standard/Math/Algorithms/Bezier.js +3 -15
  55. package/src/standard/Math/Numbers/Matrix2.js +5 -5
  56. package/src/tests.js +11 -0
  57. package/src/x_ite/Browser/Core/X3DCoreContext.js +4 -6
  58. package/src/x_ite/Browser/Text/PolygonText.js +9 -12
  59. package/src/x_ite/Browser/VERSION.js +1 -1
  60. package/src/x_ite/Components/Core/X3DNode.js +12 -0
  61. package/src/x_ite/Components/Core/X3DPrototypeInstance.js +18 -0
  62. package/src/x_ite/Configuration/UnitInfo.js +2 -0
  63. package/src/x_ite/Execution/X3DExportedNode.js +4 -0
  64. package/src/x_ite/Execution/X3DImportedNode.js +14 -0
  65. package/src/x_ite/Execution/X3DScene.js +4 -0
  66. package/src/x_ite/Fields/SFString.js +4 -6
  67. package/src/x_ite/InputOutput/FileLoader.js +1 -1
  68. package/src/x_ite/InputOutput/Generator.js +35 -55
  69. package/src/x_ite/Parser/SVGParser.js +41 -41
  70. package/src/x_ite/Parser/X3DParser.js +3 -2
  71. package/src/x_ite/Prototype/X3DExternProtoDeclaration.js +4 -0
  72. package/src/x_ite/Prototype/X3DProtoDeclaration.js +4 -0
  73. package/src/x_ite/Routing/X3DRoute.js +8 -0
package/dist/x_ite.zip CHANGED
Binary file
package/docs/_config.yml CHANGED
@@ -20,7 +20,7 @@ timezone:
20
20
  # ↓ --------------------------
21
21
 
22
22
  title: X_ITE X3D Browser # the main title
23
- version: 8.6.1 # x_ite latest version
23
+ version: 8.6.3 # x_ite latest version
24
24
  size: 287 # size in kb
25
25
  x3d_latest_version: 4.0 # x3d latest version
26
26
 
@@ -180,7 +180,7 @@ compress_html:
180
180
  profile: false
181
181
  blanklines: false
182
182
  ignore:
183
- envs: [x-development]
183
+ envs: [development]
184
184
 
185
185
  exclude:
186
186
  - "*.gem"
@@ -645,7 +645,7 @@ X_ITE can load several file formats, either directly as the source of the \<x3d-
645
645
  >**Tip:** All files can be compressed using GZip compression. This saves bandwidth and speeds up download time.
646
646
  {: .prompt-tip }
647
647
 
648
- For more information see [How to Configure Your Web Server](how-to-configure-your-web-server).
648
+ If you have an own web-server see [How to Configure Your Web Server](how-to-configure-your-web-server). If you are looking for an online file format converter [see here](laboratory/x3d-file-converter).
649
649
 
650
650
  ### Fallback Content
651
651
 
@@ -0,0 +1,183 @@
1
+ ---
2
+ title: Free Online X3D File Format Converter
3
+ date: 2023-02-21
4
+ categories: [Laboratory]
5
+ tags: [X3D, File, Format, Converter]
6
+ x_ite: true
7
+ ---
8
+ <style>
9
+ #drop-zone {
10
+ box-sizing: border-box;
11
+ border: 8px dashed lightskyblue;
12
+ }
13
+
14
+ #drop-zone .center {
15
+ padding: 3rem;
16
+ text-align: center;
17
+ font-size: 200%;
18
+ font-weight: bold;
19
+ margin: 0;
20
+ background: aliceblue;
21
+ }
22
+
23
+ #convert-files,
24
+ #converting-files {
25
+ display: none;
26
+ }
27
+
28
+ #drop-zone x3d-canvas,
29
+ #drop-zone input[type=file] {
30
+ display: none;
31
+ }
32
+
33
+ #drop-zone a {
34
+ border: none;
35
+ }
36
+
37
+ #drop-zone select {
38
+ color: unset;
39
+ position: relative;
40
+ top: -6px;
41
+ }
42
+ </style>
43
+
44
+ <script defer src="https://create3000.github.io/media/laboratory/l-system/FileSaver.js-2.0.0/dist/FileSaver.min.js"></script>
45
+ <script defer>
46
+ $(() =>
47
+ {
48
+ $("#drop-zone") .on ("dragover", event =>
49
+ {
50
+ event .stopPropagation ();
51
+ event .preventDefault ();
52
+
53
+ event .originalEvent .dataTransfer .dropEffect = "copy";
54
+ });
55
+
56
+ $("#drop-zone") .on ("drop", event =>
57
+ {
58
+ event .stopPropagation ();
59
+ event .preventDefault ();
60
+
61
+ read (event .originalEvent .dataTransfer .files);
62
+ });
63
+
64
+ $("#open-files a") .on ("click", event =>
65
+ {
66
+ const input = $("<input></input>")
67
+ .attr ("type", "file")
68
+ .appendTo ($("#open-files"));
69
+
70
+ input .on ("change", event =>
71
+ {
72
+ read (event .target .files);
73
+ input .remove ();
74
+ });
75
+
76
+ input .trigger ("click");
77
+ return false;
78
+ });
79
+
80
+ function read (files)
81
+ {
82
+ read .files = [... files];
83
+
84
+ $("#open-files") .hide ();
85
+ $("#convert-files") .show ();
86
+ }
87
+
88
+ $("#convert-files a") .on ("click", event =>
89
+ {
90
+ $("#convert-files") .hide ();
91
+ $("#converting-files") .show ();
92
+
93
+ convert ($("#drop-zone select") .val (), read .files);
94
+
95
+ return false;
96
+ });
97
+
98
+ const formats = {
99
+ "XML": ["model/x3d+xml", ".x3d", "toXMLString"],
100
+ "VRML": ["model/x3d+vrml", ".x3dv", "toVRMLString"],
101
+ "JSON": ["model/x3d+json", ".x3dj", "toJSONString"],
102
+ };
103
+
104
+ async function convert (encoding, files)
105
+ {
106
+ const [mimeType, extension, toString] = formats [encoding];
107
+
108
+ for (const file of files)
109
+ {
110
+ try
111
+ {
112
+ const
113
+ Browser = X3D .createBrowser () .browser,
114
+ url = URL .createObjectURL (file);
115
+
116
+ Browser .endUpdate ();
117
+
118
+ await Browser .loadURL (new X3D .MFString (url));
119
+
120
+ link (mimeType, file .name .replace (/\.[^.]+$/, "") + extension, Browser .currentScene [toString] ());
121
+ }
122
+ catch (error)
123
+ {
124
+ console .error (error);
125
+ }
126
+ }
127
+
128
+ $("#converting-files") .hide ();
129
+ $("#open-files") .show ();
130
+ }
131
+
132
+ function link (mimeType, name, x3dSyntax)
133
+ {
134
+ const a = $("<a></a>")
135
+ .text (name)
136
+ .attr ("href", "#")
137
+ .on ("click", download .bind (null, mimeType, name, x3dSyntax));
138
+
139
+ $("<li></li>") .append (a) .appendTo ($("#download-links"));
140
+ }
141
+
142
+ function download (mimeType, name, x3dSyntax)
143
+ {
144
+ const blob = new Blob ([x3dSyntax], { type: `${mimeType};charset=utf-8` });
145
+
146
+ saveAs (blob, name);
147
+
148
+ return false;
149
+ }
150
+ });
151
+ </script>
152
+
153
+ ## Upload and Convert
154
+
155
+ Convert **X3D, VRML, glTF (GLB), OBJ, STL,** and **SVG** to a X3D format of your choice.
156
+
157
+ <div id="drop-zone">
158
+ <p id="open-files" class="center">
159
+ <a href="#">Choose a file</a> or drag it here.
160
+ <input type="file" />
161
+ </p>
162
+ <p id="convert-files" class="center">
163
+ <a href="#">Convert file to ...</a>
164
+ <select>
165
+ <option value="XML" selected>X3D XML Encoding</option>
166
+ <option value="VRML">X3D VRML Encoding</option>
167
+ <option value="JSON">X3D JSON Encoding</option>
168
+ </select>
169
+ </p>
170
+ <p id="converting-files" class="center">
171
+ Converting files ...
172
+ </p>
173
+ </div>
174
+
175
+ ### Converted Files
176
+
177
+ Your converted files will appear here.
178
+
179
+ <ul id="download-links"></ul>
180
+
181
+ ## Command Line Tool
182
+
183
+ If you are looking for a command line tool to convert files, have a look at [x3d-tidy](https://www.npmjs.com/package/x3d-tidy){:target="_blank"}. It is a Node program and it can be run via `npx x3d-tidy`.
@@ -3,7 +3,7 @@ title: 3D L-System Generator
3
3
  layout: wide
4
4
  collection: tabs
5
5
  categories: [Laboratory]
6
- tags: [3D, l-system, generator]
6
+ tags: [3D, L-System, Generator]
7
7
  ---
8
8
  <style>
9
9
  .row, .post, .post-content {
@@ -3,7 +3,7 @@ title: glTF Sample Viewer
3
3
  layout: wide
4
4
  collection: tabs
5
5
  categories: [Laboratory]
6
- tags: [glTF, sample, viewer]
6
+ tags: [glTF, Sample, Viewer]
7
7
  ---
8
8
  <style>
9
9
  .post, .post-content {
@@ -3,7 +3,7 @@ title: Online DICOM and NRRD file Viewer
3
3
  layout: wide
4
4
  collection: tabs
5
5
  categories: [Laboratory]
6
- tags: [online, dicom, nrrd, file, viewer]
6
+ tags: [Online, DICOM, NRRD, File, Viewer]
7
7
  ---
8
8
  <style>
9
9
  .row, .post, .post-content {
@@ -3,7 +3,7 @@ title: Real Time Earth Quake Information
3
3
  layout: wide
4
4
  collection: tabs
5
5
  categories: [Laboratory]
6
- tags: [real time, earth quake]
6
+ tags: [Real Time, Earth Quake]
7
7
  ---
8
8
  <style>
9
9
  /* Table */
@@ -3,7 +3,7 @@ title: X3D Visual Blend Mode Editor
3
3
  layout: wide
4
4
  collection: tabs
5
5
  categories: [Laboratory]
6
- tags: [X3D, visual, blend mode, editor]
6
+ tags: [X3D, Visual, Blend Mode, Editor]
7
7
  ---
8
8
  <link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/cferdinandi/tabby@12.0.0/dist/css/tabby-ui.min.css">
9
9
  <script src="https://cdn.jsdelivr.net/gh/cferdinandi/tabby@12.0.0/dist/js/tabby.polyfills.min.js"></script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "x_ite",
3
- "version": "8.6.1",
3
+ "version": "8.6.3",
4
4
  "description": "X_ITE X3D Browser, view and manipulate X3D and VRML scenes in HTML.",
5
5
  "homepage": "https://create3000.github.io/x_ite/",
6
6
  "author": "Holger Seelig <holger.seelig@gmail.com>",
@@ -64,10 +64,8 @@ const Bezier =
64
64
  c = new Matrix3 (1, 0, 0, -2, 2, 0, 1, -2, 1),
65
65
  p = new Matrix3 ();
66
66
 
67
- return function (x0, y0, z0, x1, y1, z1, x2, y2, z2, steps)
67
+ return function (x0, y0, z0, x1, y1, z1, x2, y2, z2, steps, points)
68
68
  {
69
- const points = [ ];
70
-
71
69
  p .set (x0, y0, z0, x1, y1, z1, x2, y2, z2)
72
70
  .multLeft (c);
73
71
 
@@ -77,8 +75,6 @@ const Bezier =
77
75
 
78
76
  points .push (p .multVecMatrix (new Vector3 (1, t, t * t)));
79
77
  }
80
-
81
- return points;
82
78
  };
83
79
  })(),
84
80
  cubic: (function ()
@@ -88,10 +84,8 @@ const Bezier =
88
84
  c = new Matrix4 (1, 0, 0, 0, -3, 3, 0, 0, 3, -6, 3, 0, -1, 3, -3, 1),
89
85
  p = new Matrix4 ();
90
86
 
91
- return function (x0, y0, z0, x1, y1, z1, x2, y2, z2, x3, y3, z3, steps)
87
+ return function (x0, y0, z0, x1, y1, z1, x2, y2, z2, x3, y3, z3, steps, points)
92
88
  {
93
- const points = [ ];
94
-
95
89
  p .set (x0, y0, z0, 0, x1, y1, z1, 0, x2, y2, z2, 0, x3, y3, z3, 0)
96
90
  .multLeft (c);
97
91
 
@@ -103,14 +97,10 @@ const Bezier =
103
97
 
104
98
  points .push (new Vector3 (v .x, v .y, v .z));
105
99
  }
106
-
107
- return points;
108
100
  };
109
101
  })(),
110
- arc: function (ax, ay, rx, ry, xAxisRotation, largeArcFlag, sweepFlag, x, y, steps)
102
+ arc: function (ax, ay, rx, ry, xAxisRotation, largeArcFlag, sweepFlag, x, y, steps, points)
111
103
  {
112
- const points = [ ];
113
-
114
104
  // https://ericeastwood.com/blog/25/curves-and-arcs-quadratic-cubic-elliptical-svg-implementations
115
105
  // See https://www.w3.org/TR/SVG/implnote.html#ArcImplementationNotes.
116
106
 
@@ -236,8 +226,6 @@ const Bezier =
236
226
  }
237
227
 
238
228
  points .push (new Vector3 (x, y, 0));
239
-
240
- return points;
241
229
  }
242
230
  };
243
231
 
@@ -145,7 +145,7 @@ Matrix2 .prototype =
145
145
  inverse: function ()
146
146
  {
147
147
  const
148
- [A, B, C, D] = this [3],
148
+ { 0: A, 1: B, 2: C, 3: D } = this [3],
149
149
  d = A * D - B * C;
150
150
 
151
151
  // if (d === 0) ... determinant is zero.
@@ -160,8 +160,8 @@ Matrix2 .prototype =
160
160
  multLeft: function (matrix)
161
161
  {
162
162
  const
163
- [a0, a1, a2, a3] = this,
164
- [b0, b1, b2, b3] = matrix;
163
+ { 0: a0, 1: a1, 2: a2, 3: a3 } = this,
164
+ { 0: b0, 1: b1, 2: b2, 3: b3 } = matrix;
165
165
 
166
166
  this [0] = a0 * b0 + a2 * b1;
167
167
  this [1] = a1 * b0 + a3 * b1;
@@ -173,8 +173,8 @@ Matrix2 .prototype =
173
173
  multRight: function (matrix)
174
174
  {
175
175
  const
176
- [a0, a1, a2, a3] = this,
177
- [b0, b1, b2, b3] = matrix;
176
+ { 0: a0, 1: a1, 2: a2, 3: a3 } = this,
177
+ { 0: b0, 1: b1, 2: b2, 3: b3 } = matrix;
178
178
 
179
179
  this [0] = b0 * a0 + b2 * a1;
180
180
  this [1] = b1 * a0 + b3 * a1;
package/src/tests.js CHANGED
@@ -103,9 +103,20 @@ const X_ITE_TESTS = [
103
103
  { component: "HAnim" },
104
104
  { path: "HAnim/BoxManC.x3d" },
105
105
  { component: "Interpolation" },
106
+ { path: "Interpolation/ComposeSFVec3f.wrl" },
107
+ { path: "Interpolation/Cube.wrl" },
108
+ { path: "Interpolation/EaseInEaseOut.wrl" },
109
+ { path: "Interpolation/Interpolators.wrl" },
110
+ { path: "Interpolation/LineTrail.wrl" },
106
111
  { path: "Interpolation/NormalInterpolator.x3d" },
107
112
  { path: "Interpolation/OrientationInterpolator.x3d" },
113
+ { path: "Interpolation/ParticleShape.wrl" },
108
114
  { path: "Interpolation/PositionInterpolator.x3d" },
115
+ { path: "Interpolation/SplinePositionInterpolator.wrl" },
116
+ { path: "Interpolation/SplinePositionInterpolator2.wrl" },
117
+ { path: "Interpolation/SplineScalarInterpolator.wrl" },
118
+ { path: "Interpolation/SquadOrientationInterpolator.wrl" },
119
+ { path: "Interpolation/warp.wrl" },
109
120
  { component: "Layering" },
110
121
  { path: "Layering/LayerSet.x3d" },
111
122
  { path: "Layering/Rotor.x3d" },
@@ -121,7 +121,9 @@ function X3DCoreContext (element)
121
121
  this [_notification] = new Notification (this .getPrivateScene ());
122
122
  this [_contextMenu] = new ContextMenu (this .getPrivateScene ());
123
123
 
124
- this [_pixelPerPoint] = 1; // default 72 dpi
124
+ const inches = $("<div></div>") .hide () .css ("height", "10in") .appendTo ($("body"));
125
+ this [_pixelPerPoint] = inches .height () / 720 || 1;
126
+ inches .remove ();
125
127
 
126
128
  this .addChildObjects ("controlKey", new Fields .SFBool (),
127
129
  "shiftKey", new Fields .SFBool (),
@@ -261,11 +263,7 @@ X3DCoreContext .prototype =
261
263
  return this [_pixelPerPoint] * this .getRenderingProperty ("ContentScale");
262
264
  },
263
265
  connectedCallback: function ()
264
- {
265
- const inches = $("<div></div>") .hide () .css ("height", "10in") .appendTo (this [_shadow]);
266
- this [_pixelPerPoint] = inches .height () / 720 || 1;
267
- inches .remove ();
268
- },
266
+ { },
269
267
  attributeChangedCallback: function (name, oldValue, newValue)
270
268
  {
271
269
  switch (name)
@@ -256,47 +256,44 @@ PolygonText .prototype = Object .assign (Object .create (X3DTextGeometry .protot
256
256
  x = 0,
257
257
  y = 0;
258
258
 
259
- for (const command of path .commands)
259
+ for (const { type, x1, y1, x2, y2, x: cx, y: cy } of path .commands)
260
260
  {
261
- switch (command .type)
261
+ switch (type)
262
262
  {
263
263
  case "M": // Start
264
264
  case "Z": // End
265
265
  {
266
- // Filter consecutive identical points.
267
- points = points .filter ((p, i, a) => !p .equals (a [(i + 1) % a .length]));
268
-
269
266
  if (points .length > 2)
270
267
  contours .push (points);
271
268
 
272
269
  points = [ ];
273
270
 
274
- if (command .type === "M")
275
- points .push (new Vector3 (command .x, -command .y, 0));
271
+ if (type === "M")
272
+ points .push (new Vector3 (cx, -cy, 0));
276
273
 
277
274
  break;
278
275
  }
279
276
  case "L": // Linear
280
277
  {
281
- points .push (new Vector3 (command .x, -command .y, 0));
278
+ points .push (new Vector3 (cx, -cy, 0));
282
279
  break;
283
280
  }
284
281
  case "Q": // Quadric
285
282
  {
286
- points .push (... Bezier .quadric (x, -y, 0, command .x1, -command .y1, 0, command .x, -command .y, 0, steps));
283
+ Bezier .quadric (x, -y, 0, x1, -y1, 0, cx, -cy, 0, steps, points);
287
284
  break;
288
285
  }
289
286
  case "C": // Cubic
290
287
  {
291
- points .push (... Bezier .cubic (x, -y, 0, command .x1, -command .y1, 0, command .x2, -command .y2, 0, command .x, -command .y, 0, steps));
288
+ Bezier .cubic (x, -y, 0, x1, -y1, 0, x2, -y2, 0, cx, -cy, 0, steps, points);
292
289
  break;
293
290
  }
294
291
  default:
295
292
  continue;
296
293
  }
297
294
 
298
- x = command .x;
299
- y = command .y;
295
+ x = cx;
296
+ y = cy;
300
297
  }
301
298
 
302
299
  return this .triangulatePolygon (contours, vertices);
@@ -45,4 +45,4 @@
45
45
  *
46
46
  ******************************************************************************/
47
47
 
48
- export default "8.6.1";
48
+ export default "8.6.3";
@@ -804,7 +804,9 @@ X3DNode .prototype = Object .assign (Object .create (X3DBaseNode .prototype),
804
804
  generator .string += '"';
805
805
  generator .string += ':';
806
806
  generator .string += generator .TidySpace ();
807
+ generator .string += '"';
807
808
  generator .string += generator .JSONEncode (name);
809
+ generator .string += '"';
808
810
  generator .string += generator .TidyBreak ();
809
811
  generator .string += generator .DecIndent ();
810
812
  generator .string += generator .Indent ();
@@ -847,7 +849,9 @@ X3DNode .prototype = Object .assign (Object .create (X3DBaseNode .prototype),
847
849
  generator .string += '"';
848
850
  generator .string += ':';
849
851
  generator .string += generator .TidySpace ();
852
+ generator .string += '"';
850
853
  generator .string += generator .JSONEncode (name);
854
+ generator .string += '"';
851
855
  generator .string += ',';
852
856
  generator .string += generator .TidyBreak ();
853
857
  }
@@ -1008,7 +1012,9 @@ X3DNode .prototype = Object .assign (Object .create (X3DBaseNode .prototype),
1008
1012
  generator .string += '"';
1009
1013
  generator .string += ':';
1010
1014
  generator .string += generator .TidySpace ();
1015
+ generator .string += '"';
1011
1016
  generator .string += generator .JSONEncode (field .getName ());
1017
+ generator .string += '"';
1012
1018
 
1013
1019
  // If the field is a inputOutput and we have as reference only inputOnly or outputOnly we must output the value
1014
1020
  // for this field.
@@ -1131,7 +1137,9 @@ X3DNode .prototype = Object .assign (Object .create (X3DBaseNode .prototype),
1131
1137
  for (let i = 0, length = sourceTextLines .length; i < length; ++ i)
1132
1138
  {
1133
1139
  generator .string += generator .ListIndent ();
1140
+ generator .string += '"';
1134
1141
  generator .string += generator .JSONEncode (sourceTextLines [i]);
1142
+ generator .string += '"';
1135
1143
 
1136
1144
  if (i !== length - 1)
1137
1145
  generator .string += ',';
@@ -1187,7 +1195,9 @@ X3DNode .prototype = Object .assign (Object .create (X3DBaseNode .prototype),
1187
1195
  generator .string += '"';
1188
1196
  generator .string += ':';
1189
1197
  generator .string += generator .TidySpace ();
1198
+ generator .string += '"';
1190
1199
  generator .string += generator .JSONEncode (field .getName ());
1200
+ generator .string += '"';
1191
1201
  generator .string += ',';
1192
1202
  generator .string += generator .TidyBreak ();
1193
1203
 
@@ -1197,7 +1207,9 @@ X3DNode .prototype = Object .assign (Object .create (X3DBaseNode .prototype),
1197
1207
  generator .string += '"';
1198
1208
  generator .string += ':';
1199
1209
  generator .string += generator .TidySpace ();
1210
+ generator .string += '"';
1200
1211
  generator .string += generator .JSONEncode (protoField .getName ());
1212
+ generator .string += '"';
1201
1213
  generator .string += generator .TidyBreak ();
1202
1214
 
1203
1215
  generator .string += generator .DecIndent ();
@@ -663,7 +663,9 @@ X3DPrototypeInstance .prototype = Object .assign (Object .create (X3DNode .proto
663
663
  generator .string += '"';
664
664
  generator .string += ':';
665
665
  generator .string += generator .TidySpace ();
666
+ generator .string += '"';
666
667
  generator .string += generator .JSONEncode (this .getTypeName ());
668
+ generator .string += '"';
667
669
  generator .string += ',';
668
670
  generator .string += generator .TidyBreak ();
669
671
 
@@ -673,7 +675,9 @@ X3DPrototypeInstance .prototype = Object .assign (Object .create (X3DNode .proto
673
675
  generator .string += '"';
674
676
  generator .string += ':';
675
677
  generator .string += generator .TidySpace ();
678
+ generator .string += '"';
676
679
  generator .string += generator .JSONEncode (name);
680
+ generator .string += '"';
677
681
  generator .string += generator .TidyBreak ();
678
682
 
679
683
  generator .string += generator .DecIndent ();
@@ -717,7 +721,9 @@ X3DPrototypeInstance .prototype = Object .assign (Object .create (X3DNode .proto
717
721
  generator .string += '"';
718
722
  generator .string += ':';
719
723
  generator .string += generator .TidySpace ();
724
+ generator .string += '"';
720
725
  generator .string += generator .JSONEncode (name);
726
+ generator .string += '"';
721
727
  generator .string += ',';
722
728
  generator .string += generator .TidyBreak ();
723
729
  }
@@ -731,7 +737,9 @@ X3DPrototypeInstance .prototype = Object .assign (Object .create (X3DNode .proto
731
737
  generator .string += '"';
732
738
  generator .string += ':';
733
739
  generator .string += generator .TidySpace ();
740
+ generator .string += '"';
734
741
  generator .string += generator .JSONEncode (this .getTypeName ());
742
+ generator .string += '"';
735
743
  generator .string += ',';
736
744
  generator .string += generator .TidyBreak ();
737
745
 
@@ -804,7 +812,9 @@ X3DPrototypeInstance .prototype = Object .assign (Object .create (X3DNode .proto
804
812
  generator .string += '"';
805
813
  generator .string += ':';
806
814
  generator .string += generator .TidySpace ();
815
+ generator .string += '"';
807
816
  generator .string += generator .JSONEncode (field .getName ());
817
+ generator .string += '"';
808
818
  generator .string += ',';
809
819
  generator .string += generator .TidyBreak ();
810
820
  generator .string += generator .Indent ();
@@ -842,7 +852,9 @@ X3DPrototypeInstance .prototype = Object .assign (Object .create (X3DNode .proto
842
852
  generator .string += '"';
843
853
  generator .string += ':';
844
854
  generator .string += generator .TidySpace ();
855
+ generator .string += '"';
845
856
  generator .string += generator .JSONEncode (field .getName ());
857
+ generator .string += '"';
846
858
  generator .string += ',';
847
859
  generator .string += generator .TidyBreak ();
848
860
  generator .string += generator .Indent ();
@@ -872,7 +884,9 @@ X3DPrototypeInstance .prototype = Object .assign (Object .create (X3DNode .proto
872
884
  generator .string += '"';
873
885
  generator .string += ':';
874
886
  generator .string += generator .TidySpace ();
887
+ generator .string += '"';
875
888
  generator .string += generator .JSONEncode (field .getName ());
889
+ generator .string += '"';
876
890
  generator .string += ',';
877
891
  generator .string += generator .TidyBreak ();
878
892
  generator .string += generator .Indent ();
@@ -945,7 +959,9 @@ X3DPrototypeInstance .prototype = Object .assign (Object .create (X3DNode .proto
945
959
  generator .string += '"';
946
960
  generator .string += ':';
947
961
  generator .string += generator .TidySpace ();
962
+ generator .string += '"';
948
963
  generator .string += generator .JSONEncode (field .getName ());
964
+ generator .string += '"';
949
965
  generator .string += ',';
950
966
  generator .string += generator .TidyBreak ();
951
967
 
@@ -955,7 +971,9 @@ X3DPrototypeInstance .prototype = Object .assign (Object .create (X3DNode .proto
955
971
  generator .string += '"';
956
972
  generator .string += ':';
957
973
  generator .string += generator .TidySpace ();
974
+ generator .string += '"';
958
975
  generator .string += generator .JSONEncode (protoField .getName ());
976
+ generator .string += '"';
959
977
  generator .string += generator .TidyBreak ();
960
978
 
961
979
  generator .string += generator .DecIndent ();
@@ -122,7 +122,9 @@ UnitInfo .prototype = Object .assign (Object .create (X3DObject .prototype),
122
122
  generator .string += '"';
123
123
  generator .string += ':';
124
124
  generator .string += generator .TidySpace ();
125
+ generator .string += '"';
125
126
  generator .string += generator .JSONEncode (this .name);
127
+ generator .string += '"';
126
128
  generator .string += ',';
127
129
  generator .string += generator .TidyBreak ();
128
130
 
@@ -133,7 +133,9 @@ X3DExportedNode .prototype = Object .assign (Object .create (X3DObject .prototyp
133
133
  generator .string += '"';
134
134
  generator .string += ':';
135
135
  generator .string += generator .TidySpace ();
136
+ generator .string += '"';
136
137
  generator .string += generator .JSONEncode (localName);
138
+ generator .string += '"';
137
139
 
138
140
  if (this [_exportedName] !== localName)
139
141
  {
@@ -145,7 +147,9 @@ X3DExportedNode .prototype = Object .assign (Object .create (X3DObject .prototyp
145
147
  generator .string += '"';
146
148
  generator .string += ':';
147
149
  generator .string += generator .TidySpace ();
150
+ generator .string += '"';
148
151
  generator .string += generator .JSONEncode (this [_exportedName]);
152
+ generator .string += '"';
149
153
  generator .string += generator .TidyBreak ();
150
154
  }
151
155
  else