@@ -415,12 +415,29 @@ public static IEnumerable<Line> CreateGrid(GridType gridType, double width, doub
415415
416416 return lines ;
417417 }
418- ////case GridType.RootPhiRectangle:
419- //// {
420- //// var rectangle = CalculateDynamicRectangleExtents(RatioConstants.RootPhi / RatioConstants.One, actualAspectRatio);
421- //// // TODO: armature
422- //// return CreateRootNRectangle(rectangle);
423- //// }
418+ case GridType . RootPhiRectangle :
419+ {
420+ var rectangle = CalculateDynamicRectangleExtents ( RatioConstants . RootPhi / RatioConstants . One , actualAspectRatio ) ;
421+ var lines = CreateRectangleWithMainDiagonals ( rectangle ) ;
422+
423+ var w = rectangle . Width / ( RatioConstants . RootPhi * RatioConstants . RootPhi ) ;
424+ var h = rectangle . Height / ( RatioConstants . RootPhi * RatioConstants . RootPhi ) ;
425+
426+ lines . Add ( new Line ( rectangle . Left + w , rectangle . Top , rectangle . Left + w , rectangle . Bottom ) ) ;
427+ lines . Add ( new Line ( rectangle . Right - w , rectangle . Top , rectangle . Right - w , rectangle . Bottom ) ) ;
428+ lines . Add ( new Line ( rectangle . Left , rectangle . Top + h , rectangle . Right , rectangle . Top + h ) ) ;
429+ lines . Add ( new Line ( rectangle . Left , rectangle . Bottom - h , rectangle . Right , rectangle . Bottom - h ) ) ;
430+
431+ // Left
432+ lines . Add ( new Line ( rectangle . Left , rectangle . Top , rectangle . Left + w , rectangle . Bottom ) ) ;
433+ lines . Add ( new Line ( rectangle . Left , rectangle . Bottom , rectangle . Left + w , rectangle . Top ) ) ;
434+
435+ // Right
436+ lines . Add ( new Line ( rectangle . Right , rectangle . Top , rectangle . Right - w , rectangle . Bottom ) ) ;
437+ lines . Add ( new Line ( rectangle . Right , rectangle . Bottom , rectangle . Right - w , rectangle . Top ) ) ;
438+
439+ return lines ;
440+ }
424441 case GridType . Root2Rectangle :
425442 {
426443 var rectangle = CalculateDynamicRectangleExtents ( RatioConstants . Root2 / RatioConstants . One , actualAspectRatio ) ;
0 commit comments