1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "stacks": [
12 "Shaft end play: + housing depth 50 ±0.1; - bearing width 20 ±0.05; - spacer 19.8 +0.05/-0; - bearing width 10 ±0.03; gap 0.05 to 0.5",
13 "Pin in slot: + slot 10.2 to 10.3; - pin 10 g6; - position 0.1; clearance min 0",
14 {
15 "title": "Lid gap",
16 "dimensions": [
17 {
18 "name": "box height",
19 "nominal": 80,
20 "tolerance": "±0.3",
21 "sign": "+"
22 },
23 {
24 "name": "insert height",
25 "nominal": 76,
26 "tolerance": "±0.2",
27 "sign": "-",
28 "distribution": "uniform"
29 },
30 {
31 "name": "gasket",
32 "nominal": 3,
33 "tolerance": "+0.2/-0.1",
34 "sign": "-",
35 "cpk": 1.33
36 }
37 ],
38 "requirement": {
39 "min": 0.2,
40 "max": 1.8
41 }
42 }
43 ],
44 "fits": [
45 "30 H7/g6",
46 "25 H7/p6",
47 "40 H7/k6"
48 ]
49};
50
51
52const run = await client.actor("jumblemog/tolerance-stackup-analyzer").call(input);
53
54
55console.log('Results from dataset');
56console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
57const { items } = await client.dataset(run.defaultDatasetId).listItems();
58items.forEach((item) => {
59 console.dir(item);
60});
61
62