Skip to content

Integrate OpenCASCADE Technology (OCCT) as optional geometric kernel#1683

Draft
Copilot wants to merge 3 commits intomasterfrom
copilot/integrate-opencascade-submodule
Draft

Integrate OpenCASCADE Technology (OCCT) as optional geometric kernel#1683
Copilot wants to merge 3 commits intomasterfrom
copilot/integrate-opencascade-submodule

Conversation

Copy link

Copilot AI commented Mar 13, 2026

SolveSpace's solid-model operations (Boolean ops, STEP export) are handled by a custom NURBS/BRep kernel. This PR wires in OCCT as an opt-in replacement via find_package, providing more robust Boolean operations, standards-compliant STEP export, and new IGES export capability.

Build system

  • cmake/FindOpenCASCADE.cmake — new module; tries OpenCASCADEConfig.cmake first, then pkg-config, then manual header/library search
  • CMakeLists.txt — new ENABLE_OPENCASCADE cache option (default OFF); calls find_package(OpenCASCADE REQUIRED) when enabled; sets HAVE_OPENCASCADE for config.h
  • src/CMakeLists.txt — conditionally compiles occt_kernel.cpp and links OCCT into solvespace-core
cmake -DENABLE_OPENCASCADE=ON ..   # opt-in; requires OCCT 7.x installed

OCCT integration layer (src/occt_kernel.h/cpp)

  • SSurfaceToGeomSurface / SBezierToGeomCurve — converts SolveSpace's single-span rational Bezier patches/curves to Geom_BSplineSurface / Geom_BSplineCurve
  • ComputePCurve — samples 3-D trim curves and projects them onto the surface UV domain via ShapeAnalysis_Surface to produce 2-D pcurves for BRepBuilderAPI_MakeFace
  • SShellToOCCTShape — full shell conversion: face per surface with trim wires, sewn with BRepBuilderAPI_Sewing, healed with ShapeFix_Shape
  • OCCTShapeToSShell — reverse conversion after Boolean ops; handles rational/non-rational B-splines, falls back via GeomConvert
  • OCCTExportStepFile / OCCTExportIgesFile — delegates to STEPControl_Writer / IGESControl_Writer
  • OCCTBooleanUnion/Difference/Intersection — wraps BRepAlgoAPI_Fuse/Cut/Common

Geometry kernel hooks

  • src/srf/boolean.cppMakeFromUnionOf/DifferenceOf/IntersectionOf try OCCT first; fall back to built-in kernel if conversion fails (no regression when OCCT is off or conversion is unsupported)

STEP / IGES export

  • ExportSurfacesTo() short-circuits to OCCTExportStepFile() when HAVE_OPENCASCADE is defined
  • New StepFileWriter::ExportIgesTo() delegates to OCCTExportIgesFile(); errors gracefully when built without OCCT
  • File-extension routing in both GUI (solvespace.cpp) and CLI (entrycli.cpp): .iges/.igsExportIgesTo, otherwise STEP
  • IGES added to SurfaceFileFilters under #ifdef HAVE_OPENCASCADE

📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

Copilot AI changed the title [WIP] Integrate OpenCASCADE as a submodule for geometric kernel Integrate OpenCASCADE Technology (OCCT) as optional geometric kernel Mar 13, 2026
Copilot AI requested a review from Evil-Spirit March 13, 2026 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants