@indispec/fs-compat 0.0.0-stage → 0.1.0
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/LICENSE +21 -0
- package/README.md +134 -2
- package/package.json +47 -4
- package/src/engine/assembly.js +481 -0
- package/src/engine/csg.js +580 -0
- package/src/engine/interp.js +1713 -0
- package/src/engine/lex.js +166 -0
- package/src/engine/parse.js +539 -0
- package/src/engine/project.js +409 -0
- package/src/engine/regions.js +923 -0
- package/src/engine/trace.js +211 -0
- package/src/engine/values.js +494 -0
- package/src/index.d.ts +746 -0
- package/src/index.js +108 -0
package/src/index.js
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @indispec/fs-compat — the FeatureScript-compatible front end.
|
|
3
|
+
*
|
|
4
|
+
* Status: **vendored port step.** The interpreter core under `src/engine/` is the
|
|
5
|
+
* untyped JavaScript engine extracted from `featurescript-studio` (see README for
|
|
6
|
+
* provenance). The package exports a typed facade here; the internals are typed
|
|
7
|
+
* incrementally (docs/CAD.md phase 3).
|
|
8
|
+
*
|
|
9
|
+
* The engine is pure ESM with no dependencies and no DOM/browser coupling, so it
|
|
10
|
+
* runs unchanged in Node (kernel worker, CI, agent validation) and in a browser
|
|
11
|
+
* worker later.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
// Values, quantities, errors and the sketch plane / rigid transform types.
|
|
15
|
+
export {
|
|
16
|
+
FsError,
|
|
17
|
+
Q,
|
|
18
|
+
LEN,
|
|
19
|
+
ANG,
|
|
20
|
+
ONE,
|
|
21
|
+
Vec,
|
|
22
|
+
Id,
|
|
23
|
+
Xf,
|
|
24
|
+
Plane,
|
|
25
|
+
Color,
|
|
26
|
+
asQ,
|
|
27
|
+
num,
|
|
28
|
+
vec3mm,
|
|
29
|
+
vec2mm,
|
|
30
|
+
rotationMatrix,
|
|
31
|
+
} from './engine/values.js'
|
|
32
|
+
|
|
33
|
+
// Lexer + parser.
|
|
34
|
+
export { tokenize, KEYWORDS, OPERATORS } from './engine/lex.js'
|
|
35
|
+
export { parse } from './engine/parse.js'
|
|
36
|
+
|
|
37
|
+
// Interpreter entry points.
|
|
38
|
+
export {
|
|
39
|
+
Interp,
|
|
40
|
+
Env,
|
|
41
|
+
Context,
|
|
42
|
+
Feature,
|
|
43
|
+
Sel,
|
|
44
|
+
Sketch,
|
|
45
|
+
Line,
|
|
46
|
+
applyIncludes,
|
|
47
|
+
runFeature,
|
|
48
|
+
runAssembly,
|
|
49
|
+
parseOverrides,
|
|
50
|
+
parseValue,
|
|
51
|
+
fmtG,
|
|
52
|
+
fsStr,
|
|
53
|
+
} from './engine/interp.js'
|
|
54
|
+
|
|
55
|
+
// Feature history: the ordered log of feature invocations a program produced (the
|
|
56
|
+
// authoring tree in the CAD editor) and the assembly recorder. Derived per evaluation,
|
|
57
|
+
// never persisted — see docs/CAD.md §7 and src/engine/trace.js.
|
|
58
|
+
export { Tracer, TraceEntry, TraceFrame, Span, classifyBuiltin, serializeValue, spanOf } from './engine/trace.js'
|
|
59
|
+
export { projectFeatureList, projectAssemblyList, assemblyBom, formatFeatureTree, humanizeOp } from './engine/project.js'
|
|
60
|
+
export { AssemblyScene, AssemblyInstance, PartRef, partRefFromValue, transformFromValue } from './engine/assembly.js'
|
|
61
|
+
|
|
62
|
+
// Sketch topology: contours -> regions with holes, plus the sketch's faces (regions).
|
|
63
|
+
export {
|
|
64
|
+
arcPoints,
|
|
65
|
+
chainContours,
|
|
66
|
+
nestProfiles,
|
|
67
|
+
sketchRegions,
|
|
68
|
+
regionArea,
|
|
69
|
+
regionPolygon,
|
|
70
|
+
regionContains,
|
|
71
|
+
regionInteriorPoint,
|
|
72
|
+
profilePolygon,
|
|
73
|
+
profileContains,
|
|
74
|
+
profileSample,
|
|
75
|
+
polygonArea,
|
|
76
|
+
pointInPolygon,
|
|
77
|
+
interiorPoint,
|
|
78
|
+
toCCW,
|
|
79
|
+
JOIN_TOL,
|
|
80
|
+
ARC_CHORD_TOL,
|
|
81
|
+
} from './engine/regions.js'
|
|
82
|
+
|
|
83
|
+
// The recorded geometry tree. These classes are *data*: the interpreter builds
|
|
84
|
+
// them, and a kernel backend (e.g. @indispec/cad-kernel) translates them to exact
|
|
85
|
+
// geometry. They carry no sampling code — `sdfAt` exists only for legacy parity
|
|
86
|
+
// checks and is not part of the kernel path.
|
|
87
|
+
export {
|
|
88
|
+
Node,
|
|
89
|
+
Box,
|
|
90
|
+
Prism,
|
|
91
|
+
Revolve,
|
|
92
|
+
Union,
|
|
93
|
+
Diff,
|
|
94
|
+
Isect,
|
|
95
|
+
Moved,
|
|
96
|
+
Fillet,
|
|
97
|
+
Chamfer,
|
|
98
|
+
Shell,
|
|
99
|
+
Loft,
|
|
100
|
+
Sweep,
|
|
101
|
+
FaceExtrude,
|
|
102
|
+
Circle2,
|
|
103
|
+
Rect2,
|
|
104
|
+
Poly2,
|
|
105
|
+
Solid,
|
|
106
|
+
Scene,
|
|
107
|
+
sdfAt,
|
|
108
|
+
} from './engine/csg.js'
|