As mentioned in another comment, I’m interested in this as well and I think it might be a good option to put COTS-LoRa-components in a 3D-printed TOH shell instead of designing all the hardware.
Today, I was curious about co-designing stuff with AI and decided to mess around with the LoRa TOH as an example.
If you start with nothing and use declarative languages like OpenSCAD or build123d, generating even complex geometries with a few prompts can be surprisingly effective. In this case, however, I needed to combine the design by @thejiral from this thread with modifications to accomodate the LoRa-Boards (the Seeed XIAO I have), cables and antenna.
That’s a whole other can of worms because depending on the source format (in this case, .STEP) you feed your LLM with a whole confusing mess of data. It needed more prompts that I’m happy with and the result is not great but I learned something. ^^ I’ll print and test it, but for future iterations, I will just do the modifications by hand. @thejiral could you tell me what software you designed your TOH in and if the STEP is not the source format, would you mind sharing the base/source file?
In case anybody wants the messy code (it assumes a vscode instance with the OCP-Viewer Extension buf if you remove the second line (from ocp_…) and the last one (show(…), you can use it in anything that speaks Python an can import the build123d library:
from build123d import *
from ocp_vscode import show
# Geometric constants and parameters
xiao_length, xiao_width = 21.0, 17.5
wio_length, wio_width = 21.0, 17.5
cavity_depth = 4.8 # 4.5mm board thickness + 0.3mm tolerance gap
spool_depth = 1.5 # Depth for the cable spool cavity
sma_dia = 6.1 # Press-fit for 6.35mm SMA thread
base_plate_thickness = 1.2 # Estimated thickness of the original TOH backplate
# 7.0mm total thickness seamlessly encloses the 6.1mm connector in the upper edge
target_thickness = 7.0
wall_thickness = target_thickness - cavity_depth # Results in 2.2mm outer wall
thickening_delta = target_thickness - base_plate_thickness
with BuildPart() as toh_customized:
# 1. Import and rotation of the base file
toh_base = import_step("/home/coder/projects/toh-lora/optional_frame-final1-modified.step")
toh_base = toh_base.rotate(Axis.X, -90)
add(toh_base)
# 2. Thickening
planar_z_faces = toh_base.faces().filter_by(GeomType.PLANE).filter_by(Axis.Z)
back_face = sorted(planar_z_faces, key=lambda f: f.area)[-1]
extrude(back_face, amount=thickening_delta)
# Calculate Z and Y planes
bbox = toh_customized.part.bounding_box()
z_new_bottom = bbox.min.Z
board_floor_z = z_new_bottom + wall_thickness
y_min = bbox.min.Y # Case top edge (near camera)
y_max = bbox.max.Y # Case bottom edge (near pogo pins)
y_mid = (y_max + y_min) / 2
# 3. Board cavities (compact, shifted 2mm upwards away from pogo pins)
cavity_plane = Plane(origin=(0, 0, board_floor_z), z_dir=(0, 0, 1))
with BuildSketch(cavity_plane):
# XIAO bottom left (-X). Pierces bottom edge for USB-C.
with Locations((-15, y_max - (xiao_length/2) + 1)):
Rectangle(xiao_width, xiao_length + 2)
# Wio-SX1262 bottom right (+X), shifted 2mm upwards to clear pogo pins
with Locations((15, y_max - 27)):
Rectangle(wio_width, wio_length)
# Routing channel between Wio and XIAO as an isolated slot
with BuildSketch(mode=Mode.PRIVATE) as route_boards:
with Locations((-15, y_max - 15), (15, y_max - 17)):
Circle(4.0)
make_hull()
add(route_boards.sketch)
extrude(amount=cavity_depth + 2, mode=Mode.SUBTRACT)
# 4. Spool cavity and coaxial routing
spool_floor_z = board_floor_z + (cavity_depth - spool_depth)
spool_plane = Plane(origin=(0, 0, spool_floor_z), z_dir=(0, 0, 1))
with BuildSketch(spool_plane):
# Spool centered in the MagSafe ring
with Locations((0, y_mid)):
SlotOverall(30, 15)
# Cable channel: Wio (+X) to spool (center) via make_hull
with BuildSketch(mode=Mode.PRIVATE) as route_wio:
with Locations((15, y_max - 27), (0, y_mid - 6)):
Circle(1.5)
make_hull()
add(route_wio.sketch)
# Cable channel: Spool (center) to antenna (+X) via make_hull
with BuildSketch(mode=Mode.PRIVATE) as route_sma:
with Locations((0, y_mid + 6), (20, y_min + 12)):
Circle(1.5)
make_hull()
add(route_sma.sketch)
extrude(amount=spool_depth + 2, mode=Mode.SUBTRACT)
# 5. Press-fit for SMA connector (top right, +X)
sma_z_center = z_new_bottom + (target_thickness / 2)
sma_plane = Plane(origin=(20, y_min - 1, sma_z_center), z_dir=(0, -1, 0))
with BuildSketch(sma_plane):
Circle(radius=sma_dia/2)
extrude(amount=-16, mode=Mode.SUBTRACT)
show(toh_customized)
edit: The components this is designed for:
- https://www.seeedstudio.com/XIAO-nRF52840-Wio-SX1262-Kit-for-Meshtastic-p-6400.html
- https://www.seeedstudio.com/External-Antenna-868MHz-L195mm-black-folding-antena-With-Male-SMA-J-p-5045.html
- https://www.seeedstudio.com/UF-L-SMA-K-1-13-120mm-p-5046.html
edit2: Code slightly updated







