算法艺术创作
algorithmic-art
通过代码和可调参数创作生成艺术与交互式视觉效果。
constraint-physical【设计与创意】Use this skill when designing structural constraints that prevent invalid actions through the shape, layout, or behavior of the design itself — paths (channels of motion), axes (rotary controls), barriers (blocks). Trigger when designing input controls, drag-and-drop affordances, modal dialogs, or hardware-style structural prevention. Sub-aspect of `…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
constraint; read that first.'Physical constraints prevent invalid actions through the structure of the design — the shape of a connector, the boundary of a screen, the channel of a slider. The user can't take the wrong action because the structure rejects it. Stronger than psychological constraints; not always available.
Channels that direct motion. The user can move along the path; off-path movement is impossible or rejected.
Software examples:
<!-- Path constraint: value must be 0-100 -->
<input type="range" min="0" max="100" value="50" />
<!-- Path constraint: choice from fixed set -->
<select>
<option>Small</option>
<option>Medium</option>
<option>Large</option>
</select>
Rotary controls. Convert applied force into rotation; effectively infinite range in a small space.
Software examples:
Block, slow, or redirect motion.
Software examples:
<input type="email" /> <!-- only accepts email format -->
<input type="number" min="0" /> <!-- only non-negative numbers -->
<input type="date" /> <!-- only valid dates -->
<input type="color" /> <!-- only valid hex colors -->
The browser enforces the constraint; the user can't submit invalid data.
A drag-and-drop interaction can constrain valid drops at the API level:
dropZone.addEventListener('dragover', e => {
if (isValidTarget(draggedItem, dropZone)) {
e.preventDefault(); // allow drop
}
// not preventing default = drop won't fire
});
The browser's drag-and-drop API itself uses constraint: preventDefault opens the channel; absence keeps it blocked.
<dialog open>
<h2>Required action</h2>
<p>You must complete this step before continuing.</p>
<button onclick="proceed()">Continue</button>
</dialog>
The dialog blocks interaction with the page beneath. Use sparingly; barriers irritate when they don't serve a clear purpose.
<button id="submit" disabled>Submit</button>
The button can't trigger its action until enabled. Pair with explanation of what would enable it.
The discipline: constrain real requirements; explain when surprises occur.
constraint (parent).constraint-psychological — the other half; symbols, conventions, mappings.affordance — affordance + constraint = the action space.accessibility-operable — physical constraints must be operable across assistive technologies.