Skip to content

Commit

Permalink
fix: Pass configuration when getting part size
Browse files Browse the repository at this point in the history
  • Loading branch information
aklinker1 committed Apr 10, 2024
1 parent 9b91e40 commit 77d67ab
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
4 changes: 0 additions & 4 deletions npm/src/geometry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,6 @@ export class BoardLayouter {
readonly config: Config,
) {
const padding = -new Distance(config.extraSpace).m;
console.log('PADDING', padding, {
a: stock,
b: stock.pad({ right: padding, top: padding }),
});
this.paddedStock = stock.pad({ right: padding, top: padding });
}

Expand Down
15 changes: 11 additions & 4 deletions npm/src/onshape.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export function defineOnshapeLoader(config?: OnshapeApiConfig): OnshapeLoader {
itemSource.wvmId,
itemSource.elementId,
itemSource.partId,
itemSource.configuration,
);
const material = headerIdToValue[materialHeaderId] as any;
return {
Expand Down Expand Up @@ -142,10 +143,14 @@ function defineOnshapeApi(config?: OnshapeApiConfig) {
wvmid: string,
eid: string,
partid: string,
) =>
fetch<Onshape.BoundingBox>(
`/parts/d/${did}/${wvm}/${wvmid}/e/${eid}/partid/${partid}/boundingboxes`,
),
configuration: string | undefined,
) => {
let url = `/parts/d/${did}/${wvm}/${wvmid}/e/${eid}/partid/${partid}/boundingboxes`;
if (configuration) {
url += `?configuration=${encodeURIComponent(configuration)}`;
}
return fetch<Onshape.BoundingBox>(url);
},
};
}

Expand Down Expand Up @@ -181,6 +186,8 @@ namespace Onshape {
partId: string;
wvmType: string;
wvmId: string;
configuration: string;
fullConfiguration?: string;
};
headerIdToValue: Record<string, unknown>;
}>;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"web"
],
"scripts": {
"dev": "bun --cwd web dev",
"dev": "bun run build && bun --cwd web dev",
"build": "bun --cwd npm build",
"check": "bun --cwd npm check && bun --cwd web check",
"prepare": "simple-git-hooks"
Expand Down
1 change: 0 additions & 1 deletion web/components/SettingsTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ const extraSpace = useExtraSpaceSetting();
watch(distanceUnit, (newUnit, oldUnit) => {
if (!newUnit || !oldUnit) return;
console.log(newUnit, oldUnit);
const convertValue = (value: Ref<string | number>) => {
const dist = new Distance(value.value + oldUnit);
value.value = dist[newUnit];
Expand Down
1 change: 0 additions & 1 deletion web/composables/useBoardLayoutsQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export default function () {
const parts = partsQuery.data.value;
if (parts == null) return undefined;

console.log(toRaw(config.value));
return generateBoardLayouts(parts, stock.value, config.value);
});

Expand Down

0 comments on commit 77d67ab

Please sign in to comment.