x_ite 8.6.2 → 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.
- package/.vscode/settings.json +7 -7
- package/dist/assets/components/Annotation.js +13 -13
- package/dist/assets/components/Annotation.min.js +1 -1
- package/dist/assets/components/CADGeometry.js +13 -13
- package/dist/assets/components/CADGeometry.min.js +1 -1
- package/dist/assets/components/CubeMapTexturing.js +25 -25
- package/dist/assets/components/CubeMapTexturing.min.js +1 -1
- package/dist/assets/components/DIS.js +13 -13
- package/dist/assets/components/DIS.min.js +1 -1
- package/dist/assets/components/EventUtilities.js +9 -9
- package/dist/assets/components/EventUtilities.min.js +1 -1
- package/dist/assets/components/Geometry2D.js +19 -19
- package/dist/assets/components/Geometry2D.min.js +1 -1
- package/dist/assets/components/Geospatial.js +33 -33
- package/dist/assets/components/Geospatial.min.js +1 -1
- package/dist/assets/components/HAnim.js +18 -18
- package/dist/assets/components/HAnim.min.js +1 -1
- package/dist/assets/components/KeyDeviceSensor.js +8 -8
- package/dist/assets/components/KeyDeviceSensor.min.js +1 -1
- package/dist/assets/components/Layout.js +27 -27
- package/dist/assets/components/Layout.min.js +1 -1
- package/dist/assets/components/NURBS.js +24 -24
- package/dist/assets/components/NURBS.min.js +1 -1
- package/dist/assets/components/ParticleSystems.js +23 -23
- package/dist/assets/components/ParticleSystems.min.js +1 -1
- package/dist/assets/components/Picking.js +19 -19
- package/dist/assets/components/Picking.min.js +1 -1
- package/dist/assets/components/RigidBodyPhysics.js +18 -18
- package/dist/assets/components/RigidBodyPhysics.min.js +1 -1
- package/dist/assets/components/Scripting.js +28 -28
- package/dist/assets/components/Scripting.min.js +1 -1
- package/dist/assets/components/Text.js +24 -24
- package/dist/assets/components/Text.min.js +1 -1
- package/dist/assets/components/TextureProjector.js +14 -14
- package/dist/assets/components/TextureProjector.min.js +1 -1
- package/dist/assets/components/Texturing3D.js +32 -32
- package/dist/assets/components/Texturing3D.min.js +1 -1
- package/dist/assets/components/VolumeRendering.js +19 -19
- package/dist/assets/components/VolumeRendering.min.js +1 -1
- package/dist/assets/components/X_ITE.js +9 -9
- package/dist/assets/components/X_ITE.min.js +1 -1
- package/dist/x_ite.css +1 -1
- package/dist/x_ite.js +88 -80
- package/dist/x_ite.min.js +1 -1
- package/dist/x_ite.zip +0 -0
- package/docs/_config.yml +1 -1
- package/docs/_posts/getting-started.md +1 -1
- package/docs/_posts/laboratory/x3d-file-converter.md +12 -7
- package/package.json +1 -1
- package/src/x_ite/Browser/VERSION.js +1 -1
- package/src/x_ite/Parser/SVGParser.js +30 -23
- package/src/x_ite/Parser/X3DParser.js +3 -2
package/dist/x_ite.zip
CHANGED
|
Binary file
|
package/docs/_config.yml
CHANGED
|
@@ -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
|
-
|
|
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
|
|
|
@@ -37,13 +37,12 @@ x_ite: true
|
|
|
37
37
|
#drop-zone select {
|
|
38
38
|
color: unset;
|
|
39
39
|
position: relative;
|
|
40
|
-
top: -
|
|
40
|
+
top: -6px;
|
|
41
41
|
}
|
|
42
42
|
</style>
|
|
43
43
|
|
|
44
|
-
<script defer
|
|
45
|
-
|
|
46
|
-
<script defer="">
|
|
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>
|
|
47
46
|
$(() =>
|
|
48
47
|
{
|
|
49
48
|
$("#drop-zone") .on ("dragover", event =>
|
|
@@ -118,7 +117,7 @@ $(() =>
|
|
|
118
117
|
|
|
119
118
|
await Browser .loadURL (new X3D .MFString (url));
|
|
120
119
|
|
|
121
|
-
link (mimeType, file .name + extension, Browser .currentScene [toString] ());
|
|
120
|
+
link (mimeType, file .name .replace (/\.[^.]+$/, "") + extension, Browser .currentScene [toString] ());
|
|
122
121
|
}
|
|
123
122
|
catch (error)
|
|
124
123
|
{
|
|
@@ -151,7 +150,9 @@ $(() =>
|
|
|
151
150
|
});
|
|
152
151
|
</script>
|
|
153
152
|
|
|
154
|
-
|
|
153
|
+
## Upload and Convert
|
|
154
|
+
|
|
155
|
+
Convert **X3D, VRML, glTF (GLB), OBJ, STL,** and **SVG** to a X3D format of your choice.
|
|
155
156
|
|
|
156
157
|
<div id="drop-zone">
|
|
157
158
|
<p id="open-files" class="center">
|
|
@@ -171,8 +172,12 @@ $(() =>
|
|
|
171
172
|
</p>
|
|
172
173
|
</div>
|
|
173
174
|
|
|
174
|
-
|
|
175
|
+
### Converted Files
|
|
175
176
|
|
|
176
177
|
Your converted files will appear here.
|
|
177
178
|
|
|
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`.
|
package/package.json
CHANGED
|
@@ -260,9 +260,12 @@ SVGParser .prototype = Object .assign (Object .create (X3DParser .prototype),
|
|
|
260
260
|
// Get attributes of svg element.
|
|
261
261
|
|
|
262
262
|
const
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
263
|
+
defaultWidth = this .lengthAttribute (xmlElement .getAttribute ("width", 100)),
|
|
264
|
+
defaultHeight = this .lengthAttribute (xmlElement .getAttribute ("height", 100)),
|
|
265
|
+
defaultViewBox = new Vector4 (0, 0, defaultWidth, defaultHeight),
|
|
266
|
+
viewBox = this .viewBoxAttribute (xmlElement .getAttribute ("viewBox"), defaultViewBox),
|
|
267
|
+
width = this .lengthAttribute (xmlElement .getAttribute ("width", viewBox [2])),
|
|
268
|
+
height = this .lengthAttribute (xmlElement .getAttribute ("height", viewBox [3]));
|
|
266
269
|
|
|
267
270
|
// Create viewpoint.
|
|
268
271
|
|
|
@@ -855,7 +858,7 @@ SVGParser .prototype = Object .assign (Object .create (X3DParser .prototype),
|
|
|
855
858
|
for (const [o, c, a] of g .stops)
|
|
856
859
|
gradient .addColorStop (o, `rgba(${c .r * 255},${c .g * 255},${c .b * 255},${a})`);
|
|
857
860
|
|
|
858
|
-
return this .drawGradient (gradient, g .transform, bbox);
|
|
861
|
+
return this .drawGradient (gradient, g .transform, bbox, g .units);
|
|
859
862
|
},
|
|
860
863
|
linearGradientElement: function (xmlElement, gradient)
|
|
861
864
|
{
|
|
@@ -873,9 +876,9 @@ SVGParser .prototype = Object .assign (Object .create (X3DParser .prototype),
|
|
|
873
876
|
|
|
874
877
|
gradient .x1 = this .lengthAttribute (xmlElement .getAttribute ("x1"), gradient .x1 || 0);
|
|
875
878
|
gradient .y1 = this .lengthAttribute (xmlElement .getAttribute ("y1"), gradient .y1 || 0);
|
|
876
|
-
gradient .x2 = this .lengthAttribute (xmlElement .getAttribute ("x2"), gradient .x2 ||
|
|
879
|
+
gradient .x2 = this .lengthAttribute (xmlElement .getAttribute ("x2"), gradient .x2 || 1);
|
|
877
880
|
gradient .y2 = this .lengthAttribute (xmlElement .getAttribute ("y2"), gradient .y2 || 0);
|
|
878
|
-
gradient .units = xmlElement .getAttribute ("gradientUnits");
|
|
881
|
+
gradient .units = xmlElement .getAttribute ("gradientUnits") || "objectBoundingBox";
|
|
879
882
|
gradient .transform = this .transformAttribute (xmlElement .getAttribute ("gradientTransform"));
|
|
880
883
|
|
|
881
884
|
// Stops
|
|
@@ -889,12 +892,12 @@ SVGParser .prototype = Object .assign (Object .create (X3DParser .prototype),
|
|
|
889
892
|
{
|
|
890
893
|
const
|
|
891
894
|
g = this .radialGradientElement (xmlElement, { stops: [ ] }),
|
|
892
|
-
gradient = this .context .createRadialGradient (g .fx, g .fy,
|
|
895
|
+
gradient = this .context .createRadialGradient (g .fx, g .fy, g. fr, g .cx, g .cy, g .r);
|
|
893
896
|
|
|
894
897
|
for (const [o, c, a] of g .stops)
|
|
895
898
|
gradient .addColorStop (o, `rgba(${c .r * 255},${c .g * 255},${c .b * 255},${a})`);
|
|
896
899
|
|
|
897
|
-
return this .drawGradient (gradient, g .transform, bbox);
|
|
900
|
+
return this .drawGradient (gradient, g .transform, bbox, g .units);
|
|
898
901
|
},
|
|
899
902
|
radialGradientElement: function (xmlElement, gradient)
|
|
900
903
|
{
|
|
@@ -907,14 +910,13 @@ SVGParser .prototype = Object .assign (Object .create (X3DParser .prototype),
|
|
|
907
910
|
|
|
908
911
|
// Attributes
|
|
909
912
|
|
|
910
|
-
gradient .cx = this .lengthAttribute (xmlElement .getAttribute ("cx"), gradient .cx || 0),
|
|
911
|
-
gradient .cy = this .lengthAttribute (xmlElement .getAttribute ("cy"), gradient .cy || 0),
|
|
912
|
-
gradient .
|
|
913
|
-
gradient .
|
|
914
|
-
gradient .
|
|
915
|
-
gradient .
|
|
916
|
-
gradient .
|
|
917
|
-
gradient .units = xmlElement .getAttribute ("gradientUnits");
|
|
913
|
+
gradient .cx = this .lengthAttribute (xmlElement .getAttribute ("cx"), gradient .cx || 0.5),
|
|
914
|
+
gradient .cy = this .lengthAttribute (xmlElement .getAttribute ("cy"), gradient .cy || 0.5),
|
|
915
|
+
gradient .r = this .lengthAttribute (xmlElement .getAttribute ("r"), gradient .r || 0.5),
|
|
916
|
+
gradient .fx = this .lengthAttribute (xmlElement .getAttribute ("fx"), gradient .fx || gradient .cx),
|
|
917
|
+
gradient .fy = this .lengthAttribute (xmlElement .getAttribute ("fy"), gradient .fy || gradient .cy),
|
|
918
|
+
gradient .fr = this .lengthAttribute (xmlElement .getAttribute ("fr"), gradient .fr || 0),
|
|
919
|
+
gradient .units = xmlElement .getAttribute ("gradientUnits") || "objectBoundingBox";
|
|
918
920
|
gradient .spreadMethod = xmlElement .getAttribute ("spreadMethod");
|
|
919
921
|
gradient .transform = this .transformAttribute (xmlElement .getAttribute ("gradientTransform"));
|
|
920
922
|
|
|
@@ -956,14 +958,19 @@ SVGParser .prototype = Object .assign (Object .create (X3DParser .prototype),
|
|
|
956
958
|
|
|
957
959
|
this .styles .pop ();
|
|
958
960
|
},
|
|
959
|
-
drawGradient: function (gradient, transform, bbox)
|
|
961
|
+
drawGradient: function (gradient, transform, bbox, units)
|
|
960
962
|
{
|
|
961
963
|
const m = new Matrix3 ();
|
|
962
964
|
|
|
963
965
|
m .scale (new Vector2 (GRADIENT_SIZE / 2, GRADIENT_SIZE / 2));
|
|
964
966
|
m .translate (Vector2 .One);
|
|
965
967
|
m .scale (new Vector2 (1, -1));
|
|
966
|
-
|
|
968
|
+
|
|
969
|
+
if (units === "userSpaceOnUse")
|
|
970
|
+
m .multLeft (Matrix3 .inverse (bbox .matrix));
|
|
971
|
+
else
|
|
972
|
+
m .multLeft (new Matrix3 (2, 0, 0, 0, 2, 0, -1, -1, 1));
|
|
973
|
+
|
|
967
974
|
m .multLeft (transform);
|
|
968
975
|
|
|
969
976
|
// Paint.
|
|
@@ -1028,7 +1035,7 @@ SVGParser .prototype = Object .assign (Object .create (X3DParser .prototype),
|
|
|
1028
1035
|
{
|
|
1029
1036
|
if (!attribute)
|
|
1030
1037
|
return;
|
|
1031
|
-
|
|
1038
|
+
|
|
1032
1039
|
const
|
|
1033
1040
|
scene = this .getExecutionContext (),
|
|
1034
1041
|
hash = new URL (attribute, scene .getWorldURL ()) .hash .slice (1);
|
|
@@ -1535,14 +1542,14 @@ SVGParser .prototype = Object .assign (Object .create (X3DParser .prototype),
|
|
|
1535
1542
|
case 'S':
|
|
1536
1543
|
case 's':
|
|
1537
1544
|
{
|
|
1538
|
-
x1 = ax + (ax - px);
|
|
1539
|
-
y1 = ay + (ay - py);
|
|
1545
|
+
var x1 = ax + (ax - px);
|
|
1546
|
+
var y1 = ay + (ay - py);
|
|
1540
1547
|
break;
|
|
1541
1548
|
}
|
|
1542
1549
|
default:
|
|
1543
1550
|
{
|
|
1544
|
-
x1 = ax;
|
|
1545
|
-
y1 = ay;
|
|
1551
|
+
var x1 = ax;
|
|
1552
|
+
var y1 = ay;
|
|
1546
1553
|
break;
|
|
1547
1554
|
}
|
|
1548
1555
|
}
|
|
@@ -142,11 +142,12 @@ X3DParser .prototype = {
|
|
|
142
142
|
convertColor: function (value)
|
|
143
143
|
{
|
|
144
144
|
const
|
|
145
|
-
|
|
145
|
+
wrap = $("<div></div>") .hide () .css ("color", "black") .appendTo ($("body")),
|
|
146
|
+
div = $("<div></div>").css ("color", value) .appendTo (wrap),
|
|
146
147
|
rgb = window .getComputedStyle (div [0]) .color,
|
|
147
148
|
values = rgb .replace (/^rgba?\(|\)$/g, "") .split (/[\s,]+/) .map (s => parseFloat (s));
|
|
148
149
|
|
|
149
|
-
|
|
150
|
+
wrap .remove ();
|
|
150
151
|
|
|
151
152
|
values [0] /= 255;
|
|
152
153
|
values [1] /= 255;
|