From 92324af573c77358d18f4093b8a15089a25131c4 Mon Sep 17 00:00:00 2001 From: Philip Puk Date: Sat, 26 Mar 2022 16:58:06 +0000 Subject: [PATCH] added code analysis for autorouting --- bugfix.md | 1 + docs/ReadMeCodeAnalysis.md | 57 +++++++++++++++++++++++++++++++++---- docs/img/Rightangle.png | Bin 0 -> 10799 bytes 3 files changed, 52 insertions(+), 6 deletions(-) create mode 100644 docs/img/Rightangle.png diff --git a/bugfix.md b/bugfix.md index e69de29..fecb196 100644 --- a/bugfix.md +++ b/bugfix.md @@ -0,0 +1 @@ +yhp19 - Fixing the Rightangle (2-4 Segment) case for the Autorouting algorithms. Equidistance is attempted whenever is possible (more explanation in the code analysis) \ No newline at end of file diff --git a/docs/ReadMeCodeAnalysis.md b/docs/ReadMeCodeAnalysis.md index b65b763..3bc81b8 100644 --- a/docs/ReadMeCodeAnalysis.md +++ b/docs/ReadMeCodeAnalysis.md @@ -1,9 +1,58 @@ # Code Analysis Readme -## BusWire - Section 1 +## BusWire -### 1. Add new auto-routing cases (Phillip?) +### 1. Add new auto-routing cases +A new type called *routeType* has been created to pass the information between functions + +1. Oppositeside - 3 / 5 Segments Wire (Original Issie implementation) + +2. Sameside - 3 / 5 Segments Wire (Ports are at the same side) + +3. Rightangle - 2 / 4 Segments Wire (Difference of Port Orientation = 90 degree) + +type *Direction* determine the Wire rotation + +`makeInitialASegList` + +1. Take the input and output Port position and Orientation from Symbol + +2. Match the orientation of the two port to the routeType, the rotation and yreflect applied to the default cases of routing in the spec. + +3. Find the location of the input port for the default cases by reversing the rotation and yreflect applied using relative location of input port to the output port + +4. Get the Vertices from `initialWireVerticesFromPorts` and convert them to ASegs using `convertVerticesToASegs` + +`initialWireVerticesFromPorts` + +- Oppositeside contains the same implementation of the original Issie + +- Sameside contains 3 conditions + + - Default three segments with endY >= startY + + - Three segments with endY < startY + + - Five segments where the endX is near with the startX + +- Rightangle contrains 3 conditions + + - Default two segments that endY>startY and endX>startX + + - Four Segments that the implement equidistance Horizontal Segments where (startX + endX) / 2.0)>(startX+Wire.stickLength) + + - Four Segments that do not implement equidistance Horizontal Segments: it is used for the edge cases from the second condition where the first horizontal segments after the first stick would go into opposite direction of the stick and through the component. Although at a cost that some cases could still implement equidistance segments after the rotation would fall into this case with the restriction of the second condition. + + ![Weird RightAngle Case](/docs/img/Rightangle.png) + +`convertVerticesToASegs` + +1. Assign the orientation and Dragable and the Direction of the ASeg from the Vertices + +2. Convert them to RISeg in order to rotate the segments back to original routing from default cases + +3. Calculate the Start for each RISeg and convert back to ASeg ### 2. Add rotation invariant Segment type #### Changes in files @@ -48,10 +97,6 @@ __Here, `Seq.zip3` is used instead of `List.zip3` as the former allows for uneve The presence of start and end rounded corners is calculated next. If the adjoining segment is too short, or if there is no connecting segment (ie. the current segment is the start / end), there is no rounded corner. If a rounded corner is present, the respective coordinates (start / end) of the segment are adjusted to meet the `svg path` of the rounded corner, and the path is drawn using a Bezier Curve, where the second control point lies on the end coordinate of the path. -## BusWire - Section 2 - -## BusWire - Section 3 - ## Symbol - Section 1 ## Symbol - Section 2 diff --git a/docs/img/Rightangle.png b/docs/img/Rightangle.png new file mode 100644 index 0000000000000000000000000000000000000000..7964d0d1fa37866f3ee588217f7a0ad3558c335b GIT binary patch literal 10799 zcmeHNc{J32zaRU)WS3=xB4S7yJB37vP?SAM5`(d?O}|J)*+P~SrR+=geJ9ykFfrC- z-`6bTe!eI@&vWl{&OPV;@!WeK=gje)na}(E`F!5**L$Bw+LzR5C=XM@U@#i>^C~(p z7!e5!Mj%g43O>31x$P-F| zoYK)%Cm`Ulj+t*m)kmKCs%D;s#23*y2_F$3A1SGJw6dNrE#bqXNj(Y= z4Dbx3q(LZZ>W_?vZm8?Bu@w}Gi=FQ~8}ROO{SD!#VoX zPvnV+rf@quiZ)_m*;+Tv)@2uVb_RlWc6LhHZsTo9{fQ!B@n_B3k(w1IK(bdY4b*RG zYQluTGdYalp*4&cJQ0A`VekS<2=j-Lf&UEPrIJYa>sum{M515M1oF_rG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