This file contains 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
... | |
dotProduct ({ x, y }) { | |
return (this.x * x) + (this.y + y) | |
} | |
... |
This file contains 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
const Vector3D = (x, y, z) => create({ | |
scaleBy (factor) { | |
return Vector2D(x * factor, y * factor, z * factor) | |
}, | |
negate () { | |
return this.scaleBy(-1) | |
}, | |
normalize () { | |
return this.scaleBy(1 / this.length) | |
}, |
This file contains 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
public class WallGeometry : IGraphNode | |
{ | |
public Line2D Basis; | |
public List<WallSibling> Siblings; | |
public List<List<Line3D>> Openings; | |
public double Thickness; | |
public double Height; | |
public double Elevation; | |
public List<IGraphNode> Childrens => |
This file contains 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
public void InitSiblings(List<WallGeometry> possibleSiblings) | |
{ | |
var filtered = possibleSiblings.Where(wall => wall != this); | |
Siblings = filtered.Aggregate(new List<WallSibling>(), (walls, wall) => | |
{ | |
var point = SU.RealIntersection(wall.Basis, Basis); | |
return point == null ? walls : walls.Concat(new List<WallSibling> { new WallSibling(point.Value, wall) }).ToList(); | |
}); | |
} |
This file contains 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
List<Rebar> GetHorizontalRebars(WallGeometry wall, double cover, double step); | |
(List<Rebar> start, List<Rebar> end) GetPLikeRebars(WallGeometry wall, double cover, double step); | |
List<Rebar> GetTransVerseRebars(WallGeometry wall, double cover, double stepH, double stepV, double tr1, double tr2); | |
List<Rebar> GetAngularRebars(Point2D startPoint, Point2D intersectionPoint, Point2D endPoint, double thickness, double cover, double height, double step, double lanc, double elevation); |
This file contains 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
// openings reinforcement | |
List<Rebar> GetPLikeRebars(List<Line3D> holeContour, double thickness, double cover, double step) | |
List<Rebar> GetILikeRebars(List<Line3D> holeContour, double thickness, double cover, double step, double lanc) | |
// rebars cropping | |
List<List<Line3D>> LinesCroppingMappingForHoles(List<List<Line3D>> rebars, List<Point3D> contour, List<List<Point3D>> holeContours, double thickness, bool croppByContour = false) |
This file contains 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); | |
} |
This file contains 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
public class Rebar | |
{ | |
public List<Line3D> Polyline { get; set; } | |
public double Diameter { get; set; } | |
public string ShapeCode { get; set; } | |
public int Type { get; set; } | |
} |
This file contains 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
empty yet |
This file contains 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
function delay(duration) { | |
const promise = new Promise(resolve => { | |
setTimeout(() => resolve(true), duration) | |
}) | |
return promise | |
} | |
function* getCost(successAction) { | |
try { | |
const { startLocation, endLocation, apiKey } = yield select() |