# Moon lamp ## What this builds A hollow sphere, like a small moon, with a cavity for a bulb or an LED module, modelled as code. Diameter, wall thickness, and cavity clearance are measured. The mesh is manifold. Lit and unlit renders use a simulated light; a physical bulb is not required. Relief, if on, is an original shallow pattern, not a copyrighted map. Read `spekkr.inputs.json` first. `diameter` and `wall` size the shell. `socket` is the cavity. `relief` and `stand` add features. `tool` is the modeller. ## Out of scope - A mains-voltage safety certification, or a real bulb in the checks. - A copyrighted planetary texture. - A physical print or a shop listing. ## Requirements Each requirement has an id. Checks name the id they cover. ### R1. Shell and cavity - The outside diameter is `diameter` within 0.1 mm. The wall is `wall` within 0.1 mm, on a section through the equator away from the socket. - The cavity is a cylinder (or a documented socket) of diameter `socket` plus 0.3 mm clearance, depth in `design.md`, and it does not break the wall thinner than 1.2 mm at the neck. - The mesh is watertight. If `stand` is on, the sphere sits in the ring with a 0.4 mm radial clearance and no overlap. Accept when: diameter, wall, cavity, neck, and stand clearance match, and the mesh is manifold. ### R2. Renders and files - An unlit render, a lit render with a simulated point or area light in the cavity, a section, and the stand. - The lit render is a simulation; no physical lamp is used. One command builds, measures, and writes the renders. No print. Accept when: the command passes for both tools, and the four renders are written. ### R3. Inputs - Numeric inputs are read from `spekkr.inputs.json` and must stay inside the ranges in the Inputs table in `design.md`. - A value outside a range is refused before modelling, with a message that names the key. - Options add or remove the features in that table. The `tool` swap selects CadQuery or OpenSCAD; both must meet the same numbers. Accept when: default and one out-of-range value are handled as above, and a second legal input set still matches the formulas in `design.md`. ### R4. Checks and report - One command builds the model at the defaults and at the person's inputs, measures it against `design.md`, and writes a short report. - A model broken on purpose, for example a wall thinner than `wall`, must fail the report. - The command exports the files this spec asks for (STL, and STEP when the tool can). No physical print is required. Accept when: the report says pass at the defaults and at the person's inputs, and fail on a deliberately broken model. ## Verification Sphere diameter, wall thickness, and fixture or bulb cavity clearance are measured on the mesh. The mesh is manifold. Lit and unlit renders use simulated light. No physical print and no real bulb are required. Relief, if any, is original. ## Definition of done - Every acceptance check above runs from one command, and all pass at the person's inputs. - A README says how to export, how the cavity is meant to be used, and that lighting is simulated in the checks.