SnapLine

public sealed class SnapLine : ISnapElement
Implements ISnapElement for individual lines.

Constructors

SnapLine

#
public SnapLine(LinearSegment line, bool infinite, double radius)
Create a new snap line.
line (LinearSegment)Line geometry.
infinite (bool)True if line ought to be considered as infinite.
radius (double)Snapping radius.

Properties

Disjoint

#
public bool Disjoint { get; }
Gets whether this element consists of multiple disjoint pieces.

Infinite

#
public bool Infinite { get; }
Gets whether this line ought to be treated as infinitely long.

Line

#
public LinearSegment Line { get; }
Gets the line geometry.

Projection

#
public SnapProjection Projection { get; }
Gets the type of projection for this element.
Projection

Radius

#
public double Radius { get; }
Gets the radius within which this element is active.
Radius

Methods

DistanceTo

#
public double DistanceTo(double x, double y)
Compute the distance from a coordinate to this element.
x (double)X coordinate.
y (double)Y coordinate.
Minimum distance from the coordinate to this element.

Project

#
public bool Project(double x, double y, bool limitToRadius, out double xPrime, out double yPrime, out string description)
x (double)
y (double)
limitToRadius (bool)
xPrime (out double)
yPrime (out double)
description (out string)
Project

Project

#
public bool Project(double x, double y, bool limitToRadius, out double xPrime, out double yPrime)
Project a coordinate pair onto this element.
x (double)X coordinate to project.
y (double)Y coordinate to project.
limitToRadius (bool)If true, coordinates will not be projected if the projection distance would exceed the radius.
xPrime (out double)Projected x coordinate. If the projection fails, xPrime will be equal to x.
yPrime (out double)Projected y coordinate. If the projection fails, yPrime will be equal to y.
True if projection was successful.