@xeokit/xeokit-sdk 2.5.2-beta-23 → 2.5.2-beta-24

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.
@@ -194009,7 +194009,7 @@ const MAX_VERTICES = 500000; // TODO: Rough estimate
194009
194009
  *
194010
194010
  * ## Summary
194011
194011
  *
194012
- * * Loads [LAS 1.4 Format](https://www.asprs.org/divisions-committees/lidar-division/laser-las-file-format-exchange-activities) from both *.las* and *.laz* files.
194012
+ * * Loads [LAS Formats](https://www.asprs.org/divisions-committees/lidar-division/laser-las-file-format-exchange-activities) up to v1.3 from both *.las* and *.laz* files. It does not support LAS v1.4.
194013
194013
  * * Loads lidar point cloud positions, colors and intensities.
194014
194014
  * * Supports 32 and 64-bit positions.
194015
194015
  * * Supports 8 and 16-bit color depths.
@@ -194005,7 +194005,7 @@ const MAX_VERTICES = 500000; // TODO: Rough estimate
194005
194005
  *
194006
194006
  * ## Summary
194007
194007
  *
194008
- * * Loads [LAS 1.4 Format](https://www.asprs.org/divisions-committees/lidar-division/laser-las-file-format-exchange-activities) from both *.las* and *.laz* files.
194008
+ * * Loads [LAS Formats](https://www.asprs.org/divisions-committees/lidar-division/laser-las-file-format-exchange-activities) up to v1.3 from both *.las* and *.laz* files. It does not support LAS v1.4.
194009
194009
  * * Loads lidar point cloud positions, colors and intensities.
194010
194010
  * * Supports 32 and 64-bit positions.
194011
194011
  * * Supports 8 and 16-bit color depths.
@@ -28465,7 +28465,7 @@ var headerBlockItems=[{item:'FileSignature',format:'char',size:4},{item:'FileSou
28465
28465
  *
28466
28466
  * ## Summary
28467
28467
  *
28468
- * * Loads [LAS 1.4 Format](https://www.asprs.org/divisions-committees/lidar-division/laser-las-file-format-exchange-activities) from both *.las* and *.laz* files.
28468
+ * * Loads [LAS Formats](https://www.asprs.org/divisions-committees/lidar-division/laser-las-file-format-exchange-activities) up to v1.3 from both *.las* and *.laz* files. It does not support LAS v1.4.
28469
28469
  * * Loads lidar point cloud positions, colors and intensities.
28470
28470
  * * Supports 32 and 64-bit positions.
28471
28471
  * * Supports 8 and 16-bit color depths.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xeokit/xeokit-sdk",
3
- "version": "2.5.2-beta-23",
3
+ "version": "2.5.2-beta-24",
4
4
  "description": "Web Programming Toolkit for 3D/2D BIM and AEC Graphics",
5
5
  "module": "./dist/xeokit-sdk.es.js",
6
6
  "main": "./dist/xeokit-sdk.cjs.js",
@@ -18,7 +18,7 @@ const MAX_VERTICES = 500000; // TODO: Rough estimate
18
18
  *
19
19
  * ## Summary
20
20
  *
21
- * * Loads [LAS 1.4 Format](https://www.asprs.org/divisions-committees/lidar-division/laser-las-file-format-exchange-activities) from both *.las* and *.laz* files.
21
+ * * Loads [LAS Formats](https://www.asprs.org/divisions-committees/lidar-division/laser-las-file-format-exchange-activities) up to v1.3 from both *.las* and *.laz* files. It does not support LAS v1.4.
22
22
  * * Loads lidar point cloud positions, colors and intensities.
23
23
  * * Supports 32 and 64-bit positions.
24
24
  * * Supports 8 and 16-bit color depths.
@@ -84,4 +84,123 @@ function buildPolylineGeometry(cfg = {}) {
84
84
  });
85
85
  }
86
86
 
87
- export {buildPolylineGeometry};
87
+ /**
88
+ * @desc Creates a 3D polyline from curve {@link Geometry}.
89
+ *
90
+ * ## Usage
91
+ *
92
+ * In the example below we'll create a {@link Mesh} with a polyline {@link ReadableGeometry} created from curves.
93
+ *
94
+ * [[Run this example](/examples/#geometry_builders_buildPolylineGeometryFromCurve)]
95
+ *
96
+ * ````javascript
97
+ * //------------------------------------------------------------------------------------------------------------------
98
+ * // Import the modules we need for this example
99
+ * //------------------------------------------------------------------------------------------------------------------
100
+ *
101
+ * import {buildPolylineGeometryFromCurve, Viewer, Mesh, PhongMaterial, NavCubePlugin, CubicBezierCurve, SplineCurve, QuadraticBezierCurve, ReadableGeometry} from "../../dist/xeokit-sdk.min.es.js";
102
+ *
103
+ * //------------------------------------------------------------------------------------------------------------------
104
+ * // Create a Viewer and arrange the camera
105
+ * //------------------------------------------------------------------------------------------------------------------
106
+ *
107
+ * const viewer = new Viewer({
108
+ * canvasId: "myCanvas"
109
+ * });
110
+ *
111
+ * new NavCubePlugin(viewer, {
112
+ * canvasId: "myNavCubeCanvas",
113
+ * visible: true,
114
+ * size: 250,
115
+ * alignment: "bottomRight",
116
+ * bottomMargin: 100,
117
+ * rightMargin: 10
118
+ * });
119
+ *
120
+ * viewer.camera.eye = [0, -250, 1];
121
+ * viewer.camera.look = [0, 0, 0];
122
+ * viewer.camera.up = [0, 1, 0];
123
+ *
124
+ * //------------------------------------------------------------------------------------------------------------------
125
+ * // Create a mesh with polyline shape from Spline
126
+ * //------------------------------------------------------------------------------------------------------------------
127
+ *
128
+ * new Mesh(viewer.scene, {
129
+ * geometry: new ReadableGeometry(viewer.scene, buildPolylineGeometryFromCurve({
130
+ * id: "SplineCurve",
131
+ * curve: new SplineCurve(viewer.scene, {
132
+ * points: [
133
+ * [-65.77614, 0, -88.881992],
134
+ * [90.020852, 0, -61.589088],
135
+ * [-67.766247, 0, -22.071238],
136
+ * [93.148164, 0, -13.826507],
137
+ * [-14.033343, 0, 3.231558],
138
+ * [32.592034, 0, 9.20188],
139
+ * [3.309023, 0, 22.848332],
140
+ * [23.210098, 0, 28.818655],
141
+ * ],
142
+ * }),
143
+ * divisions: 100,
144
+ * })),
145
+ * material: new PhongMaterial(viewer.scene, {
146
+ * emissive: [1, 0, 0]
147
+ * })
148
+ * });
149
+ *
150
+ * //------------------------------------------------------------------------------------------------------------------
151
+ * // Create a mesh with polyline shape from CubicBezier
152
+ * //------------------------------------------------------------------------------------------------------------------
153
+ *
154
+ * new Mesh(viewer.scene, {
155
+ * geometry: new ReadableGeometry(viewer.scene, buildPolylineGeometryFromCurve({
156
+ * id: "CubicBezierCurve",
157
+ * curve: new CubicBezierCurve(viewer.scene, {
158
+ * v0: [120, 0, 100],
159
+ * v1: [120, 0, 0],
160
+ * v2: [80, 0, 100],
161
+ * v3: [80, 0, 0],
162
+ * }),
163
+ * divisions: 50,
164
+ * })),
165
+ * material: new PhongMaterial(viewer.scene, {
166
+ * emissive: [0, 1, 0]
167
+ * })
168
+ * });
169
+ *
170
+ * //------------------------------------------------------------------------------------------------------------------
171
+ * // Create a mesh with polyline shape from QuadraticBezier
172
+ * //------------------------------------------------------------------------------------------------------------------
173
+ *
174
+ * new Mesh(viewer.scene, {
175
+ * geometry: new ReadableGeometry(viewer.scene, buildPolylineGeometryFromCurve({
176
+ * id: "QuadraticBezierCurve",
177
+ * curve: new QuadraticBezierCurve(viewer.scene, {
178
+ * v0: [-100, 0, 100],
179
+ * v1: [-50, 0, 150],
180
+ * v2: [-50, 0, 0],
181
+ * }),
182
+ * divisions: 20,
183
+ * })),
184
+ * material: new PhongMaterial(viewer.scene, {
185
+ * emissive: [0, 0, 1]
186
+ * })
187
+ * });
188
+ * ````
189
+ *
190
+ * @function buildPolylineGeometryFromCurve
191
+ * @param {*} [cfg] Configs
192
+ * @param {String} [cfg.id] Optional ID, unique among all components in the parent {@link Scene}, generated automatically when omitted.
193
+ * @param {Object} [cfg.curve] Curve for which polyline will be created.
194
+ * @param {Number} [cfg.divisions] The number of divisions.
195
+ * @returns {Object} Configuration for a {@link Geometry} subtype.
196
+ */
197
+ function buildPolylineGeometryFromCurve(cfg = {}) {
198
+
199
+ let polylinePoints = cfg.curve.getPoints(cfg.divisions).map(a => [...a]).flat();
200
+ return buildPolylineGeometry({
201
+ id: cfg.id,
202
+ points: polylinePoints
203
+ });
204
+ }
205
+
206
+ export {buildPolylineGeometry, buildPolylineGeometryFromCurve};