Compare commits
No commits in common. "76e508869c6fffb2a1bab5d77686ef87b43d06c2" and "e04ff156d6f76ad5ed9f6a2b5f25da25230e471f" have entirely different histories.
76e508869c
...
e04ff156d6
@ -1046,33 +1046,6 @@ export default function StuffDetail() {
|
|||||||
form.setValue('otherSaleStoreId', info.saleStoreId)
|
form.setValue('otherSaleStoreId', info.saleStoreId)
|
||||||
form.setValue('otherSaleStoreName', info.saleStoreName)
|
form.setValue('otherSaleStoreName', info.saleStoreName)
|
||||||
form.setValue('otherSaleStoreLevel', info.saleStoreLevel)
|
form.setValue('otherSaleStoreLevel', info.saleStoreLevel)
|
||||||
get({ url: `/api/object/saleStore/${info.saleStoreId}/firstAgent` }).then((res) => {
|
|
||||||
if (res?.firstAgentId) {
|
|
||||||
const firstAgent = { saleStoreId: res.firstAgentId, saleStoreName: res.firstAgentName }
|
|
||||||
setSaleStoreList((prev) => {
|
|
||||||
const exists = prev.some((s) => s.saleStoreId === res.firstAgentId)
|
|
||||||
return exists ? prev : [...prev, firstAgent]
|
|
||||||
})
|
|
||||||
setShowSaleStoreList((prev) => {
|
|
||||||
const exists = prev.some((s) => s.saleStoreId === res.firstAgentId)
|
|
||||||
return exists ? prev : [...prev, firstAgent]
|
|
||||||
})
|
|
||||||
setSelOptions(res.firstAgentId)
|
|
||||||
form.setValue('saleStoreId', res.firstAgentId)
|
|
||||||
form.setValue('saleStoreName', res.firstAgentName)
|
|
||||||
form.setValue('saleStoreLevel', '1')
|
|
||||||
} else {
|
|
||||||
setSelOptions('')
|
|
||||||
form.setValue('saleStoreId', '')
|
|
||||||
form.setValue('saleStoreName', '')
|
|
||||||
form.setValue('saleStoreLevel', '')
|
|
||||||
}
|
|
||||||
}).catch(() => {
|
|
||||||
setSelOptions('')
|
|
||||||
form.setValue('saleStoreId', '')
|
|
||||||
form.setValue('saleStoreName', '')
|
|
||||||
form.setValue('saleStoreLevel', '')
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -11,7 +11,7 @@ import { isObjectNotEmpty, queryStringFormatter } from '@/util/common-utils'
|
|||||||
import QPagination from '@/components/common/pagination/QPagination'
|
import QPagination from '@/components/common/pagination/QPagination'
|
||||||
import { useSwal } from '@/hooks/useSwal'
|
import { useSwal } from '@/hooks/useSwal'
|
||||||
import { QcastContext } from '@/app/QcastProvider'
|
import { QcastContext } from '@/app/QcastProvider'
|
||||||
import { sanitizeDecimalInputEvent, sanitizeIntegerInputEvent } from '@/util/input-utils'
|
import { sanitizeDecimalInputEvent } from '@/util/input-utils'
|
||||||
|
|
||||||
export default function PlanRequestPop(props) {
|
export default function PlanRequestPop(props) {
|
||||||
const [pageNo, setPageNo] = useState(1) //현재 페이지 번호
|
const [pageNo, setPageNo] = useState(1) //현재 페이지 번호
|
||||||
@ -212,7 +212,6 @@ export default function PlanRequestPop(props) {
|
|||||||
//설계의뢰 그리드에서 선택한 설계의뢰 정보
|
//설계의뢰 그리드에서 선택한 설계의뢰 정보
|
||||||
const getSelectedRowdata = (data) => {
|
const getSelectedRowdata = (data) => {
|
||||||
if (isNotEmptyArray(data)) {
|
if (isNotEmptyArray(data)) {
|
||||||
console.log('planReqObject fields:', data[0])
|
|
||||||
setPlanReqObject(data[0])
|
setPlanReqObject(data[0])
|
||||||
} else {
|
} else {
|
||||||
setPlanReqObject({})
|
setPlanReqObject({})
|
||||||
|
|||||||
@ -991,7 +991,7 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
|
|||||||
newPStart.y = wallBaseLine.y1
|
newPStart.y = wallBaseLine.y1
|
||||||
|
|
||||||
findPoints.push({ x: ePoint.x, y: ePoint.y, position: 'left_in_start' })
|
findPoints.push({ x: ePoint.x, y: ePoint.y, position: 'left_in_start' })
|
||||||
let newPointX = Big(roofLine.x1).plus(moveDist).abs().toNumber()
|
const newPointX = Big(roofLine.x1).plus(moveDist).abs().toNumber()
|
||||||
const pDist = Big(wallLine.x1).minus(roofLine.x1).toNumber()
|
const pDist = Big(wallLine.x1).minus(roofLine.x1).toNumber()
|
||||||
const pLineY = Big(roofLine.y1).minus(0).abs().toNumber()
|
const pLineY = Big(roofLine.y1).minus(0).abs().toNumber()
|
||||||
// let idx = 0 > index - 1 ? sortRoofLines.length : index
|
// let idx = 0 > index - 1 ? sortRoofLines.length : index
|
||||||
@ -1005,14 +1005,8 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
|
|||||||
// getAddLine({ x: roofLine.x2, y: roofLine.y2 }, { x: newPointX, y: roofLine.y2 }, 'orange')
|
// getAddLine({ x: roofLine.x2, y: roofLine.y2 }, { x: newPointX, y: roofLine.y2 }, 'orange')
|
||||||
|
|
||||||
if (Math.abs(wallBaseLine.y1 - wallLine.y1) < 0.1) {
|
if (Math.abs(wallBaseLine.y1 - wallLine.y1) < 0.1) {
|
||||||
// Validate: newPointX should not cross over pLineX (adjacent line)
|
getAddLine({ x: pLineX, y: pLineY }, { x: newPointX, y: pLineY }, 'green')
|
||||||
if (newPointX > pLineX) {
|
getAddLine({ x: newPointX, y: pLineY }, { x: ePoint.x, y: ePoint.y }, 'pink')
|
||||||
console.warn('⚠️ [LEFT_IN_START] Line crossing detected! newPointX:', newPointX, 'exceeds pLineX:', pLineX, '| Clamping to prevent overlap')
|
|
||||||
newPointX = pLineX
|
|
||||||
} else {
|
|
||||||
getAddLine({ x: pLineX, y: pLineY }, { x: newPointX, y: pLineY }, 'green')
|
|
||||||
getAddLine({ x: newPointX, y: pLineY }, { x: ePoint.x, y: ePoint.y }, 'pink')
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getAddLine(newPStart, newPEnd, 'red')
|
getAddLine(newPStart, newPEnd, 'red')
|
||||||
@ -1028,7 +1022,7 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
|
|||||||
newPEnd.y = wallBaseLine.y2
|
newPEnd.y = wallBaseLine.y2
|
||||||
|
|
||||||
findPoints.push({ x: ePoint.x, y: ePoint.y, position: 'left_in_end' })
|
findPoints.push({ x: ePoint.x, y: ePoint.y, position: 'left_in_end' })
|
||||||
let newPointX = Big(roofLine.x1).plus(moveDist).toNumber()
|
const newPointX = Big(roofLine.x1).plus(moveDist).toNumber()
|
||||||
const pDist = Big(wallLine.x1).minus(roofLine.x1).abs().toNumber()
|
const pDist = Big(wallLine.x1).minus(roofLine.x1).abs().toNumber()
|
||||||
const pLineY = Big(roofLine.y2).minus(0).toNumber()
|
const pLineY = Big(roofLine.y2).minus(0).toNumber()
|
||||||
// let idx = sortRoofLines.length < index + 1 ? 0 : index
|
// let idx = sortRoofLines.length < index + 1 ? 0 : index
|
||||||
@ -1042,84 +1036,14 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
|
|||||||
// getAddLine({ x: roofLine.x1, y: roofLine.y1 }, { x: newPointX, y: roofLine.y1 }, 'orange')
|
// getAddLine({ x: roofLine.x1, y: roofLine.y1 }, { x: newPointX, y: roofLine.y1 }, 'orange')
|
||||||
|
|
||||||
if (Math.abs(wallBaseLine.y2 - wallLine.y2) < 0.1) {
|
if (Math.abs(wallBaseLine.y2 - wallLine.y2) < 0.1) {
|
||||||
// Validate: newPointX should not cross over pLineX (adjacent line)
|
getAddLine({ x: pLineX, y: pLineY }, { x: newPointX, y: pLineY }, 'green')
|
||||||
if (newPointX > pLineX) {
|
getAddLine({ x: newPointX, y: pLineY }, { x: ePoint.x, y: ePoint.y }, 'pink')
|
||||||
console.warn('⚠️ [LEFT_IN_END] Line crossing detected! newPointX:', newPointX, 'exceeds pLineX:', pLineX, '| Clamping to prevent overlap')
|
|
||||||
newPointX = pLineX
|
|
||||||
} else {
|
|
||||||
getAddLine({ x: pLineX, y: pLineY }, { x: newPointX, y: pLineY }, 'green')
|
|
||||||
getAddLine({ x: newPointX, y: pLineY }, { x: ePoint.x, y: ePoint.y }, 'pink')
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
//getAddLine({ x: roofLine.x2, y: roofLine.y2 }, { x: newPointX, y: roofLine.y2 }, 'orange')
|
//getAddLine({ x: roofLine.x2, y: roofLine.y2 }, { x: newPointX, y: roofLine.y2 }, 'orange')
|
||||||
getAddLine(newPStart, newPEnd, 'red')
|
getAddLine(newPStart, newPEnd, 'red')
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!isStartEnd.start && !isStartEnd.end){
|
|
||||||
console.log('left_in::::isStartEnd:::::', isStartEnd)
|
|
||||||
const moveDistY1 = Big(roofLine.y1).minus(wallBaseLine.y1).abs().toNumber()
|
|
||||||
const moveDistX1 = Big(roofLine.x1).minus(wallBaseLine.x1).abs().toNumber()
|
|
||||||
const moveDistX2 = Big(roofLine.x2).minus(wallBaseLine.x2).abs().toNumber()
|
|
||||||
const moveDistY2 = Big(roofLine.y2).minus(wallBaseLine.y2).abs().toNumber()
|
|
||||||
|
|
||||||
const sPoint = { x: wallBaseLine.x1, y: wallBaseLine.y1 }
|
|
||||||
const ePoint = { x: wallBaseLine.x2, y: wallBaseLine.y2 }
|
|
||||||
|
|
||||||
|
|
||||||
if(moveDistY1 > 0) {
|
|
||||||
findPoints.push({ x: sPoint.x, y: sPoint.y, position: 'left_in_start' })
|
|
||||||
|
|
||||||
if(moveDistY1 > moveDistX1){
|
|
||||||
const dist = moveDistY1 - moveDistX1
|
|
||||||
// console.log('Creating extensionLine (Y1 > X1):', { sPoint, roofLine, dist, roofId })
|
|
||||||
const createdLine = getAddLine({ x: sPoint.x, y: sPoint.y }, { x: roofLine.x1, y: roofLine.y1 + dist }, 'orange','extensionLine')
|
|
||||||
console.log('extensionLine created - length:', createdLine.length, 'coords:', { x1: createdLine.x1, y1: createdLine.y1, x2: createdLine.x2, y2: createdLine.y2 })
|
|
||||||
createdLine.set({ name: LINE_TYPE.SUBLINE.HIP, lineName: LINE_TYPE.SUBLINE.HIP, stroke: '#1083E3', strokeWidth: 2 })
|
|
||||||
createdLine.attributes = { ...createdLine.attributes, type: LINE_TYPE.SUBLINE.HIP }
|
|
||||||
innerLines.push(createdLine)
|
|
||||||
|
|
||||||
}else{
|
|
||||||
const dist = moveDistX1 - moveDistY1
|
|
||||||
// console.log('Creating extensionLine (X1 > Y1):', { sPoint, roofLine, dist, roofId })
|
|
||||||
const createdLine = getAddLine({ x: sPoint.x, y: sPoint.y }, { x: roofLine.x1 + dist, y: roofLine.y1 }, 'orange','extensionLine')
|
|
||||||
console.log('extensionLine created - length:', createdLine.length, 'coords:', { x1: createdLine.x1, y1: createdLine.y1, x2: createdLine.x2, y2: createdLine.y2 })
|
|
||||||
createdLine.set({ name: LINE_TYPE.SUBLINE.HIP, lineName: LINE_TYPE.SUBLINE.HIP, stroke: '#1083E3', strokeWidth: 2 })
|
|
||||||
createdLine.attributes = { ...createdLine.attributes, type: LINE_TYPE.SUBLINE.HIP }
|
|
||||||
innerLines.push(createdLine)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
if(moveDistY2 > 0) {
|
|
||||||
findPoints.push({ x: ePoint.x, y: ePoint.y, position: 'left_in_end' })
|
|
||||||
|
|
||||||
if(moveDistY2 > moveDistX2){
|
|
||||||
const dist = moveDistY2 - moveDistX2
|
|
||||||
// getAddLine({ x: roofLine.x2, y: roofLine.y2 }, { x: roofLine.x2, y: roofLine.y2 - dist }, 'red')
|
|
||||||
// console.log('Creating extensionLine (Y2 > X2):', { ePoint, roofLine, dist, roofId })
|
|
||||||
const createdLine = getAddLine({ x: ePoint.x, y: ePoint.y }, { x: roofLine.x2, y: roofLine.y2 - dist }, 'orange', 'extensionLine')
|
|
||||||
console.log('extensionLine created1 - length:', createdLine.length, 'coords:', { x1: createdLine.x1, y1: createdLine.y1, x2: createdLine.x2, y2: createdLine.y2 })
|
|
||||||
createdLine.set({ name: LINE_TYPE.SUBLINE.HIP, lineName: LINE_TYPE.SUBLINE.HIP, stroke: '#1083E3', strokeWidth: 2 })
|
|
||||||
createdLine.attributes = { ...createdLine.attributes, type: LINE_TYPE.SUBLINE.HIP }
|
|
||||||
innerLines.push(createdLine)
|
|
||||||
|
|
||||||
}else{
|
|
||||||
const dist = moveDistX2 - moveDistY2
|
|
||||||
// getAddLine({ x: roofLine.x2, y: roofLine.y2 }, { x: roofLine.x2 - dist, y: roofLine.y2 }, 'red')
|
|
||||||
// console.log('Creating extensionLine (X2 > Y2):', { ePoint, roofLine, dist, roofId })
|
|
||||||
const createdLine = getAddLine({ x: ePoint.x, y: ePoint.y }, { x: roofLine.x2 + dist, y: roofLine.y2 }, 'orange', 'extensionLine')
|
|
||||||
console.log('extensionLine created2 - length:', createdLine.length, 'coords:', { x1: createdLine.x1, y1: createdLine.y1, x2: createdLine.x2, y2: createdLine.y2 })
|
|
||||||
createdLine.set({ name: LINE_TYPE.SUBLINE.HIP, lineName: LINE_TYPE.SUBLINE.HIP, stroke: '#1083E3', strokeWidth: 2 })
|
|
||||||
createdLine.attributes = { ...createdLine.attributes, type: LINE_TYPE.SUBLINE.HIP }
|
|
||||||
innerLines.push(createdLine)
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
} else if (condition === 'left_out') {
|
} else if (condition === 'left_out') {
|
||||||
console.log('left_out::::isStartEnd:::::', isStartEnd)
|
console.log('left_out::::isStartEnd:::::', isStartEnd)
|
||||||
|
|
||||||
if (isStartEnd.start) {
|
if (isStartEnd.start) {
|
||||||
const moveDist = Big(wallLine.x1).minus(wallBaseLine.x1).abs().toNumber()
|
const moveDist = Big(wallLine.x1).minus(wallBaseLine.x1).abs().toNumber()
|
||||||
const aStartY = Big(roofLine.y1).minus(moveDist).abs().toNumber()
|
const aStartY = Big(roofLine.y1).minus(moveDist).abs().toNumber()
|
||||||
@ -1179,7 +1103,7 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isStartEnd.end) {
|
if (isStartEnd.end) {
|
||||||
console.log('left_out::::isStartEnd:::::', isStartEnd)
|
console.log('left_in::::isStartEnd:::::', isStartEnd)
|
||||||
const moveDist = Big(wallLine.x1).minus(wallBaseLine.x1).abs().toNumber()
|
const moveDist = Big(wallLine.x1).minus(wallBaseLine.x1).abs().toNumber()
|
||||||
const aStartY = Big(roofLine.y2).plus(moveDist).toNumber()
|
const aStartY = Big(roofLine.y2).plus(moveDist).toNumber()
|
||||||
const bStartY = Big(wallLine.y2).plus(moveDist).toNumber()
|
const bStartY = Big(wallLine.y2).plus(moveDist).toNumber()
|
||||||
@ -1239,9 +1163,7 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
|
|||||||
findPoints.push({ y: newPStart.y, x: newPEnd.x, position: 'left_out_end' })
|
findPoints.push({ y: newPStart.y, x: newPEnd.x, position: 'left_out_end' })
|
||||||
getAddLine(newPStart, newPEnd, 'red')
|
getAddLine(newPStart, newPEnd, 'red')
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (condition === 'right_in') {
|
} else if (condition === 'right_in') {
|
||||||
|
|
||||||
if (isStartEnd.start) {
|
if (isStartEnd.start) {
|
||||||
console.log('right_in::::isStartEnd:::::', isStartEnd)
|
console.log('right_in::::isStartEnd:::::', isStartEnd)
|
||||||
newPEnd.y = roofLine.y2
|
newPEnd.y = roofLine.y2
|
||||||
@ -1252,7 +1174,7 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
|
|||||||
newPStart.y = wallBaseLine.y1
|
newPStart.y = wallBaseLine.y1
|
||||||
|
|
||||||
findPoints.push({ x: ePoint.x, y: ePoint.y, position: 'right_in_start' })
|
findPoints.push({ x: ePoint.x, y: ePoint.y, position: 'right_in_start' })
|
||||||
let newPointX = Big(roofLine.x1).minus(moveDist).abs().toNumber()
|
const newPointX = Big(roofLine.x1).minus(moveDist).abs().toNumber()
|
||||||
const pDist = Big(wallLine.x1).minus(roofLine.x1).abs().toNumber()
|
const pDist = Big(wallLine.x1).minus(roofLine.x1).abs().toNumber()
|
||||||
const pLineY = Big(roofLine.y1).minus(0).abs().toNumber()
|
const pLineY = Big(roofLine.y1).minus(0).abs().toNumber()
|
||||||
// let idx = 0 >= index - 1 ? sortRoofLines.length : index
|
// let idx = 0 >= index - 1 ? sortRoofLines.length : index
|
||||||
@ -1266,14 +1188,8 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
|
|||||||
//getAddLine({ x: roofLine.x2, y: roofLine.y2 }, { x: newPointX, y: roofLine.y2 }, 'orange')
|
//getAddLine({ x: roofLine.x2, y: roofLine.y2 }, { x: newPointX, y: roofLine.y2 }, 'orange')
|
||||||
|
|
||||||
if (Math.abs(wallBaseLine.y1 - wallLine.y1) < 0.1) {
|
if (Math.abs(wallBaseLine.y1 - wallLine.y1) < 0.1) {
|
||||||
// Validate: newPointX should not cross over pLineX (adjacent line)
|
getAddLine({ x: pLineX, y: pLineY }, { x: newPointX, y: pLineY }, 'green')
|
||||||
if (newPointX < pLineX) {
|
getAddLine({ x: newPointX, y: pLineY }, { x: ePoint.x, y: ePoint.y }, 'pink')
|
||||||
console.warn('⚠️ [RIGHT_IN_START] Line crossing detected! newPointX:', newPointX, 'is less than pLineX:', pLineX, '| Clamping to prevent overlap')
|
|
||||||
newPointX = pLineX
|
|
||||||
} else {
|
|
||||||
getAddLine({ x: pLineX, y: pLineY }, { x: newPointX, y: pLineY }, 'green')
|
|
||||||
getAddLine({ x: newPointX, y: pLineY }, { x: ePoint.x, y: ePoint.y }, 'pink')
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
getAddLine(newPStart, newPEnd, 'red')
|
getAddLine(newPStart, newPEnd, 'red')
|
||||||
}
|
}
|
||||||
@ -1288,7 +1204,7 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
|
|||||||
newPEnd.y = wallBaseLine.y2
|
newPEnd.y = wallBaseLine.y2
|
||||||
|
|
||||||
findPoints.push({ x: ePoint.x, y: ePoint.y, position: 'right_in_end' })
|
findPoints.push({ x: ePoint.x, y: ePoint.y, position: 'right_in_end' })
|
||||||
let newPointX = Big(roofLine.x1).minus(moveDist).toNumber()
|
const newPointX = Big(roofLine.x1).minus(moveDist).toNumber()
|
||||||
const pDist = Big(wallLine.x1).minus(roofLine.x1).abs().toNumber()
|
const pDist = Big(wallLine.x1).minus(roofLine.x1).abs().toNumber()
|
||||||
const pLineY = Big(roofLine.y2).minus(0).abs().toNumber()
|
const pLineY = Big(roofLine.y2).minus(0).abs().toNumber()
|
||||||
// let idx = sortRoofLines.length < index + 1 ? 0 : index
|
// let idx = sortRoofLines.length < index + 1 ? 0 : index
|
||||||
@ -1302,82 +1218,12 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
|
|||||||
//getAddLine({ x: roofLine.x1, y: Big(roofLine.y1).minus(moveDist).toNumber() }, { x: newPointX, y: Big(roofLine.y1).minus(moveDist).toNumber()}, 'orange')
|
//getAddLine({ x: roofLine.x1, y: Big(roofLine.y1).minus(moveDist).toNumber() }, { x: newPointX, y: Big(roofLine.y1).minus(moveDist).toNumber()}, 'orange')
|
||||||
|
|
||||||
if (Math.abs(wallBaseLine.y2 - wallLine.y2) < 0.1) {
|
if (Math.abs(wallBaseLine.y2 - wallLine.y2) < 0.1) {
|
||||||
// Validate: newPointX should not cross over pLineX (adjacent line)
|
getAddLine({ x: pLineX, y: pLineY }, { x: newPointX, y: pLineY }, 'green')
|
||||||
if (newPointX < pLineX) {
|
getAddLine({ x: newPointX, y: pLineY }, { x: ePoint.x, y: ePoint.y }, 'pink')
|
||||||
console.warn('⚠️ [RIGHT_IN_END] Line crossing detected! newPointX:', newPointX, 'is less than pLineX:', pLineX, '| Clamping to prevent overlap')
|
|
||||||
newPointX = pLineX
|
|
||||||
} else {
|
|
||||||
getAddLine({ x: pLineX, y: pLineY }, { x: newPointX, y: pLineY }, 'green')
|
|
||||||
getAddLine({ x: newPointX, y: pLineY }, { x: ePoint.x, y: ePoint.y }, 'pink')
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
//getAddLine({ x: roofLine.x2, y: roofLine.y2 }, { x: newPointX, y: roofLine.y2 }, 'orange')
|
//getAddLine({ x: roofLine.x2, y: roofLine.y2 }, { x: newPointX, y: roofLine.y2 }, 'orange')
|
||||||
getAddLine(newPStart, newPEnd, 'red')
|
getAddLine(newPStart, newPEnd, 'red')
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!isStartEnd.start && !isStartEnd.end){
|
|
||||||
console.log('right_in::::isStartEnd:::::', isStartEnd)
|
|
||||||
const moveDistY1 = Big(roofLine.y1).minus(wallBaseLine.y1).abs().toNumber()
|
|
||||||
const moveDistX1 = Big(roofLine.x1).minus(wallBaseLine.x1).abs().toNumber()
|
|
||||||
const moveDistX2 = Big(roofLine.x2).minus(wallBaseLine.x2).abs().toNumber()
|
|
||||||
const moveDistY2 = Big(roofLine.y2).minus(wallBaseLine.y2).abs().toNumber()
|
|
||||||
|
|
||||||
const sPoint = { x: wallBaseLine.x1, y: wallBaseLine.y1 }
|
|
||||||
const ePoint = { x: wallBaseLine.x2, y: wallBaseLine.y2 }
|
|
||||||
|
|
||||||
|
|
||||||
if(moveDistY1 > 0) {
|
|
||||||
findPoints.push({ x: sPoint.x, y: sPoint.y, position: 'right_in_start' })
|
|
||||||
|
|
||||||
if(moveDistY1 > moveDistX1){
|
|
||||||
const dist = moveDistY1 - moveDistX1
|
|
||||||
// console.log('Creating extensionLine (Y1 > X1):', { sPoint, roofLine, dist, roofId })
|
|
||||||
const createdLine = getAddLine({ x: sPoint.x, y: sPoint.y }, { x: roofLine.x1, y: roofLine.y1 + dist }, 'orange','extensionLine')
|
|
||||||
console.log('extensionLine created - length:', createdLine.length, 'coords:', { x1: createdLine.x1, y1: createdLine.y1, x2: createdLine.x2, y2: createdLine.y2 })
|
|
||||||
createdLine.set({ name: LINE_TYPE.SUBLINE.HIP, lineName: LINE_TYPE.SUBLINE.HIP, stroke: '#1083E3', strokeWidth: 2 })
|
|
||||||
createdLine.attributes = { ...createdLine.attributes, type: LINE_TYPE.SUBLINE.HIP }
|
|
||||||
innerLines.push(createdLine)
|
|
||||||
|
|
||||||
}else{
|
|
||||||
const dist = moveDistX1 - moveDistY1
|
|
||||||
// console.log('Creating extensionLine (X1 > Y1):', { sPoint, roofLine, dist, roofId })
|
|
||||||
const createdLine = getAddLine({ x: sPoint.x, y: sPoint.y }, { x: roofLine.x1 - dist, y: roofLine.y1 }, 'orange','extensionLine')
|
|
||||||
console.log('extensionLine created - length:', createdLine.length, 'coords:', { x1: createdLine.x1, y1: createdLine.y1, x2: createdLine.x2, y2: createdLine.y2 })
|
|
||||||
createdLine.set({ name: LINE_TYPE.SUBLINE.HIP, lineName: LINE_TYPE.SUBLINE.HIP, stroke: '#1083E3', strokeWidth: 2 })
|
|
||||||
createdLine.attributes = { ...createdLine.attributes, type: LINE_TYPE.SUBLINE.HIP }
|
|
||||||
innerLines.push(createdLine)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
if(moveDistY2 > 0) {
|
|
||||||
findPoints.push({ x: ePoint.x, y: ePoint.y, position: 'right_in_end' })
|
|
||||||
|
|
||||||
if(moveDistY2 > moveDistX2){
|
|
||||||
const dist = moveDistY2 - moveDistX2
|
|
||||||
// getAddLine({ x: roofLine.x2, y: roofLine.y2 }, { x: roofLine.x2, y: roofLine.y2 - dist }, 'red')
|
|
||||||
// console.log('Creating extensionLine (Y2 > X2):', { ePoint, roofLine, dist, roofId })
|
|
||||||
const createdLine = getAddLine({ x: ePoint.x, y: ePoint.y }, { x: roofLine.x2, y: roofLine.y2 - dist }, 'orange', 'extensionLine')
|
|
||||||
console.log('extensionLine created1 - length:', createdLine.length, 'coords:', { x1: createdLine.x1, y1: createdLine.y1, x2: createdLine.x2, y2: createdLine.y2 })
|
|
||||||
createdLine.set({ name: LINE_TYPE.SUBLINE.HIP, lineName: LINE_TYPE.SUBLINE.HIP, stroke: '#1083E3', strokeWidth: 2 })
|
|
||||||
createdLine.attributes = { ...createdLine.attributes, type: LINE_TYPE.SUBLINE.HIP }
|
|
||||||
innerLines.push(createdLine)
|
|
||||||
|
|
||||||
}else{
|
|
||||||
const dist = moveDistX2 - moveDistY2
|
|
||||||
// getAddLine({ x: roofLine.x2, y: roofLine.y2 }, { x: roofLine.x2 - dist, y: roofLine.y2 }, 'red')
|
|
||||||
// console.log('Creating extensionLine (X2 > Y2):', { ePoint, roofLine, dist, roofId })
|
|
||||||
const createdLine = getAddLine({ x: ePoint.x, y: ePoint.y }, { x: roofLine.x2 - dist, y: roofLine.y2 }, 'orange', 'extensionLine')
|
|
||||||
console.log('extensionLine created2 - length:', createdLine.length, 'coords:', { x1: createdLine.x1, y1: createdLine.y1, x2: createdLine.x2, y2: createdLine.y2 })
|
|
||||||
createdLine.set({ name: LINE_TYPE.SUBLINE.HIP, lineName: LINE_TYPE.SUBLINE.HIP, stroke: '#1083E3', strokeWidth: 2 })
|
|
||||||
createdLine.attributes = { ...createdLine.attributes, type: LINE_TYPE.SUBLINE.HIP }
|
|
||||||
innerLines.push(createdLine)
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
} else if (condition === 'right_out') {
|
} else if (condition === 'right_out') {
|
||||||
console.log('right_out::::isStartEnd:::::', isStartEnd)
|
console.log('right_out::::isStartEnd:::::', isStartEnd)
|
||||||
if (isStartEnd.start) {
|
if (isStartEnd.start) {
|
||||||
@ -1524,7 +1370,7 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
|
|||||||
sPoint = { x: wallBaseLine.x1, y: wallBaseLine.y1 }
|
sPoint = { x: wallBaseLine.x1, y: wallBaseLine.y1 }
|
||||||
newPStart.x = wallBaseLine.x1
|
newPStart.x = wallBaseLine.x1
|
||||||
|
|
||||||
let newPointY = Big(roofLine.y2).plus(moveDist).toNumber()
|
const newPointY = Big(roofLine.y2).plus(moveDist).toNumber()
|
||||||
|
|
||||||
const pDist = Big(wallLine.y2).minus(roofLine.y2).abs().toNumber()
|
const pDist = Big(wallLine.y2).minus(roofLine.y2).abs().toNumber()
|
||||||
const pLineX = Big(roofLine.x1).minus(0).toNumber()
|
const pLineX = Big(roofLine.x1).minus(0).toNumber()
|
||||||
@ -1540,14 +1386,8 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
|
|||||||
findPoints.push({ x: sPoint.x, y: sPoint.y, position: 'top_in_start' })
|
findPoints.push({ x: sPoint.x, y: sPoint.y, position: 'top_in_start' })
|
||||||
|
|
||||||
if (Math.abs(wallBaseLine.x1 - wallLine.x1) < 0.1) {
|
if (Math.abs(wallBaseLine.x1 - wallLine.x1) < 0.1) {
|
||||||
// Validate: newPointY should not cross over pLineY (adjacent line)
|
getAddLine({ x: pLineX, y: pLineY }, { x: pLineX, y: newPointY }, 'green')
|
||||||
if (newPointY > pLineY) {
|
getAddLine({ x: pLineX, y: newPointY }, { x: sPoint.x, y: sPoint.y }, 'pink')
|
||||||
console.warn('⚠️ [TOP_IN_START] Line crossing detected! newPointY:', newPointY, 'exceeds pLineY:', pLineY, '| Clamping to prevent overlap')
|
|
||||||
newPointY = pLineY
|
|
||||||
} else {
|
|
||||||
getAddLine({ x: pLineX, y: pLineY }, { x: pLineX, y: newPointY }, 'green')
|
|
||||||
getAddLine({ x: pLineX, y: newPointY }, { x: sPoint.x, y: sPoint.y }, 'pink')
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
//getAddLine({ x: roofLine.x2, y: roofLine.y2 }, { x: roofLine.x2, y: newPointY }, 'orange')
|
//getAddLine({ x: roofLine.x2, y: roofLine.y2 }, { x: roofLine.x2, y: newPointY }, 'orange')
|
||||||
getAddLine(newPStart, newPEnd, 'red')
|
getAddLine(newPStart, newPEnd, 'red')
|
||||||
@ -1559,7 +1399,7 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
|
|||||||
sPoint = { x: wallBaseLine.x2, y: wallBaseLine.y2 }
|
sPoint = { x: wallBaseLine.x2, y: wallBaseLine.y2 }
|
||||||
newPEnd.x = wallBaseLine.x2
|
newPEnd.x = wallBaseLine.x2
|
||||||
|
|
||||||
let newPointY = Big(roofLine.y1).plus(moveDist).toNumber()
|
const newPointY = Big(roofLine.y1).plus(moveDist).toNumber()
|
||||||
|
|
||||||
const pDist = Big(wallLine.y1).minus(roofLine.y1).abs().toNumber()
|
const pDist = Big(wallLine.y1).minus(roofLine.y1).abs().toNumber()
|
||||||
const pLineX = Big(roofLine.x2).minus(0).toNumber()
|
const pLineX = Big(roofLine.x2).minus(0).toNumber()
|
||||||
@ -1575,27 +1415,20 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
|
|||||||
findPoints.push({ x: sPoint.x, y: sPoint.y, position: 'top_in_end' })
|
findPoints.push({ x: sPoint.x, y: sPoint.y, position: 'top_in_end' })
|
||||||
|
|
||||||
if (Math.abs(wallBaseLine.x2 - wallLine.x2) < 0.1) {
|
if (Math.abs(wallBaseLine.x2 - wallLine.x2) < 0.1) {
|
||||||
// Validate: newPointY should not cross over pLineY (adjacent line)
|
getAddLine({ x: pLineX, y: pLineY }, { x: pLineX, y: newPointY }, 'green')
|
||||||
if (newPointY > pLineY) {
|
getAddLine({ x: pLineX, y: newPointY }, { x: sPoint.x, y: sPoint.y }, 'pink')
|
||||||
console.warn('⚠️ [TOP_IN_END] Line crossing detected! newPointY:', newPointY, 'exceeds pLineY:', pLineY, '| Clamping to prevent overlap')
|
|
||||||
newPointY = pLineY
|
|
||||||
} else {
|
|
||||||
getAddLine({ x: pLineX, y: pLineY }, { x: pLineX, y: newPointY }, 'green')
|
|
||||||
getAddLine({ x: pLineX, y: newPointY }, { x: sPoint.x, y: sPoint.y }, 'pink')
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//getAddLine({ x: roofLine.x1, y: roofLine.y1 }, { x: roofLine.x1, y: newPointY }, 'orange')
|
//getAddLine({ x: roofLine.x1, y: roofLine.y1 }, { x: roofLine.x1, y: newPointY }, 'orange')
|
||||||
getAddLine(newPStart, newPEnd, 'red')
|
getAddLine(newPStart, newPEnd, 'red')
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!isStartEnd.start && !isStartEnd.end){
|
if(!isStartEnd.start && !isStartEnd.end){
|
||||||
console.log('top_in start and end false')
|
console.log('top_in start and end false')
|
||||||
|
|
||||||
const moveDistY1 = Big(roofLine.y1).minus(wallBaseLine.y1).abs().toNumber()
|
const moveDistY1 = Big(wallLine.y1).minus(wallBaseLine.y1).abs().toNumber()
|
||||||
const moveDistX1 = Big(roofLine.x1).minus(wallBaseLine.x1).abs().toNumber()
|
const moveDistX1 = Big(wallLine.x1).minus(wallBaseLine.x1).abs().toNumber()
|
||||||
const moveDistX2 = Big(roofLine.x2).minus(wallBaseLine.x2).abs().toNumber()
|
const moveDistX2 = Big(wallLine.x2).minus(wallBaseLine.x2).abs().toNumber()
|
||||||
const moveDistY2 = Big(roofLine.y2).minus(wallBaseLine.y2).abs().toNumber()
|
const moveDistY2 = Big(wallLine.y2).minus(wallBaseLine.y2).abs().toNumber()
|
||||||
|
|
||||||
const sPoint = { x: wallBaseLine.x1, y: wallBaseLine.y1 }
|
const sPoint = { x: wallBaseLine.x1, y: wallBaseLine.y1 }
|
||||||
const ePoint = { x: wallBaseLine.x2, y: wallBaseLine.y2 }
|
const ePoint = { x: wallBaseLine.x2, y: wallBaseLine.y2 }
|
||||||
@ -1776,7 +1609,7 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
|
|||||||
sPoint = { x: wallBaseLine.x1, y: wallBaseLine.y1 }
|
sPoint = { x: wallBaseLine.x1, y: wallBaseLine.y1 }
|
||||||
newPStart.x = wallBaseLine.x1
|
newPStart.x = wallBaseLine.x1
|
||||||
|
|
||||||
let newPointY = Big(roofLine.y2).minus(moveDist).toNumber()
|
const newPointY = Big(roofLine.y2).minus(moveDist).toNumber()
|
||||||
|
|
||||||
const pDist = Big(wallLine.y2).minus(roofLine.y2).abs().toNumber()
|
const pDist = Big(wallLine.y2).minus(roofLine.y2).abs().toNumber()
|
||||||
const pLineX = Big(roofLine.x1).minus(0).toNumber()
|
const pLineX = Big(roofLine.x1).minus(0).toNumber()
|
||||||
@ -1792,14 +1625,8 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
|
|||||||
findPoints.push({ x: sPoint.x, y: sPoint.y, position: 'bottom_in_start' })
|
findPoints.push({ x: sPoint.x, y: sPoint.y, position: 'bottom_in_start' })
|
||||||
|
|
||||||
if (Math.abs(wallBaseLine.x1 - wallLine.x1) < 0.1) {
|
if (Math.abs(wallBaseLine.x1 - wallLine.x1) < 0.1) {
|
||||||
// Validate: newPointY should not cross over pLineY (adjacent line)
|
getAddLine({ x: pLineX, y: pLineY }, { x: pLineX, y: newPointY }, 'green')
|
||||||
if (newPointY < pLineY) {
|
getAddLine({ x: pLineX, y: newPointY }, { x: sPoint.x, y: sPoint.y }, 'pink')
|
||||||
console.warn('⚠️ [BOTTOM_IN_START] Line crossing detected! newPointY:', newPointY, 'is less than pLineY:', pLineY, '| Clamping to prevent overlap')
|
|
||||||
newPointY = pLineY
|
|
||||||
} else {
|
|
||||||
getAddLine({ x: pLineX, y: pLineY }, { x: pLineX, y: newPointY }, 'green')
|
|
||||||
getAddLine({ x: pLineX, y: newPointY }, { x: sPoint.x, y: sPoint.y }, 'pink')
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
//getAddLine({ x: roofLine.x2, y: roofLine.y2 }, { x: roofLine.x2, y: newPointY }, 'orange')
|
//getAddLine({ x: roofLine.x2, y: roofLine.y2 }, { x: roofLine.x2, y: newPointY }, 'orange')
|
||||||
getAddLine(newPStart, newPEnd, 'red')
|
getAddLine(newPStart, newPEnd, 'red')
|
||||||
@ -1811,7 +1638,7 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
|
|||||||
sPoint = { x: wallBaseLine.x2, y: wallBaseLine.y2 }
|
sPoint = { x: wallBaseLine.x2, y: wallBaseLine.y2 }
|
||||||
newPEnd.x = wallBaseLine.x2
|
newPEnd.x = wallBaseLine.x2
|
||||||
|
|
||||||
let newPointY = Big(roofLine.y1).minus(moveDist).toNumber()
|
const newPointY = Big(roofLine.y1).minus(moveDist).toNumber()
|
||||||
|
|
||||||
const pDist = Big(wallLine.y1).minus(roofLine.y1).abs().toNumber()
|
const pDist = Big(wallLine.y1).minus(roofLine.y1).abs().toNumber()
|
||||||
const pLineX = Big(roofLine.x2).minus(0).toNumber()
|
const pLineX = Big(roofLine.x2).minus(0).toNumber()
|
||||||
@ -1828,14 +1655,8 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
|
|||||||
findPoints.push({ x: sPoint.x, y: sPoint.y, position: 'bottom_in_end' })
|
findPoints.push({ x: sPoint.x, y: sPoint.y, position: 'bottom_in_end' })
|
||||||
|
|
||||||
if (Math.abs(wallBaseLine.x2 - wallLine.x2) < 0.1) {
|
if (Math.abs(wallBaseLine.x2 - wallLine.x2) < 0.1) {
|
||||||
// Validate: newPointY should not cross over pLineY (adjacent line)
|
getAddLine({ x: pLineX, y: pLineY }, { x: pLineX, y: newPointY }, 'green')
|
||||||
if (newPointY < pLineY) {
|
getAddLine({ x: pLineX, y: newPointY }, { x: sPoint.x, y: sPoint.y }, 'pink')
|
||||||
console.warn('⚠️ [BOTTOM_IN_END] Line crossing detected! newPointY:', newPointY, 'is less than pLineY:', pLineY, '| Clamping to prevent overlap')
|
|
||||||
newPointY = pLineY
|
|
||||||
}else {
|
|
||||||
getAddLine({ x: pLineX, y: pLineY }, { x: pLineX, y: newPointY }, 'green')
|
|
||||||
getAddLine({ x: pLineX, y: newPointY }, { x: sPoint.x, y: sPoint.y }, 'pink')
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
//getAddLine({ x: roofLine.x1, y: roofLine.y1 }, { x: roofLine.x1, y: newPointY }, 'orange')
|
//getAddLine({ x: roofLine.x1, y: roofLine.y1 }, { x: roofLine.x1, y: newPointY }, 'orange')
|
||||||
getAddLine(newPStart, newPEnd, 'red')
|
getAddLine(newPStart, newPEnd, 'red')
|
||||||
@ -1845,10 +1666,10 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
|
|||||||
|
|
||||||
console.log('isStartEnd:::::', isStartEnd)
|
console.log('isStartEnd:::::', isStartEnd)
|
||||||
|
|
||||||
const moveDistY1 = Big(roofLine.y1).minus(wallBaseLine.y1).abs().toNumber()
|
const moveDistY1 = Big(wallLine.y1).minus(wallBaseLine.y1).abs().toNumber()
|
||||||
const moveDistX1 = Big(roofLine.x1).minus(wallBaseLine.x1).abs().toNumber()
|
const moveDistX1 = Big(wallLine.x1).minus(wallBaseLine.x1).abs().toNumber()
|
||||||
const moveDistX2 = Big(roofLine.x2).minus(wallBaseLine.x2).abs().toNumber()
|
const moveDistX2 = Big(wallLine.x2).minus(wallBaseLine.x2).abs().toNumber()
|
||||||
const moveDistY2 = Big(roofLine.y2).minus(wallBaseLine.y2).abs().toNumber()
|
const moveDistY2 = Big(wallLine.y2).minus(wallBaseLine.y2).abs().toNumber()
|
||||||
|
|
||||||
const sPoint = { x: wallBaseLine.x1, y: wallBaseLine.y1 }
|
const sPoint = { x: wallBaseLine.x1, y: wallBaseLine.y1 }
|
||||||
const ePoint = { x: wallBaseLine.x2, y: wallBaseLine.y2 }
|
const ePoint = { x: wallBaseLine.x2, y: wallBaseLine.y2 }
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user