Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Part::checkIntersection returns false negatives preventing functioning of PDN Mirror transformation when faces just touch #5704

Closed
FreeCAD-Bug-Importer opened this issue Feb 7, 2022 · 1 comment
Labels
Bug This issue or PR is related to a bug WB Part Design Related to the Part Design Workbench

Comments

@FreeCAD-Bug-Importer
Copy link
Collaborator

FreeCAD-Bug-Importer commented Feb 7, 2022

Issue imported from https://tracker.freecad.org/view.php?id=3065

  • Reporter: @abdullahtahiriyo
  • Date submitted: 6/1/2017
  • FreeCAD version: 0.17
  • Category: Bug
  • Status: assigned
  • Tags: Mirror transformation

Original report text

Problem 1

Part::checkIntersection first uses first_bb.IsOut(second_bb) for a quick test. However, this function is known to fail in cases of touching (there is even a previous comment in the code). Mirror transformation explicitly asks that touching to be considered intersection. Therefore it is wrong to rely on this test.

Problem 2

The Extrema method implemented in Part::checkIntersection fails:

Case 1: When mirroring a feature that just touches, it sometimes fails because BRepExtrema_DistShapeShape returns BRepExtrema_IsVertex instead of BRepExtrema_IsInFace, so the manyfold detection mechanism fails to identify a non-manyfold case. In one example, instead of InFace it returns 4 Vertex: [0, 5.5, -2.5], [0,5.5,2.5], [1E-15, 13, -2.5], [1E-15, 13, 2.5] for Support1 and [0, 5.5, -2.5], [0,5.5,2.5], [-1E-15, 13, -2.5], [-1E-15, 13, 2.5] for Support2. I am unsure if this can be somehow reused.

Case 2: When doing a multitransformation to create a part out of a quarter like here:
https://forum.freecadweb.org/viewtopic.php?f=19&t=22747#p176513

The extrema method provides a separation (notable, in the order of milimeters) in operations with intersection parts. This may be a consequence of which parameters we are passing the to function.

OTHER ISSUES

Some related problems not directly related to the extrema method, but that seem to be related:
https://forum.freecadweb.org/viewtopic.php?f=19&t=22747#p176509

Additional information

https://forum.freecadweb.org/viewtopic.php?f=19&t=22747

Steps to reproduce

EXAMPLE 1

  1. Load the attached file.

  2. Activate the first body

  3. Select the pad and add a Mirror transformation (you can try directly the mirror, or a multi-transformation, vertical+horizontal to see the different cases)

EXAMPLE 2

  1. Load the attached file

  2. Activate the second body

  3. Select the pad and mirror or multi-transform mirror the pad

Other bug information

  • Priority: high
  • Severity: major
  • Category: Bug
  • Updated: 2/6/2021
  • Fixed in version: 0.17

Discussion from Mantis ticket

Comment by kkremitzki 2017-06-18 03:49

abdullah should this be resolved now that #816 has been merged?


Comment by abdullah 2017-06-19 12:49

Yes, this ticket is to be closed as fixed by that PR


Comment by Kunda1 2017-06-19 17:12

Thanks! Closed.


Comment by abdullah 2017-06-25 09:36

The boolean check method fails in some circumnstances where the extrema method success. For example:

https://forum.freecadweb.org/viewtopic.php?t=23029#p178800

The result is that "the shape does not intersect support" is generated, when the real problem is OCE/OCCT can not make a proper fusion of those valid and perfectly intersecting objects.

IMO it is not ok to inform that something that clearly intersect does not. So this is a bug.

The final outcome in these cases should be: no error because it does intersect, and a resulting bad solid because it is what OCC gives back. This can be solved by a three phase checking (instead of a two phase one):

1.Quick check
2. Extrema
3. If Extrema says it does not intersect (sometimes because of the non-manifold detection failure), boolean check.

In case of OCC>6.9.0, this checkIntersection, as well as all the fusing in PDN should probably be upgraded to use generalFuse (same as Part boolean fragments fuse).


Comment by DeepSOIC 2017-11-20 10:08

How about avoiding the check altogether? I.e., mirror, then fuse, then check the result of fusion (it should remain a single solid; if it doesn't -> show the "does not intersect support" message to user).

Another option is to drop the single-solid limitation altogether. Then, the check can also be removed.


Comment by abdullah 2018-01-02 17:56

DeepSOIC

Good to hear from you :)

What we have currently in master seems to work well. I am not sure if I "fixed" this, or what exactly went on (I can not remember).

I have just updated the target version to 0.18 to get it out of the 0.17 roadmap, as this is no urgent matter.

I do not close the ticket. I will eventually come back to this and assess it again.


Comment by Kunda1 2019-04-06 19:15

Changing ticket status from 'feedback' to 'assigned'

@FreeCAD-Bug-Importer FreeCAD-Bug-Importer added Bug This issue or PR is related to a bug WB Part Design Related to the Part Design Workbench labels Feb 7, 2022
@chrisb-github
Copy link
Contributor

Fixed in this version:

OS: macOS 10.16
Word size of FreeCAD: 64-bit
Version: 0.20.28751 (Git)
Build type: Release
Python 3.9.12, Qt 5.12.9, Coin 4.0.0, OCC 7.5.3
Locale: C/Default (C)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This issue or PR is related to a bug WB Part Design Related to the Part Design Workbench
Projects
None yet
Development

No branches or pull requests

2 participants