Add enclosure and reference CAD assets
This commit is contained in:
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@@ -0,0 +1,95 @@
|
||||
# RS-15-5 + Heltec WiFi LoRa 32 V4 enclosure
|
||||
|
||||
Printable mechanical prototype, revision 3 — 16 September 2026.
|
||||
Units: millimetres. Case body: **122 × 116 × 51 mm**; overall envelope with mounting flanges: **122 × 152 × 51 mm**, excluding screw heads, feet, cable gland and antenna. Designed for the **Mean Well RS-15-5** and **Heltec WiFi LoRa 32 V4.3.1**. Other V4 revisions need a fit check.
|
||||
|
||||
## What to print
|
||||
|
||||
| File | Quantity | Purpose |
|
||||
|---|---:|---|
|
||||
| base.stl | 1 | Housing with bottom mounting flanges, PSU pads, divider and carrier supports |
|
||||
| board_carrier.stl | 1 | Removable Heltec mount; print this first to check board fit |
|
||||
| lid_solid.stl | 1 | Default ventilated lid, without a display opening |
|
||||
| lid_window.stl | Alternative | Ventilated lid with a display opening and underside pane recess |
|
||||
| M16_thread_test.stl | 1 first | Small horizontal-thread fit coupon for the actual LAPP gland |
|
||||
|
||||
Choose one lid. Print the M16 thread coupon before committing to the base. STL parts are already oriented for printing. The base sits on its floor, the carrier on its underside, and each lid on its exterior face. The lid's registration tabs face upwards in the print files. Ask the slicer to place all parts on the build plate; do not scale them. Required bed area for each large part is at least 132 × 162 mm including a 5 mm brim allowance.
|
||||
|
||||
`housing_assembly.step` is an assembly of the base, carrier and solid lid in their installed positions. Open it in FreeCAD using File → Open. Separate STEP files are also included, including the windowed lid. These are editable solid models, not a FreeCAD feature-history tree. `build_enclosure.py` is the parameterized CadQuery source; changing its parameters and running it regenerates all parts. Requires Python and CadQuery (generated with the installed CadQuery runtime).
|
||||
|
||||
## Construction
|
||||
|
||||
- 3 mm walls, floor and lid; 5 mm outside corner radius.
|
||||
- PSU metal body at X=46, Y=13, Z=8. Its 62.5 × 51 × 28 mm body has a separate allowance for the **up to 13 mm terminal projection**.
|
||||
- PSU bottom mounting holes at (54.75, 38.25) and (93.85, 38.25), with 3.6 mm clearance holes and 5 mm-high floor pads.
|
||||
- Full-height, 3 mm-thick divider at Y=72…75. The 8 mm DC-wire passage needs an appropriate insulating grommet. It is a wiring separator, not certified reinforced insulation.
|
||||
- Heltec PCB lower face at Z=35, with 13 mm clearance above the carrier plate for underside components and header pins. The screen is near the lid, in its own compartment.
|
||||
- Heltec mount-hole centres: (28.879, 88.7), (57.879, 88.7), (28.879, 102.7), (57.879, 102.7). Pitch is 29 × 14 mm. Carrier passages are 2.1 mm diameter with 3.5 mm AF nut recesses underneath.
|
||||
- **M16 × 1.5 right-hand internal thread** on the left wall, in an integral 24 mm-diameter boss. Total threaded wall depth is 6 mm, with the extra 3 mm extending inward. This is designed for the LAPP 53111810 gland and replaces the previous smooth 16.2 mm opening. The actual gland provides cable retention; its mounting thread screws into the printed case.
|
||||
- 6.5 mm SMA bulkhead opening on the opposite wall, in the Heltec compartment. Verify the connector shank diameter, thread length and nut clearance; use an IPEX-to-SMA pigtail appropriate to your board.
|
||||
- USB opening about 15.4 × 10 mm. The USB receptacle is recessed about 11 mm from the outer wall. A narrow plug overmould must pass through the opening. Check your cable before printing; enlarge the source opening if necessary.
|
||||
- Small vent slots on the PSU side wall and lid; no lid vents above the terminal bank. Keep them unobstructed. No waterproofing or IP rating is claimed.
|
||||
|
||||
## Bottom mounting flanges (revision 2)
|
||||
|
||||
Two integral flanges extend 18 mm beyond the Y ends of the case. Each is 4.5 mm thick with rounded corners, a central keyhole, and two Ø4.5 mm clearance holes for M4 or similar screws. They print flat with the base and need no additional supports. The overall footprint is now 122 × 152 mm; the lid and internal layout retain their original dimensions.
|
||||
|
||||
| Feature | Hole centres (X, Y), mm |
|
||||
|---|---|
|
||||
| Four round mounting holes | (16, -9), (106, -9), (16, 125), (106, 125) |
|
||||
| Keyhole head entries, Ø9 mm | (61, -10), (61, 124) |
|
||||
| Keyhole seated positions, Ø4.5 mm | (61, -4.5), (61, 129.5) |
|
||||
|
||||
The four round holes form a **90 × 134 mm** rectangle. Both keyholes have a 5.5 mm travel toward +Y. For hanging, orient +Y upward (the Heltec compartment above the PSU compartment): engage the heads in the larger openings, lower the enclosure 5.5 mm, then tighten and secure it with at least one round-hole fastener to prevent lifting off. Use pan/button-head screws whose heads pass through the Ø9 mm entry but retain securely over the 4.5 mm neck; check actual head size. The flanges are not countersunk.
|
||||
|
||||
**Mounting clearance:** the PSU screws project below the case floor. Use rigid stand-offs/spacers at every mounting fastener, typically at least 3 mm and always greater than the measured screw-head projection, so the enclosure does not rock on those heads. Use washers at the round holes and tighten gently. Select fasteners/anchors for the wall or support material. Printed flange strength and pull-out resistance have not been physically tested.
|
||||
|
||||
## Threaded mains entry (revision 3)
|
||||
|
||||
The left-wall opening now has a modeled **M16 × 1.5, right-hand, single-start, 60-degree internal thread**, not merely a cosmetic thread annotation. It is present in both the STL and STEP files. An inward boss increases the wall locally from 3 to **6 mm** (four pitches of total depth, with partial threads at the lead-in and exit). Its outside diameter is 24 mm. A 0.75 mm entry chamfer helps the gland start squarely; a 0.5 mm exit chamfer relieves the inner edge. The exterior wall remains flat for the gland shoulder/sealing washer.
|
||||
|
||||
The profile includes **0.20 mm radial print clearance** (0.40 mm on diameter). This is a starting tolerance, not a verified thread-fit class. It can be adjusted through `THREAD_RADIAL_CLEARANCE` in `build_enclosure.py`. The nominal mating gland remains M16 × 1.5. Based on LAPP's listed 8 mm mounting-thread length, about 2 mm of that thread can extend past a 6 mm wall before allowance for a sealing washer. No separate locknut is intended for this revision.
|
||||
|
||||
Print **M16_thread_test.stl** first using the same material, layer height and settings as the case. The coupon holds the bore horizontally, matching the case's print orientation. Its foot should lie flat on the bed. Try approximately 0.15 mm layers, at least four perimeters, and inspect the top of the bore for sagging or support residue. Do not force the gland into an undersized or rough thread. It should start by hand and seat without cross-threading. If fit is too tight or loose, change the radial clearance and regenerate both parts. Scaling the whole case is not a thread-fit adjustment.
|
||||
|
||||
The gland mounts from the outside. Use its appropriate sealing washer if required, and seat the shoulder gently. The finished printed thread's tightening strength, pull-out resistance and long-term creep are **not validated**, so no mounting torque is specified. Check secure cable retention in the finished assembly before powered use; the gland's factory ratings do not establish those of the printed mounting thread or enclosure. Electrical-safety limitations in this document still apply.
|
||||
|
||||
Manufacturer identification: [LAPP SKINTOP BS-M product table, article 53111810](https://products.lappgroup.com/online-catalogue/cable-glands/skintop-cable-glands-plastic-metric/bending-protection/skintop-bs-m.html).
|
||||
|
||||
## Hardware and assembly
|
||||
|
||||
1. Print the **carrier first** and check all four holes against your particular board. With power disconnected, check how the original screen cover and its screws are retained. The model uses the four display-mount positions; it is not a snap-in cradle.
|
||||
2. If those positions can accept through-fasteners without damaging the screen assembly, use **four M1.6 screws and nuts**, with the nuts in the carrier's underside recesses. Approximately 22 mm screw length is a starting point for a through-stack, not a confirmed OEM screw specification. Measure the actual grip length, head clearance and thread engagement. Do not force a screw into the board or drill the PCB. If your factory cover has incompatible blind posts or fasteners, adjust the carrier/fastening method before use.
|
||||
3. Secure the carrier to the two base pedestals using **two M3 × 10 screws**. Secure the lid using **four M3 × 10 screws**. The 2.7 mm pilots are for careful hand tapping or suitable plastic-thread-forming screws; check thread fit and avoid overtightening. No heat-set inserts are required by this version.
|
||||
4. Attach the PSU using **two M3 × 10 screws from below**, with approximately 0.5 mm-thick washers. The floor-plus-pad grip is 8 mm, giving about 1.5 mm nominal engagement. **Measure the actual protrusion: the PSU's bottom holes allow at most 3 mm insertion.** Adjust washers/length for printed dimensions. The side-mount holes are not used.
|
||||
5. Add four adhesive feet taller than the underside screw heads (typically at least 3 mm); these are not printed into the base, so its floor prints flat.
|
||||
6. Test and fit the threaded cable gland as described below, then the DC-passage grommet and SMA bulkhead. Cable-tie anchors are included for organizing wires; they do not replace the mains cable gland.
|
||||
7. If using the windowed lid, fit a **30 × 22 × 1 mm clear polycarbonate pane**, with corners rounded about R1.5 to suit the recess. Retain it with a compatible adhesive around the perimeter. Do not leave the opening uncovered. Check display alignment before bonding.
|
||||
|
||||
### Mains-power and material limits
|
||||
|
||||
This is a **mechanical prototype, not a certified electrical enclosure**. The RS-15-5 has exposed mains terminals and requires protective-earth bonding to its FG terminal. Have the final wiring, strain relief, earth connection, touch protection, insulation and thermal behaviour checked by someone qualified before powered operation. Disconnect mains before removing the lid. The divider and small vents do not establish an electrical safety or IP rating.
|
||||
|
||||
Use a suitably rated flame-retardant, heat-resistant material/process for any proposed mains installation, and validate the finished print. Material marketing or a filament rating alone does not certify an FDM enclosure. PLA/PETG prototypes are useful for an **unpowered fit check**; this design does not validate them for unattended mains service. At 15 W output and the datasheet's nominal 77% efficiency, the PSU dissipates roughly 4.5 W internally; ventilation area alone does not prove an acceptable temperature.
|
||||
|
||||
For a fit prototype: 0.4 mm nozzle, 0.2 mm layers, 4 perimeters, 5 top/bottom layers and approximately 30% infill. Enable localized supports for the side cable-gland/SMA/USB openings if your printer needs them. The base contains short bridges at cable-tie anchors; inspect those passages. Clear the holes carefully and remove all debris before installing electronics.
|
||||
|
||||
The Heltec documentation states that USB and the 5 V input must not be supplied simultaneously. Isolate the PSU's low-voltage feed before connecting a powered programming USB cable. This enclosure does not add power switching or isolation circuitry. Do not feed 5 V into the battery connector.
|
||||
|
||||
## Validation and remaining fit checks
|
||||
|
||||
- All five printable CAD bodies pass OpenCascade validity checks and each contains one solid.
|
||||
- Exact solid-intersection checks cover the installed printed parts, the nominal PSU body/terminal envelopes, and simplified board/screen envelopes. Results are included in `validation.json`.
|
||||
- `board_cad_check.json` records the separate comparison against the manufacturer's V4.3.1 STEP geometry. That manufacturer model does not include a complete screen/cover assembly; the screen is represented by a simplified envelope in the preview and initial checks.
|
||||
- `mesh_validation.json` records watertight-edge and positive-volume checks on the exported STLs.
|
||||
- No physical print, screw engagement, cable insertion, heat test, material validation, electrical safety test or RF test has been performed. Printed thread fit/retention, SMA pigtail, screen-cover fasteners and the clear pane are hardware-dependent.
|
||||
- **Source discrepancy:** the Heltec drawing labels mounting holes Ø1.90 mm, while the supplied STEP model's PCB holes measure approximately Ø2.80 mm. Hole pitch agrees at 29 × 14 mm. The carrier uses 2.1 mm passages for M1.6 fasteners, but the actual board/cover hardware must be checked.
|
||||
|
||||
## Manufacturer references
|
||||
|
||||
- Mean Well RS-15 datasheet, mechanical drawing on page 2: https://www.meanwell.com/upload/pdf/RS-15/RS-15-SPEC.pdf
|
||||
- Heltec WiFi LoRa 32 V4.3.1 datasheet, dimensions on page 15: https://resource.heltec.cn/download/WiFi_LoRa_32_V4/datasheet/WiFi_LoRa_32_V4.3.1_Datasheet.pdf
|
||||
- Heltec official 3D model directory: https://resource.heltec.cn/download/WiFi_LoRa_32_V4/3D
|
||||
- STEP used for internal checks: HTIT-WB32LAF_V4.3.1(1).step. Manufacturer files are not redistributed in this package.
|
||||
|
||||
`preview.png` shows the housing with simplified component envelopes; the PSU, board, display, screws and purchased hardware are not printable parts. Auxiliary BREP caches are omitted from the download; the build script regenerates them.
|
||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"base": [],
|
||||
"board_carrier": [],
|
||||
"lid_solid": []
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@@ -0,0 +1,168 @@
|
||||
"""RS-15-5 + Heltec WiFi LoRa 32 V4.3.1 enclosure, units mm.
|
||||
Requires CadQuery 2.6+. Run: python build_enclosure.py
|
||||
Source dimensions and assembly limitations are in README.md.
|
||||
"""
|
||||
from pathlib import Path
|
||||
import cadquery as cq
|
||||
import json
|
||||
from math import sqrt
|
||||
OUT=Path(__file__).resolve().parent
|
||||
L,W,H=122.,116.,48.
|
||||
WALL=3.; FLOOR=3.; LID=3.
|
||||
FLANGE_EXTENSION=18.; FLANGE_THICKNESS=4.5
|
||||
MOUNT_HOLE_D=4.5; KEYHOLE_HEAD_D=9.; KEYHOLE_TRAVEL=5.5
|
||||
GLAND_PITCH=1.5; GLAND_DIAMETER=16.; GLAND_DEPTH=6.
|
||||
# Radial FDM clearance: 0.20 mm = 0.40 mm on diameter. Test before full print.
|
||||
THREAD_RADIAL_CLEARANCE=0.20
|
||||
PSU_X,PSU_Y,PSU_Z=46.,13.,8.
|
||||
BOARD_X,BOARD_Y,BOARD_BOTTOM=12.,83.,35.
|
||||
# Hole coordinates relative to PCB left edge / lower edge.
|
||||
BOARD_HOLES=[(16.879,5.7),(45.879,5.7),(16.879,19.7),(45.879,19.7)]
|
||||
LID_HOLES=[(6,6),(116,6),(6,110),(116,110)]
|
||||
CARRIER_HOLES=[(15,80),(65,109)]
|
||||
def box(x,y,z,dx,dy,dz):
|
||||
return cq.Workplane('XY').box(dx,dy,dz,centered=False).translate((x,y,z))
|
||||
def cyl(x,y,z,d,h):
|
||||
return cq.Workplane('XY').circle(d/2).extrude(h).translate((x,y,z))
|
||||
def rr(x,y,z,dx,dy,dz,r):
|
||||
return box(x,y,z,dx,dy,dz).edges('|Z').fillet(r)
|
||||
def xhole(x,y,z,d,length):
|
||||
return cq.Workplane('YZ').circle(d/2).extrude(length).translate((x,y,z))
|
||||
def yhole(x,y,z,d,length):
|
||||
return cq.Workplane('XZ').circle(d/2).extrude(-length).translate((x,y,z))
|
||||
def hexcut(x,y,z,af,h):
|
||||
return cq.Workplane('XY').polygon(6,af/0.8660254038).extrude(h).translate((x,y,z))
|
||||
def gland_thread_tool():
|
||||
# Right-handed, single-start 60-degree metric internal thread, with flat roots.
|
||||
pitch=GLAND_PITCH
|
||||
major=GLAND_DIAMETER/2+THREAD_RADIAL_CLEARANCE
|
||||
minor=major-5*sqrt(3)*pitch/16
|
||||
overlap=.05
|
||||
profile=cq.Workplane('XZ').polyline([
|
||||
(minor-overlap,-3*pitch/8-overlap/sqrt(3)),
|
||||
(major,-pitch/16),(major,pitch/16),
|
||||
(minor-overlap,3*pitch/8+overlap/sqrt(3))]).close()
|
||||
path=cq.Wire.makeHelix(pitch,GLAND_DEPTH+2*pitch,minor)
|
||||
groove=profile.sweep(path,isFrenet=True).translate((0,0,-pitch))
|
||||
cutter=cyl(0,0,-pitch,2*minor,GLAND_DEPTH+2*pitch).union(groove)
|
||||
cutter=cutter.union(cq.Workplane(obj=cq.Solid.makeCone(major+.2,minor,.75)))
|
||||
cutter=cutter.union(cq.Workplane(obj=cq.Solid.makeCone(minor,major+.1,.5)).translate((0,0,GLAND_DEPTH-.5)))
|
||||
return cutter.rotate((0,0,0),(0,1,0),90)
|
||||
thread_tool=gland_thread_tool()
|
||||
# Main shell and full-height wiring divider.
|
||||
base=rr(0,0,0,L,W,H,5).cut(rr(3,3,3,L-6,W-6,H,2))
|
||||
base=base.union(box(3,72,3,L-6,3,H-3))
|
||||
# Integral bottom flanges, coplanar with the floor for flat printing.
|
||||
# Both keyhole necks point +Y: orient +Y upward for gravity-assisted hanging.
|
||||
for flange_y,hole_y,entry_y in [(-FLANGE_EXTENSION,-9.,-10.),(W-3,W+9.,W+8.)]:
|
||||
flange=rr(0,flange_y,0,L,FLANGE_EXTENSION+3,FLANGE_THICKNESS,5)
|
||||
for x in [16.,L-16.]:
|
||||
flange=flange.cut(cyl(x,hole_y,-1,MOUNT_HOLE_D,FLANGE_THICKNESS+2))
|
||||
slot=cyl(L/2,entry_y,-1,KEYHOLE_HEAD_D,FLANGE_THICKNESS+2)
|
||||
slot=slot.union(box(L/2-MOUNT_HOLE_D/2,entry_y,-1,MOUNT_HOLE_D,KEYHOLE_TRAVEL,FLANGE_THICKNESS+2))
|
||||
slot=slot.union(cyl(L/2,entry_y+KEYHOLE_TRAVEL,-1,MOUNT_HOLE_D,FLANGE_THICKNESS+2))
|
||||
base=base.union(flange.cut(slot))
|
||||
# Lid pilots: M3 plastic-tapping screw or carefully hand-tapped M3.
|
||||
for x,y in LID_HOLES:
|
||||
base=base.union(cyl(x,y,3,10,H-3))
|
||||
base=base.cut(cyl(x,y,H-12,2.7,13))
|
||||
# PSU underside holes: 39.1 pitch; max 3 mm screw intrusion.
|
||||
psu_holes=[(PSU_X+8.75,PSU_Y+25.25),(PSU_X+47.85,PSU_Y+25.25)]
|
||||
for x,y in psu_holes:
|
||||
base=base.union(cyl(x,y,3,12,PSU_Z-3))
|
||||
base=base.cut(cyl(x,y,-1,3.6,PSU_Z+2))
|
||||
# Support pads prevent rocking; contact metal base only.
|
||||
for x in [PSU_X+3,PSU_X+57]:
|
||||
for y in [PSU_Y+3,PSU_Y+45]:
|
||||
base=base.union(box(x,y,3,3,3,PSU_Z-3))
|
||||
# Carrier pedestals.
|
||||
for x,y in CARRIER_HOLES:
|
||||
base=base.union(cyl(x,y,3,9,19))
|
||||
base=base.cut(cyl(x,y,12,2.7,11))
|
||||
# Integral 24 mm boss: 6 mm total threaded wall depth, extending inward.
|
||||
base=base.union(xhole(0,49,22,24,GLAND_DEPTH))
|
||||
base=base.cut(thread_tool.translate((0,49,22)))
|
||||
# Matching fit coupon, with its thread horizontal as in the case print.
|
||||
thread_coupon=box(0,-14,0,GLAND_DEPTH,28,30).union(box(0,-14,0,20,28,3))
|
||||
thread_coupon=thread_coupon.cut(thread_tool.translate((0,0,16)))
|
||||
# SMA bulkhead on opposite wall (low voltage bay).
|
||||
base=base.cut(xhole(L-4,94,32,6.5,5))
|
||||
# USB opening sized for plug overmould, not just metal connector. Support locally.
|
||||
base=base.cut(rr(-1,88,33,5,15.4,10,1.5))
|
||||
# DC passage takes a grommet with a nominal 8 mm panel cutout.
|
||||
base=base.cut(yhole(109,71,18,8,5))
|
||||
# Small vertical side vents, only opposite the terminal bank.
|
||||
for y in range(17,65,6):
|
||||
for z in [10,29]:
|
||||
base=base.cut(box(L-4,y,z,5,2,12))
|
||||
# Cable tie anchors are raised blocks with horizontal 5 x 2.5 passages.
|
||||
for x,y in [(24,15),(109,66),(89,103)]:
|
||||
anchor=box(x-4,y-3,3,8,6,5).cut(box(x-2.5,y-4,4.5,5,8,2.5))
|
||||
base=base.union(anchor)
|
||||
# Removable carrier, print plate flat with four small supports upright.
|
||||
carrier=rr(12,77,22,60,36,3,2)
|
||||
for x,y in CARRIER_HOLES:
|
||||
carrier=carrier.cut(cyl(x,y,21,3.4,5))
|
||||
for hx,hy in BOARD_HOLES:
|
||||
x,y=BOARD_X+hx,BOARD_Y+hy
|
||||
carrier=carrier.union(cyl(x,y,25,4.4,BOARD_BOTTOM-25))
|
||||
carrier=carrier.cut(cyl(x,y,21,2.1,BOARD_BOTTOM-20))
|
||||
# M1.6 nut recess open underneath, 3.5 mm AF / 1.5 mm deep.
|
||||
carrier=carrier.cut(hexcut(x,y,21.9,3.5,1.6))
|
||||
# Lid in assembled coordinates, simple face-down print orientation on export.
|
||||
lid=rr(0,0,H,L,W,LID,5)
|
||||
for x,y in LID_HOLES:
|
||||
lid=lid.cut(cyl(x,y,H-1,3.4,5))
|
||||
# Registration tabs avoid tall corner posts and the divider.
|
||||
for x in [22,87]:
|
||||
lid=lid.union(box(x,3.3,H-2,15,1.5,2.1))
|
||||
lid=lid.union(box(x,W-4.8,H-2,15,1.5,2.1))
|
||||
for y in [17,80]:
|
||||
lid=lid.union(box(3.3,y,H-2,1.5,10,2.1))
|
||||
lid=lid.union(box(L-4.8,y,H-2,1.5,10,2.1))
|
||||
# Exhaust slots above the metal PSU body, no slots above its terminals.
|
||||
for x in range(61,106,5):
|
||||
for y in [20,43]:
|
||||
lid=lid.cut(rr(x,y,H-1,2,16,5,0.8))
|
||||
# Two lid options. Windowed version requires a separately fitted clear pane.
|
||||
lid_window=lid.cut(rr(31,87,H-1,25,17,5,1.5))
|
||||
# Recess on underside for a 30 x 22 x 1 mm clear polycarbonate pane.
|
||||
lid_window=lid_window.cut(rr(28.5,84.5,H-.1,30,22,1.2,1.5))
|
||||
# Models used ONLY for clearance checks/preview, never included in print STLs.
|
||||
psu_ref=box(PSU_X,PSU_Y,PSU_Z,62.5,51,28)
|
||||
terminal_ref=box(PSU_X-13,PSU_Y+2,PSU_Z+8,13,47,13)
|
||||
board_ref=box(BOARD_X,BOARD_Y,BOARD_BOTTOM,51.7,25.4,1.56)
|
||||
# PCB underside relief, header pins and screen approximations are explicitly illustrative.
|
||||
screen_ref=box(BOARD_X+15,BOARD_Y+3.3,BOARD_BOTTOM+1.56,33,18.8,5.5)
|
||||
parts={'base':base,'lid_solid':lid,'lid_window':lid_window,'board_carrier':carrier,'M16_thread_test':thread_coupon}
|
||||
report={}
|
||||
for name,part in parts.items():
|
||||
s=part.val(); assert s.isValid(),name+' invalid'
|
||||
assert len(s.Solids())==1,name+' not one solid'
|
||||
printable=part
|
||||
if name.startswith('lid'):
|
||||
printable=part.rotate((0,0,0),(1,0,0),180).translate((0,W,H+LID))
|
||||
elif name=='board_carrier': printable=part.translate((0,0,-22))
|
||||
cq.exporters.export(printable,str(OUT/(name+'.stl')),tolerance=0.03,angularTolerance=0.12)
|
||||
cq.exporters.export(part,str(OUT/(name+'.step')))
|
||||
b=printable.val().BoundingBox()
|
||||
report[name]={'valid':True,'solids':1,'volume_mm3':round(s.Volume(),2),'print_bounds_mm':[round(b.xlen,3),round(b.ylen,3),round(b.zlen,3)],'print_zmin':round(b.zmin,5)}
|
||||
# Pairwise exact solid intersections (touching surfaces permitted).
|
||||
for a,b in [('base','lid_solid'),('base','lid_window'),('base','board_carrier'),('board_carrier','lid_solid')]:
|
||||
vol=parts[a].intersect(parts[b]).val().Volume()
|
||||
report[a+' vs '+b]={'intersection_mm3':round(vol,7)}
|
||||
assert vol<1e-5,(a,b,vol)
|
||||
for name,ref in [('PSU',psu_ref),('terminals',terminal_ref),('PCB',board_ref),('screen',screen_ref)]:
|
||||
for pname in ['base','board_carrier','lid_solid']:
|
||||
vol=parts[pname].intersect(ref).val().Volume()
|
||||
report[pname+' vs '+name]={'intersection_mm3':round(vol,7)}
|
||||
assert vol<1e-5,(pname,name,vol)
|
||||
assy=cq.Assembly(name='RS15_Heltec_V4_housing')
|
||||
for name in ['base','board_carrier','lid_solid']:
|
||||
assy.add(parts[name],name=name,color=cq.Color(0.24,0.32,0.39) if name=='base' else cq.Color(0.8,0.84,0.85))
|
||||
assy.save(str(OUT/'housing_assembly.step'))
|
||||
(OUT/'validation.json').write_text(json.dumps(report,indent=2))
|
||||
# Cache original shapes for deterministic previews without rebuilding.
|
||||
for name,part in {**parts,'psu_reference':psu_ref,'terminal_reference':terminal_ref,'board_reference':board_ref,'screen_reference':screen_ref}.items():
|
||||
part.val().exportBrep(str(OUT/(name+'.brep')))
|
||||
print(json.dumps(report,indent=2))
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"lid_solid.stl": {
|
||||
"triangles": 10404,
|
||||
"all_edges_have_two_faces": true,
|
||||
"signed_volume_mm3": 40884.329,
|
||||
"minimum_z_mm": -6.112874255887531e-16
|
||||
},
|
||||
"M16_thread_test.stl": {
|
||||
"triangles": 4196,
|
||||
"all_edges_have_two_faces": true,
|
||||
"signed_volume_mm3": 5069.676,
|
||||
"minimum_z_mm": 0.0
|
||||
},
|
||||
"board_carrier.stl": {
|
||||
"triangles": 4764,
|
||||
"all_edges_have_two_faces": true,
|
||||
"signed_volume_mm3": 6800.201,
|
||||
"minimum_z_mm": 0.0
|
||||
},
|
||||
"lid_window.stl": {
|
||||
"triangles": 11304,
|
||||
"all_edges_have_two_faces": true,
|
||||
"signed_volume_mm3": 39356.635,
|
||||
"minimum_z_mm": -6.112874255887531e-16
|
||||
},
|
||||
"base.stl": {
|
||||
"triangles": 15766,
|
||||
"all_edges_have_two_faces": true,
|
||||
"signed_volume_mm3": 150649.21,
|
||||
"minimum_z_mm": 0.0
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 74 KiB |
@@ -0,0 +1,105 @@
|
||||
{
|
||||
"base": {
|
||||
"valid": true,
|
||||
"solids": 1,
|
||||
"volume_mm3": 150656.34,
|
||||
"print_bounds_mm": [
|
||||
122.017,
|
||||
152.004,
|
||||
48.004
|
||||
],
|
||||
"print_zmin": -0.00222
|
||||
},
|
||||
"lid_solid": {
|
||||
"valid": true,
|
||||
"solids": 1,
|
||||
"volume_mm3": 40884.34,
|
||||
"print_bounds_mm": [
|
||||
122.004,
|
||||
116.004,
|
||||
5.002
|
||||
],
|
||||
"print_zmin": -0.00212
|
||||
},
|
||||
"lid_window": {
|
||||
"valid": true,
|
||||
"solids": 1,
|
||||
"volume_mm3": 39356.63,
|
||||
"print_bounds_mm": [
|
||||
122.004,
|
||||
116.004,
|
||||
5.002
|
||||
],
|
||||
"print_zmin": -0.00212
|
||||
},
|
||||
"board_carrier": {
|
||||
"valid": true,
|
||||
"solids": 1,
|
||||
"volume_mm3": 6800.46,
|
||||
"print_bounds_mm": [
|
||||
60.002,
|
||||
36.002,
|
||||
13.002
|
||||
],
|
||||
"print_zmin": -0.00085
|
||||
},
|
||||
"M16_thread_test": {
|
||||
"valid": true,
|
||||
"solids": 1,
|
||||
"volume_mm3": 5069.09,
|
||||
"print_bounds_mm": [
|
||||
20.015,
|
||||
28.0,
|
||||
30.0
|
||||
],
|
||||
"print_zmin": -0.0
|
||||
},
|
||||
"base vs lid_solid": {
|
||||
"intersection_mm3": 0.0
|
||||
},
|
||||
"base vs lid_window": {
|
||||
"intersection_mm3": 0.0
|
||||
},
|
||||
"base vs board_carrier": {
|
||||
"intersection_mm3": 0.0
|
||||
},
|
||||
"board_carrier vs lid_solid": {
|
||||
"intersection_mm3": 0.0
|
||||
},
|
||||
"base vs PSU": {
|
||||
"intersection_mm3": 0.0
|
||||
},
|
||||
"board_carrier vs PSU": {
|
||||
"intersection_mm3": 0.0
|
||||
},
|
||||
"lid_solid vs PSU": {
|
||||
"intersection_mm3": 0.0
|
||||
},
|
||||
"base vs terminals": {
|
||||
"intersection_mm3": 0.0
|
||||
},
|
||||
"board_carrier vs terminals": {
|
||||
"intersection_mm3": 0.0
|
||||
},
|
||||
"lid_solid vs terminals": {
|
||||
"intersection_mm3": 0.0
|
||||
},
|
||||
"base vs PCB": {
|
||||
"intersection_mm3": 0.0
|
||||
},
|
||||
"board_carrier vs PCB": {
|
||||
"intersection_mm3": 0.0
|
||||
},
|
||||
"lid_solid vs PCB": {
|
||||
"intersection_mm3": 0.0
|
||||
},
|
||||
"base vs screen": {
|
||||
"intersection_mm3": 0.0
|
||||
},
|
||||
"board_carrier vs screen": {
|
||||
"intersection_mm3": 0.0
|
||||
},
|
||||
"lid_solid vs screen": {
|
||||
"intersection_mm3": 0.0
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
After Width: | Height: | Size: 86 KiB |
File diff suppressed because one or more lines are too long
Binary file not shown.
Reference in New Issue
Block a user