Skip to main content
added 1 character in body
Source Link
user1703
user1703

You can use an incremental approach.

In 3D, it works as follows:

  • Assume that as some point you have constructed the (possibly open) polytope defined by the $k$ first planeplanes.

  • Consider the next plane and change the coordinate system so that the equation simplifies to $z=0$.

  • For every edge of the polytope, check if the endpoints belong to the same half-plane defined by the next plane ($z$ sign).

  • If both have $z>0$, keep the edge; if both have $z<0$, discard the edge; otherwise, compute the intersection point of the edge with the plane and trim the edge. Finally, join the intersection points to form a convex section polygon.

  • Repeat with the remaining planes.

This method cannot avoid the $O(n^3)$ behavior in the worst case (no method can) but if you are lucky it can keep the number of useless vertex computations to a low value. (At best, $O(nm)$ intersections for $n$ planes and $m$ vertices in the solution.)

You can use an incremental approach.

In 3D, it works as follows:

  • Assume that as some point you have constructed the (possibly open) polytope defined by the $k$ first plane.

  • Consider the next plane and change the coordinate system so that the equation simplifies to $z=0$.

  • For every edge of the polytope, check if the endpoints belong to the same half-plane defined by the next plane.

  • If both have $z>0$, keep the edge; if both have $z<0$, discard the edge; otherwise, compute the intersection point of the edge with the plane and trim the edge. Finally, join the intersection points to form a convex section polygon.

  • Repeat with the remaining planes.

This method cannot avoid the $O(n^3)$ behavior in the worst case (no method can) but if you are lucky it can keep the number of useless vertex computations to a low value. (At best, $O(nm)$ intersections for $n$ planes and $m$ vertices in the solution.)

You can use an incremental approach.

In 3D, it works as follows:

  • Assume that as some point you have constructed the (possibly open) polytope defined by the $k$ first planes.

  • Consider the next plane and change the coordinate system so that the equation simplifies to $z=0$.

  • For every edge of the polytope, check if the endpoints belong to the same half-plane defined by the plane ($z$ sign).

  • If both have $z>0$, keep the edge; if both have $z<0$, discard the edge; otherwise, compute the intersection point of the edge with the plane and trim the edge. Finally, join the intersection points to form a convex section polygon.

  • Repeat with the remaining planes.

This method cannot avoid the $O(n^3)$ behavior in the worst case (no method can) but if you are lucky it can keep the number of useless vertex computations to a low value. (At best, $O(nm)$ intersections for $n$ planes and $m$ vertices in the solution.)

added 14 characters in body
Source Link
user1703
user1703

You can use an incremental approach.

In 3D, it works as follows:

  • Assume that as some point you have constructed the (possibly open) polytope defined by the $k$ first plane.

  • Consider the next plane and change the coordinate system so that the equation simplifies to $z=0$.

  • For every edge of the polytope, check if the endpoints belong to the same half-plane defined by the next plane.

  • If both have $z>0$, keep the edge; if both have $z<0$, discard the edge; otherwise, compute the intersection point of the edge with the plane and trim the edge. Finally, join the intersection points to form a convex section polygon.

  • Repeat with the remaining planes.

This method cannot avoid the $O(n^d)$$O(n^3)$ behavior in the worst case (no method can) but if you are lucky it can keep the number of useless vertex computations to a low value. (At best, $O(nm)$ intersections for $n$ planes and $m$ vertices in the solution.)

You can use an incremental approach.

In 3D, it works as follows:

  • Assume that as some point you have constructed the (possibly open) polytope defined by the $k$ first plane.

  • Consider the next plane and change the coordinate system so that the equation simplifies to $z=0$.

  • For every edge of the polytope, check if the endpoints belong to the same half-plane defined by the next plane.

  • If both have $z>0$, keep the edge; if both have $z<0$, discard the edge; otherwise, compute the intersection point of the edge with the plane and trim the edge. Finally, join the intersection points to form a convex section polygon.

  • Repeat with the remaining planes.

This method cannot avoid the $O(n^d)$ behavior in the worst case (no method can) but if you are lucky it can keep the number of useless vertex computations to a low value. (At best, $O(nm)$ for $n$ planes and $m$ vertices in the solution.)

You can use an incremental approach.

In 3D, it works as follows:

  • Assume that as some point you have constructed the (possibly open) polytope defined by the $k$ first plane.

  • Consider the next plane and change the coordinate system so that the equation simplifies to $z=0$.

  • For every edge of the polytope, check if the endpoints belong to the same half-plane defined by the next plane.

  • If both have $z>0$, keep the edge; if both have $z<0$, discard the edge; otherwise, compute the intersection point of the edge with the plane and trim the edge. Finally, join the intersection points to form a convex section polygon.

  • Repeat with the remaining planes.

This method cannot avoid the $O(n^3)$ behavior in the worst case (no method can) but if you are lucky it can keep the number of useless vertex computations to a low value. (At best, $O(nm)$ intersections for $n$ planes and $m$ vertices in the solution.)

Source Link
user1703
user1703

You can use an incremental approach.

In 3D, it works as follows:

  • Assume that as some point you have constructed the (possibly open) polytope defined by the $k$ first plane.

  • Consider the next plane and change the coordinate system so that the equation simplifies to $z=0$.

  • For every edge of the polytope, check if the endpoints belong to the same half-plane defined by the next plane.

  • If both have $z>0$, keep the edge; if both have $z<0$, discard the edge; otherwise, compute the intersection point of the edge with the plane and trim the edge. Finally, join the intersection points to form a convex section polygon.

  • Repeat with the remaining planes.

This method cannot avoid the $O(n^d)$ behavior in the worst case (no method can) but if you are lucky it can keep the number of useless vertex computations to a low value. (At best, $O(nm)$ for $n$ planes and $m$ vertices in the solution.)