Table of Contents

Method TryFilletCorner

Namespace
GeometryHelper.Core
Assembly
GeometryHelper.dll

TryFilletCorner(GeoLine2, GeoLine2, double, out GeoArc2, out GeoLine2, out GeoLine2)

Rounds the corner between two segments with an arc of a given radius, using the default tolerance.

public static bool TryFilletCorner(GeoLine2 line1, GeoLine2 line2, double radius, out GeoArc2 arc, out GeoLine2 trimmed1, out GeoLine2 trimmed2)

Parameters

line1 GeoLine2
line2 GeoLine2
radius double
arc GeoArc2
trimmed1 GeoLine2
trimmed2 GeoLine2

Returns

bool

TryFilletCorner(GeoLine2, GeoLine2, double, out GeoArc2, out GeoLine2, out GeoLine2, Tolerance)

Rounds the corner between two segments with an arc of a given radius, within a tolerance.

public static bool TryFilletCorner(GeoLine2 line1, GeoLine2 line2, double radius, out GeoArc2 arc, out GeoLine2 trimmed1, out GeoLine2 trimmed2, Tolerance tolerance)

Parameters

line1 GeoLine2

The first segment.

line2 GeoLine2

The second segment.

radius double

The radius of the arc; it must be positive.

arc GeoArc2

The arc tangent to both segments, running from the first to the second, or an arc of no meaning when the method returns false.

trimmed1 GeoLine2

The first segment ending where the arc begins.

trimmed2 GeoLine2

The second segment beginning where the arc ends.

tolerance Tolerance

The tolerance.

Returns

bool

true if the corner had room for an arc of that radius; otherwise, false.

Remarks

This is AutoCAD's FILLET with two objects picked. The corner is where the lines carrying the two segments cross, and the arc touches each of them at radius / tan(half the corner) from it. Each segment keeps its part on the far side of the corner, as TryTrimExtendToCorner(GeoLine2, GeoLine2, out GeoLine2, out GeoLine2) does, and gives up the part the arc replaces.

The corner needs room for the arc: the touching points must lie within the segments once they are trimmed or extended to it. Where they do not, or the segments are parallel, or one of them is too short to have a direction, the answer is false rather than an arc that overshoots.

Exceptions

ArgumentOutOfRangeException

Thrown when the radius is not a positive number.