From 232d7a9a7b97f9a7abe2c2dc934da5fce038d529 Mon Sep 17 00:00:00 2001 From: Paul Heidenreich Date: Sun, 25 Jan 2026 11:44:54 +0100 Subject: [PATCH 1/2] Export embossed labels as multiple parts --- src/gflabel/cli.py | 38 +++++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/src/gflabel/cli.py b/src/gflabel/cli.py index a165524..fed6c0d 100755 --- a/src/gflabel/cli.py +++ b/src/gflabel/cli.py @@ -435,23 +435,35 @@ def run(argv: list[str] | None = None): add(body.part) logger.debug("Extruding labels") - is_embossed = args.style == LabelStyle.EMBOSSED - extrude( - label_sketch.sketch, - amount=args.depth if is_embossed else -args.depth, - mode=(Mode.ADD if is_embossed else Mode.SUBTRACT), - ) + + if args.style in [LabelStyle.DEBOSSED, LabelStyle.EMBEDDED]: + extrude( + label_sketch.sketch, + amount=-args.depth, + mode=Mode.SUBTRACT, + ) if not is_2d: part.part.label = "Base" - if args.style == LabelStyle.EMBEDDED: - # We want to make new volumes for the label, making it flush - embedded_label = extrude(label_sketch.sketch, amount=-args.depth) - embedded_label.label = "Label" - assembly = Compound([part.part, embedded_label]) - else: - assembly = Compound(part.part) + if args.style == LabelStyle.EMBEDDED: + embedded_label = extrude(label_sketch.sketch, amount=-args.depth) + embedded_label.label = "Label" + + assembly = Compound([part.part, embedded_label]) + + elif args.style == LabelStyle.EMBOSSED: + embossed_label = extrude(label_sketch.sketch, amount=args.depth) + embossed_label.label = "Label" + + assembly = Compound([part.part, embossed_label]) + + elif args.style == LabelStyle.DEBOSSED: + assembly = Compound(part.part) + + else: + logger.error(f"Error: Unknown label style '{args.style}'") + sys.exit(1) assembly = scale(assembly, (args.xscale, args.yscale, args.zscale)) From 474297b513eb834b55d328ebcf771f5de8eb6833 Mon Sep 17 00:00:00 2001 From: Paul Heidenreich Date: Sun, 25 Jan 2026 11:51:56 +0100 Subject: [PATCH 2/2] Fix vscode preview --- src/gflabel/cli.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gflabel/cli.py b/src/gflabel/cli.py index fed6c0d..e85301f 100755 --- a/src/gflabel/cli.py +++ b/src/gflabel/cli.py @@ -508,6 +508,7 @@ def run(argv: list[str] | None = None): show_cols.append((0.2, 0.2, 0.2)) else: # Split the base for display as two colours + is_embossed = args.style == LabelStyle.EMBOSSED top = part.part.split( Plane.XY if is_embossed else Plane.XY.offset(-args.depth), keep=Keep.TOP,