Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,13 @@ jobs:

- name: Install locked dependencies and build the C++ module
run: CMAKE_ARGS="-DSCAD_OCCT_PREFIX=$HOME/occt" uv sync --locked --group dev
- name: Verify headless rendering support
run: command -v xvfb-run


- name: Compile package
run: uv run python -m compileall -q src/simplecadapi

- name: Run tests
run: xvfb-run --auto-servernum uv run pytest test tests -q
run: uv run pytest test tests -q

editor-e2e:
needs: occt
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -309,13 +309,10 @@ jobs:
uv sync --locked --group dev --no-install-project
uv pip install --no-deps dist/*-"$py"-"$py"-*.whl

- name: Install headless rendering support
run: sudo apt-get update && sudo apt-get install --yes xvfb

- name: Run tests
run: |
xvfb-run --auto-servernum .venv/bin/python -m pytest test tests -q
xvfb-run --auto-servernum .venv/bin/python -m pytest src/cpp/tests/python -q
.venv/bin/python -m pytest test tests -q
.venv/bin/python -m pytest src/cpp/tests/python -q

release:
name: Build the skill and publish the release
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ user-facing notes live in [`docs/updates/`](docs/updates/) (English and
built by the release workflow against one static OpenCASCADE 7.9.3.

### Changed
- `simplecadapi.inspect.brep` is part of the default install and renders with the built-in software renderer: VTK is no
longer needed, `matplotlib` is a core dependency, and the `inspect` extra is an empty alias.
- The geometry engine is C++ on OpenCASCADE, shipped in the wheel as `simplecadapi._cpp`; one distribution, one
import package. The public API is unchanged, and the previous test suite passes (three tests that relied on a dropped
sliver of a tangent cut now use a tool clear of the wall).
Expand Down
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -560,12 +560,10 @@ A durable CAD/viewer deliverable is a notebook product captured to

## STEP/BREP Inspection

Install the optional rendering dependency when synchronized STEP views,
highlighted regions, or slice overlays are needed:

```bash
pip install "simplecadapi[inspect]"
```
Synchronized STEP views, highlighted regions and slice overlays need nothing
beyond `pip install simplecadapi`: they are drawn by the built-in software
renderer (no GPU, no display server, no VTK). Only the engineering-drawing
family (`simplecadapi.inspect.drawing`) needs the `drawing` extra.

Inspection lives under `simplecadapi.inspect.brep`. These APIs are diagnostic
tools, not modeling operations: they do not enter the graph and are rejected
Expand Down
7 changes: 2 additions & 5 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -508,11 +508,8 @@ cell 已经记录进各自的 session,不要在 cell 里再开一个。它在

## STEP/BREP 检查

需要同步 STEP 视图、区域高亮或截面叠加时,安装可选渲染依赖:

```bash
pip install "simplecadapi[inspect]"
```
同步 STEP 视图、区域高亮和截面叠加不需要额外安装:`pip install simplecadapi` 即可,由内置软渲染绘制
(不依赖 GPU、显示服务和 VTK)。只有工程图系列(`simplecadapi.inspect.drawing`)需要 `drawing` 额外依赖。

检查 API 位于 `simplecadapi.inspect.brep`。它们是诊断工具,不是建模操作:不进入
操作图,在 `GraphSession` 内调用会被拒绝。先导出或拿到几何,再在建模脚本之外
Expand Down
7 changes: 1 addition & 6 deletions docs/skill/references/inspect/brep-reverse-engineering.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,12 +249,7 @@ both models to the union of their bounds so independent camera fitting cannot
hide size or placement differences. The rendered image remains diagnostic and
does not replace the strict BREP gate.

On macOS the render functions offload drawing to an isolated worker process
that may hit a rare native VTK crash under heavy system load. The SDK already
retries such failures internally; if a render call still raises, the error is
transient — retry the same call (ideally after a few seconds or once
CPU-heavy work has finished). It does not mean the render interface is broken
or unusable.
The render functions draw with the SDK's own software renderer: they need no GPU, display server or VTK, and run in the calling process.

After `compare_steps_rbrepcomparison(...)`, use
`comparison.to_error_summary()` to collect every failed validity, bounds,
Expand Down
5 changes: 3 additions & 2 deletions docs/skill/references/workflows/step-reconstruction.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,9 @@ repair_routes:
geometry and call it recovered.
- Candidate structurally different → re-open the feature-tree hypothesis
before accepting a visual-close stop.
- Reconstruction tooling absent (`inspect` extra not installed) → report the
missing capability rather than degrading silently.
- Reconstruction tooling absent (for example the `drawing` extra, which
`simplecadapi.inspect.drawing` needs, is not installed) → report the missing
capability rather than degrading silently.

## Deliverables

Expand Down
6 changes: 4 additions & 2 deletions docs/updates/2.2.7b1.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ The models computed are the same (volumes agree to 1e-12 relative).
* Removed dependencies: `cadquery-ocp`, `ocp-gordon`, `py-slvs`. The OpenCASCADE view of a shape
(`shape.wrapped`) is now the module's own binding, `simplecadapi._cpp.occt`, laid out like OCP.
* `SCA_BACKEND` is gone: there is one backend.
* BREP rendering through VTK is part of the `inspect` extra (`pip install "simplecadapi[inspect]"`); `cadquery-ocp` used
to bring VTK in, so it is no longer installed by default.
* `simplecadapi.inspect.brep` is part of the default install and renders with the same software renderer as
`render_screenshot_rpath`: no VTK, no GPU, no display server (no `xvfb`). `matplotlib` is now a core dependency; the
`inspect` extra stays as an empty alias so older install commands keep working. Only `simplecadapi.inspect.drawing`
still needs an extra (`drawing`).

## Booleans that split a body

Expand Down
3 changes: 1 addition & 2 deletions docs/updates/2.2.7b1.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ macOS Intel、musl Linux、Windows ARM 没有预编译包;这些平台由源
* 移除的依赖:`cadquery-ocp`、`ocp-gordon`、`py-slvs`。形状的 OpenCASCADE 视图(`shape.wrapped`)现在是模块自带的绑定
`simplecadapi._cpp.occt`,布局与 OCP 相同。
* `SCA_BACKEND` 已删除:只有一个后端。
* 通过 VTK 的 BREP 渲染归入 `inspect` 额外依赖(`pip install "simplecadapi[inspect]"`);原来 `cadquery-ocp` 会顺带装上 VTK,
现在默认不再安装。
* `simplecadapi.inspect.brep` 成为默认安装的一部分,使用与 `render_screenshot_rpath` 相同的软渲染:不依赖 VTK、GPU 和显示服务(无需 `xvfb`)。`matplotlib` 变为核心依赖;`inspect` 额外依赖保留为空别名,旧的安装命令仍然可用。只有 `simplecadapi.inspect.drawing` 仍需要额外依赖(`drawing`)。

## 会把实体切成多段的布尔运算

Expand Down
10 changes: 4 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ dependencies = [
"marimo>=0.25.0",
"plotly>=7.1.0",
"cryptography>=42.0.0",
"matplotlib>=3.7.0",
]

[project.optional-dependencies]
Expand All @@ -53,11 +54,9 @@ editor = [
"uvicorn>=0.54.0",
"websockets>=16.1.1",
]
inspect = [
"matplotlib>=3.7.0",
# BREP rendering (simplecadapi.inspect.brep): cadquery-ocp used to bring VTK in
"vtk>=9.3",
]
# simplecadapi.inspect.brep is part of the default install; this extra is kept empty so that
# `pip install "simplecadapi[inspect]"` from older instructions still works.
inspect = []
whucad = [
"h5py>=3.8",
]
Expand Down Expand Up @@ -157,7 +156,6 @@ dev = [
"matplotlib>=3.10.8",
"numpy-stl>=3.2.0",
"trimesh>=4.11.3",
"vtk>=9.3",
"datamodel-code-generator==0.32.0",
"ty>=0.0.18",
]
Expand Down
7 changes: 7 additions & 0 deletions src/cpp/tests/wheel_smoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ def main() -> None:
scad.render_screenshot_rpath(shapes=[body], output_path=str(png))
assert png.read_bytes()[:8] == b"\x89PNG\r\n\x1a\n"

# BREP inspection ships in the default install and draws with the same renderer (no VTK).
from simplecadapi.inspect import brep

views = folder / "views.png"
brep.render_step_views_rpath(str(step), str(views), image_size=(6.0, 4.0), dpi=60)
assert views.read_bytes()[:8] == b"\x89PNG\r\n\x1a\n"

# Sketch solver and the product layer.
part = scad.make_part_rpart("plate", body)
assembly = scad.make_assembly_rassembly("a")
Expand Down
Loading
Loading