OpenCASCADE surface fact extractor
  • C++ 87.1%
  • CMake 7.4%
  • Nix 5.5%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-09-13 20:18:32 +03:00
models tiny readme for models example directory 2026-09-13 20:18:32 +03:00
.gitignore Initial commit 2025-01-10 20:44:21 +03:00
CMakeLists.txt CMakeLists.txt fix for OpenMP 2026-08-30 14:44:28 +03:00
flake.lock flake.nix added 2026-08-29 08:19:16 +03:00
flake.nix meta.mainProgram added 2026-09-13 19:35:36 +03:00
LICENSE Initial commit 2025-01-10 20:44:21 +03:00
main.cpp Add files via upload 2025-01-10 20:45:08 +03:00
Models.cpp warnings fixed 2026-08-29 08:19:38 +03:00
Models.hpp Add files via upload 2025-01-10 20:45:08 +03:00
README.md fixed some typos in README 2026-09-13 20:14:40 +03:00
Relation.cpp Add files via upload 2025-01-10 20:45:08 +03:00
Relation.hpp Add files via upload 2025-01-10 20:45:08 +03:00

OCCTSurfacer

The OCCTSurfacer intersects B-Rep parts and shows a full list of relations in two possible notations, named and syllogical.

The idea behind OCCTSurfacer

  1. Named notation have such possible results to show for each surface pair:
  • Equals: means two surfaces are completely equal, including their orientation; A\B (A substracted to B) is empty as B\A too.

  • Negates: means surfaces don't leave any substraction results (A\B = B\A = empty) but also A and B have different orientation (e.g. a cylinder part side surface and a cylinder hole side surface with the same diameters)

  • Included/Includes: means A\B (or B\A) is empty while B\A (or A\B) is not, so B includes A (or A includes B)

  • Crosses: intersection of A and B is not a surface

  • Intersects: intersection of A and B is a surface, but A\B and B\A both is not empty

  • Irrelates intersection of A and B is empty

  1. Logical notation (AIEO) is a simpler option to show the same thing in classic syllogical terms:
  • A Includes B = "all A are (has) B" = A "A" "B"
  • A Included in B = "all B are (has) A" = A "B" "A"
  • A Equals B = "all A are B, and vice versa" = (A "A" "B") and (A "B" "A")
  • A Negated B = "No A are B" = E "A" "B" = E "B" "A"
  • A Crosses B = "No A are B" = E "A" "B" = E "B" "A"
  • A Intersects B = "there's an I subsurface which is a part of A (so A has I), and part of B too (so A has I). however, there're subsufaces A1 and B1 which are parts of A and B too": (A "A" "I") and (A "B" "I") and (A "B" "B0") and (A "A" "A0")

Usage

To list relations with their names, send a B-Rep filenames list to stdin with -named arg:

OCCTSurfacer -named < brep_filename_list.txt

By default, Irrelates relations are hidden. To show it too, pass -irrelates after -named:

OCCTSurfacer -named -irrelates < brep_filename_list.txt

The main objective of OCCTSurfacer is extracting facts, so to use logical notation you can pass it without additional arguments:

OCCTSurfacer < brep_filename_list.txt

Building and installation

nix/NixOS flakes

nix run "git+https://forgejo.gregorbednov.ru/gregorbednov/OcctSurfacer" -- -named -irrelates

classic build

You need a OpenCASCADE Techology OCCT, CMake, OpenMP (optional), and C++ compiler.

cmake -B build -S .
make
./OCCTSurfacer # to run it
make install # or to install it