Skip to content

Add BRep I/O support (Text and Binary)#218

Merged
bschwind merged 5 commits intobschwind:mainfrom
lzpel:main
Feb 23, 2026
Merged

Add BRep I/O support (Text and Binary)#218
bschwind merged 5 commits intobschwind:mainfrom
lzpel:main

Conversation

@lzpel
Copy link
Copy Markdown
Contributor

@lzpel lzpel commented Feb 11, 2026

Summary

  • Add BRepTools support for text-based BRep I/O (read_brep / write_brep)
  • Add BinTools support for binary BRep I/O (read_brep_bin / write_brep_bin)
  • Expose these methods on the Shape struct

Description

I needed a way to cache parsed STEP files because Shape::read_step is extremely slow for complex models. For example, a 6MB STEP file takes ~2 minutes to load. OpenCascade supports native BRep serialization (both text and binary) which is orders of magnitude faster than re-parsing STEP.

@lzpel lzpel changed the title Add Brep format IO Add BRep I/O support (Text and Binary) Feb 11, 2026
Copy link
Copy Markdown
Owner

@bschwind bschwind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @lzpel, thanks for the contribution! I actually didn't know opencascade can serialize its internal R-Rep data like this, very cool.

The code looks good, I'll go ahead and merge it.

@bschwind
Copy link
Copy Markdown
Owner

Ah, seems like the C++ code formatting failed, please run:

clang-format -i crates/opencascade-sys/include/wrapper.hxx

@lzpel
Copy link
Copy Markdown
Contributor Author

lzpel commented Feb 14, 2026

Thank you for your review.
I applied "cargo +nightly fmt" and "clang-format -i crates/opencascade-sys/include/wrapper.hxx" as suggested in README.md.

@bschwind
Copy link
Copy Markdown
Owner

Hmm, the formatter check is failing on some docker issues, I'll have to look into it.

@lzpel
Copy link
Copy Markdown
Contributor Author

lzpel commented Feb 20, 2026

Hi
I fixed a minor naming inconsistency and grouping issue in the BRep I/O bindings. ready for review whenever.

@bschwind
Copy link
Copy Markdown
Owner

@lzpel sorry for the wait, thanks again for the PR!

@bschwind bschwind merged commit 09b2614 into bschwind:main Feb 23, 2026
4 checks passed
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