feat: extend ordered pair evidence through common
This commit is contained in:
@@ -205,6 +205,15 @@ def collect_rejected():
|
||||
"sections": [{"name": item.Name, "typeId": item.TypeId} for item in feature.Sections],
|
||||
"spine": link_snapshot(feature.Spine),
|
||||
}
|
||||
elif operation == "revolution":
|
||||
feature = document.addObject("Part::Revolution", "PairResult")
|
||||
feature.Source = source
|
||||
feature.Axis = App.Vector(0.0, 1.0, 0.0)
|
||||
feature.Base = App.Vector(-1.0, 0.0, 0.0)
|
||||
feature.Angle = 360.0
|
||||
feature.Solid = True
|
||||
diagnostic["parameter"] = {"name": "angle", "value": round(float(feature.Angle), 7)}
|
||||
diagnostic["input"] = link_snapshot(feature.Source)
|
||||
else:
|
||||
raise RuntimeError("Unsupported rejected ordered-pair operation: " + operation)
|
||||
diagnostic["nativeTypeId"] = feature.TypeId
|
||||
@@ -248,8 +257,8 @@ def collect_rejected():
|
||||
or "Error" in diagnostic["state"]
|
||||
or "Invalid" in diagnostic["state"]
|
||||
)
|
||||
expected_type_id = {"pad": "PartDesign::Pad", "loft": "Part::Loft", "pipe": "Part::Sweep"}[operation]
|
||||
input_names = [diagnostic.get("input", {}).get("name")] if operation == "pad" else [item["name"] for item in diagnostic.get("input", {}).get("sections", [])]
|
||||
expected_type_id = {"pad": "PartDesign::Pad", "loft": "Part::Loft", "pipe": "Part::Sweep", "revolution": "Part::Revolution"}[operation]
|
||||
input_names = [diagnostic.get("input", {}).get("name")] if operation in ("pad", "revolution") else [item["name"] for item in diagnostic.get("input", {}).get("sections", [])]
|
||||
checks = {
|
||||
"nativeFeatureConstructed": diagnostic.get("nativeTypeId") == expected_type_id,
|
||||
"fuseSolidUsedAsInput": source_name in input_names and diagnostic.get("inputShape", {}).get("solids") == 1,
|
||||
|
||||
Reference in New Issue
Block a user