Polygon Clipping

Polygon Clipping

The average user will not need to look at this page.

clip_in_tet_coordinates(p)

Calls clip

source
clip_plane_tet(plane, tet)

Clips a plane by a tetrahedron. The plane takes the form of a static row matrix The tet takes the form of a static matrix

source
getTetQuadRule(n_rule)

Outputs the Yu tetrahedron quadrature rules from the Python package quadpy.

source
getTriQuadRule(n_rule)

Outputs the XiaoGimbutas triangle quadrature rules from the Python package quadpy.

source

Sets small coondinates of a polygon in tetrahedral coordinates to zero. This function addresses a specific probability one degeneracy that results when clipping an edge in the same place twice.

source

Together with cut_clip, implements the clipping of polygons by tetrahedra using the Sutherland–Hodgman algorithm. The Sutherland-Hodgman algorithm essentially clips a polygon by one plane at a time. You should not call this function directly. Clipped polygons are assumed to have at most 8 sides. This implementation should correctly handle the case where 2 of fewer vertices lie exactly on a plane.

source
cut_clip(z1, z2, z3, i)

Removes a non-positive vertex from a polygon.

source
centroid(p_new, n̂)

Finds the centroid of a 3 dimensional poly_eight by dividing the area into triangles. This funciton requires a reference normal n̂.

source
mul_then_un_pad(m, p)

Multiplies a 4 dimensional polygon by a 4x4 matrix and then unpads the 4 dimensional polygon. This function is used to convert a polygon in tetrahedral coordinates to a polygon in Cartesian coordinates.

source
one_pad_then_mul(m, p)

One pads each element of a 3 dimensional polygon and then multiplies it by a 4x4 matrix m. This funciton is used to convert each element of a Cartesian polygon into tetrahedral coordinates.

source