public Intersection mergeToNewIntersectionWithinBorder(Intersection anotherIntersection, IBorder3d aBorder, Trace aTrace, Object3d intersectedObject3d) { //List<IntersectionPoint> allips = new List<IntersectionPoint>(new IntersectionPoint[]{this.enter, this.exit, anotherIntersection.enter, anotherIntersection.exit} ); List <IntersectionPoint> allips = new List <IntersectionPoint>(); allips.Add(this.enter); allips.Add(this.exit); allips.Add(anotherIntersection.enter); allips.Add(anotherIntersection.exit); List <IntersectionPoint> validips = new List <IntersectionPoint>(); foreach (IntersectionPoint ip in allips) { if ((ip != null) && (aBorder.contains(ip.loc))) { validips.Add(ip); } } return(new Intersection(aTrace, validips.ToArray(), intersectedObject3d)); }
public Intersection mergeToNewIntersectionWithinBorder(Intersection anotherIntersection, IBorder3d aBorder, Trace aTrace, Object3d intersectedObject3d) { //List<IntersectionPoint> allips = new List<IntersectionPoint>(new IntersectionPoint[]{this.enter, this.exit, anotherIntersection.enter, anotherIntersection.exit} ); List<IntersectionPoint> allips = new List<IntersectionPoint>(); allips.Add(this.enter); allips.Add(this.exit); allips.Add(anotherIntersection.enter); allips.Add(anotherIntersection.exit); List<IntersectionPoint> validips = new List<IntersectionPoint>(); foreach (IntersectionPoint ip in allips) if ((ip != null) && (aBorder.contains(ip.loc))) validips.Add(ip); return new Intersection(aTrace, validips.ToArray(), intersectedObject3d); }