CadQuery BRep_API: command not done when a slot collapses to a circle

Diagnostic signature

BRep_API: command not done

A slot whose end-to-end length equals its diameter has zero-length straight edges. CadQuery 2.8.0 can raise this OpenCascade diagnostic while constructing those edges.

What it means

The underlying OpenCascade builder did not complete its operation. This message is generic and does not identify one universal geometry defect. The example here isolates a zero-length slot edge.

Why it happens

In CadQuery 2.8.0, slot2D constructs two straight edges of length length minus diameter. When both dimensions equal 10 mm, those straight edges collapse. This does not prove that every occurrence of the diagnostic has the same cause. Boolean and finishing operations can fail with this message for other reasons.

Minimal reproduction

import cadquery as cad
result = cad.Workplane("XY").slot2D(10, 10).extrude(3)

How to fix it

Use a circle when slot length equals diameter. Both the 10 mm width and 10 mm overall length are preserved. Use slot2D for a strictly longer slot; reject inconsistent dimensions rather than adding an arbitrary offset.

```python
import cadquery as cad
length, diameter, depth = 10, 10, 3
if length < diameter:
    raise ValueError("Slot length must be at least its diameter")
profile = cad.Workplane("XY")
if length == diameter:
    profile = profile.circle(diameter / 2)
else:
    profile = profile.slot2D(length, diameter)
result = profile.extrude(depth)
```

Step 1

Step 2

Step 3

Upstream references

CadQuery 2.8.0 slot2D source

CadQuery 2.8.0 Edge.makeLine source