Repository navigation
Conversation
part boolean stores its result in project parts with type cut/fuse/common, but the macro generator only emitted primitives, so the boolean object was never created. The exporter also collected every shape in the document, so boolean operands and PartDesign feature solids were exported on top of the final result. Fixes HKUDS#468
kevin9327
requested review from
omerarslan0,
yuh-yang and
zhangxilong-43
as code owners
October 17, 2026 15:24
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Two defects from #468 in the FreeCAD harness's macro generator (
utils/freecad_macro_gen.py).A:
part booleannever produced geometry.parts.boolean_opstores the result inproject["parts"]withtypeset tocut/fuse/commonandparams.base_id/tool_id._gen_partsonly knew primitives, so the result was written out as# WARNING: Unknown part type 'cut'. (_gen_boolean_opsreads a separateboolean_opslist thatpart booleandoesn't fill.)_gen_partsnow emitsPart::Cut/Part::Fuse/Part::Commonfor these parts, looking up the operands by id. The operands are always earlier parts, so they already exist at that point.B: export included intermediate shapes.
_gen_exportcollected every object with a validShape, so boolean operands and every PartDesign feature solid were exported along with the final result. It now skips objects with a non-emptyInList, meaning objects another object consumes (boolean operands, features inside a Body, the Body's origin). Standalone parts are still exported as before.Measured with real FreeCAD 1.1.4 (
freecadcmd) on the repro from the issue (40×30×20 box minus an r=6 cylinder, expected 24000 − π·6²·20 = 21738.05 mm³):part add×2 +part boolean cutbody additive-box+subtractive-cylinderThese match the numbers in the issue.
Fixes #468 (defects A and B; I didn't touch the secondary notes 4–6).
Type of Change
Testing
TestIntermediateFiles::test_boolean_part_emits_freecad_boolean: the macro buildsPart::Cutwith the right Base/Tool (no FreeCAD needed).TestFreeCADBackend::test_export_boolean_cut_stl_is_the_cut_solidandtest_export_body_stl_excludes_intermediate_features: export to STL and check the mesh volume against the expected solid.FREECAD_PATHpointing at FreeCAD 1.1.4). The fullcli_anything/freecad/testssuite gives 109 passed, 6 skipped.I used an AI assistant to help write this change. I reproduced both defects with real FreeCAD and checked the fix and tests myself.