[2332] 東/西 흐름 手動배치·이동 게이트 縦/横 간격 축 스왑 누락 수정

작업내용 :
- isTooCloseToOtherModules(배치·이동 게이트)가 flowDirection 에 무관하게
  항상 moduleIntvlVer=세로간격, moduleIntvlHor=가로간격으로 고정해
  東/西 흐름 설치면에서 스냅이 横(3mm)으로 붙인 정상 배치를
  縦(7mm) 기준으로 오판 거부하던 버그 수정
- 스냅 배치 로직(:824-831)과 동일하게 direction east/west 일 때
  gapVer=moduleIntvlHor, gapHor=moduleIntvlVer 로 스왑 적용
- useModuleBasicSetting.js(手動배치), useModule.js(이동) 동기 수정
This commit is contained in:
ysCha 2026-07-02 17:48:56 +09:00
parent d12a4a2e34
commit 5f316195e0
2 changed files with 16 additions and 4 deletions

View File

@ -1072,8 +1072,14 @@ export function useModule() {
// 정상 격자(정확히 30/3mm)도 측정 간격이 축소돼 위반 오판 → 모든 방향 이동 차단(회귀) 발생.
const isTooCloseToOtherModules = (module, otherModules, surface) => {
if (!otherModules || otherModules.length === 0) return false
const gapVer = Number(surface?.trestleDetail?.moduleIntvlVer ?? 0) / 10 // mm → canvas unit
const gapHor = Number(surface?.trestleDetail?.moduleIntvlHor ?? 0) / 10
// [PLACE-CLEARANCE-SWAP 2026-07-02] 스냅 배치와 동일하게 flowDirection 으로 縦/横 간격을 캔버스 축에 매핑.
// 東/西 흐름에선 縦(moduleIntvlVer)이 캔버스 x축, 横(moduleIntvlHor)이 캔버스 y축이라 축이 뒤바뀐다.
// 스왑 없이 세로(캔버스 y) 적재에 항상 moduleIntvlVer 를 요구하면, 스냅이 moduleIntvlHor 로 붙인 정상 배치를 오판 거부한다.
const isEastWest = surface?.direction === 'east' || surface?.direction === 'west'
const intvlVerMm = Number(surface?.trestleDetail?.moduleIntvlVer ?? 0)
const intvlHorMm = Number(surface?.trestleDetail?.moduleIntvlHor ?? 0)
const gapVer = (isEastWest ? intvlHorMm : intvlVerMm) / 10 // 세로(캔버스 y) 적재 요구 간격
const gapHor = (isEastWest ? intvlVerMm : intvlHorMm) / 10 // 가로(캔버스 x) 적재 요구 간격
if (gapVer <= 0 && gapHor <= 0) return false
const EPS = 0.05 // 0.5mm — 좌표 반올림 잔차(±0.02) 흡수, 의미있는 위반은 통과 못함
const bboxOf = (o) => {

View File

@ -303,8 +303,14 @@ export function useModuleBasicSetting(tabNum) {
// ⚠ 간격은 stroke 를 뺀 실제 정점(getCurrentPoints)으로 잰다. getBoundingRect 는 strokeWidth 팽창 → 정상 격자도 위반 오판.
const isTooCloseToOtherModules = (module, otherModules, surface) => {
if (!otherModules || otherModules.length === 0) return false
const gapVer = Number(surface?.trestleDetail?.moduleIntvlVer ?? 0) / 10 // mm → canvas unit
const gapHor = Number(surface?.trestleDetail?.moduleIntvlHor ?? 0) / 10
// [PLACE-CLEARANCE-SWAP 2026-07-02] 스냅 배치(:824-831)와 동일하게 flowDirection 으로 縦/横 간격을 캔버스 축에 매핑.
// 東/西 흐름에선 縦(moduleIntvlVer)이 캔버스 x축, 横(moduleIntvlHor)이 캔버스 y축이라 축이 뒤바뀐다.
// 스왑 없이 세로(캔버스 y) 적재에 항상 moduleIntvlVer 를 요구하면, 스냅이 moduleIntvlHor 로 붙인 정상 배치를 오판 거부한다.
const isEastWest = surface?.direction === 'east' || surface?.direction === 'west'
const intvlVerMm = Number(surface?.trestleDetail?.moduleIntvlVer ?? 0)
const intvlHorMm = Number(surface?.trestleDetail?.moduleIntvlHor ?? 0)
const gapVer = (isEastWest ? intvlHorMm : intvlVerMm) / 10 // 세로(캔버스 y) 적재 요구 간격
const gapHor = (isEastWest ? intvlVerMm : intvlHorMm) / 10 // 가로(캔버스 x) 적재 요구 간격
if (gapVer <= 0 && gapHor <= 0) return false
const EPS = 0.05 // 0.5mm — 좌표 반올림 잔차(±0.02) 흡수
const bboxOf = (o) => {