@faicad/faijs-gears 0.0.0-stage → 0.29.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.
Files changed (67) hide show
  1. package/LICENSE +202 -0
  2. package/dist/bevel_gear.d.ts +113 -0
  3. package/dist/bevel_gear.d.ts.map +1 -0
  4. package/dist/bevel_gear.js +327 -0
  5. package/dist/bevel_gear.js.map +1 -0
  6. package/dist/crossed_helical_gear.d.ts +24 -0
  7. package/dist/crossed_helical_gear.d.ts.map +1 -0
  8. package/dist/crossed_helical_gear.js +24 -0
  9. package/dist/crossed_helical_gear.js.map +1 -0
  10. package/dist/crossed_pair.d.ts +177 -0
  11. package/dist/crossed_pair.d.ts.map +1 -0
  12. package/dist/crossed_pair.js +237 -0
  13. package/dist/crossed_pair.js.map +1 -0
  14. package/dist/features.d.ts +184 -0
  15. package/dist/features.d.ts.map +1 -0
  16. package/dist/features.js +408 -0
  17. package/dist/features.js.map +1 -0
  18. package/dist/index.d.ts +178 -0
  19. package/dist/index.d.ts.map +1 -0
  20. package/dist/index.js +223 -0
  21. package/dist/index.js.map +1 -0
  22. package/dist/kernel/gears.d.ts +231 -0
  23. package/dist/kernel/gears.d.ts.map +1 -0
  24. package/dist/kernel/gears.js +274 -0
  25. package/dist/kernel/gears.js.map +1 -0
  26. package/dist/kernel/index.d.ts +10 -0
  27. package/dist/kernel/index.d.ts.map +1 -0
  28. package/dist/kernel/index.js +9 -0
  29. package/dist/kernel/index.js.map +1 -0
  30. package/dist/math.d.ts +200 -0
  31. package/dist/math.d.ts.map +1 -0
  32. package/dist/math.js +274 -0
  33. package/dist/math.js.map +1 -0
  34. package/dist/pairs.d.ts +161 -0
  35. package/dist/pairs.d.ts.map +1 -0
  36. package/dist/pairs.js +183 -0
  37. package/dist/pairs.js.map +1 -0
  38. package/dist/planetary.d.ts +96 -0
  39. package/dist/planetary.d.ts.map +1 -0
  40. package/dist/planetary.js +139 -0
  41. package/dist/planetary.js.map +1 -0
  42. package/dist/profile.d.ts +439 -0
  43. package/dist/profile.d.ts.map +1 -0
  44. package/dist/profile.js +597 -0
  45. package/dist/profile.js.map +1 -0
  46. package/dist/rack_gear.d.ts +125 -0
  47. package/dist/rack_gear.d.ts.map +1 -0
  48. package/dist/rack_gear.js +344 -0
  49. package/dist/rack_gear.js.map +1 -0
  50. package/dist/ring_gear.d.ts +54 -0
  51. package/dist/ring_gear.d.ts.map +1 -0
  52. package/dist/ring_gear.js +133 -0
  53. package/dist/ring_gear.js.map +1 -0
  54. package/dist/spline-face.d.ts +99 -0
  55. package/dist/spline-face.d.ts.map +1 -0
  56. package/dist/spline-face.js +94 -0
  57. package/dist/spline-face.js.map +1 -0
  58. package/dist/spur_gear.d.ts +112 -0
  59. package/dist/spur_gear.d.ts.map +1 -0
  60. package/dist/spur_gear.js +206 -0
  61. package/dist/spur_gear.js.map +1 -0
  62. package/dist/worm_gear.d.ts +78 -0
  63. package/dist/worm_gear.d.ts.map +1 -0
  64. package/dist/worm_gear.js +256 -0
  65. package/dist/worm_gear.js.map +1 -0
  66. package/package.json +49 -4
  67. package/README.md +0 -3
@@ -0,0 +1,274 @@
1
+ /**
2
+ * gears — raw-handle primitives for the cq_gears port (E1–E6 companion layer).
3
+ *
4
+ * cq_gears' tooth faces are B-spline patches built from (u,v) point grids and
5
+ * assembled by sewing — these need raw kernel construction primitives that no
6
+ * Workplane op exposes (bsplineSurface / approximatePoints / interpolatePoints,
7
+ * tolerant edge chaining, sew+makeSolid). The faijs-gears v1 port probed them
8
+ * in its own `kernel.ts` / `geom-build.ts` / `spline-face.ts`; per the port
9
+ * plan (§4) the implementations must live INSIDE cq-compat — this file is that
10
+ * landing spot. faijs-gears only imports from here; it must not touch
11
+ * occt-wasm directly.
12
+ *
13
+ * Everything here is a verbatim port of the proven v1 implementations (same
14
+ * kernel call sequence → bit-identical geometry).
15
+ */
16
+ import { initOcctWasm } from '@faicad/faijs';
17
+ let gearKernelPromise = null;
18
+ /**
19
+ * Get the raw occt-wasm kernel (process-wide singleton).
20
+ *
21
+ * Same instance as `initOcctWasm()` — this only asserts the richer
22
+ * `GearKernel` type, never constructs a second kernel (handles are indices
23
+ * into one kernel arena and must not cross instances).
24
+ *
25
+ * @returns the raw kernel (promise; initializes wasm on first call)
26
+ */
27
+ export function getGearKernel() {
28
+ if (!gearKernelPromise) {
29
+ gearKernelPromise = initOcctWasm().then((k) => k);
30
+ }
31
+ return gearKernelPromise;
32
+ }
33
+ function gearDist(a, b) {
34
+ return Math.hypot(a.x - b.x, a.y - b.y, a.z - b.z);
35
+ }
36
+ /**
37
+ * Endpoints of an edge, via the curve parameter domain.
38
+ *
39
+ * ⚠️ Endpoint red line (probed 2026-09-11): `getSubShapes(edge, 'vertex')`
40
+ * returns fewer than 2 vertices for **B-spline curve edges** (OCCT stores no
41
+ * explicit vertices on them), which used to make edge chaining treat every
42
+ * edge as its own wire. The correct path is `curveParameters(edge)` →
43
+ * `curvePointAtParam(edge, param)` — valid for ALL edge kinds (line / arc /
44
+ * B-spline); the vertex fallback only covers degenerate edges without an
45
+ * underlying curve.
46
+ *
47
+ * @param kernel raw OCCT kernel
48
+ * @param edge edge handle
49
+ * @returns both endpoints (closed edges: first == last)
50
+ */
51
+ export function gearEdgeEnds(kernel, edge) {
52
+ try {
53
+ const { first, last } = kernel.curveParameters(edge);
54
+ return {
55
+ edge,
56
+ a: kernel.curvePointAtParam(edge, first),
57
+ b: kernel.curvePointAtParam(edge, last),
58
+ };
59
+ }
60
+ catch {
61
+ // Fallback: rare degenerate edges without an underlying curve.
62
+ const vs = kernel.getSubShapes(edge, 'vertex');
63
+ if (vs.length < 2) {
64
+ const p = kernel.vertexPosition(vs[0]);
65
+ return { edge, a: p, b: p };
66
+ }
67
+ return { edge, a: kernel.vertexPosition(vs[0]), b: kernel.vertexPosition(vs[1]) };
68
+ }
69
+ }
70
+ /**
71
+ * TS port of OCCT `ShapeAnalysis_FreeBounds::ConnectEdgesToWires` — chain
72
+ * unordered edges into wires by endpoint proximity within `tol`.
73
+ *
74
+ * faijs/occt-wasm has no such binding and `makeWire(edges)` is
75
+ * `BRepBuilderAPI_MakeWire` — measured (2026-09-08) to silently drop edges on
76
+ * unordered input (68 edges → 9-edge broken wire). Endpoint pairing is O(n²)
77
+ * (n = 4·z teeth, at most a few hundred — fine).
78
+ *
79
+ * Gaps above OCCT precision (~1e-7) get a bridging line segment, matching
80
+ * upstream ConnectEdgesToWires behaviour.
81
+ *
82
+ * @param kernel raw OCCT kernel
83
+ * @param edges unordered edge set
84
+ * @param tol endpoint pairing tolerance (mm); cq uses `wire_comb_tol = 1e-2`
85
+ * @returns one or more wires, each with its edges chained head-to-tail
86
+ */
87
+ export function connectEdgesToWires(kernel, edges, tol) {
88
+ if (!Number.isFinite(tol) || tol <= 0) {
89
+ throw new Error(`connectEdgesToWires: tol must be a positive finite number, got ${String(tol)}`);
90
+ }
91
+ const pool = edges.map((e) => gearEdgeEnds(kernel, e));
92
+ const used = new Array(pool.length).fill(false);
93
+ const wires = [];
94
+ for (let start = 0; start < pool.length; start++) {
95
+ if (used[start])
96
+ continue;
97
+ used[start] = true;
98
+ const chain = [pool[start].edge];
99
+ let tail = pool[start].b;
100
+ const head = pool[start].a;
101
+ // Chain forward: find an unused edge whose endpoint touches `tail` within tol.
102
+ for (;;) {
103
+ let found = -1;
104
+ let best = Infinity;
105
+ for (let j = 0; j < pool.length; j++) {
106
+ if (used[j])
107
+ continue;
108
+ const dA = gearDist(pool[j].a, tail);
109
+ const dB = gearDist(pool[j].b, tail);
110
+ const d = Math.min(dA, dB);
111
+ if (d <= tol && d < best) {
112
+ best = d;
113
+ found = j;
114
+ }
115
+ }
116
+ if (found < 0)
117
+ break;
118
+ used[found] = true;
119
+ const e = pool[found];
120
+ const flip = gearDist(e.a, tail) <= gearDist(e.b, tail);
121
+ if (best > 1e-7) {
122
+ chain.push(kernel.makeLineEdge(tail, flip ? e.a : e.b));
123
+ }
124
+ // Edge points the wrong way: reverseShape makes a reversed copy.
125
+ chain.push(flip ? e.edge : kernel.reverseShape(e.edge));
126
+ tail = flip ? e.b : e.a;
127
+ // Back at the start ⇒ closed loop, stop.
128
+ if (gearDist(tail, head) <= tol)
129
+ break;
130
+ }
131
+ // Close the loop: bridge the tail-to-head gap too.
132
+ const endGap = gearDist(tail, head);
133
+ if (chain.length > 1 && endGap > 1e-7 && endGap <= tol) {
134
+ chain.push(kernel.makeLineEdge(tail, head));
135
+ }
136
+ wires.push(kernel.makeWire(chain));
137
+ }
138
+ return wires;
139
+ }
140
+ /**
141
+ * cq `Face.makeFromWires(outer, holes)` analogue.
142
+ *
143
+ * @param kernel raw OCCT kernel
144
+ * @param outer outer wire
145
+ * @param holes inner hole wires (may be empty)
146
+ * @returns face handle
147
+ */
148
+ export function gearFaceFromWires(kernel, outer, holes = []) {
149
+ const f = kernel.makeFace(outer);
150
+ return holes.length > 0 ? kernel.addHolesInFace(f, holes) : f;
151
+ }
152
+ /**
153
+ * cq `make_shell(faces, tol)` + `Solid.makeSolid(shell)` analogue.
154
+ *
155
+ * A non-shell sew result is NOT silently swallowed — that is a construction
156
+ * failure signal.
157
+ *
158
+ * @param kernel raw OCCT kernel
159
+ * @param faces faces to sew
160
+ * @param sewingTol sewing tolerance (mm, cq `shell_sewing_tol`)
161
+ * @returns solid built from the sewn shell
162
+ */
163
+ export function gearShellToSolid(kernel, faces, sewingTol) {
164
+ const shell = kernel.sew(faces, sewingTol);
165
+ if (!kernel.isShell(shell) && !kernel.isSolid(shell)) {
166
+ throw new Error(`gearShellToSolid: sew did not produce a shell (got ${String(kernel.getShapeType(shell))})`);
167
+ }
168
+ return kernel.makeSolid(shell);
169
+ }
170
+ /** All selectable strategies (tests iterate in this order for the deviation table). */
171
+ export const GEAR_SPLINE_FACE_STRATEGIES = [
172
+ 'grid-approx',
173
+ 'row-approx-loft',
174
+ 'row-interp-loft',
175
+ ];
176
+ /**
177
+ * Default strategy chosen by P0 measurement (2026-09-08).
178
+ *
179
+ * Per the measured table in the faijs-gears spike: S2's area relative
180
+ * deviation is 5.6e-7 / max sample-point distance 2.6e-6 mm — about three
181
+ * orders of magnitude better than S1/S3. See
182
+ * `docs/analysis/2026-09-08-fai-cq-gears-spike.md`.
183
+ */
184
+ export const DEFAULT_GEAR_SPLINE_FACE_STRATEGY = 'row-approx-loft';
185
+ /**
186
+ * Build a face from a row×col point grid with the given strategy.
187
+ *
188
+ * @throws kernel errors propagate verbatim (never swallowed — red line)
189
+ *
190
+ * @param kernel raw OCCT kernel
191
+ * @param grid row×col point grid
192
+ * @param strategy face building strategy
193
+ * @param options tolerance/degree options
194
+ * @returns single face handle (Face)
195
+ */
196
+ export function buildGearSplineFace(kernel, grid, strategy, options = {}) {
197
+ const tol = options.tolerance ?? 1e-2;
198
+ switch (strategy) {
199
+ case 'grid-approx':
200
+ return buildGearGridApprox(kernel, grid);
201
+ case 'row-approx-loft':
202
+ return buildGearRowLoft(kernel, grid, (row) => kernel.approximatePoints(row, tol));
203
+ case 'row-interp-loft':
204
+ return buildGearRowLoft(kernel, grid, (row) => kernel.interpolatePoints(row, false));
205
+ }
206
+ }
207
+ /** S1: fit the whole grid to one B-spline surface at once. */
208
+ function buildGearGridApprox(kernel, grid) {
209
+ const flat = [];
210
+ for (const row of grid.points)
211
+ for (const p of row)
212
+ flat.push(p);
213
+ return kernel.bsplineSurface(flat, grid.rows, grid.cols);
214
+ }
215
+ /** S2/S3: per-row curve → `loft` skinning. */
216
+ function buildGearRowLoft(kernel, grid, makeCurve) {
217
+ const wires = grid.points.map((row) => kernel.makeWire([makeCurve(row)]));
218
+ // `loft(wires, isSolid=false, ruled=false)` returns a **shell** (measured
219
+ // 2026-09-08), while cq's tooth face is a TopoDS_Face; downstream sew /
220
+ // projectPointOnFace require a Face, so extract the sole face.
221
+ return soleGearFace(kernel, kernel.loft(wires, false, false));
222
+ }
223
+ /**
224
+ * Reduce a "single-face shell" to a Face; a Face passes through unchanged.
225
+ *
226
+ * @throws when the face count is not 1 (silently taking the first would mask problems)
227
+ *
228
+ * @param kernel raw OCCT kernel
229
+ * @param shape any shape (Face / single-face shell / …)
230
+ * @returns the sole Face
231
+ */
232
+ export function soleGearFace(kernel, shape) {
233
+ if (kernel.isFace(shape))
234
+ return shape;
235
+ const faces = kernel.getSubShapes(shape, 'face');
236
+ if (faces.length !== 1) {
237
+ throw new Error(`soleGearFace: expected a single face, got ${faces.length} (shapeType=${String(kernel.getShapeType(shape))})`);
238
+ }
239
+ return faces[0];
240
+ }
241
+ /** Distance from a point to a face (`projectPointOnFace`).
242
+ *
243
+ * @param kernel raw OCCT kernel
244
+ * @param face target face
245
+ * @param p query point
246
+ * @returns euclidean distance (mm)
247
+ */
248
+ export function gearDistanceToFace(kernel, face, p) {
249
+ const q = kernel.projectPointOnFace(face, p);
250
+ return Math.hypot(q.x - p.x, q.y - p.y, q.z - p.z);
251
+ }
252
+ /**
253
+ * Distance statistics of reference sample points against a face.
254
+ *
255
+ * Parameterization-independent: samples come from the cq side's (u,v) grid, so
256
+ * the two surfaces may have different parameterizations.
257
+ *
258
+ * @param kernel raw OCCT kernel
259
+ * @param face face under test
260
+ * @param samplePoints reference sample points (3D)
261
+ * @returns max distance / RMS / sample count
262
+ */
263
+ export function gearFaceDeviation(kernel, face, samplePoints) {
264
+ let max = 0;
265
+ let sumSq = 0;
266
+ for (const p of samplePoints) {
267
+ const d = gearDistanceToFace(kernel, face, p);
268
+ if (d > max)
269
+ max = d;
270
+ sumSq += d * d;
271
+ }
272
+ return { max, rms: Math.sqrt(sumSq / samplePoints.length), n: samplePoints.length };
273
+ }
274
+ //# sourceMappingURL=gears.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gears.js","sourceRoot":"","sources":["../../src/kernel/gears.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AA8E5C,IAAI,iBAAiB,GAA+B,IAAI,CAAA;AAExD;;;;;;;;GAQG;AACH,MAAM,UAAU,aAAa;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AC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;AACpD,CAAC;AASD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,iBAAiB,CAC/B,MAAkB,EAClB,IAAgB,EAChB,YAAoB;IAEpB,IAAI,GAAG,GAAG,CAAC,CAAA;IACX,IAAI,KAAK,GAAG,CAAC,CAAA;IACb,KAAK,MAAM,CAAC,IAAI,YAAY,EAAE,CAAC;QAC7B,MAAM,CAAC,GAAG,kBAAkB,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;QAC7C,IAAI,CAAC,GAAG,GAAG;YAAE,GAAG,GAAG,CAAC,CAAA;QACpB,KAAK,IAAI,CAAC,GAAG,CAAC,CAAA;IAChB,CAAC;IACD,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,YAAY,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,YAAY,CAAC,MAAM,EAAE,CAAA;AACrF,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Raw occt-wasm kernel primitives for the gear builders.
3
+ *
4
+ * This module was migrated verbatim from cq-compat (`gears.ts`) — see the
5
+ * file header in gears.ts for the provenance and red lines (no direct
6
+ * occt-wasm usage outside `getGearKernel`).
7
+ */
8
+ export { getGearKernel, connectEdgesToWires, gearFaceFromWires, gearShellToSolid, gearEdgeEnds, buildGearSplineFace, soleGearFace, gearDistanceToFace, gearFaceDeviation, DEFAULT_GEAR_SPLINE_FACE_STRATEGY, GEAR_SPLINE_FACE_STRATEGIES, } from './gears.js';
9
+ export type { GearKernel, GearAxis, GearEdgeEnds, GearSplineFaceStrategy, GearSplineFaceOptions, GearSplineGrid, GearDeviationStats, } from './gears.js';
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/kernel/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,EACZ,mBAAmB,EACnB,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,EACjB,iCAAiC,EACjC,2BAA2B,GAC5B,MAAM,SAAS,CAAA;AAChB,YAAY,EACV,UAAU,EACV,QAAQ,EACR,YAAY,EACZ,sBAAsB,EACtB,qBAAqB,EACrB,cAAc,EACd,kBAAkB,GACnB,MAAM,SAAS,CAAA"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Raw occt-wasm kernel primitives for the gear builders.
3
+ *
4
+ * This module was migrated verbatim from cq-compat (`gears.ts`) — see the
5
+ * file header in gears.ts for the provenance and red lines (no direct
6
+ * occt-wasm usage outside `getGearKernel`).
7
+ */
8
+ export { getGearKernel, connectEdgesToWires, gearFaceFromWires, gearShellToSolid, gearEdgeEnds, buildGearSplineFace, soleGearFace, gearDistanceToFace, gearFaceDeviation, DEFAULT_GEAR_SPLINE_FACE_STRATEGY, GEAR_SPLINE_FACE_STRATEGIES, } from './gears.js';
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/kernel/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,EACZ,mBAAmB,EACnB,YAAY,EACZ,kBAAkB,EAClB,iBAAiB,EACjB,iCAAiC,EACjC,2BAA2B,GAC5B,MAAM,SAAS,CAAA"}
package/dist/math.d.ts ADDED
@@ -0,0 +1,200 @@
1
+ /**
2
+ * math — cq_gears `utils.py` 的 numpy 子集(零依赖,TS 手写)
3
+ *
4
+ * 约定(**与 Python 逐字对齐,不要"修正"**):
5
+ *
6
+ * - `rotationMatrix(axis, alpha)` 返回 cq 的同款 Rodrigues 矩阵 R(列向量约定 `p' = R·p`)。
7
+ * - cq 里齿轮点集用的是 `pts @ r_mat`(**行向量**左乘),等价于 `Rᵀ·p`,即**绕轴转 −alpha**。
8
+ * 这不是笔误——`spur_gear.py::_build_tooth_faces` 就是这么写的,实测
9
+ * (`spur-helix15` 参考数据)确认齿面扭转方向与 `−twist_angle` 一致。
10
+ * 所以本模块同时提供 `applyRowMatrix()`(忠实复刻)与 `rotateRows()`(语义命名)。
11
+ */
12
+ /** 三维点 / 向量(与 `BrepVec3` 同构)。 */
13
+ export interface Vec3 {
14
+ x: number;
15
+ y: number;
16
+ z: number;
17
+ }
18
+ /**
19
+ * 构造一个 `Vec3`。
20
+ *
21
+ * @param x x 分量
22
+ * @param y y 分量
23
+ * @param z z 分量
24
+ * @returns 三维向量
25
+ */
26
+ export declare const vec3: (x: number, y: number, z: number) => Vec3;
27
+ /**
28
+ * 向量加法。
29
+ *
30
+ * @param a 左操作数
31
+ * @param b 右操作数
32
+ * @returns `a + b`
33
+ */
34
+ export declare const add: (a: Vec3, b: Vec3) => Vec3;
35
+ /**
36
+ * 向量减法。
37
+ *
38
+ * @param a 左操作数
39
+ * @param b 右操作数
40
+ * @returns `a - b`
41
+ */
42
+ export declare const sub: (a: Vec3, b: Vec3) => Vec3;
43
+ /**
44
+ * 标量乘法。
45
+ *
46
+ * @param a 向量
47
+ * @param k 标量
48
+ * @returns `k·a`
49
+ */
50
+ export declare const scale: (a: Vec3, k: number) => Vec3;
51
+ /**
52
+ * 点积。
53
+ *
54
+ * @param a 左操作数
55
+ * @param b 右操作数
56
+ * @returns `a·b`
57
+ */
58
+ export declare const dot: (a: Vec3, b: Vec3) => number;
59
+ /**
60
+ * 叉积。
61
+ *
62
+ * @param a 左操作数
63
+ * @param b 右操作数
64
+ * @returns `a×b`
65
+ */
66
+ export declare const cross: (a: Vec3, b: Vec3) => Vec3;
67
+ /**
68
+ * 向量模长。
69
+ *
70
+ * @param a 向量
71
+ * @returns 模长
72
+ */
73
+ export declare const norm: (a: Vec3) => number;
74
+ /**
75
+ * 归一化;零向量返回零向量(避免除零)。
76
+ *
77
+ * @param a 向量
78
+ * @returns 单位向量(零向量输入返回零向量)
79
+ */
80
+ export declare const normalize: (a: Vec3) => Vec3;
81
+ /**
82
+ * `np.linspace(a, b, n)` —— 闭区间,含两端。
83
+ *
84
+ * @param a 起始值
85
+ * @param b 结束值
86
+ * @param n 点数
87
+ * @returns n 个等距点(n <= 1 时只含 a)
88
+ */
89
+ export declare function linspace(a: number, b: number, n: number): number[];
90
+ /**
91
+ * 弧度夹到 [0, 2π)。
92
+ *
93
+ * @param t 任意弧度角
94
+ * @returns 归一化后的弧度角
95
+ */
96
+ export declare function normalizeAngle2pi(t: number): number;
97
+ /** 3×3 矩阵(行主序)。 */
98
+ export type Mat3 = number[][];
99
+ /**
100
+ * `cq_gears.utils.rotation_matrix` 的逐字移植(Rodrigues,列向量约定)。
101
+ *
102
+ * @param axis 旋转轴(无需归一化,内部归一)
103
+ * @param alpha 旋转角(弧度)
104
+ * @returns 3×3 Rodrigues 旋转矩阵(行主序)
105
+ */
106
+ export declare function rotationMatrix(axis: Vec3, alpha: number): Mat3;
107
+ /**
108
+ * 行向量左乘:`pts @ m`(cq 的实际用法)。
109
+ *
110
+ * 结果第 j 分量 = Σᵢ pᵢ·m[i][j],等价于 `mᵀ · p`。
111
+ *
112
+ * @param points 行向量点集
113
+ * @param m 3×3 矩阵
114
+ * @returns 变换后的点集
115
+ */
116
+ export declare function applyRowMatrix(points: Vec3[], m: Mat3): Vec3[];
117
+ /**
118
+ * 语义化包装:`applyRowMatrix(pts, rotationMatrix(axis, alpha))`。
119
+ *
120
+ * ⚠️ 因为 cq 用行向量左乘,实际旋转角是 **−alpha**。
121
+ *
122
+ * @param points 点集
123
+ * @param axis 旋转轴
124
+ * @param alpha 名义旋转角(弧度,实际为 −alpha)
125
+ * @returns 旋转后的点集
126
+ */
127
+ export declare function rotateRows(points: Vec3[], axis: Vec3, alpha: number): Vec3[];
128
+ /**
129
+ * 真正按 +alpha 旋转(标准列向量约定),用于 TS 侧需要正向旋转的场景。
130
+ *
131
+ * @param points 点集
132
+ * @param axis 旋转轴
133
+ * @param alpha 旋转角(弧度)
134
+ * @returns 旋转后的点集
135
+ */
136
+ export declare function rotatePoints(points: Vec3[], axis: Vec3, alpha: number): Vec3[];
137
+ /**
138
+ * `cq_gears.utils.sphere_to_cartesian` 的逐字移植:球坐标 → 笛卡尔。
139
+ *
140
+ * ⚠️ 注意极点角 `gamma` 是**从 +Z 轴量起**(`z = r·cos(gamma)`),
141
+ * 而不是数学习惯里从 XY 平面量起的仰角——BevelGear 的整套公式都建立在这个约定上。
142
+ *
143
+ * @param r 球半径
144
+ * @param gamma 极角(弧度,自 +Z 轴)
145
+ * @param theta 方位角(弧度)
146
+ * @returns 笛卡尔坐标
147
+ */
148
+ export declare function sphereToCartesian(r: number, gamma: number, theta: number): Vec3;
149
+ /**
150
+ * `cq_gears.utils.s_inv` 的逐字移植:球面渐开线(给定极角 → 方位角)。
151
+ *
152
+ * `phi = arccos(tan(gamma0)/tan(gamma))`;
153
+ * `return arccos(cos(gamma)/cos(gamma0))/sin(gamma0) − phi`。
154
+ *
155
+ * 定义域外(`|tan(gamma0)/tan(gamma)| > 1`)与 Python 的 numpy 一样返回 NaN——
156
+ * 由调用方决定是否报错,本函数不静默替换。
157
+ *
158
+ * @param gamma0 基锥极角(弧度)
159
+ * @param gamma 曲线上点的极角(弧度)
160
+ * @returns 该点的方位角(弧度)
161
+ */
162
+ export declare function sInv(gamma0: number, gamma: number): number;
163
+ /**
164
+ * `cq_gears.utils.s_arc` 的逐字移植:球面上的一段圆弧。
165
+ *
166
+ * Python 侧是 `cos(t)·a + sin(t)·(k×a) + (k·a)(1−cos t)·k`(`a` = 球心到弧心方向
167
+ * 偏移 `r_delta` 后的单位向量,`k` = 弧心的单位向量),再整体乘球半径。
168
+ *
169
+ * @param sr 球半径
170
+ * @param cGamma 弧心的极角(弧度)
171
+ * @param cTheta 弧心的方位角(弧度)
172
+ * @param rDelta 弧心与弧上任一点的夹角(弧度)
173
+ * @param start 起始角(弧度)
174
+ * @param end 终止角(弧度)
175
+ * @param n 点数(含两端)
176
+ * @returns 弧上 n 个点
177
+ */
178
+ export declare function sArc(sr: number, cGamma: number, cTheta: number, rDelta: number, start: number, end: number, n?: number): Vec3[];
179
+ /**
180
+ * `cq_gears.utils.angle_between` 的移植:向量 OA 与 OB 的夹角。
181
+ *
182
+ * @param o 公共起点
183
+ * @param a 向量 OA 的终点
184
+ * @param b 向量 OB 的终点
185
+ * @returns 夹角(弧度)
186
+ */
187
+ export declare function angleBetween(o: Vec3, a: Vec3, b: Vec3): number;
188
+ /**
189
+ * `cq_gears.utils.circle3d_by3points` 的移植:三点定圆。
190
+ *
191
+ * @param a 第一点
192
+ * @param b 第二点
193
+ * @param c 第三点
194
+ * @returns `{ radius, center }`
195
+ */
196
+ export declare function circle3dBy3points(a: Vec3, b: Vec3, c: Vec3): {
197
+ radius: number;
198
+ center: Vec3;
199
+ };
200
+ //# sourceMappingURL=math.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"math.d.ts","sourceRoot":"","sources":["../src/math.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,iCAAiC;AACjC,MAAM,WAAW,IAAI;IACnB,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;CACV;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,IAAI,GAAI,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,MAAM,KAAG,IAAqB,CAAA;AAE5E;;;;;;GAMG;AACH,eAAO,MAAM,GAAG,GAAI,GAAG,IAAI,EAAE,GAAG,IAAI,KAAG,IAAsD,CAAA;AAE7F;;;;;;GAMG;AACH,eAAO,MAAM,GAAG,GAAI,GAAG,IAAI,EAAE,GAAG,IAAI,KAAG,IAAsD,CAAA;AAE7F;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,GAAI,GAAG,IAAI,EAAE,GAAG,MAAM,KA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