Back to FabImage Library website
You are here: Start » Function Reference » Path » Path Global Transforms » ReducePath

ReducePath
Header: | FIL.h |
---|---|
Namespace: | fil |
Module: | FoundationBasic |
Reduces the number of points in a path preserving its shape with the specified precision.
Syntax
C++
C#
void fil::ReducePath ( const fil::Path& inPath, float inMaxDistance, fil::Path& outPath, ftl::Array<fil::Path>& diagIntermediatePaths )
Parameters
Name | Type | Range | Default | Description | |
---|---|---|---|---|---|
![]() |
inPath | const Path& | Input path | ||
![]() |
inMaxDistance | float | 0.0 - ![]() |
0.5f | Maximum distance between (possibly removed in the process) characteristic point of the input path and the output path. |
![]() |
outPath | Path& | Reduced path | ||
![]() |
diagIntermediatePaths | Array<Path>& | Intermediate results on all levels of recursion of the Ramer algorithm |
Description
The operation removes some of the characteristic points of the input path preserving its shape with the selected precision. The algorithm guarantees that each of the removed characteristic points lies within the inMaxDistance distance from the resulting path.
The operation works with open and closed paths as well.
Examples
![]() |
![]() |
![]() |
ReducePath run on the sample path array with inMaxDistance = 0.5. |
ReducePath run on the sample path array with inMaxDistance = 5. |
See Also
- ConvertToEquidistantPath – Creates a new path whose characteristic points lie on the input path, but are equally spaced.