feat: classify pad ordered pair row
Some checks failed
real-verification / chrome (push) Has been cancelled
real-verification / freecad-oracle (push) Has been cancelled
real-verification / wasm (push) Has been cancelled

This commit is contained in:
2026-08-15 12:51:22 -04:00
parent 8ef796552d
commit 10d11ad608
7 changed files with 6706 additions and 483 deletions

View File

@@ -53,11 +53,12 @@ def phase_snapshot(document):
def document_snapshot(document):
datum_types = {"App::Line", "App::Plane", "App::Point"}
return {
"objects": [{
"name": obj.Name,
"typeId": obj.TypeId,
**({"shape": shape_snapshot(obj)} if hasattr(obj, "Shape") and not obj.Shape.isNull() else {}),
**({"shape": shape_snapshot(obj)} if obj.TypeId not in datum_types and hasattr(obj, "Shape") and not obj.Shape.isNull() else {}),
} for obj in document.Objects],
}
@@ -144,13 +145,11 @@ def collect_rejected():
Import.insert(step_path, document.Name)
document.recompute()
source_objects = [obj for obj in document.Objects if hasattr(obj, "Shape") and not obj.Shape.isNull()]
if len(source_objects) != 1:
raise RuntimeError("Fuse STEP import must produce exactly one Shape object")
source = source_objects[0]
if len(source.Shape.Solids) != 1:
raise RuntimeError("Fuse STEP import did not produce one Solid")
if source.Shape.isNull():
raise RuntimeError("STEP import produced no Shape")
solid_sources = [obj for obj in source_objects if obj.TypeId == "Part::Feature" and obj.Shape.isValid() and len(obj.Shape.Solids) == 1]
if len(solid_sources) != 1:
candidates = [{"name": obj.Name, "typeId": obj.TypeId, "shape": shape_snapshot_from_shape(obj.Shape)} for obj in solid_sources]
raise RuntimeError("Rejected-pair STEP import must produce exactly one valid single-Solid source: " + json.dumps(candidates, sort_keys=True))
source = solid_sources[0]
source_name = source.Name
source_type_id = source.TypeId
document.UndoMode = 1