Skip to content

TrimCollinear

Seth Hillbrand edited this page Oct 29, 2026 · 2 revisions

Home › clipper.h › TrimCollinear

TrimCollinear

inline Path64 TrimCollinear(const Path64& p, bool is_open_path = false);
inline PathD TrimCollinear(const PathD& p, int precision, bool is_open_path = false);

This function removes the vertices between adjacent collinear segments. It will also remove duplicate vertices (adjacent vertices with identical coordinates).

With floating point paths, the precision parameter indicates the decimal precision that's required when determining collinearity.

Note: While duplicate vertices will be removed automatically from clipping solutions, collinear edges will not unless the Clipper object's PreserveCollinear property had been disabled.

See Also

Clipper64.PreserveCollinear, ClipperD.PreserveCollinear

Clone this wiki locally