Skip to content

Commit 88c6f31

Browse files
Copilotdorkmo
andcommitted
Add clarifying comments about duplicate parts and calculation method
Co-authored-by: dorkmo <[email protected]>
1 parent 0f25a38 commit 88c6f31

File tree

2 files changed

+132
-6
lines changed

2 files changed

+132
-6
lines changed
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
# CNC Layout Changes
2+
3+
## Overview
4+
The `cnclayout.scad` file has been refactored to arrange parts in a left-to-right layout optimized for direct CNC machine use.
5+
6+
## Changes Made
7+
8+
### 1. Layout Arrangement: Left-to-Right
9+
**Previous**: Parts were arranged in multiple rows (top to bottom)
10+
**New**: All parts are arranged in a single horizontal line from left to right
11+
12+
This makes it easier for CNC operators to:
13+
- Follow the cutting sequence
14+
- Understand the material flow
15+
- Optimize sheet placement
16+
17+
### 2. Text Labels Removed
18+
**Previous**: Each part had text labels for identification
19+
**New**: All text elements have been removed
20+
21+
Benefits:
22+
- Output is ready for direct import into CNC software
23+
- No manual cleanup needed
24+
- Prevents text from interfering with cutting paths
25+
- Cleaner DXF/SVG exports
26+
27+
### 3. Parametric Spacing
28+
**Previous**: Some spacing was hard-coded
29+
**New**: All spacing is calculated parametrically based on part dimensions
30+
31+
The layout now:
32+
- Defines dimensions for each part type
33+
- Calculates X positions based on actual part widths
34+
- Uses the `SPACING` parameter (20mm) consistently between all parts
35+
- Automatically adjusts if part dimensions change in the future
36+
37+
### 4. No Overlapping Parts
38+
Each part's position is calculated by adding:
39+
- Previous part's X position
40+
- Previous part's width
41+
- Spacing constant (20mm)
42+
43+
This ensures no parts overlap, even if dimensions are changed in the parameter file.
44+
45+
## Part Order (Left to Right)
46+
47+
1. Side Panels (4x) - Largest parts, rotated 90°
48+
2. Rear Crossmember
49+
3. Bucket Bottom
50+
4. Standing Deck
51+
5. Bucket Sides (2x) - Rotated 90°
52+
6. Wheel Mounts (4x)
53+
7. Cylinder Lugs (6x)
54+
55+
Total: 19 parts in a single horizontal line
56+
57+
## Layout Dimensions
58+
59+
- **Total Width**: ~9.9 meters
60+
- **Total Height**: ~1.4 meters
61+
- **Spacing**: 20mm between all parts
62+
- **Start Position**: (10, 10)
63+
64+
## Usage
65+
66+
### Generate SVG for CNC
67+
```bash
68+
cd LifeTrac-v25/mechanical_design/openscad
69+
openscad --export-format=svg -o output/cnclayout.svg cnclayout.scad
70+
```
71+
72+
### Generate DXF for CNC
73+
```bash
74+
openscad --export-format=dxf -o output/cnclayout.dxf cnclayout.scad
75+
```
76+
77+
### Adjust Spacing
78+
To change the spacing between parts, edit the `SPACING` parameter in `cnclayout.scad`:
79+
```openscad
80+
SPACING = 20; // mm between parts - change this value as needed
81+
```
82+
83+
## Technical Details
84+
85+
### Parametric Dimensions
86+
All part dimensions are derived from the main parameter file (`lifetrac_v25_params.scad`):
87+
- `MACHINE_HEIGHT` - Used for side panel dimensions
88+
- `WHEEL_BASE` - Used for side panel dimensions
89+
- `BUCKET_WIDTH`, `BUCKET_DEPTH` - Used for bucket parts
90+
- `DECK_WIDTH`, `DECK_DEPTH` - Used for standing deck
91+
- etc.
92+
93+
### Position Calculation
94+
Positions are calculated sequentially:
95+
```openscad
96+
x_pos_0 = START_X;
97+
x_pos_1 = x_pos_0 + side_panel_width_rotated + SPACING;
98+
x_pos_2 = x_pos_1 + side_panel_width_rotated + SPACING;
99+
// ... and so on
100+
```
101+
102+
This approach ensures:
103+
- No variable reassignment (OpenSCAD compatible)
104+
- Clear dependency chain
105+
- Easy to understand and modify
106+
- Automatic adjustment when dimensions change
107+
108+
## Compatibility
109+
110+
The layout is compatible with:
111+
- OpenSCAD 2019.05 and later
112+
- CNC plasma cutters
113+
- Laser cutters
114+
- Waterjet cutters
115+
- Any CNC software that accepts SVG or DXF input
116+
117+
## Future Enhancements
118+
119+
Possible future improvements:
120+
- Add optional material optimization (nesting)
121+
- Support for multiple sheet layouts
122+
- Automatic part labeling layer (toggle-able)
123+
- Kerf compensation parameters

LifeTrac-v25/mechanical_design/openscad/cnclayout.scad

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ bucket_side_height_rotated = BUCKET_DEPTH; // 600mm (becomes height when rotate
6969
// =============================================================================
7070
// CALCULATE X POSITIONS (parametric, left-to-right)
7171
// =============================================================================
72+
// Note: OpenSCAD requires all variables to be defined at once (no reassignment)
73+
// This sequential calculation ensures proper spacing and no overlaps
7274

7375
// X positions calculated sequentially
7476
x_pos_0 = START_X;
@@ -95,19 +97,20 @@ x_pos_18 = x_pos_17 + cylinder_lug_width + SPACING;
9597
// LAYOUT ALL PARTS (LEFT TO RIGHT)
9698
// =============================================================================
9799

98-
// Part 0: Side panel outer (rotated 90°)
100+
// Part 0: Side panel outer - Left side (rotated 90°)
99101
layout_part(x_pos_0, START_Y, 90)
100102
side_panel(is_inner=false);
101103

102-
// Part 1: Side panel inner (rotated 90°)
104+
// Part 1: Side panel inner - Left side (rotated 90°)
103105
layout_part(x_pos_1, START_Y, 90)
104106
side_panel(is_inner=true);
105107

106-
// Part 2: Side panel inner (duplicate) (rotated 90°)
108+
// Part 2: Side panel inner - Right side (rotated 90°)
109+
// Note: Four panels total create a sandwich design with arms between inner pair
107110
layout_part(x_pos_2, START_Y, 90)
108111
side_panel(is_inner=true);
109112

110-
// Part 3: Side panel outer (duplicate) (rotated 90°)
113+
// Part 3: Side panel outer - Right side (rotated 90°)
111114
layout_part(x_pos_3, START_Y, 90)
112115
side_panel(is_inner=false);
113116

@@ -123,11 +126,11 @@ bucket_bottom();
123126
layout_part(x_pos_6, START_Y, 0)
124127
standing_deck();
125128

126-
// Part 7: Bucket side (rotated 90°)
129+
// Part 7: Bucket side - Left (rotated 90°)
127130
layout_part(x_pos_7, START_Y, 90)
128131
bucket_side();
129132

130-
// Part 8: Bucket side (duplicate, rotated 90°)
133+
// Part 8: Bucket side - Right (rotated 90°)
131134
layout_part(x_pos_8, START_Y, 90)
132135
bucket_side();
133136

0 commit comments

Comments
 (0)