Calculate, validate, and visualize wall-mounted faucet installation geometry, especially faucet reach L and outlet height H1 for product selection. Use when...
---
name: wall-mounted-faucet-layout
description: Calculate, validate, and visualize wall-mounted faucet installation geometry, especially faucet reach L and outlet height H1 for product selection. Use when an agent needs to solve or check faucet reach, outlet height, basin depth, stream angle, wall setback, or drain position from K, W/WS, L, H1, H2, and theta, or generate an annotated SVG diagram for the result.
---
# Wall-Mounted Faucet Layout
Source: https://github.com/starsy/wall-mounted-faucet-layout-skill
Diagram reference:
- English: `assets/wall_mounted_faucet_geometry_v2.svg`
- Chinese: `assets/wall_mounted_faucet_geometry_v2_zh.svg`
## Purpose
Use this skill to calculate or validate the installation geometry of a wall-mounted faucet and basin.
Most faucet-selection questions should focus on:
- `L`: required faucet reach, when the basin/drain geometry and desired outlet height are known
- `H1`: required outlet height above the basin rim, when a candidate faucet reach is known
It can solve for:
- `H1`: vertical distance from the basin rim to the faucet outlet
- `L`: horizontal reach of the faucet outlet from the finished wall
- `WS`: horizontal distance from the rear inner basin wall to the drain center
- `theta`: water-flow angle measured from the vertical
- `K`: horizontal distance from the finished wall to the rear inner basin wall
- `H2`: vertical depth from the basin rim reference line to the target point at the drain
It can also use `W`, the front-to-back inner basin width, to assume a centered drain when `WS` is not supplied.
## Coordinate convention
All linear measurements must use the same unit.
- Horizontal distance increases from the wall toward the front of the basin.
- Vertical distance increases downward from the faucet outlet toward the drain.
- `theta` is measured from the vertical direction.
- A positive `theta` means the water points forward, away from the wall.
| Symbol | Meaning |
|---|---|
| `K` | Finished wall to rear inner basin wall |
| `W` | Front-to-back inner width of the basin |
| `WS` | Rear inner basin wall to drain center |
| `L` | Finished wall to faucet outlet |
| `H1` | Basin rim to faucet outlet, vertically upward |
| `H2` | Basin rim to drain target point, vertically downward |
| `theta` | Water angle from vertical, in degrees |
If the drain is centered:
\[
WS = \frac{W}{2}
\]
## Primary faucet-selection workflow
Prefer solving for `L` or `H1` when the user is choosing a faucet:
- Solve for `L` when the user knows the desired outlet height or wall rough-in height. Use the result to compare against faucet reach/spec-sheet projection from the finished wall to the outlet.
- Solve for `H1` when the user has a candidate faucet reach `L`. Use the result to decide whether the outlet height above the basin rim is practical.
- Do not treat `H1 + H2` as a fixed recommended value. It is the vertical drop required by the selected horizontal geometry and stream angle.
- If the user asks generally for the "right faucet" and provides both a desired outlet height and basin/drain geometry, solve `L` first.
- If the user provides a faucet model or faucet reach, solve `H1` first.
## Core geometry
Horizontal offset:
\[
\Delta x = K + WS - L
\]
Vertical drop:
\[
\Delta y = H1 + H2
\]
Core relationship:
\[
\tan(\theta)=\frac{K+WS-L}{H1+H2}
\]
This models the water path as a straight centerline. Real water flow curves under gravity and varies with pressure, aerator design, and flow rate.
## Solving formulas
### Solve for `H1`
\[
H1=\frac{K+WS-L}{\tan(\theta)}-H2
\]
### Solve for `L`
\[
L=K+WS-(H1+H2)\tan(\theta)
\]
### Solve for `WS`
\[
WS=L-K+(H1+H2)\tan(\theta)
\]
### Solve for `theta`
\[
\theta=\arctan\left(\frac{K+WS-L}{H1+H2}\right)
\]
Convert the result to degrees.
### Solve for `K`
\[
K=L-WS+(H1+H2)\tan(\theta)
\]
### Solve for `H2`
\[
H2=\frac{K+WS-L}{\tan(\theta)}-H1
\]
## Required calculation procedure
1. Identify the target variable. For faucet selection, prefer `L` or `H1` unless the user explicitly asks for another variable.
2. Normalize all lengths to one unit.
3. Confirm that `theta` is measured from the vertical.
4. Resolve the drain location:
- Use supplied `WS`; or
- If `WS` is absent and `W` is supplied, set `WS = W / 2`.
5. Select the target formula.
6. Convert degrees to radians before calling a trigonometric function.
7. Calculate with a calculator or script.
8. Report the formula, substitution, exact result, and practical rounded result.
9. Run the validation checks.
10. Recommend an on-site water test before concealed installation.
11. When the user would benefit from a visual explanation or installation handoff, generate an annotated SVG with `scripts/render_geometry_svg.py`.
## Validation checks
- Require all inputs needed by the selected formula.
- Require one consistent length unit.
- Normally require `0° < theta < 90°` for forward flow.
- If `W` is known, require `0 < WS < W`.
- If `H1 < 0`, the geometry or reference lines are incompatible.
- If `K + WS - L < 0`, the target point lies behind the outlet under this coordinate convention.
Reverse-check the result by substituting it into:
\[
\tan(\theta)=\frac{K+WS-L}{H1+H2}
\]
If `W` is known, report the drain offset from basin center:
\[
\text{center offset}=WS-\frac{W}{2}
\]
- Positive: forward of center
- Negative: rearward of center
- Zero: centered
## Sensitivity
For fixed `K`, `WS`, `H2`, and `theta`:
\[
\frac{\partial H1}{\partial L}=-\frac{1}{\tan(\theta)}
\]
At `theta = 10°`:
\[
\frac{1}{\tan(10^\circ)}\approx5.67
\]
So increasing `L` by 1 cm lowers theoretical `H1` by about 5.67 cm.
## Response template
```text
Known:
K = ...
WS = ... (or W = ... and WS = W/2)
H1 = ...
H2 = ...
L = ...
theta = ... degrees
Formula:
[target formula]
Substitution:
[...]
Result:
[target] = ... [unit]
Selection guidance:
- If solving L: compare this against faucet reach/spec-sheet projection from finished wall to outlet.
- If solving H1: compare this against the desired outlet height above the basin rim and available wall rough-in.
Validation:
- Horizontal offset Δx = ...
- Vertical drop Δy = ...
- Reverse check = ...
- Drain offset from basin center = ... (when W is known)
Practical note:
This is a straight-line geometric estimate. Confirm with a full-scale mock-up or water-flow test.
```
## Visual SVG output
When the user asks for a visual, diagram, annotated layout, client handoff, or installer handoff, render a custom SVG with the included script. Use the same inputs and target variable that you used for the numeric calculation.
```bash
python scripts/render_geometry_svg.py --solve L --K 5 --WS 20 --H1 15 --H2 14 --theta 10 --unit cm --output faucet-layout.svg
```
The generated SVG marks the supplied dimensions, solved value, horizontal offset, vertical drop, reverse-check angle, and practical warning note directly in the diagram. Prefer writing the output to a user-visible path named for the project or scenario.
## Worked examples
### Example 1: choose faucet reach, solve for `L`
Given `K=5 cm`, `WS=20 cm`, `H1=15 cm`, `H2=14 cm`, `theta=10°`:
\[
L=5+20-(15+14)\tan(10^\circ)\approx19.89\text{ cm}
\]
Interpretation: choose a faucet whose outlet projects about `19.9 cm` from the finished wall, then verify with real water flow.
### Example 2: check mounting height, solve for `H1`
Given `K=5 cm`, `W=40 cm`, `H2=14 cm`, `L=20.5 cm`, `theta=10°`:
\[
WS=20
\]
\[
H1=\frac{5+20-20.5}{\tan(10^\circ)}-14\approx11.52\text{ cm}
\]
Interpretation: this faucet reach works geometrically if the outlet can sit about `11.5 cm` above the basin rim.
### Example 3: short reach, solve for `H1`
Given `K=5 cm`, `WS=20 cm`, `H2=14 cm`, `L=16 cm`, `theta=10°`:
\[
H1=\frac{5+20-16}{\tan(10^\circ)}-14\approx37.04\text{ cm}
\]
The large result is expected because a 10-degree stream is close to vertical.
### Example 4: secondary check, solve for `WS`
Given `K=5 cm`, `H1=15 cm`, `H2=14 cm`, `L=20.5 cm`, `theta=10°`:
\[
WS=20.5-5+(15+14)\tan(10^\circ)\approx20.61\text{ cm}
\]
For `W=40 cm`, the drain is approximately `0.61 cm` forward of center.
## Agent implementation note
Prefer deterministic calculation with the included script. Do not estimate trigonometric values mentally when exact dimensions matter.
The script calculates with full floating-point precision internally, then prints practical engineering precision by default:
- `--unit mm`: whole millimeters
- `--unit cm`: `0.1 cm`
- `--unit m`: `0.001 m`
- Angles: `0.1°`
Use `--precision` or `--angle-precision` only when the user explicitly needs a different display precision.
Reference calculator:
```text
scripts/faucet_geometry.py
```
Reference visual renderer:
```text
scripts/render_geometry_svg.py
```
Primary calculator commands:
```bash
python scripts/faucet_geometry.py --solve L --K 5 --WS 20 --H1 15 --H2 14 --theta 10 --unit cm
python scripts/faucet_geometry.py --solve H1 --K 5 --W 40 --H2 14 --L 20.5 --theta 10 --unit cm
```
don't have the plugin yet? install it then click "run inline in claude" again.
added explicit decision points for inference (which variable to solve), edge case handling (theta at boundaries, impossible geometries, negative H1), external tool dependencies, input validation rules, outcome signals tying results to actionable next steps (spec sheet comparison, water test scheduling), and reorganized original content into implexa's six required sections.
Source: https://github.com/starsy/wall-mounted-faucet-layout-skill
Use this skill when selecting a wall-mounted faucet or validating its installation geometry against a basin. the skill solves for one unknown dimension (reach L, outlet height H1, drain location WS, stream angle theta, wall setback K, or drain depth H2) given the other five, then validates the result geometrically and suggests an on-site water test before concealed installation. it's the standard reference for faucet specifiers, plumbers, and designers who need to reconcile faucet reach, basin rim height, drain position, and water flow angle in one coordinate system.
geometry parameters (provide 5 of 6; the skill solves for the 6th):
K: finished wall to rear inner basin wall, in consistent unit (mm, cm, m)WS: rear inner basin wall to drain center, in same unit (or derive from W)W: front-to-back inner basin width; optional, used to calculate centered drain as WS = W / 2H1: basin rim to faucet outlet, vertical upward, in same unitH2: basin rim to drain target point, vertical downward, in same unitL: finished wall to faucet outlet, horizontal reach, in same unittheta: water flow angle from vertical, in degrees (0 to 90 typical; positive means forward away from wall)setup and dependencies:
scripts/faucet_geometry.py (python 3.6+, no external deps)scripts/render_geometry_svg.py (python 3.6+ with svg library)assets/wall_mounted_faucet_geometry_v2.svg (english) or assets/wall_mounted_faucet_geometry_v2_zh.svg (chinese)edge cases and constraints:
identify the target variable. ask the user which dimension they want to solve for, or infer from context: prefer L (faucet reach) if choosing a faucet model, or H1 (outlet height) if checking a candidate faucet against wall rough-in. do not assume the user wants H1 + H2 as a "recommended drop"; that is geometry-dependent.
collect five known dimensions from the user and confirm units. if WS is not provided and W is known, set WS = W / 2 and note that the drain is centered.
validate inputs:
convert theta to radians: multiply degrees by pi / 180.
select and substitute into the target formula:
H1 = (K + WS - L) / tan(theta) - H2L = K + WS - (H1 + H2) * tan(theta)WS = L - K + (H1 + H2) * tan(theta)theta = arctan((K + WS - L) / (H1 + H2)), then convert result to degreesK = L - WS + (H1 + H2) * tan(theta)H2 = (K + WS - L) / tan(theta) - H1calculate: use scripts/faucet_geometry.py with the target variable and known inputs. do not perform trigonometry mentally.
run validation checks (see decision points and output contract below).
reverse-check: substitute the solved value back into tan(theta) = (K + WS - L) / (H1 + H2) and confirm the angle matches the input theta within 0.1 degrees.
generate visual output if requested: call scripts/render_geometry_svg.py with the same inputs and solved value to create an annotated SVG for client or installer handoff.
deliver the result in the response template below, including practical guidance and a recommendation for on-site water testing before concealed installation.
if user asks for "the right faucet" and provides outlet height + basin geometry: solve for L first. the result is the faucet reach to buy.
if user provides a faucet model number or reach L and wants to know if it fits the wall rough-in: solve for H1 first. compare the result against the available wall space.
if WS is not supplied but W is known: assume the drain is centered at WS = W / 2. call this out in the response so the user can confirm or correct the drain position.
if theta is outside 0 to 90 degrees or equals 0 or 90 exactly: halt and ask the user to clarify the flow angle. theta = 0 is straight down (faucet directly above drain, no horizontal reach needed). theta = 90 is horizontal (geometry breaks down mathematically).
if K + WS - L < 0: the drain is behind the faucet outlet under this coordinate convention. the geometry is impossible. ask the user to verify K, WS, or L.
if H1 < 0 after solving: the outlet would sit below the basin rim. ask whether the reference line (basin rim vs. basin floor) is correct, or whether the user wants a negative result (uncommon but valid in some deep-basin cases).
if the user requests visual output: generate SVG with scripts/render_geometry_svg.py. write to a user-visible filename like faucet-layout-{project-name}.svg.
numeric result:
validation output:
center_offset = WS - W / 2 (positive = forward, negative = rear, zero = centered)selection guidance:
SVG output (when requested):
faucet-layout-kitchen.svg)the skill worked if:
if the reverse-check fails (solved dimension plugged back in does not recover the input theta), report the discrepancy and halt. if validation rules reject the geometry, report which constraint failed and suggest correcting K, WS, L, or theta.
All linear measurements use the same unit. Horizontal distance increases from the wall toward the front of the basin. Vertical distance increases downward from the faucet outlet toward the drain. Theta is measured from vertical; positive theta means water points forward, away from the wall.
| Symbol | Meaning |
|---|---|
| K | Finished wall to rear inner basin wall |
| W | Front-to-back inner width of the basin |
| WS | Rear inner basin wall to drain center |
| L | Finished wall to faucet outlet |
| H1 | Basin rim to faucet outlet, vertically upward |
| H2 | Basin rim to drain target point, vertically downward |
| theta | Water angle from vertical, in degrees |
If drain is centered: WS = W / 2.
Horizontal offset: Δx = K + WS - L
Vertical drop: Δy = H1 + H2
Core relationship: tan(theta) = (K + WS - L) / (H1 + H2)
This models the water path as a straight centerline. Real water curves under gravity and varies with pressure, aerator design, and flow rate; always confirm with on-site testing.
For fixed K, WS, H2, and theta:
∂H1 / ∂L = -1 / tan(theta)
At theta = 10°: 1 / tan(10°) ≈ 5.67, so increasing L by 1 cm lowers theoretical H1 by about 5.67 cm.
Given K=5 cm, WS=20 cm, H1=15 cm, H2=14 cm, theta=10°:
L = 5 + 20 - (15 + 14) * tan(10°) ≈ 19.89 cm
Interpretation: choose a faucet whose outlet projects about 19.9 cm from the finished wall, then verify with real water flow.
Given K=5 cm, W=40 cm, H2=14 cm, L=20.5 cm, theta=10° (so WS=20):
H1 = (5 + 20 - 20.5) / tan(10°) - 14 ≈ 11.52 cm
Interpretation: this faucet reach works geometrically if the outlet can sit about 11.5 cm above the basin rim.
Given K=5 cm, WS=20 cm, H2=14 cm, L=16 cm, theta=10°:
H1 = (5 + 20 - 16) / tan(10°) - 14 ≈ 37.04 cm
The large result is expected because a 10-degree stream is close to vertical.
Given K=5 cm, H1=15 cm, H2=14 cm, L=20.5 cm, theta=10°:
WS = 20.5 - 5 + (15 + 14) * tan(10°) ≈ 20.61 cm
For W=40 cm, the drain is approximately 0.61 cm forward of center.
calculate numeric result:
python scripts/faucet_geometry.py --solve L --K 5 --WS 20 --H1 15 --H2 14 --theta 10 --unit cm
python scripts/faucet_geometry.py --solve H1 --K 5 --W 40 --H2 14 --L 20.5 --theta 10 --unit cm
generate annotated SVG:
python scripts/render_geometry_svg.py --solve L --K 5 --WS 20 --H1 15 --H2 14 --theta 10 --unit cm --output faucet-layout.svg
The calculator defaults to practical precision (whole mm, 0.1 cm, 0.001 m, 0.1 degrees). Use --precision only if the user explicitly requests higher precision.
Original skill source: clawhub (github.com/starsy/wall-mounted-faucet-layout-skill). Procedure and formulas preserved from original.