@cadit-app/maker-chips 0.2.5 → 0.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/assembly.ts +11 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cadit-app/maker-chips",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "description": "Customizable maker chip generator with patterns and embedded QR codes",
5
5
  "type": "module",
6
6
  "main": "src/main.ts",
package/src/assembly.ts CHANGED
@@ -6,7 +6,7 @@ import type { Manifold } from '@cadit-app/manifold-3d';
6
6
  import { roundedDisk, generateMarkingShape, generateCenterDisk } from './disk';
7
7
  import type { MakerChipParams } from './params';
8
8
  import qrCodeMaker from '@cadit-app/qr-code';
9
- import imageExtrudeMaker from '@cadit-app/image-extrude';
9
+ import { makeCrossSection } from '@cadit-app/image-extrude';
10
10
 
11
11
  export type AssemblyType = 'flat' | 'printable';
12
12
 
@@ -54,11 +54,19 @@ export async function assembleMakerchipShapes(
54
54
  }
55
55
 
56
56
  // Generate image extrude if enabled
57
+ // image-extrude's default export returns SceneOutput (2D shapes), not a Manifold.
58
+ // Use makeCrossSection + extrude to get a proper Manifold with .mirror()/.translate() etc.
57
59
  let imageExtrude: Manifold | undefined;
58
60
  if (params.imageExtrudeSettings?.enabled) {
59
61
  try {
60
- // imageExtrudeMaker is a callable ScriptModule - call it directly with params
61
- imageExtrude = await imageExtrudeMaker(params.imageExtrudeSettings.params) as Manifold;
62
+ const ieParams = params.imageExtrudeSettings.params as any;
63
+ const crossSection = await makeCrossSection({
64
+ imageFile: ieParams.imageFile,
65
+ mode: ieParams.mode,
66
+ maxWidth: ieParams.maxWidth,
67
+ despeckleSize: ieParams.despeckleSize,
68
+ });
69
+ imageExtrude = crossSection.extrude(ieParams.height);
62
70
  } catch (error) {
63
71
  console.error('Error generating image extrude:', error);
64
72
  }