SimpleCADAPI is an imperative CAD modeling Python package based on CADQuery. Its goal is to encapsulate common modeling operations into a clear, composable, testable functional API, and to support distributing "documentation + scripts + runtime installation" workflows via Skills.
This README only covers package-level capabilities, installation methods, publishing/packaging workflows, and Skills usage instructions. Experimental scripts and temporary modeling examples are not included as formal documentation.
Current package name: simplecadapi, version: 2.0.9 (see pyproject.toml).
pip install simplecadapiOptional development dependencies:
pip install "simplecadapi[dev]"Install in the current virtual environment:
uv pip install simplecadapiAdd as a project dependency in pyproject.toml:
uv add simplecadapiThe repository already contains example build artifacts (dist/):
pip install dist/simplecadapi-2.0.9-py3-none-any.whlIf you need to rebuild:
uv buildimport simplecadapi as scad
box = scad.make_box_rsolid(10.0, 20.0, 30.0)
scad.export_stl(box, "example_box.stl")
scad.export_step(box, "example_box.step")This project provides the skill-pack CLI for generating lightweight skill packages (thin mode): No built-in SDK source code, runtime installs simplecadapi from the package repository.
Execute in the repository root directory:
uv run skill-pack --refresh-docs --archive --skill-name simplecad-self-evolveCommon parameters:
--output-root <dir>: Output directory (default./skills)--package-name <pkg>: Runtime installation package name (default reads fromproject.name)--package-version <ver>: Runtime installation version (default reads fromproject.version)--no-clean: Do not clean existing output directory--archive: Additionally generate<skill-name>.tar.gz
After packaging, you will get a directory similar to:
skills/simplecad-self-evolve/SKILL.mdskills/simplecad-self-evolve/scripts/skills/simplecad-self-evolve/references/skills/simplecad-self-evolve/cases/simplecad_self_evolve_cases/
cd skills/simplecad-self-evolve
PYTHON_BIN=.venv/bin/python scripts/install.sh
PYTHON_BIN=.venv/bin/python scripts/with_skill.sh --checkPYTHON_BIN=.venv/bin/python scripts/with_skill.sh -- .venv/bin/python your_script.pyeval "$(scripts/with_skill.sh --print-env)"After activation, you can directly import:
from simplecad_self_evolve_cases.evolve import make_involute_spur_gear_rsolidscripts/add_new_case.sh path/to/new_case.pyscripts/jupyter_with_skill.sh lab
scripts/validate_skill.shThe project includes 4 main CLIs:
auto-docs-gen: Generatedocs/api/documentation from API source codemake-export: Update imports/exports insrc/simplecadapi/__init__.pyevolve: Extract functions from scripts and append to the evolve moduleskill-pack: Package thin skill (documentation + scripts + cases)
Examples:
uv run make-export --dry-run
uv run auto-docs-gen
uv run evolve path/to/your_case.py
uv run skill-pack --refresh-docs --archivescripts/sync_ragflow_docs.py is used to incrementally sync Markdown files under docs/ to the specified RAGFlow dataset, chunked by H2 headings; the document's chunk_method is set to manual.
Prepare the environment:
.venv/bin/python -m pip install ragflow-sdkIt is recommended to use .env (already added to .gitignore):
RAGFLOW_API_KEY=your_key_here
RAGFLOW_BASE_URL=http://localhost
RAGFLOW_DATASET_NAME=SimpleCADAPIRun the sync:
set -a && source .env && set +a
.venv/bin/python scripts/sync_ragflow_docs.py --create-datasetCommon parameters:
--dataset-id/RAGFLOW_DATASET_ID: Directly specify the dataset ID (avoid name conflicts)--delete-removed: Delete documents that have been removed locally--dry-run: Only preview changes without executing writes--progress-interval N: Print progress every N documents
Local development installation (editable):
uv pip install -e ".[dev]"Run unit tests:
uv run python -m unittest test/test_all_features.pyRun examples:
uv run python examples.py- API functions uniformly use
snake_caseand reflect return types in function names (e.g.,*_rsolid,*_rwire). - Core types are kept as stable as possible; functionality is extended by adding new functions (Open-Closed Principle).
- Support
SimpleWorkplanecontext for local coordinate modeling. - Export interfaces support single entities, multiple entities, and nested list inputs.
- API documentation:
docs/api/ - Core documentation:
docs/core/
MIT, see LICENSE.