@xeokit/xeokit-sdk 2.6.88 → 2.6.89

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xeokit/xeokit-sdk",
3
- "version": "2.6.88",
3
+ "version": "2.6.89",
4
4
  "description": "3D BIM IFC Viewer SDK for AEC engineering applications. Open Source JavaScript Toolkit based on pure WebGL for top performance, real-world coordinates and full double precision",
5
5
  "module": "./dist/xeokit-sdk.es.js",
6
6
  "main": "./dist/xeokit-sdk.cjs.js",
@@ -133,15 +133,21 @@ const clipSegment = (scene, parentElement, start, end, canvasStart, canvasEnd) =
133
133
  for (let i = 0; i < 2; ++i) {
134
134
  const denom = p1[i] - p0[i];
135
135
 
136
- const l = (-p0[3] - p0[i]) / denom;
137
- const r = ( p0[3] - p0[i]) / denom;
136
+ const l = (-1 - p0[i]) / denom;
137
+ const r = ( 1 - p0[i]) / denom;
138
138
 
139
139
  if (denom > 0) {
140
140
  t_min = Math.max(t_min, l);
141
141
  t_max = Math.min(t_max, r);
142
- } else {
142
+ } else if (denom < 0) {
143
143
  t_min = Math.max(t_min, r);
144
144
  t_max = Math.min(t_max, l);
145
+ } else {
146
+ if (p0[0] < -1) {
147
+ t_min = -window.Infinity;
148
+ } else if (p0[0] > 1) {
149
+ t_max = window.Infinity;
150
+ }
145
151
  }
146
152
  }
147
153