voneiden / cq-cam

CQ-CAM aims to become a free, parametric CAM solution for 3-axis CNC mills closely integrating with CadQuery.
https://cq-cam.readthedocs.io/en/latest/
Apache License 2.0
24 stars 4 forks source link

Experiment with using OCCT in toolpath generation #11

Open voneiden opened 2 years ago

voneiden commented 2 years ago

As per #1 clipping works out great using OCCT. To fully utilize the advantage of using wires and edges (to preserve arcs), one needs to be able to get segments of wires/edges between two known points. Currently there's a limitation with OCP to achieve this using GeomLib_Tool.Parameter (see cadquery/ocp#89).

BRep_Tool.Parameter does not appear to work for the purpose, as it does not seem to consider tolerance.

voneiden commented 2 years ago

Clipper appears to be about 3x faster than using OCCT native implementation. The difference is fairly significant but comes with the cost of needing to interpolate arcs into line segments. This bloats gcode, although the gcode could maybe have an arc fitting post processing optimization.

UI responsiveness is important though, so I'm inclined to keep clipper around.

voneiden commented 2 years ago

cadquery/cadquery#1130 is kind of a blocker for using wires/curves for calculating tabs. Or it requires a manual workaround of some kind.

voneiden commented 1 year ago

Another tricky thing with OCCT offsets is that it's possible to end up in infinite loops trying to shrink a wire. Negative offsets can also in some edge cases create incorrect geometry that cq.Face.makeFromWires can't handle.