집추가작업

This commit is contained in:
Cha 2025-11-09 23:01:10 +09:00
parent 881fcb91f6
commit 37eab73aef

View File

@ -543,28 +543,23 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
//const orgWallLine = wall.lines //const orgWallLine = wall.lines
//console.log("outLine:::::", p1, p2, line) //console.log("outLine:::::", p1, p2, line)
let lineExists = false;
for (const orgLine of roof.lines) { for (const orgLine of roof.lines) {
console.log("a::::",isSamePoint(p1,orgLine.startPoint), p1, orgLine.startPoint) const sameDirection = isSamePoint(p1, orgLine.startPoint) && isSamePoint(p2, orgLine.endPoint);
console.log("b::::",isSamePoint(p2,orgLine.endPoint), p2, orgLine.endPoint) const oppositeDirection = isSamePoint(p2, orgLine.startPoint) && isSamePoint(p1, orgLine.endPoint);
console.log("c::::",isSamePoint(p2,orgLine.startPoint), p2, orgLine.startPoint)
console.log("d::::",isSamePoint(p1,orgLine.endPoint), p1, orgLine.endPoint) if (sameDirection || oppositeDirection) {
let isSampe1 = false lineExists = true;
let isSampe2 = false break; // 같은 라인이 발견되면 즉시 순환 종료
const orgOuterLine = orgLine }
if(isSamePoint(p1,orgLine.startPoint) && isSamePoint(p2,orgLine.endPoint)){
isSampe1 = true;
break;
} }
orgOuterLine.startPoint = orgLine.endPoint if (!lineExists) {
orgOuterLine.endPoint = orgLine.startPoint // 같은 라인이 없으므로 새 다각형 라인 생성
const newLine = new QLine(
if(isSamePoint(p1,orgLine.endPoint) && isSamePoint(p2,orgLine.startPoint)){ [p1.x, p1.y, p2.x, p2.y],
isSampe2 = true {
return;
}
const innerLine2 = new QLine([orgOuterLine.startPoint.x, orgOuterLine.startPoint.y, orgOuterLine.endPoint.x, orgOuterLine.endPoint.y], {
parentId : roof.id, parentId : roof.id,
fontSize : roof.fontSize, fontSize : roof.fontSize,
stroke : 'yellow', stroke : 'yellow',
@ -576,26 +571,33 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
lineName : (line.attributes.isOuterEdge) ? 'addLine' : attributes.type, lineName : (line.attributes.isOuterEdge) ? 'addLine' : attributes.type,
selectable : (!line.attributes.isOuterEdge), selectable : (!line.attributes.isOuterEdge),
roofId : roofId, roofId : roofId,
});
//orgOuterLine.setCoords()
//canvas.renderAll()
canvas.add(innerLine2);
} }
);
let p1Line = findClosestRoofLine(p1, roof.lines)
let p2Line = findClosestRoofLine(p2, roof.lines)
for(const orgWallLine of wall.lines){ if(p2Line.distance > p1Line.distance){
// console.log("orgWallLine::::;",orgWallLine.startPoint, orgWallLine.endPoint); p1Line = p2Line;
// if(isSamePoint(orgWallLine.startPoint, p1) || p2Line = p1Line;
// isSamePoint(orgWallLine.endPoint, p2) || }
// isSamePoint(orgWallLine.endPoint, p1) || const newLine2 = new QLine(
// isSamePoint(orgWallLine.startPoint, p2)){ [p1Line.line.x1, p1Line.line.y1, p2Line.line.x2, p2Line.line.y2],
// idx = orgWallLine.idx {
// break parentId : roof.id,
// } fontSize : roof.fontSize,
stroke : 'red',
strokeWidth: lineStyle.width,
name : (line.attributes.isOuterEdge) ? 'eaves' : attributes.type,
attributes : attributes,
direction : direction,
isBaseLine : line.attributes.isOuterEdge,
lineName : (line.attributes.isOuterEdge) ? 'exLine' : attributes.type,
selectable : (!line.attributes.isOuterEdge),
roofId : roofId,
}
);
canvas.add(newLine);
canvas.add(newLine2);
} }
//초기외곽라인? //초기외곽라인?
@ -617,6 +619,7 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
canvas?.add(coordinateText) canvas?.add(coordinateText)
}else{ }else{
canvas.add(innerLine); canvas.add(innerLine);
innerLine.bringToFront(); innerLine.bringToFront();
existingLines.add(lineKey); // 추가된 라인을 추적 existingLines.add(lineKey); // 추가된 라인을 추적