-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontext7.json
More file actions
32 lines (32 loc) · 2.95 KB
/
Copy pathcontext7.json
File metadata and controls
32 lines (32 loc) · 2.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{
"$schema": "https://context7.com/schema/context7.json",
"projectTitle": "OCCTSwiftScripts",
"description": "A script harness + 29-verb `occtkit` CLI for OpenCASCADE CAD in Swift — the OCCTSwift answer to CadQuery/OpenSCAD. Ships the ScriptHarness and DrawingComposer libraries; OCCTMCP-ready.",
"folders": [
"docs",
"Sources/ScriptHarness",
"Sources/DrawingComposer",
"Sources/occtkit",
"recipes"
],
"excludeFolders": [
"Tests",
".build",
"okf",
"Scripts",
".swiftpm",
"docs/knowledge"
],
"rules": [
"OCCTSwiftScripts is a CadQuery/OpenSCAD-style harness for OCCTSwift, not a CAD kernel. Geometry comes from the OCCTSwift API (`import OCCTSwift`); a script accumulates bodies in a `ScriptContext`, calls `emit()`, and OCCTSwiftViewport live-reloads.",
"Script entry point is `Sources/Script/main.swift`; build then `swift run Script`. Always: `let ctx = ScriptContext()`, build geometry, `try ctx.add(shape, id:, color:)` per body, `try ctx.emit()` LAST. Headless: `occtkit run <file>.swift`.",
"Fallible OCCTSwift factories return optionals — unwrap with `guard let`/`if let`, or `!` only in throwaway scripts. `ScriptContext.add()` accepts `Shape`, `Wire`, or `Edge`; `addCompound([Shape])` and `addGraph(_:)` also exist.",
"Colors are `ScriptContext.Colors` constants (`.steel`, `.brass`, `.copper`, `.red`, ...), passed as the `color:` argument; they are `[Float]` RGBA under the hood.",
"Output: one `body-N.brep` per add + an optional combined `output.step`, to iCloud `.../CloudDocs/OCCTSwiftScripts/output/` if present, else `~/.occtswift-scripts/output/`. `manifest.json` is written LAST so a partial failure keeps the prior frame.",
"`occtkit` is a busybox-style multi-call binary: run a verb as `occtkit <verb> ...`, `swift run occtkit <verb> ...`, or an installed symlink (`make install`). 29 verbs span script-host, graph, drawings, reconstruct, construction, I/O, mesh, render, XCAF.",
"Every occtkit verb takes flag-form OR JSON-form input (JSON on stdin or a file-path argv), plus a `--serve` mode: a JSONL loop reading `{\"args\":[...]}` and emitting one `{ok,exit,stdout,stderr,error?}` envelope per request. OCCTMCP drives it this way.",
"Stable topology IDs use `face[N]`/`edge[N]`/`vertex[N]` (index in `Shape.faces()`/`.edges()`/`.vertices()` order), deterministic per BREP. IDs from `query-topology` feed `render-preview --highlight`, `feature-recognize` topologyRefs, and `graph-select`.",
"This repo OWNS `render-preview`: render a headless PNG with `render-preview <brep>... --output <png> [--camera iso|front|top|...] [--display-mode shaded|wireframe|...] [--highlight face[N]]`, wrapping OCCTSwiftViewport's OffscreenRenderer.",
"Library products `ScriptHarness` (the `ScriptContext` output pipeline) and `DrawingComposer` (`Composer.render(spec:shape:)`, the multi-view ISO drawing engine behind `drawing-export`) import directly into downstream Swift packages without the CLI."
]
}