Class BezierRouter
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
MinControlPointOffset
Minimum horizontal offset from port for control point placement.
public double MinControlPointOffset { get; set; }
Property Value
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
Returns
Route(EdgeRoutingContext, Edge)
Calculates waypoints for an edge to route around obstacles.
public IReadOnlyList<Point> Route(EdgeRoutingContext context, Edge edge)
Parameters
contextEdgeRoutingContextThe routing context containing graph information.
edgeEdgeThe edge to route.
Returns
- IReadOnlyList<Point>
A list of waypoints (including start and end points).