public override PointedSubspace IntersectedWith(PointedSubspace other) { if (other.Snap(Vector3.zero) == Vector3.zero) { return(new PointedSubspace(IntersectedWith(other.subspace), Vector3.zero)); } if (other.subspace is Subspace1) { Vector3?intersect = _intersect_plane_line( normal, Vector3.zero, other.point0, ((Subspace1)other.subspace).axis); if (intersect.HasValue) { return(new PointedSubspace(new Subspace0(), intersect.Value)); } } else if (other.subspace is Subspace2) { Subspace ss = other.subspace.NormalSubspace().JoinedWithVector(normal); if (ss is Subspace2) { Vector3 intersect_normal = ((Subspace2)ss).normal; Subspace ss2 = IntersectedWithPlane(intersect_normal); /* a Subspace1 */ PointedSubspace pss2 = ss2.IntersectedWith(other); return(new PointedSubspace(ss.NormalSubspace(), pss2.point0)); } } return(PointedSubspace.Void()); }
public override Subspace IntersectedWith(Subspace other) { return(other.NormalSubspace().JoinedWithVector(normal).NormalSubspace()); }