@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.
- package/package.json +1 -1
- package/src/assembly.ts +11 -3
package/package.json
CHANGED
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
|
|
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
|
-
|
|
61
|
-
|
|
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
|
}
|