private static IEnumerable <Pt[]> Connector(HexFrameInfo inf) { var numV = 6; var middleRadius = inf.InnerRadius * _hexFrameBoxLocationRatio + inf.OuterRadius * (1 - _hexFrameBoxLocationRatio); var boxes = Enumerable.Range(0, numV) .Select(i => 360.0 * i / numV + inf.StartAngle) .Select(angle => new { Angle = angle, BoxCenter = pt(middleRadius * cos(angle), inf.Depth, middleRadius * sin(angle)) }) .SelectMany(boxInf => circularSweep(new[] { p(0, 0), p(_hexFrameBoxInnerRadius, 0), p(_hexFrameBoxInnerRadius, _hexFrameBoxHeight), p(_hexFrameBoxOuterRadius, _hexFrameBoxHeight), p(_hexFrameBoxOuterRadius, 0) }, 4, boxInf.Angle).Move(boxInf.BoxCenter)) .ToArray(); return(boxes); }
private static IEnumerable <Pt[]> HexFrame(HexFrameInfo inf) { return(circularSweep(new[] { p(inf.InnerRadius - inf.Bevel, 0), p(inf.InnerRadius, inf.Depth), p(inf.OuterRadius, inf.Depth), p(inf.OuterRadius + inf.Bevel, 0) }, 6, inf.StartAngle)); }