dev #948
@ -147,12 +147,17 @@ export default function CircuitTrestleSetting({ id }) {
|
|||||||
const centerPoints = modules.map((module) => {
|
const centerPoints = modules.map((module) => {
|
||||||
const { x, y } = module.getCenterPoint()
|
const { x, y } = module.getCenterPoint()
|
||||||
const { width, height } = module
|
const { width, height } = module
|
||||||
|
// [RACK-AREA-SPEC 2026-07-02] 면적은 캔버스 측정치(Math.round(width/height)) 대신 모듈 스펙(longAxis×shortAxis)으로 산출.
|
||||||
|
// 측정치는 좌표 반올림으로 같은 모듈도 width 가 73/74 로 갈려 area 가 161 만큼 벌어져(=가짜 크기차) 랙 순서 위반 오판을 유발한다.
|
||||||
|
// 스펙 치수는 배치·회전과 무관해 동일 제품이면 항상 area 동일 → 반올림 잔차 제거. (gap 계산용 width/height 는 그대로 유지)
|
||||||
|
const specLong = Number(module.longAxis ?? module.moduleInfo?.longAxis ?? 0) / 10
|
||||||
|
const specShort = Number(module.shortAxis ?? module.moduleInfo?.shortAxis ?? 0) / 10
|
||||||
return {
|
return {
|
||||||
x,
|
x,
|
||||||
y,
|
y,
|
||||||
width: Math.round(width),
|
width: Math.round(width),
|
||||||
height: Math.round(height),
|
height: Math.round(height),
|
||||||
area: Math.round(width) * Math.round(height),
|
area: specLong * specShort,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@ -1072,8 +1072,14 @@ export function useModule() {
|
|||||||
// 정상 격자(정확히 30/3mm)도 측정 간격이 축소돼 위반 오판 → 모든 방향 이동 차단(회귀) 발생.
|
// 정상 격자(정확히 30/3mm)도 측정 간격이 축소돼 위반 오판 → 모든 방향 이동 차단(회귀) 발생.
|
||||||
const isTooCloseToOtherModules = (module, otherModules, surface) => {
|
const isTooCloseToOtherModules = (module, otherModules, surface) => {
|
||||||
if (!otherModules || otherModules.length === 0) return false
|
if (!otherModules || otherModules.length === 0) return false
|
||||||
const gapVer = Number(surface?.trestleDetail?.moduleIntvlVer ?? 0) / 10 // mm → canvas unit
|
// [PLACE-CLEARANCE-SWAP 2026-07-02] 스냅 배치와 동일하게 flowDirection 으로 縦/横 간격을 캔버스 축에 매핑.
|
||||||
const gapHor = Number(surface?.trestleDetail?.moduleIntvlHor ?? 0) / 10
|
// 東/西 흐름에선 縦(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
|
if (gapVer <= 0 && gapHor <= 0) return false
|
||||||
const EPS = 0.05 // 0.5mm — 좌표 반올림 잔차(±0.02) 흡수, 의미있는 위반은 통과 못함
|
const EPS = 0.05 // 0.5mm — 좌표 반올림 잔차(±0.02) 흡수, 의미있는 위반은 통과 못함
|
||||||
const bboxOf = (o) => {
|
const bboxOf = (o) => {
|
||||||
|
|||||||
@ -303,8 +303,14 @@ export function useModuleBasicSetting(tabNum) {
|
|||||||
// ⚠ 간격은 stroke 를 뺀 실제 정점(getCurrentPoints)으로 잰다. getBoundingRect 는 strokeWidth 팽창 → 정상 격자도 위반 오판.
|
// ⚠ 간격은 stroke 를 뺀 실제 정점(getCurrentPoints)으로 잰다. getBoundingRect 는 strokeWidth 팽창 → 정상 격자도 위반 오판.
|
||||||
const isTooCloseToOtherModules = (module, otherModules, surface) => {
|
const isTooCloseToOtherModules = (module, otherModules, surface) => {
|
||||||
if (!otherModules || otherModules.length === 0) return false
|
if (!otherModules || otherModules.length === 0) return false
|
||||||
const gapVer = Number(surface?.trestleDetail?.moduleIntvlVer ?? 0) / 10 // mm → canvas unit
|
// [PLACE-CLEARANCE-SWAP 2026-07-02] 스냅 배치(:824-831)와 동일하게 flowDirection 으로 縦/横 간격을 캔버스 축에 매핑.
|
||||||
const gapHor = Number(surface?.trestleDetail?.moduleIntvlHor ?? 0) / 10
|
// 東/西 흐름에선 縦(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
|
if (gapVer <= 0 && gapHor <= 0) return false
|
||||||
const EPS = 0.05 // 0.5mm — 좌표 반올림 잔차(±0.02) 흡수
|
const EPS = 0.05 // 0.5mm — 좌표 반올림 잔차(±0.02) 흡수
|
||||||
const bboxOf = (o) => {
|
const bboxOf = (o) => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user