# Computing the intersections of arbitrary number of planes

Imagine three sets of planes (A, B, and C). The planes in each set are parallel and evenly spaced and so can be defined by a plane equation and a scalar representing the distance between planes. If all three of these sets were orthogonal (as a contrived example) then by computing the intersections of all the planes somehow, it would generate a lattice consisting of an edge anywhere that any two planes intersect and a vertex at any point where three planes intersect. Assume that I am generating this lattice over a finite bounding volume (let's just make it a cube for simplicity and assume the set of planes exist within said cube). I can easily brute-force solve this by intersecting the sets of planes two sets at a time (i.e. AB, BC, and AC) generating a set of edges and then finding the intersections of each edge with every other edge, but this algorithm would be O(really bad).

I would like to find the lattice generated by an arbitrary number of sets of planes where each set contains parallel planes that are uniformly spaced (although the spacing for each set is arbitrary). I would like to do this in O(decent) if that's possible. I know that I can break this problem down exactly the same way and solve for pairs of planes and then intersect all the edges but this problem gets worse and worse as the number of planes increases. I feel like I can probably solve this more easily by transforming every set of planes into a single plane that intersects the origin, finding the intersecting lines, then intersecting all of those lines and then generating the rest of the lattice since I know the spacing of vertices (if any) on each line will correspond to the distance along that line between the planes for each set (which is again known since the spacing is constant for each set) but this would still be inefficient for an arbitrary number of planes. I'm willing to accept that this is just a hard problem to solve and that brute-forcing it may be my only option but I figured that I'd ask in case anyone has any insight on how I can make this better somehow.

Also, it is safe to ignore the case where the sets of planes never intersect at all or only intersect along an edge. The application of this problem is model synthesis (relevant paper if anyone is interested: http://gamma.cs.unc.edu/synthesis/papers/constraint.pdf)

Something like: $(x-1)(x-3)(x-5) = 1/100$ , $(y-4)(y-7)(y-10) = 1/100$, $(z-1)(z-4)(z-7) = 1/100$ ?