checkgeometry->bopcheck in background thread

Merged, abandoned or rejected pull requests are moved here to clear the main Pull Requests forum.
TheMarkster
Posts: 1061
Joined: Thu Apr 05, 2018 1:53 am

Re: checkgeometry->bopcheck in background thread

Post by TheMarkster » Thu Aug 16, 2018 1:31 am

Kunda1 wrote:
Wed Aug 15, 2018 10:08 am
We should mention something in the 0.18 Release page on the wiki about this very cool feature
I decided not to pursue the background idea as it would most likely lead to a less stable FreeCAD, but the good news is Werner came up with excellent code to add a progress indicator with a cancel button and we also found a way to make the check run faster for users with multi-core processors.

Question now is should we do away with the runbopcheck parameter and just run the full test for everybody? If that's not a good idea, how about changing the results dialog window title from "Check Geometry" to either "Check Geometry (quick check)" or "Check Geometry (full check)" depending on whether the bopcheck test was run or not? At least if it says quick check it will clue in more users that there must be an option for a full check if there's a quick check. Plus, it would be a reminder for those who deleted their config files and forgot to re-enable that option.

wmayer
Site Admin
Posts: 14981
Joined: Thu Feb 19, 2009 10:32 am

Re: checkgeometry->bopcheck in background thread

Post by wmayer » Thu Aug 16, 2018 7:28 am

Question now is should we do away with the runbopcheck parameter and just run the full test for everybody?
The BOP prefix stands for Boolean Operations and is only supposed to be used for the result of boolean operations. Using it for other shapes may lead to false-positives: https://forum.freecadweb.org/viewtopic. ... 93#p210302

I wouldn't change the title as most users of it know about what it does. Then I am not sure if "quick" will be always true as it may depend on the size of the model (e.g. if the file size of a model is > 200 MB).

User avatar
tanderson69
Posts: 1500
Joined: Thu Feb 18, 2010 1:07 am

Re: checkgeometry->bopcheck in background thread

Post by tanderson69 » Thu Aug 16, 2018 12:16 pm

wmayer wrote:
Thu Aug 16, 2018 7:28 am
The BOP prefix stands for Boolean Operations and is only supposed to be used for the result of boolean operations.
Norm said the same thing and I think this statement is misleading. When a boolean operation fails they use it on the INPUTS to the failed boolean operation. Think, "boolean simulator".

wmayer wrote:
Thu Aug 16, 2018 7:28 am
Using it for other shapes may lead to false-positives: https://forum.freecadweb.org/viewtopic. ... 93#p210302
I agree you need to be skeptical of the bopcheck results, but that has nothing to do with source of the inputs.

I have 2 examples, off the top of my head, where the bopcheck was really useful. They are purely from memory so some details may be wrong.

1) Shortly after I added the bopcheck I was struggling with a shape that was made by 'thickening' a face into a solid with part:offset with the 'fill offset' option checked. Now I had fought this battle in the past and lost because the shape had always passed the regular check and I had no idea what was wrong with it. I ran it through the bopcheck and it the found and showed me the errors. I dug into the 'fill offset' code and fixed the problem. This is in mantis somewhere.

2) Someone posted a single surface/face a little while ago that was out of control. It passed the normal check, but failed the bopcheck with self intersecting errors. Upon closer inspection, I found that this 100mm long face had a tolerance of 1000 for itself and ALL of it's subshapes. It was FUBAR! This is on the forum somewhere.


IMHO: The normal check is more of a "black and white" data structure test. Where the bopcheck is more nuanced, "shades of grey" of the shape quality.

TheMarkster
Posts: 1061
Joined: Thu Apr 05, 2018 1:53 am

Re: checkgeometry->bopcheck in background thread

Post by TheMarkster » Thu Aug 16, 2018 6:02 pm

wmayer wrote:
Thu Aug 16, 2018 7:28 am
Question now is should we do away with the runbopcheck parameter and just run the full test for everybody?
The BOP prefix stands for Boolean Operations and is only supposed to be used for the result of boolean operations. Using it for other shapes may lead to false-positives: https://forum.freecadweb.org/viewtopic. ... 93#p210302

I wouldn't change the title as most users of it know about what it does. Then I am not sure if "quick" will be always true as it may depend on the size of the model (e.g. if the file size of a model is > 200 MB).
Okay. Thanks for that link. I knew already bop stood for boolean operation, but I was thinking this was just a more extensive test that had been defaulted to false because it often took much longer to do that extra part of it.

Should the wiki page be updated?

https://www.freecadweb.org/wiki/Part_CheckGeometry
Usage
The tool is available in the Part workbench under Part menu or with the button in the Boolean toolbar. Select a part (beware to select the whole part and not just a face to check for valid solid) then launch the tool. You will see results in the Task panel.

Activate extra BOP check
If you want to enable the extra BOP (BOP= Boolean OPerations) checks then follow these steps : Tools menu > Edit Parameters > Preferences > Mod > Part > CheckGeometry then in the right pane double click under Value for the RunBOPCheck parameter and set to true, then click Save to disk, close and restart. See the screenshot below.

If the parameter or folder does not exist, you can create by

choosing "Tools > Edit Parameters ..."
How about this wording?
Activate extra BOP check
The default geometry check performs a BREP (BREP = Boundary REPresentation) check, which generally performs very quickly (depending on the size of the model) and is good for general purpose model validity checks. There is an additional, more extensive test, called a BOP (BOP = Boolean OPerations) check, which can sometimes take longer to perform (and which can also at times lead to false positives), available as an option. The BOP check is a tool that was developed mainly for programmers to help diagnose why a particular boolean operation (such as a cut or a fusion, for example) is failing, provide clues to be used perhaps for revising the code to make the operation work, but can often also sometimes provide useful information to end users, such as which object is the culprit when a boolean operation is failing and why it is failing. Just keep in mind it does sometimes produce false positives, meaning a listing of errors doesn't necessarily mean your model has fatal flaws. Most algorithms can survive in presence of geometric "defects" reported by the BOP checkers, including boolean operations themselves.

If you want to enable the extra BOP checks...

Post Reply