feat: add DIN rail (TH35) mount option#40
Open
vZhurbenko wants to merge 1 commit into
Open
Conversation
Adds a parametric TH35 top-hat rail mount as a second, independent toggle inside the existing Wall Mounts section (renamed to "Mounting"). The mount is a slotted boss that protrudes from the chosen enclosure face (default: bottom; alternative: back) with a trapezoidal undercut channel cut through it, so a standard 35 mm top-hat rail slides in end-on and is retained by the narrow mouth. - New geometry module: src/app/core/enclosure/dinrail.ts (channel + boss, surface placement) - 6 new Params fields + DEFAULT_PARAMS entries (TH35 defaults: width 35, crown 27, depth 8.5, length 60) - Mounting accordion: independent Wall + DIN toggles, Surface select, Rail Width / Crown Width / Rail Depth / Slot Length number inputs - Independent of wallMounts: both can be active simultaneously - README.md: tick off "Din rail mounts" - dinrail.spec.ts: 7 Jasmine specs covering defaults, protrusion, placement (bottom/back), channel cuts volume, coexistence with wall mounts, and undercut retention Closes bruceborrett#37
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #37
Adds a parametric TH35 top-hat rail mount as a second, independent toggle inside the existing Wall Mounts section (renamed to Mounting). The mount is a slotted boss that protrudes from the chosen enclosure face with a trapezoidal undercut channel cut through it, so a standard 35 mm top-hat rail slides in end-on and is retained by the narrower mouth.
The existing
wallMountsflag is left untouched — wall flanges and the DIN boss are independent and can be active simultaneously.What is new
src/app/core/enclosure/dinrail.ts— new geometry module (channel + boss + placement).src/app/core/enclosure/dinrail.spec.ts— 7 Jasmine specs covering defaults, protrusion, placement (bottom/back), channel cuts volume, coexistence with wall mounts, and undercut retention.src/app/core/params.ts— 6 new params (dinRailMount,dinRailSurface,dinRailWidth,dinRailCrownWidth,dinRailDepth,dinRailLength) + TH35 defaults.src/app/core/enclosure/base.ts— extraif (params.dinRailMount)branch alongside the existingwallMountsbranch.src/app/features/renderer/renderer.component.ts— the 6 DIN params added tobaseDeps.src/app/features/params/params-form.component.{html,ts,css}— accordion renamed to Mounting; new DIN toggle group (Surfaceselect,Rail Width,Crown Width,Rail Depth,Slot Lengthnumber inputs); checkboxes forced onto their own full-width row.src/app/core/state/enclosure-state.service.ts—resetToSimpleEnclosurenow also resetsdinRailMount.README.md— feature ticked off.Design notes
35, crown/top width27, height8.5. All four numbers are exposed as user inputs for non-TH35 rails (TH35-15, asymmetric rails, etc.).hull(two thin Z-slabs)— the same idiom already used bywallmount.tsandutils.ts: roundedCube.crown + clearance(27.5), chamber width =brim + clearance(35.5). The wider brim cannot pass back through the narrower mouth — a snap-in fit.bottom(default) andback. Each mode has its own translate/rotate so the channel exits to the correct face.wallMountsstays at its current default;dinRailMountis opt-in (off by default) per the issue acceptance criteria.Verification
npm test→ 28/28 SUCCESS (7 new + 21 existing).npm start→ toggling Wall and DIN Rail independently and together in the Mounting accordion updates the live preview; switchingSurface(withHeight ≥ ~39for Back) re-renders correctly; tweaking Rail Width / Crown Width / Depth / Length updates the slot.npm run format(prettier) — clean.npm run build— clean.Coded with AI