public override List <Curve> Visit(LineSite ls) { List <Curve> bisectors = new List <Curve>(); Line line0 = Line; Line line1 = ls.Line; Vector n0 = line0.KHat; double c0 = line0.C; Vector n1 = line1.KHat; double c1 = line1.C; if ((n0.Magnitude2 > 0.0) && (n1.Magnitude2 > 0.0)) { List <double> signs = new List <double> { -1.0, 1.0 }; foreach (double sign in signs) { Vector nb = n0 + sign * n1; double db = c0 + sign * c1; if (nb.Magnitude2 > Constants.tol) { Point b0 = nb * (db / nb.Magnitude2); bisectors.Add(new Line(b0, nb)); } } } return(bisectors); }
private void AddSite(Point tail, Point head) { PointSite ps = new PointSite(tail, pointSitePrefab, spheres); if (!pointSites.ContainsNear(ps)) { pointSites.Add(ps); sites.Add(ps); } LineSite ls = new LineSite(tail, head, lineSitePrefab, cylinders); if (!lineSites.Contains(ls)) { lineSites.Add(ls); sites.Add(ls); } }
public abstract List <Curve> Visit(LineSite ls);
//public override double X { get { return Center.X; } } //public override double Y { get { return Center.Y; } } //public override double Z { get { return Center.Z; } } public bool IsParallel(LineSite ls) { return(unit.IsParallel(ls.Unit)); }
public override List <Curve> Visit(LineSite ls) { return(ls.Visit(this)); }