Skip to content

Commit d864bfd

Browse files
committed
Delete commands.py and remove all Command class coupling from Ops
1 parent 186a925 commit d864bfd

6 files changed

Lines changed: 102 additions & 1706 deletions

File tree

rayforge/builtin_addons/rayforge-addon-laser/tests/producers/test_contour_producer.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def get_geo_from_artifact(artifact: WorkPieceArtifact) -> List[Geometry]:
4040
Ops are flattened, so we reconstruct geometries based on MoveTo commands.
4141
"""
4242
# Create a single geometry from all ops
43-
full_geo = Geometry.from_dict(artifact.ops.to_dict())
43+
full_geo = artifact.ops.to_geometry()
4444
# Split into individual closed loops (contours)
4545
return full_geo.split_into_contours()
4646

@@ -290,7 +290,7 @@ def test_cut_order_inside_outside(laser, dummy_surface, vector_workpiece):
290290
# The artifact.ops object contains sections. We need to convert to
291291
# geometries sequentially.
292292

293-
full_geo = Geometry.from_dict(artifact.ops.to_dict())
293+
full_geo = artifact.ops.to_geometry()
294294
# split_into_contours preserves order of occurrence in command list
295295
contours = full_geo.split_into_contours()
296296

@@ -319,7 +319,7 @@ def test_cut_order_outside_inside(laser, dummy_surface, vector_workpiece):
319319
generation_id=1,
320320
)
321321

322-
full_geo = Geometry.from_dict(artifact.ops.to_dict())
322+
full_geo = artifact.ops.to_geometry()
323323
contours = full_geo.split_into_contours()
324324

325325
assert len(contours) == 2
@@ -441,8 +441,8 @@ def test_overcut_zero_is_noop(laser, dummy_surface, vector_workpiece):
441441
generation_id=1,
442442
)
443443

444-
geo_a = Geometry.from_dict(artifact_a.ops.to_dict())
445-
geo_b = Geometry.from_dict(artifact_b.ops.to_dict())
444+
geo_a = artifact_a.ops.to_geometry()
445+
geo_b = artifact_b.ops.to_geometry()
446446
assert geo_a == geo_b
447447

448448

0 commit comments

Comments
 (0)