Table of Contents

Class BezierRouter

Namespace
FlowGraph.Core.Routing
Assembly
FlowGraph.Core.dll

Simple bezier router that creates smooth curves between ports. Does not perform obstacle avoidance - for that, use SmartBezierRouter.

public class BezierRouter : IEdgeRouter
Inheritance
BezierRouter
Implements
Inherited Members

Remarks

This router creates direction-aware bezier curves:

  • Left-to-right: Standard horizontal control points
  • Vertical edges: Control points along the vertical axis
  • Backward edges: Curves that loop appropriately

For obstacle avoidance, use SmartBezierRouter which extends this behavior to route around intermediate nodes.

Properties

Instance

Singleton instance.

public static BezierRouter Instance { get; }

Property Value

BezierRouter

MinControlPointOffset

Minimum horizontal offset from port for control point placement.

public double MinControlPointOffset { get; set; }

Property Value

double

Methods

CalculateControlPoints(Point, Point, double)

Calculates bezier control points based on edge direction.

public static (Point c1, Point c2) CalculateControlPoints(Point start, Point end, double offset)

Parameters

start Point

Start point.

end Point

End point.

offset double

Control point offset from endpoints.

Returns

(Point c1, Point c2)

Tuple of (control point 1, control point 2).

Route(EdgeRoutingContext, Edge)

Calculates waypoints for an edge to route around obstacles.

public IReadOnlyList<Point> Route(EdgeRoutingContext context, Edge edge)

Parameters

context EdgeRoutingContext

The routing context containing graph information.

edge Edge

The edge to route.

Returns

IReadOnlyList<Point>

A list of waypoints (including start and end points).