test: add reproducible FreeCAD golden oracle

This commit is contained in:
2026-08-03 03:20:37 -04:00
parent 81fcc69a74
commit 2ce261b982
27 changed files with 678 additions and 12 deletions

View File

@@ -0,0 +1,12 @@
{
"schemaVersion": 1,
"baselineId": "freecad-1.1.1",
"driver": "scripts/freecad-golden-driver.py",
"scenarios": [
{ "id": "part-box", "file": "scenarios/part-box.json" },
{ "id": "part-cylinder", "file": "scenarios/part-cylinder.json" },
{ "id": "part-sphere", "file": "scenarios/part-sphere.json" },
{ "id": "part-cone", "file": "scenarios/part-cone.json" },
{ "id": "part-cut-through-hole", "file": "scenarios/part-cut-through-hole.json" }
]
}

View File

@@ -0,0 +1,20 @@
{
"schemaVersion": 1,
"id": "part-box",
"category": "Part",
"description": "Axis-aligned 10 x 20 x 30 mm box",
"operation": { "type": "box", "length": 10, "width": 20, "height": 30 },
"tolerance": { "linear": 1e-7, "scalar": 1e-7 },
"expected": {
"shapeType": "Solid",
"isNull": false,
"isValid": true,
"solids": 1,
"faces": 6,
"edges": 12,
"vertices": 8,
"volume": 6000,
"area": 2200,
"boundingBox": { "min": [0, 0, 0], "max": [10, 20, 30] }
}
}

View File

@@ -0,0 +1,16 @@
{
"schemaVersion": 1,
"id": "part-cone",
"category": "Part",
"description": "Truncated cone with radii 5 and 2 mm and height 10 mm",
"operation": { "type": "cone", "radius1": 5, "radius2": 2, "height": 10, "angle": 360 },
"tolerance": { "linear": 1e-7, "scalar": 1e-7 },
"expected": {
"shapeType": "Solid",
"isNull": false,
"isValid": true,
"solids": 1,
"volume": 408.4070449666731,
"boundingBox": { "min": [-5, -5, 0], "max": [5, 5, 10] }
}
}

View File

@@ -0,0 +1,20 @@
{
"schemaVersion": 1,
"id": "part-cut-through-hole",
"category": "Part",
"description": "20 mm cube cut by a centered radius 5 mm through cylinder",
"operation": {
"type": "cut",
"base": { "type": "box", "length": 20, "width": 20, "height": 20 },
"tool": { "type": "cylinder", "radius": 5, "height": 20, "angle": 360, "placement": { "translation": [10, 10, 0] } }
},
"tolerance": { "linear": 1e-7, "scalar": 1e-7 },
"expected": {
"shapeType": "Compound",
"isNull": false,
"isValid": true,
"solids": 1,
"volume": 6429.203673205104,
"boundingBox": { "min": [0, 0, 0], "max": [20, 20, 20] }
}
}

View File

@@ -0,0 +1,17 @@
{
"schemaVersion": 1,
"id": "part-cylinder",
"category": "Part",
"description": "Radius 5 mm, height 20 mm cylinder on the positive Z axis",
"operation": { "type": "cylinder", "radius": 5, "height": 20, "angle": 360 },
"tolerance": { "linear": 1e-7, "scalar": 1e-7 },
"expected": {
"shapeType": "Solid",
"isNull": false,
"isValid": true,
"solids": 1,
"volume": 1570.7963267948965,
"area": 785.3981633974482,
"boundingBox": { "min": [-5, -5, 0], "max": [5, 5, 20] }
}
}

View File

@@ -0,0 +1,17 @@
{
"schemaVersion": 1,
"id": "part-sphere",
"category": "Part",
"description": "Radius 5 mm sphere centered at the origin",
"operation": { "type": "sphere", "radius": 5 },
"tolerance": { "linear": 1e-7, "scalar": 1e-7 },
"expected": {
"shapeType": "Solid",
"isNull": false,
"isValid": true,
"solids": 1,
"volume": 523.5987755982989,
"area": 314.1592653589793,
"boundingBox": { "min": [-5, -5, -5], "max": [5, 5, 5] }
}
}