Skip to content

Shape Healing - Prevent crash on non-manifold wires in ShapeAnalysis_FreeBounds - #1331

Merged
dpasukhi merged 7 commits into
Open-Cascade-SAS:IRfrom
davidgilkaufman:fix-connectedges-internal-edge-only
Jul 29, 2026
Merged

Shape Healing - Prevent crash on non-manifold wires in ShapeAnalysis_FreeBounds#1331
dpasukhi merged 7 commits into
Open-Cascade-SAS:IRfrom
davidgilkaufman:fix-connectedges-internal-edge-only

Conversation

@davidgilkaufman

@davidgilkaufman davidgilkaufman commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Fixes #1330

New test case: bugs/heal/bug1330

ShapeAnalysis_FreeBounds::connectWiresToWiresImpl updates internal data structures sewd, lwire, and aSel for the current loop iteration before checking sewd->NbEdges() > 0 and potentially skipping the iteration based on the result. If it skips the iteration, it correctly clears sewd and keeps a log of having processed the wire in aSel, but it does not appropriately reset lwire. I have added a new test case bugs/heal/bug1330, in which this mistake causes it to fail to set done = true after the loop, and later access invalid memory as a result.

Fix: only update lwire if the loop iteration is not skipped.

@davidgilkaufman
davidgilkaufman force-pushed the fix-connectedges-internal-edge-only branch from ca7d9b2 to 7557161 Compare July 8, 2026 16:55
@davidgilkaufman
davidgilkaufman marked this pull request as ready for review July 8, 2026 18:19
@dpasukhi

dpasukhi commented Jul 9, 2026

Copy link
Copy Markdown
Member

Dear @davidgilkaufman

Thank you for your patch. To proceed with integration, please complete signing CLA process:
The links: Contribution Guide
Or https://dev.opencascade.org/get_involved

In case if you already have signed CLA, please share ID that OCCT team shared with your by email after accepting of CLA.

@dpasukhi dpasukhi added the 3. CLA waited User need to process with CLA before review or integration processes label Jul 9, 2026
@davidgilkaufman

Copy link
Copy Markdown
Contributor Author

The CLA submission website was down yesterday. but I have now signed it. Thanks for reminding me. I'll post the ID when it is sent to me.

@dpasukhi

dpasukhi commented Jul 9, 2026

Copy link
Copy Markdown
Member

Thank you for update!
dev.opencascade.org and forum soon will be discontinued in the way where interaction will be without forum. And I periodically put the forum on the maitance mode to redirect people to other resources. Just to avoid any lost, I created the public archive, but I still plan to preserve original web site, but without any accounts and personal info in the future.

Later the CLA will be submittable through the email, my apologies for the complexity :(

More details: https://dev.opencascade.org/content/important-notice-upcoming-changes-devopencascadeorg-forum-and-website

@pieterhijma

Copy link
Copy Markdown

I've checked the issue (which I can confirm) and this code and it looks good to me.

This is linked to a PR in FreeCAD with workarounds for this issue. It would be good to have version guards for that workaround, so would it be possible for this PR to get added to a release? I assume it depends on the CLA verification.

@dpasukhi

Copy link
Copy Markdown
Member

I will ping manager who responsible for CLAs, My apologies for the detays. It is not me, who processing them :*(

@dpasukhi

dpasukhi commented Jul 13, 2026

Copy link
Copy Markdown
Member

@davidgilkaufman could you please write up the Telephone + Fax: ?
It is obligated fields, we not use that info for any marketing needs. It is only required by our legal team :(

I can pre-approve the CLA until the manager will officially register it.
After that I will modify your PR with GTest instead of Draw test ;) other than that I will not modify your commit

@davidgilkaufman

Copy link
Copy Markdown
Contributor Author

I've re-submitted the form with my phone number filled out

@davidgilkaufman

Copy link
Copy Markdown
Contributor Author

This is linked to a PR in FreeCAD with workarounds for this issue. It would be good to have version guards for that workaround, so would it be possible for this PR to get added to a release? I assume it depends on the CLA verification.

Can it be added to a release now?

We chose not to merge the FreeCAD PR at today's CAM developer meeting because we want to know the fix's release first to make proper version guards, but we plan to merge it regardless at the same meeting next week. It would be nice if we could be sure of the fix OCCT version by then.

@dpasukhi dpasukhi added this to the Release 8.0.1 milestone Jul 17, 2026
@dpasukhi

dpasukhi commented Jul 17, 2026

Copy link
Copy Markdown
Member

Yes, it will be in 8.0.1

I assume FreeCAD using only official release, and it will be only in beginning of august.

@dpasukhi

Copy link
Copy Markdown
Member

CLA ID: 1147

@dpasukhi dpasukhi added 1. Shape Healing Shape healing operation (fixing topology issue with BRep data) 3. CLA approved User has the signed CLA and ready to review or integration processes and removed 3. CLA waited User need to process with CLA before review or integration processes labels Jul 29, 2026
@dpasukhi
dpasukhi changed the base branch from master to IR July 29, 2026 17:13
dpasukhi added 5 commits July 29, 2026 18:38
â€ĶFreeBounds

- Exclude non-manifold-only wires from endpoint-based chaining
- Preserve INTERNAL and EXTERNAL-only wires as standalone results
- Skip empty wires and ensure input-order-independent processing
- Replace the DRAW regression with comprehensive GTests
- Cover mixed, empty, reordered, and non-manifold-only inputs through
  ConnectWiresToWires() and ConnectEdgesToWires()
@github-project-automation github-project-automation Bot moved this from Todo to Integration in Maintenance Jul 29, 2026
@dpasukhi dpasukhi changed the title Shape Healing - Fix Standard_OutOfRange in connectWiresToWiresImpl on wire with internally-oriented edge Shape Healing - Prevent crash on non-manifold wires in ShapeAnalysis_FreeBounds Jul 29, 2026
@dpasukhi
dpasukhi merged commit 72f14ee into Open-Cascade-SAS:IR Jul 29, 2026
18 checks passed
@github-project-automation github-project-automation Bot moved this from Integration to Done in Maintenance Jul 29, 2026
@dpasukhi

Copy link
Copy Markdown
Member

Thank you for your integration!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1. Shape Healing Shape healing operation (fixing topology issue with BRep data) 3. CLA approved User has the signed CLA and ready to review or integration processes

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

ShapeAnalysis_FreeBounds::connectWiresToWiresImpl - Standard_OutOfRange on wire with internally-oriented edge

3 participants