Created
October 5, 2017 13:49
-
-
Save radzionc/10efd21422076d4efc314da43b2cc1ba to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| rebars | |
| .Select((rebar, rebarIndex) => linesAfterCropping.ElementAt(rebarIndex) | |
| .Select(lines => | |
| { | |
| var shapeCode = rebar.ShapeCode; | |
| if (shapeCode == ShapeCodes.ANGULAR || shapeCode == ShapeCodes.G_LIKE) | |
| { | |
| if (lines.Count == 1) return new Rebar(rebar, lines) { ShapeCode = ShapeCodes.LINE }; | |
| return new Rebar(rebar, lines); | |
| } | |
| if (shapeCode == ShapeCodes.TRANS_VERSE) | |
| { | |
| return SU.Equals(rebar.Polyline.First().Length, lines.First().Length) ? rebar : null; | |
| } | |
| if (shapeCode == ShapeCodes.P_LIKE) | |
| { | |
| return lines.Count == 3 ? new Rebar(rebar, lines) : null; | |
| } | |
| return new Rebar(rebar, lines); | |
| }) | |
| .Where(r => r != null) | |
| ) | |
| .SelectMany(s => s) | |
| .ToList(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment