You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Live chamfer and fillet tests aim at the wrong faces of their test block #199
The live tests in tests/live/test_live_sw_add_chamfer_tool.py use fixed points for the faces and edges they chamfer and fillet. Those points assume the test block's height runs along Z. It actually runs along Y: the block is sketched on the Top Plane and extruded 15 mm, and its measured bounding box is min [0, 0, -30], max [30, 15, 0] (mm). So the tests have not been checking what they say they check.
What each constant actually hits
Constant
Meant to be
Actually is
_TOP_FACE = "face:0.005,0.005,0.0"
the 30×30 face with the hole
a 30×15 side face (z = 0)
_BOTTOM_FACE = "face:0.005,0.005,-0.015"
the opposite 30×30 face
a point inside the block, on no face
_VERTICAL_CORNER_EDGE = "0.0,0.0,-0.0075"
a vertical corner edge
the midpoint of a 30 mm base edge
Evidence: a 0.5 mm add_chamfer on _TOP_FACE removed 11.08 mm³. That's what a side face gives: two 30 mm edges and two 15 mm edges come to about 11.25 mm³. The face with the hole should give about 17.3 mm³ (the hole rim plus four 30 mm edges). Using a point on the right face, face:0.005,0,-0.025, removed 17.12 mm³, which is 99% of that expectation. A visual check confirmed the chamfer was on a short side.
Impact:test_add_chamfer_tool_whole_top_face requires more than 13.8 mm³, so it would fail against this geometry. The mixed face-and-edge test and the chamfer-plus-fillet test only check that some volume changed, so they pass while working on the wrong faces. The module docstring's history (the "3.75 mm³ wrong edge" finding) rests on the same wrong axis assumption, so it needs rechecking.
Proposed fix:
Work each face and edge point out from the block's measured bounding box, not from hard-coded coordinates. The API-lookup demo in tests/live/test_live_sw_api_lookup.py already does this.
Correct the edge constant to a real vertical edge, e.g. (0, 0.0075, 0).
Give every test a volume window from the geometry, so a chamfer on the wrong face fails.
Update the docstring.
Run the suite live to confirm.
The add_chamfer and add_fillet tools themselves behave correctly: they act on the face the given point lies on.
Activity