feat: close builder mutation and roundtrip evidence gaps
This commit is contained in:
@@ -3,6 +3,7 @@ import json
|
||||
import FreeCAD as App
|
||||
import Part
|
||||
|
||||
from freecad_mutation_evidence import capture_property_mutation
|
||||
|
||||
COMMIT = "0108fd4b4850cc46e625b60e53cea7a7bbe69f8d"
|
||||
|
||||
@@ -62,8 +63,10 @@ def success_extrusion():
|
||||
feature.Base = profile
|
||||
feature.Dir = App.Vector(0, 0, 5)
|
||||
feature.Solid = True
|
||||
document.recompute()
|
||||
return feature_status("part-extrusion-success", feature, "success")
|
||||
mutation = capture_property_mutation(document, feature, "Dir", App.Vector(0, 0, 7))
|
||||
result = feature_status("part-extrusion-success", feature, "success")
|
||||
result["mutation"] = mutation
|
||||
return result
|
||||
finally:
|
||||
App.closeDocument(document.Name)
|
||||
|
||||
@@ -78,8 +81,10 @@ def success_revolution():
|
||||
feature.Base = App.Vector(0, 0, 0)
|
||||
feature.Angle = 360
|
||||
feature.Solid = True
|
||||
document.recompute()
|
||||
return feature_status("part-revolution-success", feature, "success")
|
||||
mutation = capture_property_mutation(document, feature, "Angle", 270.0)
|
||||
result = feature_status("part-revolution-success", feature, "success")
|
||||
result["mutation"] = mutation
|
||||
return result
|
||||
finally:
|
||||
App.closeDocument(document.Name)
|
||||
|
||||
@@ -94,8 +99,10 @@ def success_loft():
|
||||
feature.Solid = True
|
||||
feature.Ruled = False
|
||||
feature.Closed = False
|
||||
document.recompute()
|
||||
return feature_status("part-loft-success", feature, "success")
|
||||
mutation = capture_property_mutation(document, feature, "Ruled", True)
|
||||
result = feature_status("part-loft-success", feature, "success")
|
||||
result["mutation"] = mutation
|
||||
return result
|
||||
finally:
|
||||
App.closeDocument(document.Name)
|
||||
|
||||
@@ -104,14 +111,17 @@ def success_sweep():
|
||||
document = App.newDocument("PartSweepSuccessOracle")
|
||||
try:
|
||||
section = add_shape(document, "Section", rectangle_wire(-1, -1, 1, 1, 0))
|
||||
edited_section = add_shape(document, "EditedSection", rectangle_wire(-0.75, -0.75, 0.75, 0.75, 0))
|
||||
spine = add_shape(document, "Spine", Part.makePolygon([App.Vector(0, 0, 0), App.Vector(0, 0, 6)]))
|
||||
feature = document.addObject("Part::Sweep", "Sweep")
|
||||
feature.Sections = [section]
|
||||
feature.Spine = spine
|
||||
feature.Solid = True
|
||||
feature.Frenet = False
|
||||
document.recompute()
|
||||
return feature_status("part-sweep-success", feature, "success")
|
||||
mutation = capture_property_mutation(document, feature, "Sections", [edited_section])
|
||||
result = feature_status("part-sweep-success", feature, "success")
|
||||
result["mutation"] = mutation
|
||||
return result
|
||||
finally:
|
||||
App.closeDocument(document.Name)
|
||||
|
||||
@@ -123,8 +133,10 @@ def success_fillet():
|
||||
feature = document.addObject("Part::Fillet", "Fillet")
|
||||
feature.Base = base
|
||||
feature.Edges = [(1, 1, 1)]
|
||||
document.recompute()
|
||||
return feature_status("part-fillet-success", feature, "success")
|
||||
mutation = capture_property_mutation(document, feature, "Edges", [(1, 0.5, 0.5)])
|
||||
result = feature_status("part-fillet-success", feature, "success")
|
||||
result["mutation"] = mutation
|
||||
return result
|
||||
finally:
|
||||
App.closeDocument(document.Name)
|
||||
|
||||
@@ -136,8 +148,10 @@ def success_chamfer():
|
||||
feature = document.addObject("Part::Chamfer", "Chamfer")
|
||||
feature.Base = base
|
||||
feature.Edges = [(1, 1, 1)]
|
||||
document.recompute()
|
||||
return feature_status("part-chamfer-success", feature, "success")
|
||||
mutation = capture_property_mutation(document, feature, "Edges", [(1, 0.5, 0.5)])
|
||||
result = feature_status("part-chamfer-success", feature, "success")
|
||||
result["mutation"] = mutation
|
||||
return result
|
||||
finally:
|
||||
App.closeDocument(document.Name)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user