kicad-3d-models-in-freecad icon indicating copy to clipboard operation
kicad-3d-models-in-freecad copied to clipboard

Geometry Check on BOP

Open easyw opened this issue 7 years ago • 6 comments

Hi @Shackmeister and all developers, I've just updated the 'cq_cad_tools.py' adding two new functions:

  1. checkUnion(doc)
  2. 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

easyw avatar Dec 02 '17 14:12 easyw

this sounds cool :D can you please try and add this in the new Resistor repo? :) would be nice with an example

Shackmeister avatar Dec 02 '17 16:12 Shackmeister

@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)

easyw avatar Dec 02 '17 21:12 easyw

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 avatar Dec 02 '17 22:12 poeschlr

@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

easyw avatar Dec 02 '17 22:12 easyw

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

easyw avatar Dec 02 '17 22:12 easyw

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.

poeschlr avatar Dec 03 '17 11:12 poeschlr