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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Where:
- `template`: `classic_brick`, `classic_plate`, `classic_tile`, or `mechanical_axle`
- `width`: studs in X (`classic_brick`: 1-10, `classic_plate`/`classic_tile`: 1-16)
- `length`: studs in Y (`classic_brick`: 1-12, `classic_plate`/`classic_tile`: 1-16)
- `height`: plate units in Z (`classic_brick`: 1-9)
- `height`: plate units in Z (`classic_brick`: 1-24)
- `l`: axle length (`mechanical_axle`: 1-16)
- `scale`: global scale percent (90-110)

Expand Down
2 changes: 1 addition & 1 deletion llms-full.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Query API (share links):
- Mechanical Axle: `?template=mechanical_axle&l={L}&scale={SCALE}`

Range constraints:
- `classic_brick`: width 1..10, length 1..12, height 1..9, scale 90..110
- `classic_brick`: width 1..10, length 1..12, height 1..24, scale 90..110
- `classic_plate`: width 1..16, length 1..16, scale 90..110
- `classic_tile`: width 1..16, length 1..16, scale 90..110
- `mechanical_axle`: l 1..16, scale 90..110
Expand Down
2 changes: 1 addition & 1 deletion llms.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Canonical URL shapes:
- https://openbrick.cogan.dev/?template=mechanical_axle&l={L}&scale={SCALE}

Allowed ranges:
- classic_brick: width 1..10, length 1..12, height 1..9, scale 90..110
- classic_brick: width 1..10, length 1..12, height 1..24, scale 90..110
- classic_plate: width 1..16, length 1..16, scale 90..110
- classic_tile: width 1..16, length 1..16, scale 90..110
- mechanical_axle: l 1..16, scale 90..110
Expand Down
2 changes: 1 addition & 1 deletion scad/classic_brick.scad
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// @description Classic interlocking brick with top studs and bottom cylindrical female sockets.
// @param X|Width (studs)|1|10|1|4
// @param Y|Length (studs)|1|12|1|2
// @param Z|Height (plates)|1|9|1|3
// @param Z|Height (plates)|1|24|1|3
// @param scale_percent|Global Scale (%)|90|110|1|100
//
// Reference proportions:
Expand Down
6 changes: 3 additions & 3 deletions tests/share-query.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const CLASSIC_TEMPLATE = {
params: [
{ key: "X", min: 1, max: 10, defaultValue: 4 },
{ key: "Y", min: 1, max: 12, defaultValue: 2 },
{ key: "Z", min: 1, max: 9, defaultValue: 3 },
{ key: "Z", min: 1, max: 24, defaultValue: 3 },
{ key: "scale_percent", min: 90, max: 110, defaultValue: 100 },
],
};
Expand Down Expand Up @@ -96,14 +96,14 @@ test("parseShareQuery reads canonical query params", () => {
});

test("parseShareQuery supports aliases and clamps values", () => {
const parsed = parseShareQuery("?template=classic-brick&x=100&y=1&z=9&scale_percent=999", [CLASSIC_TEMPLATE]);
const parsed = parseShareQuery("?template=classic-brick&x=100&y=1&z=999&scale_percent=999", [CLASSIC_TEMPLATE]);

assert.ok(parsed);
assert.equal(parsed.templateId, "classic_brick");
assert.deepEqual({ ...parsed.params }, {
X: 10,
Y: 1,
Z: 9,
Z: 24,
scale_percent: 110,
});
});
Expand Down
Loading