@xort/cga 0.1.3 → 0.1.4
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 +16 -14
- package/readme.md +98 -95
- package/readme.zh-CN.md +241 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xort/cga",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.1.4",
|
|
4
|
+
"description": "TypeScript computational geometry for Web3D editors. Unified queries, mesh tools, and zero runtime dependencies.",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"format:check": "node scripts/format.mjs",
|
|
19
19
|
"prepublishOnly": "npm run release:check -- --complete && npm run verify",
|
|
20
20
|
"release:check": "node scripts/release-check.mjs",
|
|
21
|
-
"verify": "npm run release:check && npm run source:check && npm run algorithms:check && npm run typecheck && npm run docs:typecheck && npm run format:check && npm test && npm run readme:check && npm run demos:check && npm run api:check && npm run media:check && npm run docs:build && npm run build:demo && npm run browser:check && npm audit && npm pack --dry-run && npm run package:check",
|
|
21
|
+
"verify": "npm run release:check && npm run source:check && npm run algorithms:check && npm run typecheck && npm run docs:typecheck && npm run format:check && npm test && npm run readme:check && npm run demos:check && npm run api:check && npm run docs:check && npm run media:check && npm run docs:build && npm run build:demo && npm run browser:check && npm audit && npm pack --dry-run && npm run package:check",
|
|
22
22
|
"source:check": "node scripts/source-check.mjs",
|
|
23
23
|
"browser:check": "node scripts/browser-check.mjs",
|
|
24
24
|
"package:check": "node scripts/package-check.mjs",
|
|
@@ -29,7 +29,8 @@
|
|
|
29
29
|
"media:check": "node scripts/media-check.mjs",
|
|
30
30
|
"api:check": "node scripts/api-methods.mjs",
|
|
31
31
|
"readme:check": "node scripts/readme-check.mjs",
|
|
32
|
-
"algorithms:check": "node scripts/algorithm-check.mjs"
|
|
32
|
+
"algorithms:check": "node scripts/algorithm-check.mjs",
|
|
33
|
+
"docs:check": "node scripts/docs-check.mjs"
|
|
33
34
|
},
|
|
34
35
|
"private": false,
|
|
35
36
|
"repository": {
|
|
@@ -38,16 +39,16 @@
|
|
|
38
39
|
},
|
|
39
40
|
"author": "Zhao YS",
|
|
40
41
|
"keywords": [
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
42
|
+
"computational-geometry",
|
|
43
|
+
"typescript",
|
|
44
|
+
"web3d",
|
|
45
|
+
"geometry",
|
|
46
|
+
"distance",
|
|
47
|
+
"intersection",
|
|
48
|
+
"triangulation",
|
|
49
|
+
"polygon-clipping",
|
|
50
|
+
"mesh",
|
|
51
|
+
"threejs"
|
|
51
52
|
],
|
|
52
53
|
"license": "MIT",
|
|
53
54
|
"devDependencies": {
|
|
@@ -71,6 +72,7 @@
|
|
|
71
72
|
"dist",
|
|
72
73
|
"build",
|
|
73
74
|
"readme.md",
|
|
75
|
+
"readme.zh-CN.md",
|
|
74
76
|
"LICENSE",
|
|
75
77
|
"THIRD_PARTY_NOTICES.md"
|
|
76
78
|
],
|
package/readme.md
CHANGED
|
@@ -1,38 +1,41 @@
|
|
|
1
|
+
@@file readme.md
|
|
1
2
|
# cga.js
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
[English](readme.md) · [简体中文](readme.zh-CN.md)
|
|
5
|
+
|
|
6
|
+
**Computational geometry for JavaScript and TypeScript.** Unified data structures for distances, closest points, intersections, polygon booleans, triangulation, point clouds and path meshes, plus decimal CSG, IK, GIS and optional Three.js / GLSL adapters.
|
|
4
7
|
|
|
5
8
|
[](https://www.npmjs.com/package/@xort/cga) [](https://github.com/yszhao91/cga.js/actions/workflows/ci.yml) [](LICENSE)
|
|
6
9
|
|
|
7
|
-
[
|
|
10
|
+
[Quick start](#installation-and-quick-start) · [Playground](https://yszhao91.github.io/cga.js/guide/playground.html) · [Gallery](https://yszhao91.github.io/cga.js/guide/gallery.html) · [API](https://yszhao91.github.io/cga.js/guide/api.html) · [Roadmap](docs/guide/architecture.md) · [Contributing](CONTRIBUTING.md)
|
|
8
11
|
|
|
9
12
|
<!-- release-status:start -->
|
|
10
|
-
|
|
13
|
+
**0.1.4** introduces English-first project presentation and bilingual documentation. All computation kernels are internal TypeScript with zero core runtime dependencies. The [release status](https://yszhao91.github.io/cga.js/release-status.html) records published versions, tags and deployment receipts.
|
|
11
14
|
<!-- release-status:end -->
|
|
12
15
|
|
|
13
|
-
##
|
|
16
|
+
## See it in action
|
|
14
17
|
|
|
15
|
-
|
|
18
|
+
These images are captured from the actual running examples. Open a scene to reproduce its parameters; the gallery also includes full screenshots with controls, legends and computed results.
|
|
16
19
|
|
|
17
|
-
|
|
|
20
|
+
| Distances and closest points | Concave polygons with multiple holes |
|
|
18
21
|
| --- | --- |
|
|
19
|
-
| [](https://yszhao91.github.io/cga.js/guide/playground.html#geometry-distance?a=Capsule&b=Triangle&ax=0.5&ay=3&az=1) | [](https://yszhao91.github.io/cga.js/guide/playground.html#triangulation-multiple-holes) |
|
|
23
|
+
| **Hollow profiles and path sweeps** | **High-precision solid booleans** |
|
|
24
|
+
| [](https://yszhao91.github.io/cga.js/guide/playground.html#extrude-holes-closed?width=0.65) | [](https://yszhao91.github.io/cga.js/guide/playground.html#csg-subtract?x=0.5) |
|
|
25
|
+
| **Constrained inverse kinematics** | **GIS globe tiles** |
|
|
26
|
+
| [](https://yszhao91.github.io/cga.js/guide/playground.html#ik-hinge?x=1.5&y=2) | [](https://yszhao91.github.io/cga.js/guide/playground.html#gis-globe?level=2) |
|
|
24
27
|
|
|
25
|
-
**94
|
|
28
|
+
**94 interactive cases · 184 public entry mappings · 225 ordered pairs across 15 geometry types.** These figures describe examples and entry coverage; [method-level coverage](docs/guide/method-coverage.md) is tracked separately. Analytical, reference and degeneracy tests check numerical behavior.
|
|
26
29
|
|
|
27
|
-
[
|
|
30
|
+
[All 14 illustrated scenes](https://yszhao91.github.io/cga.js/guide/gallery.html) · [Example coverage](docs/guide/demo-coverage.md) · [Reproduce screenshots](#development-and-verification)
|
|
28
31
|
|
|
29
|
-
##
|
|
32
|
+
## Installation and quick start
|
|
30
33
|
|
|
31
34
|
```sh
|
|
32
35
|
npm install @xort/cga
|
|
33
36
|
```
|
|
34
37
|
|
|
35
|
-
###
|
|
38
|
+
### Distance, closest points and parameters
|
|
36
39
|
|
|
37
40
|
```js
|
|
38
41
|
// example:distance
|
|
@@ -50,7 +53,7 @@ console.log(intersects(point, edge)); // false
|
|
|
50
53
|
console.log(point.queryDistance(edge).distance); // 2
|
|
51
54
|
```
|
|
52
55
|
|
|
53
|
-
`distance(a, b)
|
|
56
|
+
`distance(a, b)` and `a.queryDistance(b)` return the same result contract. `Vec3.distanceTo(otherPoint)` returns a numeric point-to-point distance.
|
|
54
57
|
|
|
55
58
|
### CommonJS
|
|
56
59
|
|
|
@@ -61,7 +64,7 @@ const result = distance(v3(1, 2, 0), segment(v3(), v3(4, 0, 0)));
|
|
|
61
64
|
console.log(result.distance); // 2
|
|
62
65
|
```
|
|
63
66
|
|
|
64
|
-
###
|
|
67
|
+
### Independent copies and serialization
|
|
65
68
|
|
|
66
69
|
```js
|
|
67
70
|
// example:serialization
|
|
@@ -71,10 +74,10 @@ const original = new Triangle(v3(), v3(2, 0, 0), v3(0, 2, 0));
|
|
|
71
74
|
const clone = original.clone();
|
|
72
75
|
const restored = geometryFromJSON(JSON.parse(JSON.stringify(original)));
|
|
73
76
|
original[0].x = 3;
|
|
74
|
-
console.log(clone[0].x, restored[0].x); // 0, 0
|
|
77
|
+
console.log(clone[0].x, restored[0].x); // 0, 0; coordinates are independent
|
|
75
78
|
```
|
|
76
79
|
|
|
77
|
-
###
|
|
80
|
+
### Internal TypeScript polygon kernels
|
|
78
81
|
|
|
79
82
|
```js
|
|
80
83
|
// example:polygon
|
|
@@ -84,85 +87,85 @@ const outer = [v3(-2,-2,0), v3(2,-2,0), v3(2,2,0), v3(-2,2,0)];
|
|
|
84
87
|
const hole = [v3(-.5,-.5,0), v3(.5,-.5,0), v3(.5,.5,0), v3(-.5,.5,0)];
|
|
85
88
|
const vertices = [...outer, ...hole];
|
|
86
89
|
const indices = triangulation(outer, [hole]);
|
|
87
|
-
console.log(vertices.length, indices.length / 3); // 8
|
|
90
|
+
console.log(vertices.length, indices.length / 3); // 8 vertices, 8 triangles
|
|
88
91
|
|
|
89
92
|
const contours = clipPolygons([outer], [hole], 'difference', v3(0,0,1));
|
|
90
|
-
console.log(contours.length); // 2
|
|
93
|
+
console.log(contours.length); // 2; boundary and hole have opposite winding
|
|
91
94
|
```
|
|
92
95
|
|
|
93
|
-
|
|
96
|
+
Triangulation, clipping, offsetting and cleanup use maintained internal TypeScript kernels. See [polygon kernels](docs/guide/polygon-kernels.md) for input restrictions, precision and complexity.
|
|
94
97
|
|
|
95
|
-
##
|
|
98
|
+
## Algorithms and runnable examples
|
|
96
99
|
|
|
97
|
-
|
|
|
100
|
+
| Area | Examples | Capabilities |
|
|
98
101
|
| --- | --- | --- |
|
|
99
|
-
|
|
|
100
|
-
|
|
|
101
|
-
|
|
|
102
|
-
|
|
|
103
|
-
|
|
|
104
|
-
| Delaunay / Voronoi | [
|
|
105
|
-
|
|
|
106
|
-
|
|
|
107
|
-
|
|
|
108
|
-
|
|
|
109
|
-
|
|
|
110
|
-
|
|
|
111
|
-
| IK | [
|
|
112
|
-
| GIS | [
|
|
113
|
-
|
|
|
114
|
-
|
|
115
|
-
##
|
|
116
|
-
|
|
117
|
-
15
|
|
118
|
-
|
|
119
|
-
-
|
|
120
|
-
-
|
|
121
|
-
-
|
|
122
|
-
-
|
|
123
|
-
- `Shape`
|
|
124
|
-
|
|
125
|
-
###
|
|
126
|
-
|
|
127
|
-
|
|
|
102
|
+
| Geometry queries | [Distance and intersection](https://yszhao91.github.io/cga.js/guide/playground.html#geometry-distance) | Closest points, parameters, reciprocal queries, tolerance-based intersection |
|
|
103
|
+
| Arcs and disks | [Directed arcs](https://yszhao91.github.io/cga.js/guide/playground.html#circle-arc) | Angular bounds, endpoint constraints, numerical error bounds |
|
|
104
|
+
| Polygon booleans | [Topology changes](https://yszhao91.github.io/cga.js/guide/playground.html#polygon-topology) | Intersection, union, difference, XOR, holes and shared edges |
|
|
105
|
+
| Offsets and strokes | [Diagonal caps](https://yszhao91.github.io/cga.js/guide/playground.html#offset-open-caps) | Miter/round/square joins and butt/round/square caps |
|
|
106
|
+
| Triangulation | [Concave boundary with holes](https://yszhao91.github.io/cga.js/guide/playground.html#triangulation-multiple-holes) | 3D plane projection, original vertex indices, multiple holes |
|
|
107
|
+
| Delaunay / Voronoi | [Triangles](https://yszhao91.github.io/cga.js/guide/playground.html#delaunay-delaunay) · [Cells and neighbors](https://yszhao91.github.io/cga.js/guide/playground.html#voronoi) | Planar triangulation, clipped cells and adjacency |
|
|
108
|
+
| Point clouds | [3D hull](https://yszhao91.github.io/cga.js/guide/playground.html#hull-degeneracy) · [Closest pair](https://yszhao91.github.io/cga.js/guide/playground.html#closest-pair) | Affine degeneracy, outward faces and exact closest pairs |
|
|
109
|
+
| Curves and paths | [Catmull–Rom](https://yszhao91.github.io/cga.js/guide/playground.html#curve-catmull) · [Path distance](https://yszhao91.github.io/cga.js/guide/playground.html#path-mileage) | Parameterization, accumulated distance, slicing and sampling |
|
|
110
|
+
| Extrusion and meshes | [Hollow sweeps](https://yszhao91.github.io/cga.js/guide/playground.html#extrude-holes-closed) | Transported frames, joins, caps, UVs and normals |
|
|
111
|
+
| Plane cutting | [Volume conservation](https://yszhao91.github.io/cga.js/guide/playground.html#mesh-split-volume) | Separate halves, interpolated attributes and multi-ring caps |
|
|
112
|
+
| Spatial structures | [KdTree](https://yszhao91.github.io/cga.js/guide/playground.html#tree-kdtree) · [QuadTree](https://yszhao91.github.io/cga.js/guide/playground.html#tree-quadtree) · [Frustum](https://yszhao91.github.io/cga.js/guide/playground.html#frustum) | Neighbors, ranges, partitions, culling and clipping |
|
|
113
|
+
| Precision and CSG | [Projection](https://yszhao91.github.io/cga.js/guide/playground.html#precision-projection) · [Solid difference](https://yszhao91.github.io/cga.js/guide/playground.html#csg-subtract) | Decimal vectors, planes and BSP booleans |
|
|
114
|
+
| IK | [CCD](https://yszhao91.github.io/cga.js/guide/playground.html#ik-free) · [Hinge](https://yszhao91.github.io/cga.js/guide/playground.html#ik-hinge) · [Slider](https://yszhao91.github.io/cga.js/guide/playground.html#ik-slider) | Target solving, accumulated limits, convergence and bone lengths |
|
|
115
|
+
| GIS | [Coordinates](https://yszhao91.github.io/cga.js/guide/playground.html#gis-coordinates) · [Geodesics](https://yszhao91.github.io/cga.js/guide/playground.html#gis-geodesic) · [Terrain](https://yszhao91.github.io/cga.js/guide/playground.html#gis-heightmap) | ECEF/WGS84, tiles, imagery, terrain and tasks |
|
|
116
|
+
| Rendering and GLSL | [Viewer](https://yszhao91.github.io/cga.js/guide/playground.html#glview) · [Noise](https://yszhao91.github.io/cga.js/guide/playground.html#shader-classicnoise3d) | Optional Three.js, materials, noise and distance fields |
|
|
117
|
+
|
|
118
|
+
## Unified data structures and interfaces
|
|
119
|
+
|
|
120
|
+
The 15 geometry types are `Point / Vec3`, `Line`, `Ray`, `Segment`, `Plane`, `Triangle`, `Rectangle`, `Circle`, `Disk`, `Sphere`, `Capsule`, `Box`, `Polyline`, `Polygon` and `Shape`.
|
|
121
|
+
|
|
122
|
+
- Geometries share `kind`, `copy`, `clone`, `distancePoint`, `queryDistance` and `toJSON`. `geometryFromJSON` validates and restores data.
|
|
123
|
+
- Distance results always include `distance / distanceSqr / closests / parameters`, ordered as `[a, b]`. Iterative curved queries can report `errorBound`.
|
|
124
|
+
- Constructors and clones own their coordinates; queries preserve inputs. Fixed-arity objects support indexing and iteration without resizing.
|
|
125
|
+
- Mesh algorithms use `IGeometry`: `position:number[]`, optional `index / normal / uv / uv2 / tangent`. Indices are local to the returned vertex array.
|
|
126
|
+
- `Shape` retains holes for queries, triangulation and serialization.
|
|
127
|
+
|
|
128
|
+
### Conventions
|
|
129
|
+
|
|
130
|
+
| Item | Contract |
|
|
128
131
|
| --- | --- |
|
|
129
|
-
|
|
|
130
|
-
|
|
|
131
|
-
|
|
|
132
|
-
|
|
|
133
|
-
|
|
|
134
|
-
|
|
|
135
|
-
|
|
|
136
|
-
|
|
|
132
|
+
| Line | `Line(origin, end)` takes two points |
|
|
133
|
+
| Ray | `Ray(origin, direction)` takes an origin and a direction |
|
|
134
|
+
| Segment | Parameter interval is `[0, 1]` |
|
|
135
|
+
| Plane | `normal · point + w = 0`; numeric signed distance has its own method |
|
|
136
|
+
| Circle / Disk | `Circle` is a circumference or directed arc; `Disk` is a filled surface |
|
|
137
|
+
| Polygon | Filled planar region; clean self-intersections first, and keep triangulation holes separate |
|
|
138
|
+
| Units | Caller-defined model units; GIS uses radians internally and WGS84 heights in meters |
|
|
139
|
+
| Resources | Dispose viewers and effects explicitly; the host owns its model geometry and materials |
|
|
137
140
|
|
|
138
|
-
##
|
|
141
|
+
## Precision, IK and GIS
|
|
139
142
|
|
|
140
143
|
```js
|
|
141
144
|
// example:domains
|
|
142
145
|
import { HVec3, IK, GIS, v3 } from '@xort/cga';
|
|
143
146
|
|
|
144
147
|
const precise = new HVec3('0.1', '0.2', '0.3').add(new HVec3('0.2', 0, 0));
|
|
145
|
-
console.log(precise.x.toString()); // 0.3
|
|
148
|
+
console.log(precise.x.toString()); // 0.3; strings preserve decimal input
|
|
146
149
|
|
|
147
150
|
const skeleton = IK.Skeleton.fromPoints([v3(), v3(1,0,0), v3(2,0,0)]);
|
|
148
151
|
const solved = new IK.CCDSolver().solve(skeleton, v3(1,1,0));
|
|
149
152
|
console.log(solved.converged, solved.distance);
|
|
150
153
|
|
|
151
154
|
const ecef = GIS.GVec3.fromDegrees(116.4, 39.9, 50);
|
|
152
|
-
console.log(ecef.toCartographic()); //
|
|
155
|
+
console.log(ecef.toCartographic()); // longitude/latitude in radians, height in meters
|
|
153
156
|
```
|
|
154
157
|
|
|
155
|
-
CSG
|
|
158
|
+
CSG accepts closed, consistently oriented solids made of convex polygon faces. GIS `Globe` supplies tile and mesh data for a host renderer; `pick` queries the reference ellipsoid, while `getHeight` reads loaded terrain. Fetch/decode adapters integrate imagery and terrain services; examples inject local data. See [domain modules](docs/guide/experimental.md).
|
|
156
159
|
|
|
157
|
-
##
|
|
160
|
+
## Browsers and optional Three.js
|
|
158
161
|
|
|
159
|
-
|
|
162
|
+
Core calculations need no DOM, Three.js or GPU. Install the display dependency when needed:
|
|
160
163
|
|
|
161
164
|
```sh
|
|
162
165
|
npm install three
|
|
163
166
|
```
|
|
164
167
|
|
|
165
|
-
|
|
168
|
+
For a browser project using a bundler such as Vite, provide a container with an explicit height:
|
|
166
169
|
|
|
167
170
|
```html
|
|
168
171
|
<div id="view" style="height:420px;width:100%"></div>
|
|
@@ -178,16 +181,16 @@ view.add(light);
|
|
|
178
181
|
view.addUpdates(time => light.update(time));
|
|
179
182
|
view.run();
|
|
180
183
|
|
|
181
|
-
//
|
|
184
|
+
// Call on unmount; dispose host model resources according to ownership.
|
|
182
185
|
const dispose = () => { light.dispose(); view.dispose(); };
|
|
183
186
|
window.addEventListener('pagehide', dispose, { once: true });
|
|
184
187
|
```
|
|
185
188
|
|
|
186
|
-
|
|
189
|
+
Additional entries include `@xort/cga/shaders`, `ThreeBSP` and `DiamondShader`. Without a bundler, use the global `cga` from `build/@xort_cga.js` or the ESM `build/cga.esm.js`; these core files do not include the Three.js viewer.
|
|
187
190
|
|
|
188
|
-
##
|
|
191
|
+
## Internal algorithms and dependencies
|
|
189
192
|
|
|
190
|
-
|
|
193
|
+
Geometry, triangulation, booleans, CSG, IK, ellipsoid geodesics and decimal arithmetic are implemented inside the repository in TypeScript. The core has **zero runtime dependencies**. Decimal uses a BigInt kernel; geodesics use an internal Karney port with antipodal support and retained MIT attribution. Build tools stay out of the runtime package, Three.js is optional, and GPU shaders use GLSL.
|
|
191
194
|
|
|
192
195
|
```js
|
|
193
196
|
// example:decimal
|
|
@@ -200,40 +203,40 @@ try {
|
|
|
200
203
|
} finally { Decimal.set(previous); }
|
|
201
204
|
```
|
|
202
205
|
|
|
203
|
-
|
|
206
|
+
Internal Decimal supplies arithmetic, comparison, square roots and formatting for vectors and CSG. It does not implement the complete decimal.js API, including trigonometry and clone configurations. Constructors retain input digits; arithmetic rounds to 1–1000 significant digits, with 20 by default. Non-finite values and out-of-range exponents throw. See [implementation and migration](docs/guide/internal-algorithms.md).
|
|
204
207
|
|
|
205
|
-
##
|
|
208
|
+
## Limits and remaining work
|
|
206
209
|
|
|
207
|
-
-
|
|
208
|
-
-
|
|
209
|
-
-
|
|
210
|
-
-
|
|
211
|
-
-
|
|
212
|
-
-
|
|
210
|
+
- Floating-point queries use tolerances. Exhausting an iteration budget throws; zero distance between intersecting solids does not provide a general contact manifold or penetration depth.
|
|
211
|
+
- Hole triangulation uses visible bridges and ear clipping, with worst-case O(n³) behavior. Polygon intersection enumeration is O(E²), with additional edge scans for classification; use it for small or medium contours.
|
|
212
|
+
- Planar booleans default to roughly `1e-6` model-unit quantization, configurable through `scale`. Smaller features can merge. Decimal vectors do not turn floating-point boolean operations into exact predicates.
|
|
213
|
+
- Round joins and caps use sampled curves. Large contours, extreme aspect ratios and nearly coincident edges still need dedicated performance/error benchmarks and stronger predicates.
|
|
214
|
+
- Public entries have examples; **dedicated method-level examples remain incomplete**, especially matrix projection, transforms and buffer attributes. The [method inventory](docs/guide/method-coverage.md) separates dedicated tags from shared queries.
|
|
215
|
+
- Constrained Delaunay, BVH, incremental updates, additional curves/surfaces and GIS protocols remain future capabilities. See the [roadmap](docs/guide/architecture.md).
|
|
213
216
|
|
|
214
|
-
##
|
|
217
|
+
## Development and verification
|
|
215
218
|
|
|
216
|
-
|
|
219
|
+
Minimum Node.js **22.12**; **Node 26** from `.nvmrc` is recommended. CI covers Linux / Windows with Node 22 / 24 / 26.
|
|
217
220
|
|
|
218
221
|
```sh
|
|
219
222
|
npm ci
|
|
220
|
-
npx playwright install chromium
|
|
221
|
-
npm run docs:dev #
|
|
222
|
-
npm run verify #
|
|
223
|
-
npm run algorithms:check #
|
|
224
|
-
npm run docs:screenshots #
|
|
225
|
-
npm run media:check #
|
|
226
|
-
npm run api:check #
|
|
227
|
-
npm run readme:check #
|
|
223
|
+
npx playwright install chromium # Windows can use installed Edge
|
|
224
|
+
npm run docs:dev # Local guides and examples
|
|
225
|
+
npm run verify # Complete checks
|
|
226
|
+
npm run algorithms:check # Internal TS and dependency boundary
|
|
227
|
+
npm run docs:screenshots # Capture 14 scenes / 28 images
|
|
228
|
+
npm run media:check # Image hashes, dimensions and source fingerprint
|
|
229
|
+
npm run api:check # Method-level inventory
|
|
230
|
+
npm run readme:check # Execute README snippets
|
|
228
231
|
npm run release:check -- --complete
|
|
229
232
|
```
|
|
230
233
|
|
|
231
|
-
|
|
234
|
+
See [architecture](docs/guide/architecture.md) for module boundaries and `.release/screenshots.json` for screenshot parameters and hashes. New public entries need runnable examples; behavior changes need analytical or independent reference checks.
|
|
232
235
|
|
|
233
|
-
|
|
236
|
+
Plan the version and documentation before implementation, verification, commits, deployment and npm publication. Increment once per release, carrying at 100: `0.1.99 → 0.2.0`, `0.99.99 → 1.0.0`. Commits and authentication retries keep the same planned version.
|
|
234
237
|
|
|
235
|
-
[0.1.
|
|
238
|
+
[0.1.4 release notes](docs/guide/migration-0.1.4.md) · [Delivery checklist](docs/guide/gaps.md) · [Contributing](CONTRIBUTING.md) · [Release status](docs/release-status.md)
|
|
236
239
|
|
|
237
|
-
##
|
|
240
|
+
## License
|
|
238
241
|
|
|
239
|
-
MIT
|
|
242
|
+
MIT. Ported algorithms and shaders retain their [third-party notices](THIRD_PARTY_NOTICES.md).
|
package/readme.zh-CN.md
ADDED
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
# cga.js
|
|
2
|
+
|
|
3
|
+
[English](readme.md) · [简体中文](readme.zh-CN.md)
|
|
4
|
+
|
|
5
|
+
**JavaScript / TypeScript 计算几何库。** 用统一数据结构计算距离、最近点、相交、多边形布尔、剖分、点云和路径网格,并提供高精度 CSG、IK、GIS 与可选 Three.js / GLSL 适配。
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/@xort/cga) [](https://github.com/yszhao91/cga.js/actions/workflows/ci.yml) [](LICENSE)
|
|
8
|
+
|
|
9
|
+
[快速开始](#安装与快速开始) · [在线演示](https://yszhao91.github.io/cga.js/zh/guide/playground.html) · [真实图册](https://yszhao91.github.io/cga.js/zh/guide/gallery.html) · [API](https://yszhao91.github.io/cga.js/zh/guide/api.html) · [复审与路线图](docs/zh/guide/review-0.1.3.md) · [贡献](CONTRIBUTING.md)
|
|
10
|
+
|
|
11
|
+
<!-- release-status:start -->
|
|
12
|
+
本轮发行版本 **0.1.4**:英文为默认介绍与文档语言,同时提供独立中文版本;全部计算算法使用内部 TypeScript、核心零运行时依赖;丰富 README、真实截图和演示;修复方端盖、微小尺度剖分与非法轮廓校验。npm latest、发布标签和线上部署的实际状态见[发布记录](https://yszhao91.github.io/cga.js/zh/release-status.html)。版本按发布递增,提交和授权重试不重复升版。
|
|
13
|
+
<!-- release-status:end -->
|
|
14
|
+
|
|
15
|
+
## 看看实际效果
|
|
16
|
+
|
|
17
|
+
图片由当前项目在真实浏览器中计算并截取。点击可操作对应场景;图册还保留带控件、图例和计算结果的完整截图。
|
|
18
|
+
|
|
19
|
+
| 几何距离与最近点 | 凹多边形和多个孔洞 |
|
|
20
|
+
| --- | --- |
|
|
21
|
+
| [](https://yszhao91.github.io/cga.js/zh/guide/playground.html#geometry-distance?a=Capsule&b=Triangle&ax=0.5&ay=3&az=1) | [](https://yszhao91.github.io/cga.js/zh/guide/playground.html#triangulation-multiple-holes) |
|
|
22
|
+
| **带孔截面与路径扫掠** | **高精度实体布尔** |
|
|
23
|
+
| [](https://yszhao91.github.io/cga.js/zh/guide/playground.html#extrude-holes-closed?width=0.65) | [](https://yszhao91.github.io/cga.js/zh/guide/playground.html#csg-subtract?x=0.5) |
|
|
24
|
+
| **带约束的逆运动学** | **GIS 球面瓦片** |
|
|
25
|
+
| [](https://yszhao91.github.io/cga.js/zh/guide/playground.html#ik-hinge?x=1.5&y=2) | [](https://yszhao91.github.io/cga.js/zh/guide/playground.html#gis-globe?level=2) |
|
|
26
|
+
|
|
27
|
+
**94 个可操作案例 · 184 个公开入口映射 · 15 类几何体的 225 种有序组合。** 这些数字描述案例和入口覆盖,公有方法的逐项演示另见[方法级清单](docs/zh/guide/method-coverage.md),数值正确性由解析、随机和退化测试验证。
|
|
28
|
+
|
|
29
|
+
[查看全部 14 组真实预览](https://yszhao91.github.io/cga.js/zh/guide/gallery.html) · [带参数的案例目录](docs/zh/guide/demo-coverage.md) · [截图复现方法](#开发与验证)
|
|
30
|
+
|
|
31
|
+
## 安装与快速开始
|
|
32
|
+
|
|
33
|
+
```sh
|
|
34
|
+
npm install @xort/cga
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### 距离、最近点和参数
|
|
38
|
+
|
|
39
|
+
```js
|
|
40
|
+
// example:distance
|
|
41
|
+
import { v3, segment, distance, intersects } from '@xort/cga';
|
|
42
|
+
|
|
43
|
+
const point = v3(1, 2, 0);
|
|
44
|
+
const edge = segment(v3(0, 0, 0), v3(4, 0, 0));
|
|
45
|
+
const result = distance(point, edge);
|
|
46
|
+
|
|
47
|
+
console.log(result.distance); // 2
|
|
48
|
+
console.log(result.distanceSqr); // 4
|
|
49
|
+
console.log(result.closests.map(p => p.toArray())); // [[1, 2, 0], [1, 0, 0]]
|
|
50
|
+
console.log(result.parameters); // [0, 0.25]
|
|
51
|
+
console.log(intersects(point, edge)); // false
|
|
52
|
+
console.log(point.queryDistance(edge).distance); // 2
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
`distance(a, b)`、`a.queryDistance(b)` 返回相同结果契约。`Vec3.distanceTo(otherPoint)` 则返回点间距离数字。
|
|
56
|
+
|
|
57
|
+
### CommonJS
|
|
58
|
+
|
|
59
|
+
```js
|
|
60
|
+
// example:commonjs
|
|
61
|
+
const { v3, segment, distance } = require('@xort/cga');
|
|
62
|
+
const result = distance(v3(1, 2, 0), segment(v3(), v3(4, 0, 0)));
|
|
63
|
+
console.log(result.distance); // 2
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### 克隆和序列化
|
|
67
|
+
|
|
68
|
+
```js
|
|
69
|
+
// example:serialization
|
|
70
|
+
import { Triangle, geometryFromJSON, v3 } from '@xort/cga';
|
|
71
|
+
|
|
72
|
+
const original = new Triangle(v3(), v3(2, 0, 0), v3(0, 2, 0));
|
|
73
|
+
const clone = original.clone();
|
|
74
|
+
const restored = geometryFromJSON(JSON.parse(JSON.stringify(original)));
|
|
75
|
+
original[0].x = 3;
|
|
76
|
+
console.log(clone[0].x, restored[0].x); // 0, 0:坐标相互独立
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### 自有 TypeScript 多边形内核
|
|
80
|
+
|
|
81
|
+
```js
|
|
82
|
+
// example:polygon
|
|
83
|
+
import { v3, triangulation, clipPolygons } from '@xort/cga';
|
|
84
|
+
|
|
85
|
+
const outer = [v3(-2,-2,0), v3(2,-2,0), v3(2,2,0), v3(-2,2,0)];
|
|
86
|
+
const hole = [v3(-.5,-.5,0), v3(.5,-.5,0), v3(.5,.5,0), v3(-.5,.5,0)];
|
|
87
|
+
const vertices = [...outer, ...hole];
|
|
88
|
+
const indices = triangulation(outer, [hole]);
|
|
89
|
+
console.log(vertices.length, indices.length / 3); // 8 顶点、8 三角形
|
|
90
|
+
|
|
91
|
+
const contours = clipPolygons([outer], [hole], 'difference', v3(0,0,1));
|
|
92
|
+
console.log(contours.length); // 2:外边界和孔洞,绕序相反
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
剖分、裁剪、偏移、清理均由本项目维护的 TypeScript 内核实现。输入限制、精度和复杂度见[多边形内核说明](docs/zh/guide/polygon-kernels.md)。
|
|
96
|
+
|
|
97
|
+
## 算法与示例导航
|
|
98
|
+
|
|
99
|
+
| 范围 | 可操作示例 | 关键能力 |
|
|
100
|
+
| --- | --- | --- |
|
|
101
|
+
| 几何查询 | [距离与求交](https://yszhao91.github.io/cga.js/zh/guide/playground.html#geometry-distance) | 最近点、参数、双向查询、容差相交 |
|
|
102
|
+
| 圆弧与圆盘 | [有向圆弧](https://yszhao91.github.io/cga.js/zh/guide/playground.html#circle-arc) | 弧段范围、端点限制、迭代误差界 |
|
|
103
|
+
| 平面布尔 | [拓扑变化](https://yszhao91.github.io/cga.js/zh/guide/playground.html#polygon-topology) | 交/并/差/异或、多轮廓、孔洞、共边 |
|
|
104
|
+
| 偏移与描边 | [斜线端盖](https://yszhao91.github.io/cga.js/zh/guide/playground.html#offset-open-caps) | 尖/圆/方连接,平/圆/方端盖 |
|
|
105
|
+
| 三角剖分 | [多孔凹轮廓](https://yszhao91.github.io/cga.js/zh/guide/playground.html#triangulation-multiple-holes) | 3D 平面投影、原始顶点索引、多个孔洞 |
|
|
106
|
+
| Delaunay / Voronoi | [三角网](https://yszhao91.github.io/cga.js/zh/guide/playground.html#delaunay-delaunay) · [单元和邻居](https://yszhao91.github.io/cga.js/zh/guide/playground.html#voronoi) | 平面剖分、裁剪单元、站点与邻接 |
|
|
107
|
+
| 点云 | [三维凸包](https://yszhao91.github.io/cga.js/zh/guide/playground.html#hull-degeneracy) · [最近点对](https://yszhao91.github.io/cga.js/zh/guide/playground.html#closest-pair) | 共面/共线退化、三维 hull、最近点对 |
|
|
108
|
+
| 曲线与路径 | [Catmull–Rom](https://yszhao91.github.io/cga.js/zh/guide/playground.html#curve-catmull) · [里程采样](https://yszhao91.github.io/cga.js/zh/guide/playground.html#path-mileage) | 参数化、累计长度、切片与重采样 |
|
|
109
|
+
| 挤压与网格 | [带孔扫掠](https://yszhao91.github.io/cga.js/zh/guide/playground.html#extrude-holes-closed) | 平行移动标架、连接、封口、UV 与法线 |
|
|
110
|
+
| 平面切割 | [体积守恒](https://yszhao91.github.io/cga.js/zh/guide/playground.html#mesh-split-volume) | 分侧网格、属性插值、多轮廓封口 |
|
|
111
|
+
| 空间结构 | [KdTree](https://yszhao91.github.io/cga.js/zh/guide/playground.html#tree-kdtree) · [QuadTree](https://yszhao91.github.io/cga.js/zh/guide/playground.html#tree-quadtree) · [Frustum](https://yszhao91.github.io/cga.js/zh/guide/playground.html#frustum) | 最近邻、范围、空间划分、剔除与裁剪 |
|
|
112
|
+
| 高精度与 CSG | [精度投影](https://yszhao91.github.io/cga.js/zh/guide/playground.html#precision-projection) · [实体差集](https://yszhao91.github.io/cga.js/zh/guide/playground.html#csg-subtract) | Decimal 向量、平面、BSP 并/交/差 |
|
|
113
|
+
| IK | [自由 CCD](https://yszhao91.github.io/cga.js/zh/guide/playground.html#ik-free) · [铰链](https://yszhao91.github.io/cga.js/zh/guide/playground.html#ik-hinge) · [滑块](https://yszhao91.github.io/cga.js/zh/guide/playground.html#ik-slider) | 目标求解、累计限位、收敛与骨长 |
|
|
114
|
+
| GIS | [坐标转换](https://yszhao91.github.io/cga.js/zh/guide/playground.html#gis-coordinates) · [测地线](https://yszhao91.github.io/cga.js/zh/guide/playground.html#gis-geodesic) · [地形](https://yszhao91.github.io/cga.js/zh/guide/playground.html#gis-heightmap) | ECEF/WGS84、瓦片、影像、地形和任务 |
|
|
115
|
+
| 渲染与 GLSL | [查看器](https://yszhao91.github.io/cga.js/zh/guide/playground.html#glview) · [噪声](https://yszhao91.github.io/cga.js/zh/guide/playground.html#shader-classicnoise3d) | 可选 Three.js、材质、噪声和距离场 |
|
|
116
|
+
|
|
117
|
+
## 统一数据结构与接口
|
|
118
|
+
|
|
119
|
+
15 类几何体:`Point / Vec3`、`Line`、`Ray`、`Segment`、`Plane`、`Triangle`、`Rectangle`、`Circle`、`Disk`、`Sphere`、`Capsule`、`Box`、`Polyline`、`Polygon`、`Shape`。
|
|
120
|
+
|
|
121
|
+
- 查询共有 `kind`、`copy`、`clone`、`distancePoint`、`queryDistance` 和 `toJSON`;`geometryFromJSON` 校验并恢复数据。
|
|
122
|
+
- 距离结果必含 `distance / distanceSqr / closests / parameters`。最近点和参数始终按 `[a, b]` 排列;迭代圆类查询可报告 `errorBound`。
|
|
123
|
+
- 构造和克隆拥有独立坐标;查询保留输入。固定顶点对象支持索引与迭代,顶点数量固定。
|
|
124
|
+
- 网格统一使用 `IGeometry`:`position:number[]`,可选 `index / normal / uv / uv2 / tangent`。索引相对于该次返回的顶点数组。
|
|
125
|
+
- `Shape` 在外轮廓之外保留孔洞,并统一参与查询、剖分和序列化。
|
|
126
|
+
|
|
127
|
+
### 使用时需要明确的约定
|
|
128
|
+
|
|
129
|
+
| 项目 | 约定 |
|
|
130
|
+
| --- | --- |
|
|
131
|
+
| 直线 | `Line(origin, end)` 的第二项是另一个点 |
|
|
132
|
+
| 射线 | `Ray(origin, direction)` 的第二项是方向 |
|
|
133
|
+
| 线段 | 参数区间为 `[0, 1]` |
|
|
134
|
+
| 平面 | `normal · point + w = 0`;数值有符号距离单独定义 |
|
|
135
|
+
| 圆圈 / 圆盘 | `Circle` 表示圆周或有向圆弧;`Disk` 表示填充面 |
|
|
136
|
+
| 多边形 | 填充面;自交轮廓先整理,剖分孔洞须互不接触 |
|
|
137
|
+
| 单位 | 核心几何使用调用者的模型单位;GIS 经纬度内部为弧度,高度为米 |
|
|
138
|
+
| 资源所有权 | 查看器与效果显式释放;宿主模型的几何和材质由宿主管理 |
|
|
139
|
+
|
|
140
|
+
## 高精度、IK 与 GIS
|
|
141
|
+
|
|
142
|
+
```js
|
|
143
|
+
// example:domains
|
|
144
|
+
import { HVec3, IK, GIS, v3 } from '@xort/cga';
|
|
145
|
+
|
|
146
|
+
const precise = new HVec3('0.1', '0.2', '0.3').add(new HVec3('0.2', 0, 0));
|
|
147
|
+
console.log(precise.x.toString()); // 0.3:用字符串保留十进制输入
|
|
148
|
+
|
|
149
|
+
const skeleton = IK.Skeleton.fromPoints([v3(), v3(1,0,0), v3(2,0,0)]);
|
|
150
|
+
const solved = new IK.CCDSolver().solve(skeleton, v3(1,1,0));
|
|
151
|
+
console.log(solved.converged, solved.distance);
|
|
152
|
+
|
|
153
|
+
const ecef = GIS.GVec3.fromDegrees(116.4, 39.9, 50);
|
|
154
|
+
console.log(ecef.toCartographic()); // 经度/纬度为弧度,高度为米
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
CSG 使用凸多边形面组成的闭合定向实体。GIS 的 `Globe` 提供瓦片和网格数据层,宿主负责渲染;`pick` 查询参考椭球,`getHeight` 读取已加载地形。影像和地形服务通过 fetch / 解码器接入,演示中明确使用本地注入数据。详见[领域模块指南](docs/zh/guide/experimental.md)。
|
|
158
|
+
|
|
159
|
+
## 浏览器与可选 Three.js
|
|
160
|
+
|
|
161
|
+
核心计算无需 DOM、Three.js 或 GPU。按需安装渲染依赖:
|
|
162
|
+
|
|
163
|
+
```sh
|
|
164
|
+
npm install three
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
在 Vite 等支持包导入的浏览器工程中,先提供有高度的容器:
|
|
168
|
+
|
|
169
|
+
```html
|
|
170
|
+
<div id="view" style="height:420px;width:100%"></div>
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
```js
|
|
174
|
+
// example:browser
|
|
175
|
+
import { GLView, BreathLight } from '@xort/cga/three';
|
|
176
|
+
|
|
177
|
+
const view = new GLView({ container: document.querySelector('#view') });
|
|
178
|
+
const light = new BreathLight();
|
|
179
|
+
view.add(light);
|
|
180
|
+
view.addUpdates(time => light.update(time));
|
|
181
|
+
view.run();
|
|
182
|
+
|
|
183
|
+
// 在组件卸载或页面销毁时调用;自有模型资源也应按所有权释放。
|
|
184
|
+
const dispose = () => { light.dispose(); view.dispose(); };
|
|
185
|
+
window.addEventListener('pagehide', dispose, { once: true });
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
另有 `@xort/cga/shaders` 文本入口、`ThreeBSP` 和 `DiamondShader`。不使用打包器时可选择 `build/@xort_cga.js` 的全局 `cga`,或 `build/cga.esm.js` 的 ESM;这两个核心文件不包含 Three.js 查看器。
|
|
189
|
+
|
|
190
|
+
## 内部算法与依赖边界
|
|
191
|
+
|
|
192
|
+
几何、剖分、布尔、CSG、IK、GIS 测地线和高精度运算均在仓库内实现为 TypeScript,核心包 **零运行时依赖**。十进制采用内部 BigInt 内核;椭球测地线采用内部 Karney 移植,保留对跖点能力与 MIT 来源声明。开发工具不进入核心发行包,Three.js 是可选的显示适配器,GPU 着色器使用 GLSL。
|
|
193
|
+
|
|
194
|
+
```js
|
|
195
|
+
// example:decimal
|
|
196
|
+
import { Decimal, HVec3 } from '@xort/cga';
|
|
197
|
+
const previous = { precision: Decimal.precision, rounding: Decimal.rounding };
|
|
198
|
+
try {
|
|
199
|
+
Decimal.set({ precision: 50, rounding: Decimal.ROUND_HALF_EVEN });
|
|
200
|
+
console.log(new Decimal(2).sqrt().toString());
|
|
201
|
+
console.log(new HVec3('0.1').add(new HVec3('0.2')).toJSON());
|
|
202
|
+
} finally { Decimal.set(previous); }
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
内部 Decimal 提供向量/CSG 所需算术、比较、开方和格式化;不宣称完整兼容 decimal.js 的三角函数、clone 或配置接口。构造时保留输入数字,运算按 1–1000 位有效数字舍入,默认 20 位;非有限值和超范围指数会报错。[实现、来源与迁移](docs/zh/guide/internal-algorithms.md)。
|
|
206
|
+
|
|
207
|
+
## 能力边界与剩余工作
|
|
208
|
+
|
|
209
|
+
- 浮点查询按容差计算,迭代预算耗尽会明确报错;距离为 0 的实体交叠查询不提供通用接触流形或穿透深度。
|
|
210
|
+
- 带孔剖分采用可见桥和耳切法,最坏 O(n³)。多边形布尔的边交点阶段 O(E²),分类还需扫描原始边,适用于中小型轮廓。
|
|
211
|
+
- 平面布尔默认量化步长约为 `1e-6` 模型单位,可调整 `scale`;小于量化精度的特征可能合并。高精度向量不会自动把普通浮点布尔变为精确谓词算法。
|
|
212
|
+
- 圆角和圆端盖使用离散圆弧。对超大轮廓、极端长宽比和近重合边的性能与误差,还需要专门的基准与更强的数值谓词。
|
|
213
|
+
- 入口示例已覆盖,**方法级的独立演示仍需继续补充**,优先矩阵法线/投影、几何变换和缓冲属性;[方法清单](docs/zh/guide/method-coverage.md)明确区分独立示例和共享查询。
|
|
214
|
+
- 约束 Delaunay、BVH、大型数据增量更新、更多曲线/曲面、GIS 瓦片协议扩展属于后续能力,见[复审与路线图](docs/zh/guide/review-0.1.3.md)。
|
|
215
|
+
|
|
216
|
+
## 开发与验证
|
|
217
|
+
|
|
218
|
+
最低 Node.js **22.12**,建议使用 `.nvmrc` 指定的 **Node.js 26**。CI 同时验证 Linux / Windows 和 Node 22 / 24 / 26。
|
|
219
|
+
|
|
220
|
+
```sh
|
|
221
|
+
npm ci
|
|
222
|
+
npx playwright install chromium # Windows 也可使用已安装的 Edge
|
|
223
|
+
npm run docs:dev # 本地文档与演示
|
|
224
|
+
npm run verify # 完整验证
|
|
225
|
+
npm run algorithms:check # 内部 TS、零运行时依赖、算法导入边界
|
|
226
|
+
npm run docs:screenshots # 从真实浏览器重新生成 14 组、28 张截图
|
|
227
|
+
npm run media:check # 截图哈希、尺寸、案例和源代码指纹
|
|
228
|
+
npm run api:check # 方法级示例登记
|
|
229
|
+
npm run readme:check # 执行 README 中的 Node.js 示例
|
|
230
|
+
npm run release:check -- --complete
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
源码目录与模块关系见[架构说明](docs/zh/guide/architecture.md),截图参数和哈希保存在 `.release/screenshots.json`。新增公开入口须增加可操作案例;新功能与边界修复须提供相应的解析或独立参考验证。
|
|
234
|
+
|
|
235
|
+
每轮发布先规划版本并同步文档,再实现与验收,最后提交、推送、部署和发布 npm。版本末位每次加 1,满 100 进位:`0.1.99 → 0.2.0`、`0.99.99 → 1.0.0`。同一轮提交和授权重试保持相同版本。
|
|
236
|
+
|
|
237
|
+
[0.1.4 说明](docs/zh/guide/migration-0.1.4.md) · [缺口清单](docs/zh/guide/gaps.md) · [贡献约定](CONTRIBUTING.md) · [发布记录](docs/zh/release-status.md)
|
|
238
|
+
|
|
239
|
+
## 许可证
|
|
240
|
+
|
|
241
|
+
MIT License。第三方组件与着色器声明见 [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md)。
|