three-text 0.2.14 → 0.2.15
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/README.md +1 -1
- package/dist/index.cjs +4 -4
- package/dist/index.js +4 -4
- package/dist/index.min.cjs +4 -4
- package/dist/index.min.js +4 -4
- package/dist/index.umd.js +4 -4
- package/dist/index.umd.min.js +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -322,7 +322,7 @@ For text with tight tracking, connected scripts, or complex kerning pairs, indiv
|
|
|
322
322
|
|
|
323
323
|
#### Flat geometry mode
|
|
324
324
|
|
|
325
|
-
When `depth` is 0, the library generates single-sided geometry
|
|
325
|
+
When `depth` is 0, the library generates single-sided geometry with normals pointing toward the camera (positive Z direction), reducing triangles by approximately 50% compared to extruded geometry
|
|
326
326
|
|
|
327
327
|
|
|
328
328
|
## Configuration
|
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* three-text v0.2.
|
|
2
|
+
* three-text v0.2.15
|
|
3
3
|
* Copyright (C) 2025 Countertype LLC
|
|
4
4
|
*
|
|
5
5
|
* This program is free software: you can redistribute it and/or modify
|
|
@@ -2815,7 +2815,7 @@ class Extruder {
|
|
|
2815
2815
|
vertices[vPos + 2] = 0;
|
|
2816
2816
|
normals[vPos] = 0;
|
|
2817
2817
|
normals[vPos + 1] = 0;
|
|
2818
|
-
normals[vPos + 2] =
|
|
2818
|
+
normals[vPos + 2] = 1;
|
|
2819
2819
|
vPos += 3;
|
|
2820
2820
|
}
|
|
2821
2821
|
for (let i = 0; i < triangleIndices.length; i++) {
|
|
@@ -2834,7 +2834,7 @@ class Extruder {
|
|
|
2834
2834
|
vertices[base + 2] = 0;
|
|
2835
2835
|
normals[base] = 0;
|
|
2836
2836
|
normals[base + 1] = 0;
|
|
2837
|
-
normals[base + 2] =
|
|
2837
|
+
normals[base + 2] = 1;
|
|
2838
2838
|
}
|
|
2839
2839
|
// Fill back vertices/normals (numPoints..2*numPoints-1)
|
|
2840
2840
|
for (let p = 0, vi = 0; p < points.length; p += 2, vi++) {
|
|
@@ -2844,7 +2844,7 @@ class Extruder {
|
|
|
2844
2844
|
vertices[base + 2] = backZ;
|
|
2845
2845
|
normals[base] = 0;
|
|
2846
2846
|
normals[base + 1] = 0;
|
|
2847
|
-
normals[base + 2] = 1;
|
|
2847
|
+
normals[base + 2] = -1;
|
|
2848
2848
|
}
|
|
2849
2849
|
// Front indices
|
|
2850
2850
|
for (let i = 0; i < triangleIndices.length; i++) {
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* three-text v0.2.
|
|
2
|
+
* three-text v0.2.15
|
|
3
3
|
* Copyright (C) 2025 Countertype LLC
|
|
4
4
|
*
|
|
5
5
|
* This program is free software: you can redistribute it and/or modify
|
|
@@ -2812,7 +2812,7 @@ class Extruder {
|
|
|
2812
2812
|
vertices[vPos + 2] = 0;
|
|
2813
2813
|
normals[vPos] = 0;
|
|
2814
2814
|
normals[vPos + 1] = 0;
|
|
2815
|
-
normals[vPos + 2] =
|
|
2815
|
+
normals[vPos + 2] = 1;
|
|
2816
2816
|
vPos += 3;
|
|
2817
2817
|
}
|
|
2818
2818
|
for (let i = 0; i < triangleIndices.length; i++) {
|
|
@@ -2831,7 +2831,7 @@ class Extruder {
|
|
|
2831
2831
|
vertices[base + 2] = 0;
|
|
2832
2832
|
normals[base] = 0;
|
|
2833
2833
|
normals[base + 1] = 0;
|
|
2834
|
-
normals[base + 2] =
|
|
2834
|
+
normals[base + 2] = 1;
|
|
2835
2835
|
}
|
|
2836
2836
|
// Fill back vertices/normals (numPoints..2*numPoints-1)
|
|
2837
2837
|
for (let p = 0, vi = 0; p < points.length; p += 2, vi++) {
|
|
@@ -2841,7 +2841,7 @@ class Extruder {
|
|
|
2841
2841
|
vertices[base + 2] = backZ;
|
|
2842
2842
|
normals[base] = 0;
|
|
2843
2843
|
normals[base + 1] = 0;
|
|
2844
|
-
normals[base + 2] = 1;
|
|
2844
|
+
normals[base + 2] = -1;
|
|
2845
2845
|
}
|
|
2846
2846
|
// Front indices
|
|
2847
2847
|
for (let i = 0; i < triangleIndices.length; i++) {
|
package/dist/index.min.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* three-text v0.2.
|
|
2
|
+
* three-text v0.2.15
|
|
3
3
|
* Copyright (C) 2025 Countertype LLC
|
|
4
4
|
*
|
|
5
5
|
* This program is free software: you can redistribute it and/or modify
|
|
@@ -475,12 +475,12 @@ let o=0
|
|
|
475
475
|
if(0!==e)for(const e of t.qi){const t=e.length/2
|
|
476
476
|
2>t||(o+=t-1)}const h=(0===e?r:2*r)+(0===e?0:4*o),a=new Float32Array(3*h),l=new Float32Array(3*h),c=new Uint32Array(0===e?n.length:2*n.length+6*o)
|
|
477
477
|
if(0===e){let t=0
|
|
478
|
-
for(let e=0;s.length>e;e+=2)a[t]=s[e],a[t+1]=s[e+1],a[t+2]=0,l[t]=0,l[t+1]=0,l[t+2]
|
|
478
|
+
for(let e=0;s.length>e;e+=2)a[t]=s[e],a[t+1]=s[e+1],a[t+2]=0,l[t]=0,l[t+1]=0,l[t+2]=1,t+=3
|
|
479
479
|
for(let t=0;n.length>t;t++)c[t]=n[t]
|
|
480
480
|
return{vertices:a,normals:l,indices:c}}const u=25e-6*i,f=e>u?e:u
|
|
481
481
|
for(let t=0,e=0;s.length>t;t+=2,e++){const i=3*e
|
|
482
|
-
a[i]=s[t],a[i+1]=s[t+1],a[i+2]=0,l[i]=0,l[i+1]=0,l[i+2]
|
|
483
|
-
a[i]=s[t],a[i+1]=s[t+1],a[i+2]=f,l[i]=0,l[i+1]=0,l[i+2]
|
|
482
|
+
a[i]=s[t],a[i+1]=s[t+1],a[i+2]=0,l[i]=0,l[i+1]=0,l[i+2]=1}for(let t=0,e=0;s.length>t;t+=2,e++){const i=3*(r+e)
|
|
483
|
+
a[i]=s[t],a[i+1]=s[t+1],a[i+2]=f,l[i]=0,l[i+1]=0,l[i+2]=-1}for(let t=0;n.length>t;t++)c[t]=n[t]
|
|
484
484
|
for(let t=0;n.length>t;t++)c[n.length+t]=n[n.length-1-t]+r
|
|
485
485
|
let d=2*r,y=2*n.length
|
|
486
486
|
for(const e of t.qi)for(let t=0;e.length-2>t;t+=2){const i=e[t],s=e[t+1],n=e[t+2],r=e[t+3],o=n-i,h=r-s,u=o*o+h*h
|
package/dist/index.min.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* three-text v0.2.
|
|
2
|
+
* three-text v0.2.15
|
|
3
3
|
* Copyright (C) 2025 Countertype LLC
|
|
4
4
|
*
|
|
5
5
|
* This program is free software: you can redistribute it and/or modify
|
|
@@ -474,12 +474,12 @@ let o=0
|
|
|
474
474
|
if(0!==e)for(const e of t.qi){const t=e.length/2
|
|
475
475
|
2>t||(o+=t-1)}const h=(0===e?r:2*r)+(0===e?0:4*o),a=new Float32Array(3*h),l=new Float32Array(3*h),c=new Uint32Array(0===e?n.length:2*n.length+6*o)
|
|
476
476
|
if(0===e){let t=0
|
|
477
|
-
for(let e=0;s.length>e;e+=2)a[t]=s[e],a[t+1]=s[e+1],a[t+2]=0,l[t]=0,l[t+1]=0,l[t+2]
|
|
477
|
+
for(let e=0;s.length>e;e+=2)a[t]=s[e],a[t+1]=s[e+1],a[t+2]=0,l[t]=0,l[t+1]=0,l[t+2]=1,t+=3
|
|
478
478
|
for(let t=0;n.length>t;t++)c[t]=n[t]
|
|
479
479
|
return{vertices:a,normals:l,indices:c}}const u=25e-6*i,f=e>u?e:u
|
|
480
480
|
for(let t=0,e=0;s.length>t;t+=2,e++){const i=3*e
|
|
481
|
-
a[i]=s[t],a[i+1]=s[t+1],a[i+2]=0,l[i]=0,l[i+1]=0,l[i+2]
|
|
482
|
-
a[i]=s[t],a[i+1]=s[t+1],a[i+2]=f,l[i]=0,l[i+1]=0,l[i+2]
|
|
481
|
+
a[i]=s[t],a[i+1]=s[t+1],a[i+2]=0,l[i]=0,l[i+1]=0,l[i+2]=1}for(let t=0,e=0;s.length>t;t+=2,e++){const i=3*(r+e)
|
|
482
|
+
a[i]=s[t],a[i+1]=s[t+1],a[i+2]=f,l[i]=0,l[i+1]=0,l[i+2]=-1}for(let t=0;n.length>t;t++)c[t]=n[t]
|
|
483
483
|
for(let t=0;n.length>t;t++)c[n.length+t]=n[n.length-1-t]+r
|
|
484
484
|
let d=2*r,y=2*n.length
|
|
485
485
|
for(const e of t.qi)for(let t=0;e.length-2>t;t+=2){const i=e[t],s=e[t+1],n=e[t+2],r=e[t+3],o=n-i,h=r-s,u=o*o+h*h
|
package/dist/index.umd.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* three-text v0.2.
|
|
2
|
+
* three-text v0.2.15
|
|
3
3
|
* Copyright (C) 2025 Countertype LLC
|
|
4
4
|
*
|
|
5
5
|
* This program is free software: you can redistribute it and/or modify
|
|
@@ -2819,7 +2819,7 @@
|
|
|
2819
2819
|
vertices[vPos + 2] = 0;
|
|
2820
2820
|
normals[vPos] = 0;
|
|
2821
2821
|
normals[vPos + 1] = 0;
|
|
2822
|
-
normals[vPos + 2] =
|
|
2822
|
+
normals[vPos + 2] = 1;
|
|
2823
2823
|
vPos += 3;
|
|
2824
2824
|
}
|
|
2825
2825
|
for (let i = 0; i < triangleIndices.length; i++) {
|
|
@@ -2838,7 +2838,7 @@
|
|
|
2838
2838
|
vertices[base + 2] = 0;
|
|
2839
2839
|
normals[base] = 0;
|
|
2840
2840
|
normals[base + 1] = 0;
|
|
2841
|
-
normals[base + 2] =
|
|
2841
|
+
normals[base + 2] = 1;
|
|
2842
2842
|
}
|
|
2843
2843
|
// Fill back vertices/normals (numPoints..2*numPoints-1)
|
|
2844
2844
|
for (let p = 0, vi = 0; p < points.length; p += 2, vi++) {
|
|
@@ -2848,7 +2848,7 @@
|
|
|
2848
2848
|
vertices[base + 2] = backZ;
|
|
2849
2849
|
normals[base] = 0;
|
|
2850
2850
|
normals[base + 1] = 0;
|
|
2851
|
-
normals[base + 2] = 1;
|
|
2851
|
+
normals[base + 2] = -1;
|
|
2852
2852
|
}
|
|
2853
2853
|
// Front indices
|
|
2854
2854
|
for (let i = 0; i < triangleIndices.length; i++) {
|
package/dist/index.umd.min.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* three-text v0.2.
|
|
2
|
+
* three-text v0.2.15
|
|
3
3
|
* Copyright (C) 2025 Countertype LLC
|
|
4
4
|
*
|
|
5
5
|
* This program is free software: you can redistribute it and/or modify
|
|
@@ -476,12 +476,12 @@ let o=0
|
|
|
476
476
|
if(0!==e)for(const e of t.qi){const t=e.length/2
|
|
477
477
|
2>t||(o+=t-1)}const h=(0===e?r:2*r)+(0===e?0:4*o),a=new Float32Array(3*h),l=new Float32Array(3*h),c=new Uint32Array(0===e?n.length:2*n.length+6*o)
|
|
478
478
|
if(0===e){let t=0
|
|
479
|
-
for(let e=0;s.length>e;e+=2)a[t]=s[e],a[t+1]=s[e+1],a[t+2]=0,l[t]=0,l[t+1]=0,l[t+2]
|
|
479
|
+
for(let e=0;s.length>e;e+=2)a[t]=s[e],a[t+1]=s[e+1],a[t+2]=0,l[t]=0,l[t+1]=0,l[t+2]=1,t+=3
|
|
480
480
|
for(let t=0;n.length>t;t++)c[t]=n[t]
|
|
481
481
|
return{vertices:a,normals:l,indices:c}}const u=25e-6*i,f=e>u?e:u
|
|
482
482
|
for(let t=0,e=0;s.length>t;t+=2,e++){const i=3*e
|
|
483
|
-
a[i]=s[t],a[i+1]=s[t+1],a[i+2]=0,l[i]=0,l[i+1]=0,l[i+2]
|
|
484
|
-
a[i]=s[t],a[i+1]=s[t+1],a[i+2]=f,l[i]=0,l[i+1]=0,l[i+2]
|
|
483
|
+
a[i]=s[t],a[i+1]=s[t+1],a[i+2]=0,l[i]=0,l[i+1]=0,l[i+2]=1}for(let t=0,e=0;s.length>t;t+=2,e++){const i=3*(r+e)
|
|
484
|
+
a[i]=s[t],a[i+1]=s[t+1],a[i+2]=f,l[i]=0,l[i+1]=0,l[i+2]=-1}for(let t=0;n.length>t;t++)c[t]=n[t]
|
|
485
485
|
for(let t=0;n.length>t;t++)c[n.length+t]=n[n.length-1-t]+r
|
|
486
486
|
let d=2*r,y=2*n.length
|
|
487
487
|
for(const e of t.qi)for(let t=0;e.length-2>t;t+=2){const i=e[t],s=e[t+1],n=e[t+2],r=e[t+3],o=n-i,h=r-s,u=o*o+h*h
|