ConstraintSystem

References
public sealed class ConstraintSystem
A constraint system.

Constructors

ConstraintSystem

#
public ConstraintSystem()
Create a new, empty system.

Properties

ConstructionEdges

#
public IEnumerable<Edge> ConstructionEdges { get; }
Iterate over all construction edges.

EdgeCount

#
public int EdgeCount { get; }
Gets the number of edges in this system.

EdgeCurves

#
public IEnumerable<(Curve curve, bool construction)> EdgeCurves { get; }
Iterate over all edges. This enumerates either returns Lines, Circles or Arcs.

Edges

#
public IEnumerable<Edge> Edges { get; }
Iterate over all edges.

GoalCount

#
public int GoalCount { get; }
Gets the number of goals in this system.

Goals

#
public IEnumerable<Goal> Goals { get; }
Iterate over all goals.

NodeCount

#
public int NodeCount { get; }
Gets the number of nodes in this system.

Nodes

#
public IEnumerable<Node> Nodes { get; }
Iterate over all edges.

PrimaryEdges

#
public IEnumerable<Edge> PrimaryEdges { get; }
Iterate over all primary edges.

ScalarCount

#
public int ScalarCount { get; }
Gets the number of scalars in this system.

Methods

Add

#
public ConstraintSystem Add(params Edge[] edges)
Add one or more edges to this system.
edges (params Edge[])

Add

#
public ConstraintSystem Add(params Goal[] goals)
Add one or more goals to this system.
goals (params Goal[])

Add

#
public ConstraintSystem Add(params Node[] nodes)
Add one or more nodes to this system.
nodes (params Node[])

Add

#
public ConstraintSystem Add(params Scalar[] scalars)
Add one or more nodes to this system.
scalars (params Scalar[])

BoundingBox

#
public bool BoundingBox(out double x0, out double x1, out double y0, out double y1)
Gets the bounding box containing all nodes and edges.
x0 (out double)
x1 (out double)
y0 (out double)
y1 (out double)

Constants

#
public int Constants(out string[] numbers, out string[] points)
Gets all the named constants in this system.
numbers (out string[])
points (out string[])

Deviation

#
public double Deviation(ConstraintSystem other)
Measure the deviation between two systems.
other (ConstraintSystem)

EdgeAt

#
public Edge EdgeAt(int index)
Gets the node at the given index.
index (int)

EdgeAt

#
public int EdgeAt(Point2d location, double radius, out Edge edge)
Find the edge at the given location.
location (Point2d)Location
radius (double)Search radius.
edge (out Edge)Edge at or near location.
Index of edge.

EdgeCurve

#
public Curve EdgeCurve(Edge edge)
Create the curve which matches the edge shape. This method will either return null if the edge nodes cannot be found, a Rhino.Geometry.Line, Rhino.Geometry.Circle or Rhino.Geometry.Arc.
edge (Edge)

EdgeLength

#
public double EdgeLength(Edge edge)
Measure the length of an edge.
edge (Edge)

EdgeRadius

#
public double EdgeRadius(Edge edge)
Measure the radius of an edge.
edge (Edge)

FindEdge

#
public int FindEdge(Guid id, out Edge edge)
Find the edge with the given id.
id (Guid)
edge (out Edge)

FindNode

#
public int FindNode(Guid id, out Node node)
Find the node with the given id.
id (Guid)
node (out Node)

FindScalar

#
public int FindScalar(Guid id, out Scalar scalar)
Find the scalar with the given id.
id (Guid)
scalar (out Scalar)

GoalAt

#
public Goal GoalAt(int index)
Gets the goal at the given index.
index (int)

Iterate

#
public ConstraintSystem Iterate(Resolver resolver, CancellationToken token, out double deviation)
Perform a solver iteration and create a new constraint system.
resolver (Resolver)
token (CancellationToken)
deviation (out double)

MoveNamedPoints

#
public ConstraintSystem MoveNamedPoints(Resolver resolver, bool dragFreePoints)
Move all fixed and named points to new location.
resolver (Resolver)Resolver for names?
dragFreePoints (bool)If true, free points are dragged along with fixed points.

NodeAt

#
public int NodeAt(Point2d location, double radius, out Node node)
Find the node at the given location.
location (Point2d)Location
radius (double)Search radius.
node (out Node)Node at or near location.
Index of node.

NodeAt

#
public Node NodeAt(int index)
Gets the node at the given index.
index (int)

Remove

#
public ConstraintSystem Remove(params Guid[] identifiers)
Remove all elements with matching identifiers from the system. Note that this will also remove any related elements which rely on any of the removed objects. If you want to switch out elements, he correct methodology is not to remove the old ones and add new ones, but rather to replace the elements.
identifiers (params Guid[])

ReplaceGoalValue

#
public ConstraintSystem ReplaceGoalValue(Guid goalId, Value value)
Replace the value of a goal.
goalId (Guid)
value (Value)

ReplaceNodes

#
public ConstraintSystem ReplaceNodes(IEnumerable<Node> newNodes)
Replace nodes in this system with nodes from the supplied list when their Ids match.
newNodes (IEnumerable<Node>)Replacement nodes.
Modified system.

ScalarAt

#
public Scalar ScalarAt(int index)
Gets the scalar at the given index.
index (int)

ToggleEdgeConstruction

#
public ConstraintSystem ToggleEdgeConstruction(int index)
Toggle the construction state of the edge at the given index.
index (int)

ToggleNodeFixing

#
public ConstraintSystem ToggleNodeFixing(int index)
Toggle the fixed state of the node at the given index.
index (int)