Prompt specification
Build or customize the Three.js 3D scene "Parallelogram shear area demonstration" inside the active workspace.
Engineering Constraints:
1. Runtime & Orbit: Use Three.js r160 with OrbitControls (damping enabled) and ACESFilmicToneMapping.
2. Frame Timing: Drive all motion strictly with clock.getDelta() so animation speed is FPS-independent.
3. Viewport Hygiene: Handle window resize cleanly, cap DPR at Math.min(window.devicePixelRatio, 2), and dispose geometries/materials/renderer on unmount.
Scene Metadata:
Scene: Parallelogram shear area demonstration
Category: Algorithms & Systems · Style: Procedural Solid / Shader 3D
License: MIT · Reference: https://three3d.app/scene/parallelogram-shear-area-demonstration-x1682
Scene Description Prompt:
Slide the top edge of a parallelogram while keeping base and height fixed; show constant area and distinguish it from changing perimeter. Build this with Three.js from cdnjs as a stylized scene in one self-contained HTML file.
Acceptance checks: Use a single planar filled quadrilateral with four vertices in boundary order and two non-overlapping triangles sharing one diagonal. Keep the base and perpendicular height fixed and update vertex positions and perimeter while area stays base × height. Verify the rectangle and both extreme shear directions.
Return a single complete HTML document. It must work in a sandbox that allows scripts, with the cdnjs Three.js r160 module and inline CSS. Use procedural geometry and local button handlers; no native form submission, pointer lock, remote assets, or runtime network requests besides Three.js.
Working Three.js Starter (parallelogram-shear-area-demonstration-x1682):
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#07131d">
<link rel="icon" href="data:,">
<title>Parallelogram Shear Lab</title>
<style>
:root {
color-scheme: dark;
--bg: #07131d;
--panel: #0c1c28;
--panel-2: #102431;
--line: rgba(174, 221, 226, 0.14);
--line-strong: rgba(174, 221, 226, 0.25);
--text: #edf8f6;
--muted: #91a8ad;
--mint: #55e0bd;
--mint-soft: rgba(85, 224, 189, 0.13);
--cyan: #64cfff;
--cyan-soft: rgba(100, 207, 255, 0.13);
--amber: #ffd166;
--amber-soft: rgba(255, 209, 102, 0.13);
--red: #ff7b8a;
--shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}
* {
box-sizing: border-box;
}
html {
min-width: 320px;
background: var(--bg);
}
body {
min-height: 100vh;
margin: 0;
color: var(--text);
background:
radial-gradient(circle at 10% 0%, rgba(39, 128, 129, 0.20), transparent 31rem),
radial-gradient(circle at 92% 10%, rgba(66, 105, 171, 0.16), transparent 30rem),
linear-gradient(145deg, #081722 0%, #061019 58%, #07141d 100%);
font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
-webkit-font-smoothing: antialiased;
}
button,
input {
font: inherit;
}
button {
color: inherit;
}
.app-shell {
width: min(1440px, calc(100% - 40px));
margin: 0 auto;
padding: 30px 0 42px;
}
.topbar {
display: flex;
align-items: flex-end;
justify-content: space-between;
gap: 32px;
margin-bottom: 24px;
}
.eyebrow,
.section-kicker {
display: inline-flex;
align-items: center;
gap: 9px;
color: var(--mint);
font-size: 0.69rem;
font-weight: 800;
letter-spacing: 0.17em;
text-transform: uppercase;
}
.eyebrow::before {
width: 8px;
height: 8px;
border-radius: 50%;
background: var(--mint);
box-shadow: 0 0 0 5px rgba(85, 224, 189, 0.10), 0 0 18px rgba(85, 224, 189, 0.65);
content: "";
}
h1 {
max-width: 820px;
margin: 10px 0 8px;
font-size: clamp(2rem, 4vw, 4.35rem);
font-weight: 780;
letter-spacing: -0.055em;
line-height: 0.98;
}
h1 span {
color: var(--mint);
}
.intro {
max-width: 740px;
margin: 0;
color: var(--muted);
font-size: clamp(0.92rem, 1.5vw, 1.06rem);
line-height: 1.65;
}
.header-facts {
display: flex;
flex-wrap: wrap;
justify-content: flex-end;
gap: 8px;
min-width: 250px;
}
.fact-chip {
display: inline-flex;
align-items: center;
gap: 8px;
padding: 9px 12px;
border: 1px solid var(--line);
border-radius: 999px;
color: #c9dcdd;
background: rgba(12, 28, 40, 0.72);
font-size: 0.75rem;
font-weight: 700;
white-space: nowrap;
}
.fact-chip i {
width: 7px;
height: 7px;
border-radius: 50%;
background: var(--cyan);
box-shadow: 0 0 12px rgba(100, 207, 255, 0.65);
}
.fact-chip:last-child i {
background: var(--mint);
box-shadow: 0 0 12px rgba(85, 224, 189, 0.65);
}
.workspace {
display: grid;
grid-template-columns: minmax(0, 1fr) 370px;
align-items: start;
gap: 20px;
}
.stage-card,
.control-panel {
overflow: hidden;
border: 1px solid var(--line);
border-radius: 24px;
background: linear-gradient(160deg, rgba(15, 34, 47, 0.96), rgba(8, 22, 32, 0.98));
box-shadow: var(--shadow);
}
.stage-card-head {
display: flex;
align-items: center;
justify-content: space-between;
gap: 20px;
padding: 19px 22px;
border-bottom: 1px solid var(--line);
}
.stage-card-head h2,
.panel-heading h2 {
margin: 4px 0 0;
font-size: 1.06rem;
letter-spacing: -0.02em;
}
.topology-pill {
display: flex;
align-items: center;
gap: 8px;
padding: 8px 11px;
border: 1px solid var(--line);
border-radius: 999px;
color: var(--muted);
background: rgba(255, 255, 255, 0.025);
font-size: 0.72rem;
font-weight: 700;
white-space: nowrap;
}
.topology-pill b {
color: var(--text);
}
.topology-pill i {
width: 3px;
height: 3px;
border-radius: 50%;
background: var(--muted);
}
.stage {
position: relative;
height: clamp(530px, 67vh, 660px);
overflow: hidden;
isolation: isolate;
background:
radial-gradient(circle at 27% 18%, rgba(41, 135, 137, 0.17), transparent 31%),
radial-gradient(circle at 80% 70%, rgba(38, 88, 139, 0.15), transparent 35%),
linear-gradient(155deg, #081a26 0%, #06131d 65%, #071923 100%);
}
.stage::before {
position: absolute;
inset: 0;
z-index: 0;
background:
linear-gradient(rgba(255, 255, 255, 0.012) 1px, transparent 1px),
linear-gradient(90deg, rgba(255, 255, 255, 0.012) 1px, transparent 1px);
background-size: 32px 32px;
mask-image: radial-gradient(circle at center, black, transparent 78%);
pointer-events: none;
content: "";
}
#canvasHost,
.scene-labels {
position: absolute;
inset: 0;
}
#canvasHost {
z-index: 1;
}
#canvasHost canvas {
display: block;
width: 100%;
height: 100%;
outline: none;
pointer-events: none;
}
.scene-labels {
z-index: 3;
pointer-events: none;
}
.scene-tag {
position: absolute;
display: inline-flex;
align-items: center;
gap: 6px;
padding: 6px 9px;
border: 1px solid var(--line-strong);
border-radius: 9px;
color: #dcebed;
background: rgba(5, 17, 26, 0.82);
box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
font-size: 0.67rem;
font-weight: 800;
letter-spacing: 0.055em;
line-height: 1;
text-transform: uppercase;
white-space: nowrap;
transform: translate(-50%, -50%);
backdrop-filter: blur(8px);
}
.scene-tag::before {
width: 6px;
height: 6px;
border-radius: 50%;
background: currentColor;
content: "";
}
.area-tag {
padding: 8px 11px;
border-color: rgba(85, 224, 189, 0.45);
color: #b9ffeb;
background: rgba(12, 59, 54, 0.74);
font-size: 0.74rem;
}
.base-tag {
border-color: rgba(100, 207, 255, 0.42);
color: #aee6ff;
}
.height-tag {
border-color: rgba(100, 207, 255, 0.42);
color: #aee6ff;
transform: translate(-50%, -50%) rotate(-90deg);
}
.top-tag {
border-color: rgba(255, 209, 102, 0.46);
color: #ffe4a3;
}
.vertex-marker {
position: absolute;
width: 10px;
height: 10px;
border: 2px solid #effffc;
border-radius: 50%;
background: #2cc9a8;
box-shadow: 0 0 0 4px rgba(44, 201, 168, 0.18), 0 0 18px rgba(85, 224, 189, 0.55);
transform: translate(-50%, -50%);
}
.vertex-marker.b,
.vertex-marker.c {
background: var(--amber);
box-shadow: 0 0 0 4px rgba(255, 209, 102, 0.16), 0 0 18px rgba(255, 209, 102, 0.50);
}
.view-chip {
position: absolute;
top: 17px;
z-index: 4;
display: inline-flex;
align-items: center;
gap: 8px;
padding: 7px 10px;
border: 1px solid var(--line);
border-radius: 999px;
color: #a9c0c4;
background: rgba(4, 15, 23, 0.68);
font-size: 0.62rem;
font-weight: 800;
letter-spacing: 0.11em;
text-transform: uppercase;
backdrop-filter: blur(8px);
}
.view-chip.left {
left: 17px;
}
.view-chip.right {
right: 17px;
}
.view-chip .live-dot {
width: 6px;
height: 6px;
border-radius: 50%;
background: var(--mint);
box-shadow: 0 0 12px rgba(85, 224, 189, 0.72);
}
.scene-legend {
position: absolute;
right: 18px;
bottom: 17px;
z-index: 4;
display: flex;
align-items: center;
gap: 13px;
padding: 9px 11px;
border: 1px solid var(--line);
border-radius: 11px;
color: #9fb5b9;
background: rgba(4, 15, 23, 0.76);
font-size: 0.66rem;
font-weight: 700;
backdrop-filter: blur(8px);
}
.scene-legend span {
display: inline-flex;
align-items: center;
gap: 6px;
}
.swatch {
width: 8px;
height: 8px;
border-radius: 2px;
background: #2cc9a8;
transform: rotate(45deg);
}
.swatch.second {
background: #58dfc0;
}
.scene-legend .shared {
padding-left: 10px;
border-left: 1px solid var(--line);
color: #d7e6e7;
}
.equation-bar {
display: grid;
grid-template-columns: 1fr 1fr;
border-top: 1px solid var(--line);
background: rgba(3, 13, 21, 0.38);
}
.equation {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
padding: 17px 21px;
}
.equation + .equation {
border-left: 1px solid var(--line);
}
.equation-label {
color: var(--muted);
font-size: 0.66rem;
font-weight: 800;
letter-spacing: 0.12em;
text-transform: uppercase;
}
.equation-value {
color: #dcebec;
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
font-size: 0.78rem;
font-weight: 700;
text-align: right;
}
.equation-value strong {
color: var(--mint);
}
.control-panel {
padding: 21px;
}
.panel-heading {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 12px;
padding-bottom: 17px;
border-bottom: 1px solid var(--line);
}
.status-pill {
padding: 7px 10px;
border: 1px solid rgba(85, 224, 189, 0.34);
border-radius: 999px;
color: var(--mint);
background: var(--mint-soft);
font-size: 0.67rem;
font-weight: 800;
white-space: nowrap;
}
.status-pill[data-mode="left"],
.status-pill[data-mode="right"] {
border-color: rgba(255, 209, 102, 0.34);
color: var(--amber);
background: var(--amber-soft);
}
.status-detail {
display: block;
margin-top: 5px;
color: var(--muted);
font-size: 0.67rem;
text-align: right;
}
.metric-grid {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 8px;
margin: 16px 0 21px;
}
.metric-card {
min-width: 0;
padding: 13px 11px;
border: 1px solid var(--line);
border-radius: 13px;
background: rgba(255, 255, 255, 0.025);
}
.metric-card.area {
border-color: rgba(85, 224, 189, 0.28);
background: linear-gradient(145deg, rgba(85, 224, 189, 0.12), rgba(85, 224, 189, 0.035));
}
.metric-card.perimeter {
border-color: rgba(255, 209, 102, 0.25);
background: linear-gradient(145deg, rgba(255, 209, 102, 0.10), rgba(255, 209, 102, 0.025));
}
.metric-top {
display: flex;
align-items: center;
justify-content: space-between;
gap: 5px;
}
.metric-name {
color: #c9d9db;
font-size: 0.65rem;
font-weight: 800;
text-transform: uppercase;
}
.metric-badge {
color: var(--mint);
font-size: 0.48rem;
font-weight: 900;
letter-spacing: 0.08em;
text-transform: uppercase;
}
.perimeter .metric-badge {
color: var(--amber);
}
.metric-value {
display: block;
margin-top: 8px;
color: #f2fcfa;
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
font-size: 1.16rem;
font-weight: 800;
letter-spacing: -0.04em;
}
.metric-foot {
display: block;
min-height: 1.9em;
margin-top: 3px;
color: var(--muted);
font-size: 0.57rem;
line-height: 1.35;
}
.control-section {
padding: 17px 0;
border-top: 1px solid var(--line);
}
.control-section:first-of-type {
border-top: 0;
padding-top: 0;
}
.range-heading {
display: flex;
align-items: flex-end;
justify-content: space-between;
gap: 12px;
margin-bottom: 13px;
}
.control-label {
display: block;
color: #d8e6e7;
font-size: 0.78rem;
font-weight: 800;
}
.control-help {
display: block;
margin-top: 3px;
color: var(--muted);
font-size: 0.65rem;
}
.range-output {
color: var(--amber);
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
font-size: 0.92rem;
font-weight: 800;
white-space: nowrap;
}
input[type="range"] {
--pct: 50%;
width: 100%;
height: 6px;
margin: 3px 0 0;
border: 0;
border-radius: 999px;
outline: none;
appearance: none;
background: linear-gradient(90deg, var(--amber) 0 var(--pct), rgba(255, 255, 255, 0.12) var(--pct) 100%);
cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
width: 20px;
height: 20px;
border: 4px solid #112431;
border-radius: 50%;
appearance: none;
background: var(--amber);
box-shadow: 0 0 0 2px rgba(255, 209, 102, 0.45), 0 4px 14px rgba(0, 0, 0, 0.38);
}
input[type="range"]::-moz-range-thumb {
width: 13px;
height: 13px;
border: 4px solid #112431;
border-radius: 50%;
background: var(--amber);
box-shadow: 0 0 0 2px rgba(255, 209, 102, 0.45), 0 4px 14px rgba(0, 0, 0, 0.38);
}
input[type="range"]:focus-visible {
box-shadow: 0 0 0 3px rgba(255, 209, 102, 0.22);
}
.range-ends {
display: flex;
justify-content: space-between;
margin-top: 8px;
color: #728b91;
font-size: 0.58rem;
font-weight: 700;
}
.preset-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 7px;
margin-top: 14px;
}
.preset-button {
min-height: 40px;
padding: 8px 5px;
border: 1px solid var(--line);
border-radius: 10px;
color: #a9bec2;
background: rgba(255, 255, 255, 0.025);
font-size: 0.65rem;
font-weight: 800;
cursor: pointer;
transition: border-color 160ms ease, color 160ms ease, background 160ms ease, transform 160ms ease;
}
.preset-button:hover {
border-color: rgba(255, 209, 102, 0.38);
color: #ffe3a0;
transform: translateY(-1px);
}
.preset-button[aria-pressed="true"] {
border-color: rgba(255, 209, 102, 0.54);
color: #ffe5a8;
background: var(--amber-soft);
}
.insight {
position: relative;
margin-top: 14px;
padding: 13px 14px 13px 38px;
border: 1px solid rgba(100, 207, 255, 0.20);
border-radius: 12px;
color: #b4c8cb;
background: rgba(100, 207, 255, 0.055);
font-size: 0.72rem;
line-height: 1.55;
}
.insight::before {
position: absolute;
top: 14px;
left: 15px;
color: var(--cyan);
content: "↳";
font-size: 1rem;
font-weight: 900;
}
.mirror-note {
margin: 9px 2px 0;
color: #728b91;
font-size: 0.62rem;
line-height: 1.45;
}
.verify-header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 10px;
margin-bottom: 11px;
}
.verify-header h3 {
margin: 0;
color: #dcebec;
font-size: 0.78rem;
}
.proof-badge {
padding: 5px 8px;
border: 1px solid rgba(85, 224, 189, 0.27);
border-radius: 999px;
color: var(--mint);
background: var(--mint-soft);
font-size: 0.57rem;
font-weight: 900;
letter-spacing: 0.06em;
}
.proof-list {
display: grid;
gap: 7px;
}
.proof-row {
display: grid;
grid-template-columns: 25px 1fr auto;
align-items: center;
gap: 9px;
min-height: 47px;
padding: 8px 9px;
border: 1px solid var(--line);
border-radius: 10px;
background: rgba(255, 255, 255, 0.02);
}
.proof-row.flash {
animation: proof-pulse 650ms ease;
}
@keyframes proof-pulse {
0% { border-color: rgba(255, 209, 102, 0.8); transform: translateX(0); }
35% { transform: translateX(3px); }
70% { transform: translateX(-2px); }
100% { transform: translateX(0); }
}
.proof-icon {
display: grid;
width: 23px;
height: 23px;
place-items: center;
border-radius: 50%;
color: #082019;
background: var(--mint);
font-size: 0.7rem;
font-weight: 950;
}
.proof-row[data-pass="false"] .proof-icon {
color: #2a090e;
background: var(--red);
}
.proof-name {
display: block;
color: #d5e4e5;
font-size: 0.68rem;
font-weight: 800;
}
.proof-detail {
display: block;
margin-top: 2px;
color: #7f999e;
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
font-size: 0.57rem;
}
.proof-state {
color: var(--mint);
font-size: 0.56rem;
font-weight: 900;
letter-spacing: 0.07em;
}
.proof-row[data-pass="false"] .proof-state {
color: var(--red);
}
.verify-button {
width: 100%;
min-height: 42px;
margin-top: 10px;
border: 1px solid rgba(85, 224, 189, 0.34);
border-radius: 11px;
color: #c8fff0;
background: linear-gradient(135deg, rgba(85, 224, 189, 0.18), rgba(85, 224, 189, 0.07));
font-size: 0.7rem;
font-weight: 850;
cursor: pointer;
transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}
.verify-button:hover:not(:disabled) {
border-color: rgba(85, 224, 189, 0.68);
transform: translateY(-1px);
}
.verify-button:disabled {
cursor: wait;
opacity: 0.72;
}
.proof-summary {
min-height: 1.4em;
margin: 9px 2px 0;
color: #8ca5aa;
font-size: 0.61rem;
line-height: 1.4;
text-align: center;
}
button:focus-visible {
outline: 2px solid var(--cyan);
outline-offset: 3px;
}
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: 0;
}
@media (max-width: 1080px) {
.workspace {
grid-template-columns: 1fr;
}
.stage {
height: clamp(520px, 67vh, 650px);
}
.control-panel {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 0 24px;
}
.panel-heading,
.metric-grid,
.verify-section {
grid-column: 1 / -1;
}
.control-section {
padding-top: 17px;
}
}
@media (max-width: 700px) {
.app-shell {
width: min(100% - 22px, 1440px);
padding-top: 20px;
}
.topbar {
display: block;
}
.header-facts {
justify-content: flex-start;
margin-top: 17px;
}
.stage-card-head {
align-items: flex-start;
padding: 16px;
}
.topology-pill {
display: grid;
grid-template-columns: auto auto;
gap: 3px 7px;
white-space: normal;
}
.topology-pill i {
display: none;
}
.stage {
height: 500px;
}
.view-chip.right {
display: none;
}
.scene-legend {
right: 12px;
bottom: 12px;
gap: 8px;
padding: 8px;
}
.scene-legend .shared {
padding-left: 7px;
}
.equation-bar {
grid-template-columns: 1fr;
}
.equation + .equation {
border-top: 1px solid var(--line);
border-left: 0;
}
.control-panel {
display: block;
padding: 18px;
}
}
@media (max-width: 430px) {
.metric-grid {
grid-template-columns: 1fr 1fr;
}
.metric-card.side-metric {
grid-column: 1 / -1;
}
.equation {
align-items: flex-start;
flex-direction: column;
gap: 5px;
}
.equation-value {
text-align: left;
}
.scene-legend span:nth-child(2) {
display: none;
}
}
@media (prefers-reduced-motion: reduce) {
*,
*::before,
*::after {
scroll-behavior: auto !important;
animation-duration: 0.001ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.001ms !important;
}
}
</style>
</head>
<body>
<div class="app-shell">
<header class="topbar">
<div>
<div class="eyebrow">Interactive geometry / 03</div>
<h1>Slide the top. <span>Keep the area.</span></h1>
<p class="intro">
A parallelogram can lean left or right without changing its base, perpendicular height, or area.
Watch the outline length respond as the top edge travels.
</p>
</div>
<div class="header-facts" aria-label="Fixed measurements">
<span class="fact-chip"><i></i> base = 4.80 u</span>
<span class="fact-chip"><i></i> height = 2.80 u</span>
</div>
</header>
<main class="workspace">
<section class="stage-card" aria-labelledby="stageTitle">
<div class="stage-card-head">
<div>
<span class="section-kicker">Live model</span>
<h2 id="stageTitle">Parallelogram shear</h2>
</div>
<div class="topology-pill" aria-label="Four boundary vertices and two triangles">
<b>4</b><span>vertices</span><i></i><b>2</b><span>triangles</span>
</div>
</div>
<div
class="stage"
id="stage"
role="img"
aria-label="An orthographic scene showing a parallelogram whose top edge slides horizontally while its base and perpendicular height stay fixed."
aria-describedby="sceneDescription"
>
<div id="canvasHost"></div>
<div class="scene-labels" aria-hidden="true">
<span class="scene-tag area-tag" id="areaTag">A = 13.44 u²</span>
<span class="scene-tag base-tag" id="baseTag">base 4.80 · fixed</span>
<span class="scene-tag height-tag" id="heightTag">height 2.80 · fixed</span>
<span class="scene-tag top-tag" id="topTag">top edge · s = +0.00 u</span>
<span class="vertex-marker" id="vertexA"></span>
<span class="vertex-marker b" id="vertexB"></span>
<span class="vertex-marker c" id="vertexC"></span>
<span class="vertex-marker" id="vertexD"></span>
</div>
<div class="view-chip left"><span class="live-dot"></span> Orthographic view</div>
<div class="view-chip right">One quad · shared edge AC</div>
<div class="scene-legend" aria-hidden="true">
<span><i class="swatch"></i>△ ABC</span>
<span><i class="swatch second"></i>△ ACD</span>
<span class="shared">AC shared</span>
</div>
</div>
<p class="sr-only" id="sceneDescription">
The base endpoints A and B remain fixed. The top endpoints D and C move only horizontally,
remaining at the same perpendicular height. The filled shape is one indexed quadrilateral
made from the non-overlapping triangles ABC and ACD, which share diagonal AC.
</p>
<div class="equation-bar" aria-label="Area and perimeter formulas">
<div class="equation">
<span class="equation-label">Locked area</span>
<span class="equation-value">A = b × h = <strong>13.44 u²</strong></span>
</div>
<div class="equation">
<span class="equation-label">Responsive perimeter</span>
<span class="equation-value">P(s) = 2[b + √(h² + s²)]</span>
</div>
</div>
</section>
<aside class="control-panel" aria-labelledby="controlTitle">
<div class="panel-heading">
<div>
<span class="section-kicker">Control deck</span>
<h2 id="controlTitle">Top-edge position</h2>
</div>
<div>
<span class="status-pill" id="statePill" data-mode="rectangle">Rectangle</span>
<span class="status-detail" id="stateDetail">top edge aligned</span>
</div>
</div>
<div class="metric-grid" aria-live="off">
<div class="metric-card area">
<div class="metric-top">
<span class="metric-name">Area</span>
<span class="metric-badge">Locked</span>
</div>
<strong class="metric-value" id="areaValue">13.44</strong>
<span class="metric-foot">square units · invariant</span>
</div>
<div class="metric-card perimeter">
<div class="metric-top">
<span class="metric-name">Perimeter</span>
<span class="metric-badge">Responds</span>
</div>
<strong class="metric-value" id="perimeterValue">15.20</strong>
<span class="metric-foot" id="perimeterDelta">minimum at rectangle</span>
</div>
<div class="metric-card side-metric">
<div class="metric-top">
<span class="metric-name">Side</span>
<span class="metric-badge">Slants</span>
</div>
<strong class="metric-value" id="sideValue">2.80</strong>
<span class="metric-foot">length of each side</span>
</div>
</div>
<section class="control-section" aria-labelledby="sliderLabel">
<div class="range-heading">
<div>
<label class="control-label" id="sliderLabel" for="shearSlider">Horizontal shear</label>
<span class="control-help">Slide the top edge without moving its height.</span>
</div>
<output class="range-output" id="offsetValue" for="shearSlider">+0.00 u</output>
</div>
<input
id="shearSlider"
type="range"
min="-3"
max="3"
step="0.01"
value="0"
aria-describedby="sliderHelp"
>
<span class="sr-only" id="sliderHelp">Negative values shear the top edge left; positive values shear it right.</span>
<div class="range-ends"><span>← left limit</span><span>right limit →</span></div>
<div class="preset-grid" aria-label="Verification presets">
<button class="preset-button" type="button" data-shear="0" aria-pressed="true">Rectangle</button>
<button class="preset-button" type="button" data-shear="-3" aria-pressed="false">← Left limit</button>
<button class="preset-button" type="button" data-shear="3" aria-pressed="false">Right limit →</button>
</div>
</section>
<section class="control-section" aria-label="Live geometric explanation">
<div class="insight" id="insightText">
The sides are perpendicular, so each side equals the height and the perimeter is at its minimum.
</div>
<p class="mirror-note">
Mirror note: both extreme directions have the same perimeter because side length depends on |s|, not its sign.
</p>
</section>
<section class="control-section verify-section" aria-labelledby="verifyTitle">
<div class="verify-header">
<h3 id="verifyTitle">Three-state verification</h3>
<span class="proof-badge" id="proofBadge">3 / 3 PASS</span>
</div>
<div class="proof-list">
<div class="proof-row" id="proof-rectangle" data-pass="true">
<span class="proof-icon">✓</span>
<div>
<span class="proof-name">Rectangle</span>
<span class="proof-detail" id="proofDetailRectangle">A 13.44 u² · P 15.20 u</span>
</div>
<span class="proof-state">PASS</span>
</div>
<div class="proof-row" id="proof-left" data-pass="true">
<span class="proof-icon">✓</span>
<div>
<span class="proof-name">Extreme left</span>
<span class="proof-detail" id="proofDetailLeft">A 13.44 u² · P 17.81 u</span>
</div>
<span class="proof-state">PASS</span>
</div>
<div class="proof-row" id="proof-right" data-pass="true">
<span class="proof-icon">✓</span>
<div>
<span class="proof-name">Extreme right</span>
<span class="proof-detail" id="proofDetailRight">A 13.44 u² · P 17.81 u</span>
</div>
<span class="proof-state">PASS</span>
</div>
</div>
<button class="verify-button" id="verifyButton" type="button">▶ Run 3-state check</button>
<p class="proof-summary" id="proofSummary" role="status" aria-live="polite">
3 / 3 pass · four boundary vertices, two shared-edge triangles
</p>
</section>
</aside>
</main>
</div>
<script type="module">
import * as THREE from "https://cdnjs.cloudflare.com/ajax/libs/three.js/0.160.0/three.module.min.js";
const $ = (id) => document.getElementById(id);
const BASE = 4.8;
const HEIGHT = 2.8;
const MAX_SHEAR = 3.0;
const AREA = BASE * HEIGHT;
const RECTANGLE_PERIMETER = 2 * (BASE + HEIGHT);
const DIMENSION_X = 5.75;
const EPSILON = 1e-9;
const stage = $("stage");
const canvasHost = $("canvasHost");
const slider = $("shearSlider");
const presetButtons = [...document.querySelectorAll(".preset-button")];
const verifyButton = $("verifyButton");
const reducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
const scene = new THREE.Scene();
const camera = new THREE.OrthographicCamera(-6, 6, 4, -4, 0.1, 100);
camera.position.set(0, 0, 10);
camera.lookAt(0, 0, 0);
const renderer = new THREE.WebGLRenderer({
antialias: true,
alpha: true,
powerPreference: "high-performance"
});
renderer.setClearColor(0x000000, 0);
renderer.outputColorSpace = THREE.SRGBColorSpace;
renderer.domElement.setAttribute("role", "img");
renderer.domElement.setAttribute("aria-label", "Three.js orthographic parallelogram shear scene");
canvasHost.appendChild(renderer.domElement);
const gridMaterial = new THREE.LineBasicMaterial({
color: 0x7eb2bc,
transparent: true,
opacity: 0.105,
depthWrite: false
});
const axisMaterial = new THREE.LineBasicMaterial({
color: 0x8ac5cf,
transparent: true,
opacity: 0.22,
depthWrite: false
});
const gridPositions = [];
for (let x = -12; x <= 12; x += 1) {
gridPositions.push(x, -10, -0.18, x, 10, -0.18);
}
for (let y = -10; y <= 10; y += 1) {
gridPositions.push(-12, y, -0.18, 12, y, -0.18);
}
const gridGeometry = new THREE.BufferGeometry();
gridGeometry.setAttribute("position", new THREE.Float32BufferAttribute(gridPositions, 3));
const grid = new THREE.LineSegments(gridGeometry, gridMaterial);
scene.add(grid);
const axesGeometry = new THREE.BufferGeometry();
axesGeometry.setAttribute("position", new THREE.Float32BufferAttribute([
-12, 0, -0.17, 12, 0, -0.17,
0, -10, -0.17, 0, 10, -0.17
], 3));
scene.add(new THREE.LineSegments(axesGeometry, axisMaterial));
const triangleLowerMaterial = new THREE.MeshBasicMaterial({
color: 0x27bea2,
side: THREE.DoubleSide,
toneMapped: false
});
const triangleUpperMaterial = new THREE.MeshBasicMaterial({
color: 0x55dfbd,
side: THREE.DoubleSide,
toneMapped: false
});
// One indexed planar mesh. A, B, C, D are the only four boundary vertices.
// The six indices form exactly two convex triangles: ABC and ACD.
// Both triangles reuse vertices A and C, so they share diagonal AC.
const shapeGeometry = new THREE.BufferGeometry();
const shapePositions = new THREE.BufferAttribute(new Float32Array(12), 3);
shapePositions.setUsage(THREE.DynamicDrawUsage);
shapeGeometry.setAttribute("position", shapePositions);
shapeGeometry.setIndex([0, 1, 2, 0, 2, 3]);
shapeGeometry.clearGroups();
shapeGeometry.addGroup(0, 3, 0);
shapeGeometry.addGroup(3, 3, 1);
shapeGeometry.userData = {
vertexOrder: ["A", "B", "C", "D"],
triangles: [["A", "B", "C"], ["A", "C", "D"]],
sharedDiagonal: "AC"
};
const shape = new THREE.Mesh(shapeGeometry, [triangleLowerMaterial, triangleUpperMaterial]);
shape.frustumCulled = false;
shape.renderOrder = 2;
scene.add(shape);
const outlineMaterial = new THREE.LineBasicMaterial({
color: 0xc7fff2,
transparent: true,
opacity: 0.92
});
const diagonalMaterial = new THREE.LineBasicMaterial({
color: 0xf0fffc,
transparent: true,
opacity: 0.62
});
const topMaterial = new THREE.LineBasicMaterial({
color: 0xffd166,
transparent: true,
opacity: 1
});
const baseMaterial = new THREE.LineBasicMaterial({
color: 0x64cfff,
transparent: true,
opacity: 1
});
const guideMaterial = new THREE.LineBasicMaterial({
color: 0x64cfff,
transparent: true,
opacity: 0.27,
depthWrite: false
});
const dimensionMaterial = new THREE.LineBasicMaterial({
color: 0x83cce7,
transparent: true,
opacity: 0.72,
depthWrite: false
});
function makeLine(points, material, loop = false, z = 0.03) {
const positions = [];
for (const point of points) {
positions.push(point.x, point.y, point.z ?? z);
}
const geometry = new THREE.BufferGeometry();
const attribute = new THREE.Float32BufferAttribute(positions, 3);
attribute.setUsage(THREE.DynamicDrawUsage);
geometry.setAttribute("position", attribute);
const line = loop ? new THREE.LineLoop(geometry, material) : new THREE.Line(geometry, material);
line.frustumCulled = false;
scene.add(line);
return line;
}
function writeLine(line, points, z = 0.03) {
const attribute = line.geometry.getAttribute("position");
for (let i = 0; i < points.length; i += 1) {
const point = points[i];
attribute.setXYZ(i, point.x, point.y, point.z ?? z);
}
attribute.needsUpdate = true;
}
const outline = makeLine([], outlineMaterial, true, 0.045);
const diagonal = makeLine([], diagonalMaterial, false, 0.05);
const topEdge = makeLine([], topMaterial, false, 0.055);
const baseEdge = makeLine([], baseMaterial, false, 0.055);
const heightGuide = makeLine([], guideMaterial, false, -0.03);
const baseGuide = makeLine([
{ x: BASE / 2, y: 0 },
{ x: DIMENSION_X, y: 0 }
], guideMaterial, false, -0.03);
const dimensionGeometry = new THREE.BufferGeometry();
dimensionGeometry.setAttribute("position", new THREE.Float32BufferAttribute([
-BASE / 2, -0.82, -0.04, BASE / 2, -0.82, -0.04,
-BASE / 2, -0.96, -0.04, -BASE / 2, -0.68, -0.04,
BASE / 2, -0.96, -0.04, BASE / 2, -0.68, -0.04,
DIMENSION_X, 0, -0.04, DIMENSION_X, HEIGHT, -0.04,
DIMENSION_X - 0.13, 0, -0.04, DIMENSION_X + 0.13, 0, -0.04,
DIMENSION_X - 0.13, HEIGHT, -0.04, DIMENSION_X + 0.13, HEIGHT, -0.04
], 3));
const dimensions = new THREE.LineSegments(dimensionGeometry, dimensionMaterial);
dimensions.frustumCulled = false;
scene.add(dimensions);
let displayedShear = 0;
let targetShear = 0;
let viewWidth = 1;
let viewHeight = 1;
let verificationToken = 0;
function clamp(value, minimum, maximum) {
return Math.min(maximum, Math.max(minimum, value));
}
function formatSigned(value) {
const sign = value < -0.0005 ? "−" : "+";
return `${sign}${Math.abs(value).toFixed(2)}`;
}
function verticesFor(shear) {
return {
A: { x: -BASE / 2, y: 0 },
B: { x: BASE / 2, y: 0 },
C: { x: BASE / 2 + shear, y: HEIGHT },
D: { x: -BASE / 2 + shear, y: HEIGHT }
};
}
function distance(a, b) {
return Math.hypot(b.x - a.x, b.y - a.y);
}
function signedTriangleArea(a, b, c) {
return 0.5 * ((b.x - a.x) * (c.y - a.y) - (b.y - a.y) * (c.x - a.x));
}
function computeState(shear) {
const points = verticesFor(shear);
const triangleABC = signedTriangleArea(points.A, points.B, points.C);
const triangleACD = signedTriangleArea(points.A, points.C, points.D);
const perimeter =
distance(points.A, points.B) +
distance(points.B, points.C) +
distance(points.C, points.D) +
distance(points.D, points.A);
return {
points,
triangleABC,
triangleACD,
area: triangleABC + triangleACD,
perimeter,
side: distance(points.B, points.C),
baseLength: distance(points.A, points.B),
topLength: distance(points.D, points.C),
perpendicularHeight: points.C.y - points.A.y
};
}
function updateShape(shear) {
const points = verticesFor(shear);
const ordered = [points.A, points.B, points.C, points.D];
const position = shapeGeometry.getAttribute("position");
for (let i = 0; i < ordered.length; i += 1) {
position.setXYZ(i, ordered[i].x, ordered[i].y, 0);
}
position.needsUpdate = true;
shapeGeometry.computeBoundingBox();
shapeGeometry.computeBoundingSphere();
writeLine(outline, ordered, 0.045);
writeLine(diagonal, [points.A, points.C], 0.05);
writeLine(topEdge, [points.D, points.C], 0.055);
writeLine(baseEdge, [points.A, points.B], 0.055);
writeLine(heightGuide, [points.C, { x: DIMENSION_X, y: HEIGHT }], -0.03);
return points;
}
function updateReadout(shear) {
const state = computeState(shear);
const delta = state.perimeter - RECTANGLE_PERIMETER;
const isRectangle = Math.abs(shear) < 0.005;
const direction = shear < 0 ? "left" : "right";
$("areaValue").textContent = AREA.toFixed(2);
$("perimeterValue").textContent = state.perimeter.toFixed(2);
$("sideValue").textContent = state.side.toFixed(2);
$("perimeterDelta").textContent = Math.abs(delta) < 0.005
? "minimum at rectangle"
: `${delta >= 0 ? "+" : ""}${delta.toFixed(2)} u vs rectangle`;
$("offsetValue").textContent = `${formatSigned(shear)} u`;
const pill = $("statePill");
pill.dataset.mode = isRectangle ? "rectangle" : direction;
pill.textContent = isRectangle ? "Rectangle" : `Sheared ${direction}`;
$("stateDetail").textContent = isRectangle
? "top edge aligned"
: `top edge shifted ${direction}`;
if (isRectangle) {
$("insightText").textContent =
"The sides are perpendicular, so each side equals the height and the perimeter is at its minimum.";
} else {
$("insightText").textContent =
`The top edge is shifted ${Math.abs(shear).toFixed(2)} u ${direction}. Each slanted side grows to ` +
`${state.side.toFixed(2)} u, increasing perimeter by ${delta.toFixed(2)} u. The perpendicular height ` +
`and area remain fixed at ${HEIGHT.toFixed(2)} u and ${AREA.toFixed(2)} u².`;
}
$("topTag").textContent = `top edge · s = ${formatSigned(shear)} u`;
slider.setAttribute(
"aria-valuetext",
isRectangle ? "Rectangle; top edge aligned" : `Top edge shifted ${Math.abs(shear).toFixed(2)} units ${direction}`
);
stage.dataset.shear = shear.toFixed(5);
stage.dataset.targetShear = targetShear.toFixed(5);
stage.dataset.area = state.area.toFixed(5);
stage.dataset.perimeter = state.perimeter.toFixed(5);
stage.dataset.base = BASE.toFixed(5);
stage.dataset.height = HEIGHT.toFixed(5);
stage.dataset.topology = "A-B-C-D;ABC;ACD;shared-AC";
}
const projected = new THREE.Vector3();
function placeAt(element, x, y) {
projected.set(x, y, 0).project(camera);
element.style.left = `${(projected.x * 0.5 + 0.5) * viewWidth}px`;
element.style.top = `${(-projected.y * 0.5 + 0.5) * viewHeight}px`;
}
function updateOverlay(points) {
placeAt($("baseTag"), 0, -1.08);
placeAt($("heightTag"), DIMENSION_X, HEIGHT / 2);
placeAt($("topTag"), displayedShear, HEIGHT + 0.37);
placeAt($("areaTag"), displayedShear / 2, HEIGHT / 2);
placeAt($("vertexA"), points.A.x, points.A.y);
placeAt($("vertexB"), points.B.x, points.B.y);
placeAt($("vertexC"), points.C.x, points.C.y);
placeAt($("vertexD"), points.D.x, points.D.y);
}
function paintRange(value) {
const minimum = Number(slider.min);
const maximum = Number(slider.max);
const percentage = ((value - minimum) / (maximum - minimum)) * 100;
slider.style.setProperty("--pct", `${percentage}%`);
}
function syncPresetUI() {
for (const button of presetButtons) {
const active = Math.abs(targetShear - Number(button.dataset.shear)) < 0.005;
button.setAttribute("aria-pressed", String(active));
}
}
function setTarget(value, syncSlider = true) {
targetShear = clamp(Number(value), -MAX_SHEAR, MAX_SHEAR);
if (syncSlider) {
slider.value = String(targetShear);
}
paintRange(targetShear);
syncPresetUI();
}
function meshContractPasses() {
const indices = Array.from(shapeGeometry.getIndex().array);
const groups = shapeGeometry.groups.map((group) => ({
start: group.start,
count: group.count,
materialIndex: group.materialIndex
}));
return (
shapeGeometry.getAttribute("position").count === 4 &&
indices.join(",") === "0,1,2,0,2,3" &&
groups.length === 2 &&
groups[0].start === 0 && groups[0].count === 3 && groups[0].materialIndex === 0 &&
groups[1].start === 3 && groups[1].count === 3 && groups[1].materialIndex === 1
);
}
function evaluateState(kind, shear) {
const state = computeState(shear);
const fixedBase = Math.abs(state.baseLength - BASE) < EPSILON;
const fixedTop = Math.abs(state.topLength - BASE) < EPSILON;
const fixedHeight = Math.abs(state.perpendicularHeight - HEIGHT) < EPSILON;
const fixedArea = Math.abs(state.area - AREA) < EPSILON;
const nonOverlappingTriangles = state.triangleABC > EPSILON && state.triangleACD > EPSILON;
const triangleAreaMatches = Math.abs(state.triangleABC + state.triangleACD - AREA) < EPSILON;
let stateCondition = false;
if (kind === "rectangle") {
stateCondition =
Math.abs(shear) < EPSILON &&
Math.abs(state.perimeter - RECTANGLE_PERIMETER) < EPSILON &&
Math.abs(state.side - HEIGHT) < EPSILON;
} else if (kind === "left") {
stateCondition =
Math.abs(shear + MAX_SHEAR) < EPSILON &&
state.perimeter > RECTANGLE_PERIMETER + EPSILON &&
state.side > HEIGHT + EPSILON;
} else if (kind === "right") {
stateCondition =
Math.abs(shear - MAX_SHEAR) < EPSILON &&
state.perimeter > RECTANGLE_PERIMETER + EPSILON &&
state.side > HEIGHT + EPSILON;
}
return {
kind,
shear,
area: state.area,
perimeter: state.perimeter,
side: state.side,
triangleABC: state.triangleABC,
triangleACD: state.triangleACD,
pass:
fixedBase &&
fixedTop &&
fixedHeight &&
fixedArea &&
nonOverlappingTriangles &&
triangleAreaMatches &&
stateCondition
};
}
function runAllChecks() {
const rectangle = evaluateState("rectangle", 0);
const left = evaluateState("left", -MAX_SHEAR);
const right = evaluateState("right", MAX_SHEAR);
const meshContract = meshContractPasses();
return {
meshContract,
rectangle,
left,
right,
allPass: meshContract && rectangle.pass && left.pass && right.pass
};
}
function refreshVerification() {
const results = runAllChecks();
$("proofBadge").textContent = results.allPass ? "3 / 3 PASS" : "CHECK FAILED";
$("proofBadge").style.color = results.allPass ? "var(--mint)" : "var(--red)";
const entries = [
["proof-rectangle", "proofDetailRectangle", results.rectangle],
["proof-left", "proofDetailLeft", results.left],
["proof-right", "proofDetailRight", results.right]
];
for (const [rowId, detailId, result] of entries) {
const row = $(rowId);
row.dataset.pass = String(result.pass);
row.querySelector(".proof-state").textContent = result.pass ? "PASS" : "FAIL";
$(detailId).textContent = `A ${result.area.toFixed(2)} u² · P ${result.perimeter.toFixed(2)} u`;
}
$("proofSummary").textContent = results.allPass
? "3 / 3 pass · four boundary vertices, two shared-edge triangles"
: "Verification failed · inspect the mesh contract or measurements";
return results;
}
function cancelVerification() {
verificationToken += 1;
verifyButton.disabled = false;
verifyButton.textContent = "▶ Run 3-state check";
}
function flashProof(rowId) {
const row = $(rowId);
row.classList.remove("flash");
void row.offsetWidth;
row.classList.add("flash");
}
function runVisualVerification() {
cancelVerification();
const token = verificationToken;
const sequence = [
{ kind: "rectangle", shear: 0, label: "rectangle", row: "proof-rectangle" },
{ kind: "left", shear: -MAX_SHEAR, label: "left limit", row: "proof-left" },
{ kind: "right", shear: MAX_SHEAR, label: "right limit", row: "proof-right" }
];
verifyButton.disabled = true;
$("proofSummary").textContent = "Running rectangle and both extreme shear checks…";
sequence.forEach((entry, index) => {
window.setTimeout(() => {
if (token !== verificationToken) return;
setTarget(entry.shear, true);
verifyButton.textContent = `Checking ${entry.label}…`;
flashProof(entry.row);
if (index === sequence.length - 1) {
window.setTimeout(() => {
if (token !== verificationToken) return;
const results = refreshVerification();
verifyButton.disabled = false;
verifyButton.textContent = "▶ Run 3-state check again";
$("proofSummary").textContent = results.allPass
? "Verified: rectangle, extreme left, and extreme right all preserve area."
: "Verification failed · one or more checks did not pass.";
}, 360);
}
}, index * 900);
});
}
slider.addEventListener("input", () => {
cancelVerification();
setTarget(Number(slider.value), false);
});
for (const button of presetButtons) {
button.addEventListener("click", () => {
cancelVerification();
setTarget(Number(button.dataset.shear), true);
});
}
verifyButton.addEventListener("click", runVisualVerification);
function resizeRenderer() {
viewWidth = Math.max(1, stage.clientWidth);
viewHeight = Math.max(1, stage.clientHeight);
const aspect = viewWidth / viewHeight;
const halfHeight = Math.max(3.8, 6.25 / aspect);
camera.left = -halfHeight * aspect;
camera.right = halfHeight * aspect;
camera.top = halfHeight;
camera.bottom = -halfHeight;
camera.updateProjectionMatrix();
camera.updateMatrixWorld();
renderer.setPixelRatio(Math.min(window.devicePixelRatio || 1, 2));
renderer.setSize(viewWidth, viewHeight, false);
}
const resizeObserver = new ResizeObserver(resizeRenderer);
resizeObserver.observe(stage);
window.addEventListener("resize", resizeRenderer);
setTarget(0, true);
resizeRenderer();
updateShape(0);
shapeGeometry.computeVertexNormals();
updateReadout(0);
refreshVerification();
let previousTime = performance.now();
function animate(time) {
const delta = Math.min(0.05, Math.max(0, (time - previousTime) / 1000));
previousTime = time;
if (reducedMotion) {
displayedShear = targetShear;
} else {
const easing = 1 - Math.exp(-12 * delta);
displayedShear += (targetShear - displayedShear) * easing;
if (Math.abs(targetShear - displayedShear) < 0.0005) {
displayedShear = targetShear;
}
}
const points = updateShape(displayedShear);
updateReadout(displayedShear);
renderer.render(scene, camera);
updateOverlay(points);
requestAnimationFrame(animate);
}
requestAnimationFrame(animate);
// A small local API makes the geometry and its verification directly inspectable.
Object.defineProperty(window, "__parallelogramLab", {
configurable: false,
writable: false,
value: Object.freeze({
constants: Object.freeze({
base: BASE,
height: HEIGHT,
maxShear: MAX_SHEAR,
area: AREA,
rectanglePerimeter: RECTANGLE_PERIMETER
}),
topology: Object.freeze({
vertexOrder: Object.freeze(["A", "B", "C", "D"]),
triangles: Object.freeze([
Object.freeze([0, 1, 2]),
Object.freeze([0, 2, 3])
]),
sharedDiagonal: "AC"
}),
getState() {
const state = computeState(displayedShear);
return {
shear: displayedShear,
targetShear,
area: state.area,
perimeter: state.perimeter,
side: state.side,
base: state.baseLength,
height: state.perpendicularHeight,
triangleAreas: [state.triangleABC, state.triangleACD]
};
},
getVertices() {
const points = verticesFor(displayedShear);
return ["A", "B", "C", "D"].map((name) => ({ name, ...points[name] }));
},
verify() {
return runAllChecks();
},
setShear(value, immediate = false) {
cancelVerification();
const clamped = clamp(Number(value), -MAX_SHEAR, MAX_SHEAR);
setTarget(clamped, true);
if (immediate) {
displayedShear = clamped;
updateShape(displayedShear);
updateReadout(displayedShear);
}
return clamped;
}
})
});
</script>
</body>
</html>
```