public sealed class Node
A node in a constraint system.

Fields

Error

#
public readonly double Error

Id

#
public readonly Guid Id

Location

#
public readonly Point2d Location

OriginId

#
public static readonly Guid OriginId

Type

#
public readonly NodeType Type

Properties

CanMove

#
public bool CanMove { get; }
Gets whether this node can move.

IsFixed

#
public bool IsFixed { get; }
Gets whether this point is fixed during solutions. This is just the opposite of CanMove.

IsValid

#
public bool IsValid { get; }
Gets whether this node is valid. Valid nodes have valid numerical coordinates.

Origin

#
public static Node Origin { get; }
Create the origin node.

Unset

#
public static Node Unset { get; }
Gets an unset node.

Methods

CreateFixed

#
public static Node CreateFixed(Point2d location, Guid id = default(Guid))
Create a fixed node.
location (Point2d)
id (Guid = null)

CreateFree

#
public static Node CreateFree(Point2d location, Guid id = default(Guid))
Create a free node.
location (Point2d)
id (Guid = null)

Distance

#
public double Distance(Point2d point)
Compute the distance to another coordinate.
point (Point2d)

Quadrance

#
public double Quadrance(Point2d point)
Compute the quadrance (i.e. distance-squared) to another coordinate.
point (Point2d)

WithLocation

#
public Node WithLocation(Point2d location, double error = NaN)
Move this node in space to a new location. Be careful when modifying fixed nodes, it is not always desired.
location (Point2d)
error (double = NaN)

WithType

#
public Node WithType(NodeType type)
Change the type of this node.
type (NodeType)

Convertors

OperationResultDescription
implicitNodeGuidAuto-convert a node to its ID.