복잡한 지붕면 대응
This commit is contained in:
parent
e1e6be28d1
commit
a13c4c4ac6
@ -1505,17 +1505,19 @@ export const usePolygon = () => {
|
|||||||
return Math.abs(line.startPoint.x - line.endPoint.x) > 2 || Math.abs(line.startPoint.y - line.endPoint.y) > 2
|
return Math.abs(line.startPoint.x - line.endPoint.x) > 2 || Math.abs(line.startPoint.y - line.endPoint.y) > 2
|
||||||
})
|
})
|
||||||
|
|
||||||
// [SUPERSEDED-EAVES 2026-06-15] 처마선을 바깥으로 옮겨 처마(연·軒)를 만들면, 옮긴 처마와 양끝 연결선
|
// [SUPERSEDED-EAVES 2026-06-15] 외곽선(처마/케라바)을 바깥으로 옮겨 처마(연·軒)를 만들면, 옮긴 선과 양끝
|
||||||
// (모두 auxiliaryLine)·원래 처마선(eaves)이 닫힌 "띠 사각형"을 이룬다. 이때 원래 처마선이 면분할
|
// 연결선(모두 auxiliaryLine)·원래 외곽선(eaves/gable)이 닫힌 "띠 사각형"을 이룬다. 이때 원래 외곽선이
|
||||||
// 입력에 남아 있으면 바깥 면을 [띠 + 사다리꼴]로 갈라, 사다리꼴을 닫는 시작선이 사라져 면이 통째로
|
// 면분할 입력에 남아 있으면 바깥 면을 [띠 + 사다리꼴]로 갈라, 사다리꼴을 닫는 시작선이 사라져 면이 통째로
|
||||||
// 누락된다(GETSPLIT-IO 진단: 위 사다리꼴 미생성). 원래 처마선은 이미 면 내부의 가상선이므로 면분할
|
// 누락된다(GETSPLIT-IO 진단). 원래 외곽선은 이미 면 내부의 가상선이므로 면분할 입력에서 제외 → 띠+사다리꼴이
|
||||||
// 입력에서 제외 → 띠+사다리꼴이 하나의 면(예: 6각형)으로 병합된다. 띠 패턴이 없으면 아무 영향 없음.
|
// 하나의 면(예: 6각형)으로 병합된다. 띠 패턴(양끝 연결선 + 평행 닫힘선)이 없으면 아무 영향 없음.
|
||||||
|
// [2026-06-16] eaves 뿐 아니라 gable 외곽선도 동일 처리 — 아래변(gable)을 옮긴 L자형 사례 대응.
|
||||||
const auxBandLines = allLines.filter((l) => l.name === 'auxiliaryLine')
|
const auxBandLines = allLines.filter((l) => l.name === 'auxiliaryLine')
|
||||||
if (auxBandLines.length > 0) {
|
if (auxBandLines.length > 0) {
|
||||||
const sharesPt = (l, p) => isSamePoint(l.startPoint, p) || isSamePoint(l.endPoint, p)
|
const sharesPt = (l, p) => isSamePoint(l.startPoint, p) || isSamePoint(l.endPoint, p)
|
||||||
const otherEnd = (l, p) => (isSamePoint(l.startPoint, p) ? l.endPoint : l.startPoint)
|
const otherEnd = (l, p) => (isSamePoint(l.startPoint, p) ? l.endPoint : l.startPoint)
|
||||||
const supersededEaves = allLines.filter((E) => {
|
const supersededEaves = allLines.filter((E) => {
|
||||||
if (E.attributes?.type !== 'eaves') return false
|
const type = E.attributes?.type
|
||||||
|
if (type !== 'eaves' && type !== 'gable') return false
|
||||||
const A = E.startPoint
|
const A = E.startPoint
|
||||||
const B = E.endPoint
|
const B = E.endPoint
|
||||||
// A·B 각각에서 바깥으로 뻗는 연결 보조선(한쪽 끝점만 공유)
|
// A·B 각각에서 바깥으로 뻗는 연결 보조선(한쪽 끝점만 공유)
|
||||||
@ -1528,7 +1530,7 @@ export const usePolygon = () => {
|
|||||||
return auxBandLines.some((c) => c !== CA && c !== CB && sharesPt(c, Ao) && sharesPt(c, Bo))
|
return auxBandLines.some((c) => c !== CA && c !== CB && sharesPt(c, Ao) && sharesPt(c, Bo))
|
||||||
})
|
})
|
||||||
if (supersededEaves.length > 0) {
|
if (supersededEaves.length > 0) {
|
||||||
logger.log(`[SUPERSEDED-EAVES] 띠로 대체된 원래 처마선 ${supersededEaves.length}개 면분할 입력에서 제외`)
|
logger.log(`[SUPERSEDED-EAVES] 띠로 대체된 원래 외곽선(처마/케라바) ${supersededEaves.length}개 면분할 입력에서 제외`)
|
||||||
allLines = allLines.filter((l) => !supersededEaves.includes(l))
|
allLines = allLines.filter((l) => !supersededEaves.includes(l))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user