Skip to content
FoadsfPublic

About

STEP-native (ISO 10303-21) parametric CAD/CAE/MBD kernel (OCCT + SolveSpace) and pure native Avalonia/Skia desktop Studio

Topics

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

CanonCAD

CanonCAD is a STEP-native parametric CAD/CAE/CAM kernel prototype built around the architecture in Modifying STEP Files in FreeCAD.md: the ISO 10303-21 STEP file serves as the canonical parametric source of truth from which Master Design, MBD/PMI, and CAE discipline views associatively branch.

Monorepo Layout

CanonCAD/
├── CMakeLists.txt                  # Top-level CMake build (libraries + canon CLI + ctest)
├── schemas/
│   └── iso10303_parametric_slice.exp # ISO 10303-11 EXPRESS schema (Parts 42/50/55/108/111/112/AP242)
├── data/
│   └── bracket_parametric.stp      # ISO 10303-21 parametric bracket with TNP & semantic MBD bindings
├── libs/
│   ├── canon-core/                 # [Apache-2.0] Structured JSON logging, per-trace tail ring buffer, CanonError
│   ├── canon-express/              # [Apache-2.0] ExpressPart21Store (Part 21 parser & serializer)
│   ├── canon-param/                # [Apache-2.0] ParameterDAG (ExprTk + Kahn sort) & IConstraintSolver
│   ├── canon-brep/                 # [LGPL-2.1]   IBRepKernel (OCCT), TNProvenanceRegistry, ProceduralExecutor
│   └── canon-mmc/                  # [LGPL-2.1]   MasterModelGraph CoW branches & AP242 MBD/DRF audit
├── plugins/
│   └── solver-slvs/                # [GPL-3.0]    SlvsConstraintSolver (SolveSpace libslvs + homotopy)
├── apps/
│   ├── canon-cli/                  # [GPL-3.0]    Headless `canon` CLI (`inspect`, `regen`, `branch`, `audit-mbd`, `scene-json`, `serve-ipc`)
│   └── canon-studio/               # [MIT]        Pure native .NET 10 Avalonia + Skia desktop app (`CanonCad.sln`, `CanonCad.Core`, `CanonCad.Studio`)
└── tests/
    └── test_vertical_slice.cpp     # Automated verification & negative-control test suite

CanonCAD Studio (Native Desktop GUI)

Double-click launch_studio.bat or run the published native binary directly:

.\apps\canon-studio\dist\win-x64\CanonCad.Studio.exe
# or from source:
dotnet run --project apps/canon-studio/src/CanonCad.Studio/CanonCad.Studio.csproj

CanonCad.Studio communicates with canon.exe serve-ipc asynchronously over NDJSON stdio (with trace_id correlation, runtime log-level switching, and automatic error tail-buffer diagnostics), featuring hardware OpenGL 3D viewport rendering via Avalonia OpenGlControlBase (with Perspective/Orthographic toggle, interactive 3D ViewCube, live section clipping, and a per-pixel software Z-buffer + Blinn-Phong fallback for headless/non-GL environments) without any embedded web view or LGPL GUI wrapper.

Build & Test

C++ Kernel & CLI (canon.exe)

$env:PATH = "C:\msys64\ucrt64\bin;$env:PATH"
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release `
  -DCMAKE_C_COMPILER=C:/msys64/ucrt64/bin/gcc.exe `
  -DCMAKE_CXX_COMPILER=C:/msys64/ucrt64/bin/g++.exe
cmake --build build -j 8
ctest --test-dir build --output-on-failure

Runtime MinGW/OCCT DLLs are automatically deployed alongside build/canon.exe.

Native Desktop Studio (.NET 10 / Avalonia / Skia)

dotnet test apps/canon-studio/CanonCad.sln --logger "console;verbosity=normal"
dotnet publish apps/canon-studio/src/CanonCad.Studio/CanonCad.Studio.csproj `
  -c Release -r win-x64 --self-contained true -o apps/canon-studio/dist/win-x64

CLI Verbs & Structured Logging Flags

Optional global logging flags on canon: --log-level trace|debug|info|warn|error|fatal|off, --log-format json|pretty, --log-ring-size <N>, and --trace-id <ID>.

# 1. Inspect EXPRESS schema, driving parameter DAG, commands, and MBD bindings
canon inspect data/bracket_parametric.stp

# 2. Regenerate B-Rep with parameter overrides and verify hybrid mass-property parity
canon regen data/bracket_parametric.stp --set W=100.0 --verify --ref-vol 71976.823001647 --out bracket_W100.stp

# 3. Derive a copy-on-write CAE idealization branch (defeatures fillet via OCCT BRepAlgoAPI_Defeaturing)
canon branch data/bracket_parametric.stp --set W=100.0 --context CAE_Analysis --defeature feat_fillet_1 --out bracket_W100_cae.stp

# 4. Audit AP242 semantic PMI bindings and solve the 3D Datum Reference Frame (A|B|C)
canon audit-mbd data/bracket_parametric.stp --set W=100.0

# 5. Emit full tessellated B-Rep + sketch + MBD/DRF JSON scene for CanonCAD Studio
canon scene-json data/bracket_parametric.stp --set W=100.0

Licensing & Contributing

Aggregate repository distribution is licensed under GPL-3.0-or-later when linking SolveSpace (plugins/solver-slvs and apps/canon-cli), with clean component license boundaries in LICENSES/:

  • Apache-2.0: libs/canon-core, libs/canon-express, libs/canon-param
  • MIT: apps/canon-studio
  • LGPL-2.1-or-later: libs/canon-brep, libs/canon-mmc (OCCT)
  • GPL-3.0-or-later: plugins/solver-slvs, apps/canon-cli (SolveSpace)

See CONTRIBUTING.md and CODE_OF_CONDUCT.md before submitting pull requests.

About

STEP-native (ISO 10303-21) parametric CAD/CAE/MBD kernel (OCCT + SolveSpace) and pure native Avalonia/Skia desktop Studio

Topics

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages