kicad-3d-models-in-freecad
kicad-3d-models-in-freecad copied to clipboard
Geometry Check on BOP
Hi @Shackmeister and all developers, I've just updated the 'cq_cad_tools.py' adding two new functions:
- checkUnion(doc)
- checkBOP(shape)
and a source file to run these functions (I included all the functions in the file so to be able to run it easily) checkBOP-example.py I attached here also a wrong STEP model, not correctly union-ed and with wrong geometries to make some tests. resistor-wrong-BOP.zip uploaded also on the repo...
It is suggested to generate/export a STEP model, then close the file generator and import the STEP file; then run the checkUnion function to see if the STEP file is correcty union-ed in a single part and run the checkBOP function to see if there are errors on the STEP shape.
This is going to be a quite robust check on the generated files... still in some case I found BOP check is not perfect, but it is for sure much better than the previous state.
Requirements:
- FreeCAD 0.17 12703 or later
this sounds cool :D can you please try and add this in the new Resistor repo? :) would be nice with an example
@Shackmeister now the 'Resistor_SMD' repo has a Union & BOP check NB the BOP check is working ONLY with FC0.17 12703 or later (it will be skipped for previous FC releases)
This means my freecad is too old. (For some reason the last build for fedora was 48 days ago.) Well i can use my ubuntu vm. Maybe there is a newer version for this operating system.
@poeschlr for BOP check this commit should be enough https://github.com/FreeCAD/FreeCAD/commit/2a6a58e but we had some issue with CQ fillet in previous FC0.17 releases... may be your release could work fine... you can simple test BOP check with the example files I linked above
a working models generator with Union and BOP check is ready here: https://github.com/easyw/kicad-3d-models-in-freecad/tree/master/cadquery/FCAD_script_generator/Resistor_SMD
I tested it with your example file and my freecad version indeed discovered that the resistor is invalid. So i included this test in my updated phoenix contact scripts.