You are here: Start » Function Reference » Path » Path Features » PathDiameter
Header: | FIL.h |
---|---|
Namespace: | fil |
Module: | FoundationLite |
Finds the longest segment connecting two characteristic points of a path.
Syntax
void fil::PathDiameter ( const fil::Path& inPath, ftl::Optional<fil::Segment2D&> outDiameter, ftl::Optional<float&> outDiameterLength )
Parameters
Name | Type | Default | Description | |
---|---|---|---|---|
![]() |
inPath | const Path& | Input path | |
![]() |
outDiameter | Optional<Segment2D&> | ||
![]() |
outDiameterLength | Optional<float&> |
Optional Outputs
The computation of following outputs can be switched off by passing value ftl::NIL
to these parameters: outDiameter, outDiameterLength.
Read more about Optional Outputs.
Description
The operation finds the most distant pair of points within a path and returns the distance between them (outDiameterLength) and the segment representing the diameter (outDiameter). If there is more than one pair of maximal distance, the returned segment will correspond to one of them. The orientation of the resulting outDiameter is always between 0 and 180 degrees.
Examples
![]() |
The resulting outDiameterLength = 280.0921, outDiameter segment was drawn onto the sample path.
Errors
List of possible exceptions:
Error type | Description |
---|---|
DomainError | Empty path on input in PathDiameter. |
See Also
- RegionDiameter – Computes the longest segment connecting two pixels contained in region and its length.