Skip to content

Commit

Permalink
Add microcontroller: WeAct Studio CH552T (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
semickolon authored Dec 20, 2023
1 parent 555c5a6 commit f76f677
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 2 deletions.
9 changes: 9 additions & 0 deletions src/lib/geometry/microcontrollers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,15 @@ export const BOARD_PROPERTIES: Record<Microcontroller, BoardProperties> = {
cutouts: [],
sidecutout: 2,
},
'weact-studio-ch552t': {
name: 'WeAct Studio CH552T',
size: new Vector(18.288, 25.908, 1.57),
boundingBoxZ: 5,
offset: new Vector(0, 0, 1.835),
holes: [],
cutouts: [],
sidecutout: 3.1,
},
}

// Use a constant set of board properties for layout so
Expand Down
1 change: 1 addition & 0 deletions src/lib/loaders/boardElement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const MICROCONTROLLER_URLS: Record<Microcontroller, string> = {
'nrfmicro-or-nicenano': '/src/assets/nrfmicro-or-nicenano.glb',
'seeed-studio-xiao': '/src/assets/seeed-studio-xiao.glb',
'waveshare-rp2040-zero': '/target/waveshare-rp2040-zero.glb',
'weact-studio-ch552t': '/target/weact-studio-ch552t.glb',
}

const CONNECTOR_URLS: Record<Connector, string> = {
Expand Down
2 changes: 2 additions & 0 deletions src/lib/worker/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export interface SpecificCuttleform<S> {
| 'nrfmicro-or-nicenano'
| 'seeed-studio-xiao'
| 'waveshare-rp2040-zero'
| 'weact-studio-ch552t'
| null
/** Additional height to add to the model. */
verticalClearance: number
Expand Down Expand Up @@ -219,6 +220,7 @@ export const MAP_MICROCONTROLLER: Record<MICROCONTROLLER, Cuttleform['microcontr
[MICROCONTROLLER.XIAO]: 'seeed-studio-xiao',
[MICROCONTROLLER.XIAO_BT]: 'seeed-studio-xiao',
[MICROCONTROLLER.RP2040_ZERO]: 'waveshare-rp2040-zero',
[MICROCONTROLLER.WEACT_CH552T]: 'weact-studio-ch552t',
}

export const MAP_CONNECTOR: Record<CONNECTOR, Cuttleform['connector']> = {
Expand Down
4 changes: 3 additions & 1 deletion src/model_gen/microcontroller-gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ export interface MicrocontrollerProps {
/* Fillet of corners */
fillet: number
connector: 'usb-c' | 'micro-usb'
connector_y_offset: number
}

export const DEFAULT_PROPS: MicrocontrollerProps = {
fillet: 0,
connector: 'usb-c',
connector_y_offset: 0,
}

// For loading STEP files and caching them
Expand Down Expand Up @@ -73,6 +75,6 @@ export async function ucModel(name: Microcontroller, opts: MicrocontrollerProps,

// Add the connector
let connector = (await loadModel(opts.connector + '.step')).clone()
connector = connector.translate(0, 0, size.z)
connector = connector.translate(0, opts.connector_y_offset, size.z)
return combine([uc, connector]) as Solid
}
4 changes: 4 additions & 0 deletions src/model_gen/parts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ async function main() {
{ start: 3.92, end: 3.92, align: { side: 'bottom', offset: 1.38 }, ...defaults },
{ start: 3.92, end: 3.92, align: { side: 'bottom', offset: 0 }, ...defaults },
])
await genUC('weact-studio-ch552t', { connector_y_offset: -1.5 }, [
{ start: 1.48, align: { side: 'left', offset: 1.38 }, ...defaults },
{ start: 1.48, align: { side: 'right', offset: 1.38 }, ...defaults },
])
for (const socket of Object.keys(PART_NAMES)) {
try {
await genSocket(socket)
Expand Down
3 changes: 2 additions & 1 deletion src/proto/cuttleform.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ enum CONNECTOR { /* RJ9 = 2; */ TRRS = 3; USB = 4; NONE = 0; /* EXTERNAL = 1; */
enum SCREW_SIZE { M3 = 0; M4 = 1; I4_40 = 2; I6_32 = 3; }
enum SCREW_TYPE { STRAIGHT_INSERT = 0; TAPERED_INSERT = 1; EXPANDING_INSERT = 2; TAPPED = 3; }
enum KEY_SIZE { U1 = 0; U125 = 1; U15 = 2; U2 = 3; }
enum MICROCONTROLLER { NOMC = 0; PIPICO = 1; PROMICRO = 2; PROMICRO_C = 3; ITSYBITSY = 4; ITSYBITSY_BT = 5; KB2040 = 6; RP2040_BLACK = 7; NRFMICRO = 8; XIAO = 9; XIAO_BT = 10; RP2040_ZERO = 11; }
enum MICROCONTROLLER { NOMC = 0; PIPICO = 1; PROMICRO = 2; PROMICRO_C = 3; ITSYBITSY = 4; ITSYBITSY_BT = 5; KB2040 = 6; RP2040_BLACK = 7; NRFMICRO = 8; XIAO = 9; XIAO_BT = 10; RP2040_ZERO = 11; WEACT_CH552T = 12; }

message Cuttleform {
message UpperKeys {
Expand Down Expand Up @@ -122,6 +122,7 @@ message Cuttleform {
(ndropdown) = {n: 9, name: "Seeed Studio Xiao RP2040/SAMD21 ☆", group: "Small Size"},
(ndropdown) = {n: 10, name: "Seeed Studio Xiao nRF52840 (Bluetooth) ☆", group: "Small Size"},
(ndropdown) = {n: 11, name: "Waveshare RP2040 Zero", group: "Small Size"},
(ndropdown) = {n: 12, name: "WeAct Studio CH552T (Low Storage)", group: "Small Size"},
(ndropdown) = {n: 6, name: "Adafruit KB2040 (USB-C) ☆", group: "Medium Size"},
(ndropdown) = {n: 7, name: "RP2040 Black from AliExpress (USB-C) ☆", group: "Large Size"},
(ndropdown) = {n: 3, name: "Pro Micro (USB-C, Low Storage) ☆", group: "Medium Size"},
Expand Down

0 comments on commit f76f677

Please sign in to comment.