Ray-Tracing Projector Shadows and 1-Inch EMT Deductions in Three.js for Home Golf Simulators
Most DIY home golf simulator builds start with a tape measure in a two-car garage and end with two expensive surprises: a short-throw projector that casts the golfer's head shadow straight onto the impact screen, or an e
Most DIY home golf simulator builds start with a tape measure in a two-car garage and end with two expensive surprises: a short-throw projector that casts the golfer's head shadow straight onto the impact screen, or an enclosure frame cut from 1-inch EMT conduit that comes out three inches too wide because nobody deducted steel corner slip-fitting insertion depths.
While building SimBayCAD, I wanted to move those calculations out of fragile spreadsheets and into an interactive, deterministic Three.js studio that runs directly in the browser with zero signup. Here is how the optical ray-casting, biomechanical swing clearance model, and 1/16-inch EMT cut-list solver work in TypeScript.
1. Modeling Real Projector Optics (Throw Ratio + Vertical Lens Offset)
A common misconception when hanging a short-throw golf simulator projector (such as a BenQ AK700ST or Optoma GT2000HDR) is assuming the lens aims straight horizontally at the center of the impact screen. In reality, fixed-offset short-throw lenses project upward (or downward when ceiling-mounted inverted) by a specific percentage of image height.
For each of the 36 projectors in our hardware catalog, we store:
- Native aspect ratio (
16:9,16:10, or4:3) and resolution - Minimum and maximum throw ratio (
throwMin,throwMax) - Vertical lens offset percentage (
offsetPct) - Ansi lumens and laser/lamp type
Given a user's screen width W and height H (fitted inside their EMT enclosure with perimeter bungee clearance), the optical engine solves:
-
Valid throw corridor:
minDist = W * throwMintomaxDist = W * throwMax. -
Ceiling mount height and drop-pipe length: Computed from the top of the projected image plus
offsetPct * Hso the beam fills the impact screen cleanly without digital keystone distortion (which crops pixels and reduces brightness). - Garage door track clearance: Compares the projector lens elevation and mounting bracket against standard 12-inch tracks, high-lift 4-inch drop tracks, or wall-mounted jackshaft openers so the garage door never clips the projector mount.
2. Deterministic Golfer Shadow Intersection in 3D
To flag projector shadows before anyone drills into drywall, the side-optics solver constructs the exact projection frustum from the ceiling mount point (X_p, Y_p, Z_p) to the four corners of the impact screen, then tests ray intersections against a parametric golfer envelope positioned at the hitting strip (X_tee, Y_tee):
-
Address head height: Scales with the selected golfer height (
5'4"to6'6"), standing on the hitting mat thickness. -
Driver swing apex arc: Computes the backswing and follow-through arc radius for the longest club swung indoors (driver
45.5", fairway wood, or iron), testing both ceiling clearance and rear/side wall impact margins.
When the ray from the projector lens to the top or middle of the screen intersects the golfer's head or downswing volume, SimBayCAD highlights the shadow line directly in the Three.js 3D viewport and side-optics elevation view, and recommends moving the mount forward (shorter throw lens) or adjusting tee offset.
3. Launch Monitor Sensor Zones: Radar vs. Photometric
Different launch monitors impose completely different room-depth requirements:
- Behind-ball Doppler radar units (Garmin Approach R10, FlightScope Mevo+, TrackMan 4) require 6 to 8 feet behind the tee plus 8 to 10+ feet of ball flight to the screen, pushing minimum room depth to 16-20 feet.
- Side-mounted photometric units (Bushnell Launch Pro, GC3, SkyTrak+, Uneekor EYE MINI, Square Golf) read ball spin within inches of impact, allowing compact 10x12 and 12x16 garage builds.
- Overhead ceiling-mounted units (Uneekor EYE XO, ProTee VX, TrackMan iO) require specific mounting zones 3 to 4 feet in front of the tee and clear of the projector beam.
SimBayCAD renders the exact radar/camera zone frustum on the floor and ceiling across 18 launch monitors so builders can compare right-handed, left-handed, and dual-handed off-center hitting strips before buying hardware.
4. Exact 1/16-Inch 1" EMT Cut Schedules and 10-ft Stick Nesting
Home simulator enclosures are typically framed with standard 1-inch EMT electrical conduit (sold in 10-foot sticks at hardware stores) joined by steel 3-way and 4-way corner slip fittings. Two real-world dimensions break naive cut math:
-
Fitting insertion deductions: Each steel corner connector adds
1.75"to2.25"per joint depending on fitting style. Cutting pipes to outer bay width produces a frame that is up to 4 inches too wide. - 10-foot stick nesting: Most width crossbars span 11 to 14 feet, requiring split spans with coupling sleeves and a center anti-sag depth rib.
Our pure-TypeScript BOM solver deducts every fitting depth down to 1/16", splits long spans cleanly across standard 120-inch EMT sticks using a bin-packing nesting pass to minimize scrap conduit, and generates a 4-sheet printable PDF blueprint pack (pdf-lib inside Cloudflare Workers) showing the full cut schedule, stick map, and ceiling mounting coordinates.
You can test your own garage or basement dimensions, compare 36 projectors and 18 launch monitors, and share a build link directly at SimBayCAD.
Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.