diff --git a/src/lib/geometry/microcontrollers.ts b/src/lib/geometry/microcontrollers.ts index c169a5d..c365133 100644 --- a/src/lib/geometry/microcontrollers.ts +++ b/src/lib/geometry/microcontrollers.ts @@ -117,6 +117,15 @@ export const BOARD_PROPERTIES: Record = { 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 diff --git a/src/lib/loaders/boardElement.ts b/src/lib/loaders/boardElement.ts index e8bd753..c919b94 100644 --- a/src/lib/loaders/boardElement.ts +++ b/src/lib/loaders/boardElement.ts @@ -14,6 +14,7 @@ const MICROCONTROLLER_URLS: Record = { '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 = { diff --git a/src/lib/worker/config.ts b/src/lib/worker/config.ts index d412926..796c5fb 100644 --- a/src/lib/worker/config.ts +++ b/src/lib/worker/config.ts @@ -78,6 +78,7 @@ export interface SpecificCuttleform { | 'nrfmicro-or-nicenano' | 'seeed-studio-xiao' | 'waveshare-rp2040-zero' + | 'weact-studio-ch552t' | null /** Additional height to add to the model. */ verticalClearance: number @@ -219,6 +220,7 @@ export const MAP_MICROCONTROLLER: Record = { diff --git a/src/model_gen/microcontroller-gen.ts b/src/model_gen/microcontroller-gen.ts index 7db6a85..b332d50 100644 --- a/src/model_gen/microcontroller-gen.ts +++ b/src/model_gen/microcontroller-gen.ts @@ -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 @@ -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 } diff --git a/src/model_gen/parts.ts b/src/model_gen/parts.ts index 730145c..b3187d1 100644 --- a/src/model_gen/parts.ts +++ b/src/model_gen/parts.ts @@ -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) diff --git a/src/proto/cuttleform.proto b/src/proto/cuttleform.proto index 58c7afa..e51d6a1 100644 --- a/src/proto/cuttleform.proto +++ b/src/proto/cuttleform.proto @@ -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 { @@ -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"},