Compare commits

..

No commits in common. "5ca4f3d901855d8664d9bb4f0a385f6bbb003452" and "559c0851833b346fade129a3e510641268c2b547" have entirely different histories.

View File

@ -947,12 +947,7 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
if(Math.abs(wallBaseLine.y1 - wallLine.y1) < 0.1) { if(Math.abs(wallBaseLine.y1 - wallLine.y1) < 0.1) {
if(inLine){ if(inLine){
if(inLine.x1 < inLine.x2) {
getAddLine({ y: bStartY, x: wallLine.x2 }, { y: inLine.y2, x: inLine.x2 }, 'pink') getAddLine({ y: bStartY, x: wallLine.x2 }, { y: inLine.y2, x: inLine.x2 }, 'pink')
}else{
getAddLine({ y: inLine.y2, x: inLine.x2 },{ y: bStartY, x: wallLine.x2 }, 'pink')
}
} }
getAddLine({ y: bStartY, x: wallLine.x2 }, { y: roofLine.y1, x: wallLine.x1 }, 'magenta') getAddLine({ y: bStartY, x: wallLine.x2 }, { y: roofLine.y1, x: wallLine.x1 }, 'magenta')
getAddLine({ y: newLine.y1, x: newLine.x1 }, { y: newLine.y2, x: wallLine.x2 }, 'Gray') getAddLine({ y: newLine.y1, x: newLine.x1 }, { y: newLine.y2, x: wallLine.x2 }, 'Gray')
@ -962,11 +957,7 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
newPStart.y = Big(newPStart.y).minus(cLineY).toNumber(); newPStart.y = Big(newPStart.y).minus(cLineY).toNumber();
const inLine = findLineContainingPoint(innerLines, { y: newPStart.y, x: newPStart.x }) const inLine = findLineContainingPoint(innerLines, { y: newPStart.y, x: newPStart.x })
if(inLine){ if(inLine){
if(inLine.x1 < inLine.x2) {
getAddLine({ y: newPStart.y, x: newPStart.x }, { y: inLine.y2, x: inLine.x2 }, 'purple') getAddLine({ y: newPStart.y, x: newPStart.x }, { y: inLine.y2, x: inLine.x2 }, 'purple')
}else{
getAddLine({ y: inLine.y1, x: inLine.x1},{ y: newPStart.y, x: newPStart.x }, 'purple')
}
}else { }else {
newPStart.y = wallLine.y1; newPStart.y = wallLine.y1;
} }
@ -989,11 +980,7 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
if(Math.abs(wallBaseLine.y2 - wallLine.y2) < 0.1) { if(Math.abs(wallBaseLine.y2 - wallLine.y2) < 0.1) {
if(inLine){ if(inLine){
if(inLine.x1 < inLine.x2) {
getAddLine({ y: bStartY, x: wallLine.x1 }, { y: inLine.y2, x: inLine.x2 }, 'pink') getAddLine({ y: bStartY, x: wallLine.x1 }, { y: inLine.y2, x: inLine.x2 }, 'pink')
}else{
getAddLine({ y: inLine.y1, x: inLine.x1 }, { y: bStartY, x: wallLine.x1 }, 'pink')
}
} }
getAddLine({ y: bStartY, x: wallLine.x1 }, { y: roofLine.y2, x: wallLine.x2 }, 'magenta') getAddLine({ y: bStartY, x: wallLine.x1 }, { y: roofLine.y2, x: wallLine.x2 }, 'magenta')
getAddLine({ y: newLine.y2, x: newLine.x2 }, { y: newLine.y1, x: wallLine.x1 }, 'Gray') getAddLine({ y: newLine.y2, x: newLine.x2 }, { y: newLine.y1, x: wallLine.x1 }, 'Gray')
@ -1003,11 +990,7 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
newPEnd.y = Big(newPEnd.y).plus(cLineY).toNumber(); newPEnd.y = Big(newPEnd.y).plus(cLineY).toNumber();
const inLine = findLineContainingPoint(innerLines, { y: newPEnd.y, x: newPEnd.x }) const inLine = findLineContainingPoint(innerLines, { y: newPEnd.y, x: newPEnd.x })
if(inLine){ if(inLine){
if(inLine.x1 < inLine.x2) {
getAddLine({ y: newPEnd.y, x: newPEnd.x }, { y: inLine.y2, x: inLine.x2 }, 'purple') getAddLine({ y: newPEnd.y, x: newPEnd.x }, { y: inLine.y2, x: inLine.x2 }, 'purple')
}else{
getAddLine({ y: inLine.y1, x: inLine.x1 },{ y: newPEnd.y, x: newPEnd.x }, 'purple')
}
}else { }else {
newPEnd.y = wallLine.y2 newPEnd.y = wallLine.y2
@ -1082,11 +1065,7 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
if(Math.abs(wallBaseLine.y1 - wallLine.y1) < 0.1) { if(Math.abs(wallBaseLine.y1 - wallLine.y1) < 0.1) {
if(inLine){ if(inLine){
if(inLine.x2 < inLine.x1) {
getAddLine({ y: bStartY, x: wallLine.x2 }, { y: inLine.y2, x: inLine.x2 }, 'pink') getAddLine({ y: bStartY, x: wallLine.x2 }, { y: inLine.y2, x: inLine.x2 }, 'pink')
}else{
getAddLine({ y: inLine.y1, x: inLine.x1 },{ y: bStartY, x: wallLine.x2 }, 'pink')
}
} }
getAddLine({ y: bStartY, x: wallLine.x2 }, { y: roofLine.y1, x: wallLine.x1 }, 'magenta') getAddLine({ y: bStartY, x: wallLine.x2 }, { y: roofLine.y1, x: wallLine.x1 }, 'magenta')
getAddLine({ y: newLine.y1, x: newLine.x1 }, { y: newLine.y2, x: wallLine.x2 }, 'Gray') getAddLine({ y: newLine.y1, x: newLine.x1 }, { y: newLine.y2, x: wallLine.x2 }, 'Gray')
@ -1096,11 +1075,7 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
newPStart.y = Big(newPStart.y).plus(cLineY).toNumber(); newPStart.y = Big(newPStart.y).plus(cLineY).toNumber();
const inLine = findLineContainingPoint(innerLines, { y: newPStart.y, x: newPStart.x }) const inLine = findLineContainingPoint(innerLines, { y: newPStart.y, x: newPStart.x })
if(inLine){ if(inLine){
if(inLine.x2 < inLine.x1 ) {
getAddLine({ y: newPStart.y, x: newPStart.x }, { y: inLine.y2, x: inLine.x2 }, 'purple') getAddLine({ y: newPStart.y, x: newPStart.x }, { y: inLine.y2, x: inLine.x2 }, 'purple')
}else{
getAddLine({ y: inLine.y1, x: inLine.x1 },{ y: newPStart.y, x: newPStart.x }, 'purple')
}
}else { }else {
newPStart.y = wallLine.y1; newPStart.y = wallLine.y1;
} }
@ -1121,11 +1096,7 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
let idx = (roofLines.length < index + 1)?0:index let idx = (roofLines.length < index + 1)?0:index
const newLine = roofLines[idx+1]; const newLine = roofLines[idx+1];
if(inLine){ if(inLine){
if(inLine.x2 < inLine.x1) {
getAddLine({ y: bStartY, x: wallLine.x1 }, { y: inLine.y2, x: inLine.x2 }, 'pink') getAddLine({ y: bStartY, x: wallLine.x1 }, { y: inLine.y2, x: inLine.x2 }, 'pink')
}else{
getAddLine({ y: inLine.y1, x: inLine.x1 },{ y: bStartY, x: wallLine.x1 }, 'pink')
}
} }
if(Math.abs(wallBaseLine.y2 - wallLine.y2) < 0.1) { if(Math.abs(wallBaseLine.y2 - wallLine.y2) < 0.1) {
getAddLine({ y: bStartY, x: wallLine.x1 }, { y: roofLine.y2, x: wallLine.x2 }, 'magenta') getAddLine({ y: bStartY, x: wallLine.x1 }, { y: roofLine.y2, x: wallLine.x2 }, 'magenta')
@ -1136,11 +1107,7 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
newPEnd.y = Big(newPEnd.y).minus(cLineY).toNumber(); newPEnd.y = Big(newPEnd.y).minus(cLineY).toNumber();
const inLine = findLineContainingPoint(innerLines, { y: newPEnd.y, x: newPEnd.x }) const inLine = findLineContainingPoint(innerLines, { y: newPEnd.y, x: newPEnd.x })
if(inLine){ if(inLine){
if(inLine.x2 < inLine.x1) {
getAddLine({ y: newPEnd.y, x: newPEnd.x }, { y: inLine.y2, x: inLine.x2 }, 'purple') getAddLine({ y: newPEnd.y, x: newPEnd.x }, { y: inLine.y2, x: inLine.x2 }, 'purple')
}else{
getAddLine({ y: inLine.y1, x: inLine.x1 }, { y: newPEnd.y, x: newPEnd.x }, 'purple')
}
}else { }else {
newPEnd.y = wallLine.y2; newPEnd.y = wallLine.y2;
} }
@ -1238,11 +1205,7 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
if(Math.abs(wallBaseLine.x1 - wallLine.x1) < 0.1) { if(Math.abs(wallBaseLine.x1 - wallLine.x1) < 0.1) {
if(inLine){ if(inLine){
if(inLine.y2 > inLine.y1 ) {
getAddLine({ x: bStartX, y: wallLine.y1 }, { x: inLine.x2, y: inLine.y2 }, 'pink') getAddLine({ x: bStartX, y: wallLine.y1 }, { x: inLine.x2, y: inLine.y2 }, 'pink')
}else{
getAddLine({ x: inLine.x1, y: inLine.y1 }, { x: bStartX, y: wallLine.y1 }, 'pink')
}
} }
getAddLine({ x: bStartX, y: wallLine.y1 }, { x: roofLine.x1, y: wallLine.y1 }, 'magenta') getAddLine({ x: bStartX, y: wallLine.y1 }, { x: roofLine.x1, y: wallLine.y1 }, 'magenta')
getAddLine({ x: newLine.x1, y: newLine.y1 }, { x: newLine.x1, y: wallLine.y1 }, 'Gray') getAddLine({ x: newLine.x1, y: newLine.y1 }, { x: newLine.x1, y: wallLine.y1 }, 'Gray')
@ -1252,12 +1215,7 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
newPStart.x = Big(newPStart.x).plus(cLineX).toNumber(); newPStart.x = Big(newPStart.x).plus(cLineX).toNumber();
const inLine = findLineContainingPoint(innerLines, { y: newPStart.y, x: newPStart.x }) const inLine = findLineContainingPoint(innerLines, { y: newPStart.y, x: newPStart.x })
if(inLine){ if(inLine){
if(inLine.y2 > inLine.y1 ) {
getAddLine({ y: newPStart.y, x: newPStart.x }, { y: inLine.y2, x: inLine.x2 }, 'purple') getAddLine({ y: newPStart.y, x: newPStart.x }, { y: inLine.y2, x: inLine.x2 }, 'purple')
}else{
getAddLine({ y: inLine.y1, x: inLine.x1 }, { y: newPStart.y, x: newPStart.x } , 'purple')
}
}else { }else {
newPStart.x = wallLine.x1; newPStart.x = wallLine.x1;
} }
@ -1278,12 +1236,7 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
if(Math.abs(wallBaseLine.x2 - wallLine.x2) < 0.1) { if(Math.abs(wallBaseLine.x2 - wallLine.x2) < 0.1) {
if(inLine){ if(inLine){
if(inLine.y2 > inLine.y1 ){
getAddLine({ x: bStartX, y: wallLine.y1 }, { x: inLine.x2, y: inLine.y2 }, 'pink') getAddLine({ x: bStartX, y: wallLine.y1 }, { x: inLine.x2, y: inLine.y2 }, 'pink')
}else{
getAddLine({ x: inLine.x1, y: inLine.y1 },{ x: bStartX, y: wallLine.y1 }, 'pink')
}
} }
getAddLine({ x: bStartX, y: wallLine.y1 }, { x: roofLine.x2, y: wallLine.y2 }, 'magenta') getAddLine({ x: bStartX, y: wallLine.y1 }, { x: roofLine.x2, y: wallLine.y2 }, 'magenta')
getAddLine({ x: newLine.x2, y: newLine.y2 }, { x: newLine.x1, y: wallLine.y1 }, 'Gray') getAddLine({ x: newLine.x2, y: newLine.y2 }, { x: newLine.x1, y: wallLine.y1 }, 'Gray')
@ -1293,11 +1246,7 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
newPEnd.x = Big(newPEnd.x).minus(cLineX).toNumber(); newPEnd.x = Big(newPEnd.x).minus(cLineX).toNumber();
const inLine = findLineContainingPoint(innerLines, { y: newPEnd.y, x: newPEnd.x }) const inLine = findLineContainingPoint(innerLines, { y: newPEnd.y, x: newPEnd.x })
if(inLine){ if(inLine){
if(inLine.y2 > inLine.y1 ) {
getAddLine({ y: newPEnd.y, x: newPEnd.x }, { y: inLine.y2, x: inLine.x2 }, 'purple') getAddLine({ y: newPEnd.y, x: newPEnd.x }, { y: inLine.y2, x: inLine.x2 }, 'purple')
}else{
getAddLine({ y: inLine.y1, x: inLine.x1 },{ y: newPEnd.y, x: newPEnd.x }, 'purple')
}
}else { }else {
newPEnd.x = wallLine.x2; newPEnd.x = wallLine.x2;
} }
@ -1366,25 +1315,17 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
if(Math.abs(wallBaseLine.x1 - wallLine.x1) < 0.1) { if(Math.abs(wallBaseLine.x1 - wallLine.x1) < 0.1) {
if(inLine){ if(inLine){
if(inLine.y2 < inLine.y1 ) {
getAddLine({ x: bStartX, y: wallLine.y1 }, { x: inLine.x2, y: inLine.y2 }, 'pink') getAddLine({ x: bStartX, y: wallLine.y1 }, { x: inLine.x2, y: inLine.y2 }, 'pink')
}else{
getAddLine({ x: inLine.x1, y: inLine.y1 },{ x: bStartX, y: wallLine.y1 }, 'pink')
}
} }
getAddLine({ x: bStartX, y: wallLine.y1 }, { x: roofLine.x1, y: wallLine.y1 }, 'magenta') getAddLine({ x: bStartX, y: wallLine.y1 }, { x: roofLine.x1, y: wallLine.y1 }, 'magenta')
getAddLine({ x: newLine.x1, y: newLine.y1 }, { x: newLine.x1, y: wallLine.y1 }, 'Gray') getAddLine({ x: newLine.x1, y: newLine.y1 }, { x: newLine.x1, y: wallLine.y1 }, 'Gray')
findPoints.push({ x: aStartX, y: newPEnd.y, position: 'bottom_out_start' }); findPoints.push({ x: aStartX, y: newPEnd.y });
}else{ }else{
const cLineX = Big(wallBaseLine.y1).minus(wallLine.y1).abs().toNumber() const cLineX = Big(wallBaseLine.y1).minus(wallLine.y1).abs().toNumber()
newPStart.x = Big(newPStart.x).minus(cLineX).toNumber(); newPStart.x = Big(newPStart.x).minus(cLineX).toNumber();
const inLine = findLineContainingPoint(innerLines, { y: newPStart.y, x: newPStart.x }) const inLine = findLineContainingPoint(innerLines, { y: newPStart.y, x: newPStart.x })
if(inLine){ if(inLine){
if(inLine.y2 < inLine.y1 ) {
getAddLine({ y: newPStart.y, x: newPStart.x }, { y: inLine.y2, x: inLine.x2 }, 'purple') getAddLine({ y: newPStart.y, x: newPStart.x }, { y: inLine.y2, x: inLine.x2 }, 'purple')
}else{
getAddLine({ y: inLine.y1, x: inLine.x1 }, { y: newPStart.y, x: newPStart.x }, 'purple')
}
}else{ }else{
newPStart.x = wallLine.x1; newPStart.x = wallLine.x1;
} }
@ -1406,11 +1347,7 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
if(Math.abs(wallBaseLine.x2 - wallLine.x2) < 0.1) { if(Math.abs(wallBaseLine.x2 - wallLine.x2) < 0.1) {
if(inLine){ if(inLine){
if(inLine.y2 < inLine.y1 ) {
getAddLine({ x: bStartX, y: wallLine.y1 }, { x: inLine.x2, y: inLine.y2 }, 'pink') getAddLine({ x: bStartX, y: wallLine.y1 }, { x: inLine.x2, y: inLine.y2 }, 'pink')
}else{
getAddLine({ x: inLine.x2, y: inLine.y2 }, { x: bStartX, y: wallLine.y1 }, 'pink')
}
} }
getAddLine({ x: bStartX, y: wallLine.y1 }, { x: roofLine.x2, y: wallLine.y2 }, 'magenta') getAddLine({ x: bStartX, y: wallLine.y1 }, { x: roofLine.x2, y: wallLine.y2 }, 'magenta')
getAddLine({ x: newLine.x2, y: newLine.y2 }, { x: newLine.x1, y: wallLine.y1 }, 'Gray') getAddLine({ x: newLine.x2, y: newLine.y2 }, { x: newLine.x1, y: wallLine.y1 }, 'Gray')
@ -1420,11 +1357,7 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
newPEnd.x = Big(newPEnd.x).plus(cLineX).toNumber(); newPEnd.x = Big(newPEnd.x).plus(cLineX).toNumber();
const inLine = findLineContainingPoint(innerLines, { y: newPEnd.y, x: newPEnd.x }) const inLine = findLineContainingPoint(innerLines, { y: newPEnd.y, x: newPEnd.x })
if(inLine){ if(inLine){
if(inLine.y2 < inLine.y1 ) {
getAddLine({ y: newPEnd.y, x: newPEnd.x }, { y: inLine.y2, x: inLine.x2 }, 'purple') getAddLine({ y: newPEnd.y, x: newPEnd.x }, { y: inLine.y2, x: inLine.x2 }, 'purple')
}else{
getAddLine({ y: inLine.y1, x: inLine.x1 },{ y: newPEnd.y, x: newPEnd.x }, 'purple')
}
}else{ }else{
newPEnd.x = wallLine.x2; newPEnd.x = wallLine.x2;
} }
@ -3131,38 +3064,6 @@ function updateAndAddLine(innerLines, targetPoint) {
if(foundLine.x2 <= foundLine.x1){ if(foundLine.x2 <= foundLine.x1){
isUpdatingStart = true; isUpdatingStart = true;
} }
}else if(targetPoint.position === "top_out_start"){
if(foundLine.y2 >= foundLine.y1){
isUpdatingStart = true;
}
}else if(targetPoint.position === "top_out_end"){
if(foundLine.y2 > foundLine.y1){
isUpdatingStart = true;
}
}else if(targetPoint.position === "bottom_out_start"){
if(foundLine.y2 <= foundLine.y1){
isUpdatingStart = true;
}
}else if(targetPoint.position === "bottom_out_end"){
if(foundLine.y2 <= foundLine.y1){
isUpdatingStart = true;
}
}else if(targetPoint.position === "left_out_start"){
if(foundLine.x2 >= foundLine.x1){
isUpdatingStart = true;
}
}else if(targetPoint.position === "left_out_end"){
if(foundLine.x2 >= foundLine.x1){
isUpdatingStart = true;
}
}else if(targetPoint.position === "right_out_start"){
if(foundLine.x2 <= foundLine.x1){
isUpdatingStart = true;
}
}else if(targetPoint.position === "right_out_end"){
if(foundLine.x2 <= foundLine.x1){
isUpdatingStart = true;
}
} }
const updatedLine = { const updatedLine = {