fix: make circular and spiral presets truthful
This commit is contained in:
@@ -38,7 +38,8 @@ const requiredIds = [
|
||||
"array-builder-split-handle", "array-input", "export-button", "array-id",
|
||||
"array-name", "array-description", "aperture-width", "aperture-height",
|
||||
"aperture-shape", "preset-type", "preset-count", "preset-columns",
|
||||
"preset-rows", "preset-seed", "preset-minimum-spacing",
|
||||
"preset-rows", "preset-turns", "preset-seed", "preset-minimum-spacing",
|
||||
"preset-hint",
|
||||
"generate-preset-button", "array-canvas", "select-tool-button",
|
||||
"add-tool-button", "array-view-2d-button", "array-view-3d-button",
|
||||
"canvas-front-badge", "fit-view-button", "zoom-in-button", "zoom-out-button",
|
||||
@@ -1129,6 +1130,7 @@ function syncPresetControls() {
|
||||
const grid = type === "grid";
|
||||
const random = type === "random";
|
||||
const linear = type === "linear";
|
||||
const archimedean = type === "archimedean";
|
||||
for (const element of [elements["preset-columns"], elements["preset-rows"]]) {
|
||||
element.closest(".field")?.toggleAttribute("hidden", !grid);
|
||||
}
|
||||
@@ -1136,6 +1138,16 @@ function syncPresetControls() {
|
||||
elements["preset-seed"].closest(".field")?.toggleAttribute("hidden", !random);
|
||||
elements["preset-minimum-spacing"].closest(".field")?.toggleAttribute("hidden", !random);
|
||||
elements["preset-axis"]?.closest(".field")?.toggleAttribute("hidden", !linear);
|
||||
elements["preset-turns"].closest(".field")?.toggleAttribute("hidden", !archimedean);
|
||||
const hints = {
|
||||
grid: "격자는 아래에서 위로, 각 행은 왼쪽에서 오른쪽 순서로 채널을 만듭니다.",
|
||||
linear: "선택한 x/y 축 위에 마이크를 같은 간격으로 놓습니다.",
|
||||
ring: "짧은 유효 반지름에 맞춘 실제 내접원 위에 같은 각도 간격으로 놓습니다.",
|
||||
archimedean: "r∝θ인 한 줄 나선입니다. 회전 수를 늘리면 같은 반경 안에서 더 많이 감깁니다.",
|
||||
spiral: "golden angle과 r∝√n을 쓰는 면적 균등 Fermat 배열입니다. 점만 보면 해바라기형으로 보입니다.",
|
||||
random: "seed로 재현되는 균일 랜덤 좌표를 요청한 최소 간격으로 생성합니다.",
|
||||
};
|
||||
elements["preset-hint"].textContent = hints[type] ?? hints.grid;
|
||||
}
|
||||
|
||||
function syncHistoryButtons() {
|
||||
@@ -1277,6 +1289,12 @@ function presetOptions() {
|
||||
options.count = integerInput(elements["preset-count"], "마이크 수", 1, 1024);
|
||||
}
|
||||
if (type === "linear") options.axis = elements["preset-axis"]?.value ?? "x";
|
||||
if (type === "archimedean") {
|
||||
options.turns = finiteInput(elements["preset-turns"], "나선 회전 수", {
|
||||
minimum: 0.25,
|
||||
maximum: 32,
|
||||
});
|
||||
}
|
||||
if (type === "random") {
|
||||
options.seed = integerInput(elements["preset-seed"], "Seed", -2147483648, 4294967295);
|
||||
options.minimumSpacingM = finiteInput(
|
||||
|
||||
Reference in New Issue
Block a user