Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions scripts/capture-view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ function parseArgs() {
debugExport?: boolean;
view?: string;
trayId?: string;
boxId?: string;
counters?: boolean;
} = {};

for (let i = 0; i < args.length; i++) {
Expand Down Expand Up @@ -72,6 +74,13 @@ function parseArgs() {
result.trayId = next;
i++;
break;
case '--boxId':
result.boxId = next;
i++;
break;
case '--counters':
result.counters = true;
break;
case '--debug-export':
result.debugExport = true;
break;
Expand Down Expand Up @@ -194,6 +203,12 @@ async function captureView() {
if (args.trayId) {
params.set('trayId', args.trayId);
}
if (args.boxId) {
params.set('boxId', args.boxId);
}
if (args.counters) {
params.set('counters', '1');
}

// Load markers from file if specified
if (args.markers) {
Expand Down
24 changes: 21 additions & 3 deletions scripts/generate-geometry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,16 @@ import { createCardWellTray } from '../src/lib/models/cardWellTray.js';
import { createCounterTray } from '../src/lib/models/counterTray.js';
import { createCupTray } from '../src/lib/models/cupTray.js';
import { createBoxWithLidGrooves, createLid } from '../src/lib/models/lid.js';
import { createStandeeTray } from '../src/lib/models/standeeTray.js';
import type { Box, Tray } from '../src/lib/types/project.js';
import { isCardDividerTray, isCardTray, isCardWellTray, isCounterTray, isCupTray } from '../src/lib/types/project.js';
import {
isCardDividerTray,
isCardTray,
isCardWellTray,
isCounterTray,
isCupTray,
isStandeeTray
} from '../src/lib/types/project.js';

// eslint-disable-next-line @typescript-eslint/no-explicit-any
const generalize = (jscad.modifiers as any).generalize as (
Expand Down Expand Up @@ -81,6 +89,8 @@ async function main() {
let trayGeom: Geom3 | null = null;
if (isCupTray(looseTray)) {
trayGeom = createCupTray(looseTray.params, looseTray.name, maxHeight, 0);
} else if (isStandeeTray(looseTray)) {
trayGeom = createStandeeTray(looseTray.params, project.standees ?? [], looseTray.name, maxHeight, 0);
} else if (isCardWellTray(looseTray)) {
trayGeom = createCardWellTray(looseTray.params, project.cardSizes, looseTray.name, maxHeight, 0);
} else if (isCardTray(looseTray)) {
Expand Down Expand Up @@ -125,7 +135,13 @@ async function main() {
// Generate box geometry
console.log('\nGenerating box geometry...');
try {
const boxGeom = createBoxWithLidGrooves(box);
const boxGeom = createBoxWithLidGrooves(
box,
project.cardSizes,
project.counterShapes,
undefined,
project.standees ?? []
);
if (boxGeom) {
const cleanedGeom = cleanGeometryForExport(boxGeom);
const boxStl = stlSerializer.serialize({ binary: true }, cleanedGeom);
Expand All @@ -142,7 +158,7 @@ async function main() {
// Generate lid geometry
console.log('Generating lid geometry...');
try {
const lidGeom = createLid(box);
const lidGeom = createLid(box, project.cardSizes, project.counterShapes, project.standees ?? []);
if (lidGeom) {
const cleanedGeom = cleanGeometryForExport(lidGeom);
const lidStl = stlSerializer.serialize({ binary: true }, cleanedGeom);
Expand Down Expand Up @@ -174,6 +190,8 @@ async function main() {
let trayGeom: Geom3 | null = null;
if (isCupTray(tray)) {
trayGeom = createCupTray(tray.params, tray.name, maxHeight, 0);
} else if (isStandeeTray(tray)) {
trayGeom = createStandeeTray(tray.params, project.standees ?? [], tray.name, maxHeight, 0);
} else if (isCardWellTray(tray)) {
trayGeom = createCardWellTray(tray.params, project.cardSizes, tray.name, maxHeight, 0);
} else if (isCardTray(tray)) {
Expand Down
4 changes: 4 additions & 0 deletions src/lib/changelog/2026-06.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#### Standee trays

Added a new **standee tray** type for storing standees (cardboard figures on plastic bases) lying on their sides. Each standee drops into an angled slot in one of two opposing slotted walls, with its base resting against the side wall and its figure pointing toward the center. [#74](https://github.com/Siege-Perilous/counterslayer/pull/74)

#### Duplicate items

Added the ability to duplicate trays and boxes. Right-click any tray or box in the sidebar or use the action menu to create a copy with all settings preserved. Duplicated items are added to the same layer and can be moved or modified independently. [#66](https://github.com/Siege-Perilous/counterslayer/pull/66)
10 changes: 10 additions & 0 deletions src/lib/components/EditorPanel.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@
updateCardDividerTrayParams,
updateCardWellTrayParams,
updateCupTrayParams,
updateStandeeTrayParams,
updateLayer,
getTrayLetterById,
isCounterTray,
isCardTray,
isCardDividerTray,
isCardWellTray,
isCupTray,
isStandeeTray,
getGlobalSettings,
updateGlobalSettings,
deleteLayer,
Expand All @@ -42,6 +44,7 @@
import type { CardDividerTrayParams } from '$lib/models/cardDividerTray';
import type { CardWellTrayParams } from '$lib/models/cardWellTray';
import type { CupTrayParams } from '$lib/models/cupTray';
import type { StandeeTrayParams } from '$lib/models/standeeTray';
import { countCups } from '$lib/types/cupLayout';
import { countCells } from '$lib/types/cardWellLayout';
import { layoutEditorState } from '$lib/stores/layoutEditor.svelte';
Expand Down Expand Up @@ -130,6 +133,12 @@
}
}

function handleStandeeParamsChange(newParams: StandeeTrayParams) {
if (selectedTray && isStandeeTray(selectedTray)) {
updateStandeeTrayParams(selectedTray.id, newParams);
}
}

// Get tray stats for display
function getTrayStats(tray: Tray): {
stacks: number;
Expand Down Expand Up @@ -401,6 +410,7 @@
onUpdateCardDividerParams={handleCardDividerParamsChange}
onUpdateCardWellParams={handleCardWellParamsChange}
onUpdateCupParams={handleCupParamsChange}
onUpdateStandeeParams={handleStandeeParamsChange}
hideList={true}
/>
{:else}
Expand Down
Loading
Loading