Post Demo Bugfix

This commit is contained in:
Aadi Desai 2022-03-26 17:52:47 +00:00
parent 84c8da773f
commit 1bd5020d22
No known key found for this signature in database
GPG key ID: CFFFE425830EF4D9
2 changed files with 80 additions and 45 deletions

View file

@ -1 +1,12 @@
yhp19 - Fixing the Rightangle (2-4 Segment) case for the Autorouting algorithms. Equidistance is attempted whenever is possible (more explanation in the code analysis)
# Post Demo Bugfixes
- yhp19
- Fixing the Rightangle (2-4 Segment) case for the Autorouting algorithms. Equidistance is attempted whenever is possible (more explanation in the code analysis)
- ad3919
- with help of yhp19 in understanding routing code
- Dragging does not work correctly in some instances
- Opposite Side, (standard Issie) works as expected
- Same Side, forces wire between two ports (as if it was opposite side) instead of only away from ports
- Right Angle, prevents movement as both ports are preventing movement perpendicular to their direction
- Position of auto-routed wires has been fixed for some orientations
- multiple 4 segment right-angle cases

View file

@ -430,11 +430,11 @@ let initialWireVerticesFromPorts
if (endX - startX >= Wire.stickLength)
&& (endY - startY >= Wire.stickLength) then
[
{X = startX; Y = startY};
{X = startX + Wire.stickLength; Y = startY};
{X = startX + Wire.stickLength; Y = startY};
{X = endX; Y = startY};
{X = endX; Y = startY};
{X = startX; Y = startY}
{X = startX + Wire.stickLength; Y = startY}
{X = startX + Wire.stickLength; Y = startY}
{X = endX; Y = startY}
{X = endX; Y = endY - Wire.stickLength}
{X = endX; Y = endY - Wire.stickLength}
{X = endX; Y = endY - Wire.stickLength}
{X = endX; Y = endY}
@ -443,24 +443,36 @@ let initialWireVerticesFromPorts
//fix issue by wrapping wire input port and not through for 1st quadrant
else if (((startX + endX) / 2.0)>(startX+Wire.stickLength)) then
[
{X = startX; Y = startY};
{X = startX + Wire.stickLength; Y = startY};
{X = startX + Wire.stickLength; Y = startY};
{X = (startX + endX) / 2.0; Y = startY};
{X = (startX + endX) / 2.0; Y = endY-Wire.stickLength};
{X = endX; Y = endY-Wire.stickLength};
{X = endX; Y = endY-Wire.stickLength};
{X = startX; Y = startY}
{X = startX + Wire.stickLength; Y = startY}
{X = startX + Wire.stickLength; Y = startY}
{X = (startX + endX) / 2.0; Y = startY}
{X = (startX + endX) / 2.0; Y = endY - Wire.stickLength}
{X = endX; Y = endY - Wire.stickLength}
{X = endX; Y = endY - Wire.stickLength}
{X = endX; Y = endY}
], false
else if (((startY + endY) / 2.0)>(startY+Wire.stickLength)) then
[
{X = startX; Y = startY}
{X = startX + Wire.stickLength; Y = startY}
{X = startX + Wire.stickLength; Y = startY}
{X = startX + Wire.stickLength; Y = startY}
{X = startX + Wire.stickLength; Y = ((startY + endY) - Wire.stickLength) / 2.0}
{X = endX; Y = ((startY + endY) - Wire.stickLength) / 2.0}
{X = endX; Y = endY - Wire.stickLength}
{X = endX; Y = endY}
],
false
else
[
{X = startX; Y = startY};
{X = startX + Wire.stickLength; Y = startY};
{X = startX + Wire.stickLength; Y = startY};
{X = startX + Wire.stickLength; Y = startY};
{X = startX + Wire.stickLength; Y = endY - Wire.stickLength};
{X = endX; Y = endY - Wire.stickLength};
{X = endX; Y = endY - Wire.stickLength};
{X = startX; Y = startY}
{X = startX + Wire.stickLength; Y = startY}
{X = startX + Wire.stickLength; Y = startY}
{X = startX + Wire.stickLength; Y = startY}
{X = startX + Wire.stickLength; Y = endY - Wire.stickLength}
{X = endX; Y = endY - Wire.stickLength}
{X = endX; Y = endY - Wire.stickLength}
{X = endX; Y = endY}
],
false
@ -479,11 +491,11 @@ let initialWireVerticesFromPorts
if abs (endX - startX) >= Wire.stickLength * 2.0
&& endY >= startY then
[
{X = startX; Y = startY};
{X = startX ; Y = startY - Wire.stickLength};
{X = startX ; Y = startY - Wire.stickLength};
{X = endX; Y = startY - Wire.stickLength};
{X = endX; Y = startY - Wire.stickLength};
{X = startX; Y = startY}
{X = startX ; Y = startY - Wire.stickLength}
{X = startX ; Y = startY - Wire.stickLength}
{X = startX ; Y = startY - Wire.stickLength}
{X = endX; Y = startY - Wire.stickLength}
{X = endX ; Y = endY - Wire.stickLength}
{X = endX ; Y = endY - Wire.stickLength}
{X = endX; Y = endY}
@ -499,11 +511,11 @@ let initialWireVerticesFromPorts
// + - + + - +
elif abs (endX - startX) >= Wire.stickLength * 2.0 then
[
{X = startX; Y = startY};
{X = startX ; Y = startY - Wire.stickLength};
{X = startX ; Y = endY - Wire.stickLength};
{X = endX; Y = endY - Wire.stickLength};
{X = endX; Y = endY - Wire.stickLength};
{X = startX; Y = startY}
{X = startX ; Y = startY - Wire.stickLength}
{X = startX ; Y = startY - Wire.stickLength}
{X = startX ; Y = endY - Wire.stickLength}
{X = endX; Y = endY - Wire.stickLength}
{X = endX; Y = endY - Wire.stickLength}
{X = endX; Y = endY - Wire.stickLength}
{X = endX; Y = endY}
@ -518,15 +530,27 @@ let initialWireVerticesFromPorts
// + - + E or S + - +
// | | | |
// + - + + - +
elif endY < startY then
[
{X = startX; Y = startY}
{X = startX; Y = startY - Wire.stickLength}
{X = startX; Y = startY - Wire.stickLength}
{X = startX; Y = ((startY + endY) / 2.0) - Wire.stickLength}
{X = endX + Wire.stickLength * 4.0; Y = ((startY + endY) / 2.0) - Wire.stickLength}
{X = endX + Wire.stickLength * 4.0; Y = endY - Wire.stickLength}
{X = endX; Y = endY - Wire.stickLength}
{X = endX; Y = endY}
],
false // Not left-to-right
else
[
{X = startX; Y = startY};
{X = startX ; Y = startY - Wire.stickLength};
{X = startX ; Y = startY - Wire.stickLength};
{X = startX + Wire.stickLength * 4.5 ; Y = startY - Wire.stickLength};
{X = startX + Wire.stickLength * 4.5 ; Y = endY - Wire.stickLength};
{X = endX; Y = endY - Wire.stickLength};
{X = endX; Y = endY - Wire.stickLength};
{X = startX; Y = startY}
{X = startX ; Y = startY - Wire.stickLength}
{X = startX + Wire.stickLength * 4.0; Y = startY - Wire.stickLength}
{X = startX + Wire.stickLength * 4.0; Y = ((startY + endY) / 2.0) - Wire.stickLength}
{X = endX; Y = ((startY + endY) / 2.0) - Wire.stickLength}
{X = endX; Y = endY - Wire.stickLength}
{X = endX; Y = endY - Wire.stickLength}
{X = endX; Y = endY}
],
false // Not left-to-right
@ -567,13 +591,13 @@ let convertVerticesToASegs connId (isLeftToRight: bool) routetype rotation (yref
| Sameside->
match isLeftToRight with
| true ->
[Vertical;Vertical;Horizontal;Horizontal;Vertical;Vertical;Vertical]
[Vertical;Horizontal;Vertical;Horizontal;Vertical;Horizontal;Vertical]
| false ->
[Vertical;Vertical;Horizontal;Vertical;Horizontal;Vertical;Vertical]
[Vertical;Horizontal;Vertical;Horizontal;Vertical;Horizontal;Vertical]
| Rightangle->
match isLeftToRight with
| true ->
[Horizontal;Horizontal;Horizontal;Horizontal;Vertical;Vertical;Vertical]
[Horizontal;Vertical;Horizontal;Vertical;Horizontal;Vertical;Vertical]
| false ->
[Horizontal;Vertical;Horizontal;Vertical;Horizontal;Vertical;Vertical]