skip navigation
  • Product Bundles

    DevCraft

    All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:

    • NEW: Design Kits for Figma
    • Online Training
    • Document Processing Library
    • Embedded Reporting for web and desktop
    Web
    Kendo UI UI for jQuery UI for Angular UI for React UI for Vue UI for Blazor UI for ASP.NET Core UI for ASP.NET MVC UI for ASP.NET AJAX UI for Silverlight UI for PHP UI for JSP
    Mobile
    UI for .NET MAUI UI for Xamarin
    Document Management
    Telerik Document Processing
    Desktop
    UI for .NET MAUI UI for WinUI UI for WinForms UI for WPF UI for UWP
    Reporting & Mocking
    Telerik Reporting Telerik Report Server Telerik JustMock
    Automated Testing
    Test Studio Test Studio Dev Edition
    CMS
    Sitefinity
    UI/UX Tools
    ThemeBuilder Design System Kit
    Debugging
    Fiddler Fiddler Everywhere Fiddler Classic Fiddler Jam FiddlerCap FiddlerCore
    Extended Reality
    UI for Unity XR
    Free Tools
    JustAssembly JustDecompile VB.NET to C# Converter Testing Framework
    View all products
  • Overview
  • Demos
    • What's New
    • Roadmap
    • Release History
  • Docs & Support
  • Pricing
  • Search
  • Shopping cart
    • Account Overview
    • Your Licenses
    • Downloads
    • Support Center
    • Forum Profile
    • Payment Methods
    • Edit Profile
    • Log out
  • Login
  • Contact Us
  • Try now

Class GeometryExtensions

Methods related to planar geometry.

Inheritance
System.Object
GeometryExtensions
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Telerik.WinControls.UI.Diagrams
Assembly: Telerik.WinControls.RadDiagram.dll

Syntax

public static class GeometryExtensions

Methods

Add(PathFigure, PathSegment)

Adds the given PathSegment to the path figure.

Declaration
public static PathFigure Add(this PathFigure pathFigure, PathSegment segment)
Parameters
PathFigure pathFigure

The path figure.

PathSegment segment

The segment.

Returns
PathFigure

The augmented path figure.

Add(PathFigure, PathSegment, Point)

Adds the given PathSegment to the path figure and sets the starting point at the same time.

Declaration
public static PathFigure Add(this PathFigure pathFigure, PathSegment segment, Point startPoint)
Parameters
PathFigure pathFigure

The path figure.

PathSegment segment

The segment.

Point startPoint

The start point.

Returns
PathFigure

The augmented path figure.

Add(PathGeometry, PathFigure)

Adds the given figure to the geometry.

Declaration
public static PathGeometry Add(this PathGeometry pathGeometry, PathFigure pathFigure)
Parameters
PathGeometry pathGeometry

The path geometry.

PathFigure pathFigure

The path figure.

Returns
PathGeometry

The resulting path geometry.

AddArc(PathFigure, Double, Double, Double, Double, Double, Double, Boolean)

Adds an arc to the path figure.

Declaration
public static void AddArc(this PathFigure pathFigure, double x, double y, double width, double height, double startAngle, double sweep, bool startPoint)
Parameters
PathFigure pathFigure

The figure.

System.Double x

The x-coordinate of the bounding rectangle.

System.Double y

The y-coordinate of the bounding rectangle.

System.Double width

The width of the bounding rectangle.

System.Double height

The height of the bounding rectangle.

System.Double startAngle

The start angle.

System.Double sweep

The sweeping angle of the arc.

System.Boolean startPoint

If set to true the starting point will be set.

AddBezier(PathFigure, Double[])

Adds a bezier segment to the path.

Declaration
public static void AddBezier(this PathFigure pathFigure, double[] points)
Parameters
PathFigure pathFigure

The path.

System.Double[] points

The eight values specifying the eight coordinates of the four Bezier points.

AddBeziers(PathFigure, Point[])

Adds a bezier segment to the path.

Declaration
public static void AddBeziers(this PathFigure pathFigure, Point[] points)
Parameters
PathFigure pathFigure

The figure.

Point[] points

The points defining the Bezier segment.

AddLine(PathFigure, Double, Double, Double, Double)

Adds a line to the path.

Declaration
public static PathFigure AddLine(this PathFigure pathFigure, double x1, double y1, double x2, double y2)
Parameters
PathFigure pathFigure

The path figure.

System.Double x1

The x-coordinate of the start point.

System.Double y1

The y-coordinate of the start point.

System.Double x2

The x-coordinate of the end point.

System.Double y2

The y-coordinate of the end point.

Returns
PathFigure

AddLine(PathFigure, Point, Point)

Adds a line to the path.

Declaration
public static PathFigure AddLine(this PathFigure pathFigure, Point point1, Point point2)
Parameters
PathFigure pathFigure

The path figure.

Point point1

The start point of the line.

Point point2

The end point of the line.

Returns
PathFigure

The augmented path figure.

AddPolyLine(PathFigure, IEnumerable<Point>)

Adds a polyline to the figure.

Declaration
public static void AddPolyLine(this PathFigure pathFigure, IEnumerable<Point> points)
Parameters
PathFigure pathFigure

The figure.

System.Collections.Generic.IEnumerable<Point> points

The points defining the polyline.

AddPolyLine(PathFigure, PointCollection)

Adds a polyline to the figure.

Declaration
public static void AddPolyLine(this PathFigure pathFigure, PointCollection collection)
Parameters
PathFigure pathFigure

The figure.

PointCollection collection

The points defining the polyline.

CreateBaseLineGeometry(LineSpecification)

Creates a line geometry based on the given specifications.

Declaration
public static PathGeometry CreateBaseLineGeometry(LineSpecification specs)
Parameters
LineSpecification specs

The specs.

Returns
PathGeometry

Remarks

CreateBezier(Point, Point, Point, Point, Double)

Creates a bezier geometry.

Declaration
public static Geometry CreateBezier(Point startPoint, Point endPoint, Point startBezierPoint, Point endBezierPoint, double tension = 1)
Parameters
Point startPoint

The start point.

Point endPoint

The end point.

Point startBezierPoint

The start bezier point.

Point endBezierPoint

The end bezier point.

System.Double tension

The tension of the Bezier curve.

Returns
Geometry

CreateConnectionGeometry(IConnection, BridgeType, Boolean)

This method is called by the connection update process to create a geometry which is then plugged into the Path in the XAML template of the connection.

Declaration
public static Geometry CreateConnectionGeometry(IConnection connection, BridgeType connectionBridge, bool connectionRoundedCorners)
Parameters
IConnection connection

The connection for which to create a geometry.

BridgeType connectionBridge

What type of bridging should be applied to the line.

System.Boolean connectionRoundedCorners

Whether the corners of the line should be rounded.

Returns
Geometry

The geometry of the connection path.

Remarks

CreateEllipse(Point, Double, Double)

Creates an ellipse.

Declaration
public static Geometry CreateEllipse(Point center, double radiusX, double radiusY)
Parameters
Point center

The center.

System.Double radiusX

The x radius.

System.Double radiusY

The y radius.

Returns
Geometry

CreateLineGeometry(PolylineSpecification)

Creates a line geometry based on the given specifications.

Declaration
public static Geometry CreateLineGeometry(PolylineSpecification specs)
Parameters
PolylineSpecification specs

Returns
Geometry

A Geometry to be used in a Path

Remarks
See Also
CreateConnectionGeometry(IConnection, BridgeType, Boolean)
PolylineSpecification
CreatePolylineLineFigure(PolylineSpecification)

CreateLineGeometry(Point, Point, Boolean, Point[])

Creates the polyline.

Declaration
public static Geometry CreateLineGeometry(Point startPoint, Point endPoint, bool roundedCorners = false, params Point[] points)
Parameters
Point startPoint

The start point.

Point endPoint

The end point.

System.Boolean roundedCorners

If set to true the corners of the polyline will be rounded.

Point[] points

The points.

Returns
Geometry

CreatePathGeometry(Point, IList<PathSegment>)

Creates a geometry.

Declaration
public static Geometry CreatePathGeometry(Point startPoint, IList<PathSegment> pathSegments)
Parameters
Point startPoint

The start point.

System.Collections.Generic.IList<PathSegment> pathSegments

The path segments.

Returns
Geometry

CreatePolylineLineFigure(PolylineSpecification)

Gets the polyline figure.

Declaration
public static PathGeometry CreatePolylineLineFigure(PolylineSpecification specs)
Parameters
PolylineSpecification specs

The polyline specifications.

Returns
PathGeometry

CreateRoundedPolyline(PathFigure, IList<Point>, Boolean)

Adds rounded corners to the existing polyline figure.

Declaration
public static void CreateRoundedPolyline(PathFigure figure, IList<Point> points, bool addLastLine)
Parameters
PathFigure figure

The figure which will be incremented with corner arcs.

System.Collections.Generic.IList<Point> points

The points of the polyline.

System.Boolean addLastLine

If set to true the last line segment will be added.

Remarks

The corner radius is set in the ConnectionCornerRadius and has default 5.0 pixels.

CreateSplineFigures(IList<Point>, Double, Boolean, Boolean)

Creates a canonical spline figure.

Declaration
public static IList<PathFigure> CreateSplineFigures(IList<Point> points, double tension = 0.5, bool isClosed = false, bool isFilled = false)
Parameters
System.Collections.Generic.IList<Point> points

The points defining the spline. These should be in local coordinates and include the endpoints.

System.Double tension

The tension of the spline. A tension or zero will result in a polyline, a tension between 0.5 and 0.8 is pleasing, other values lead to wild curves.

System.Boolean isClosed

If set to true the curve will be closed.

System.Boolean isFilled

If set to true the shape will be filled .

Returns
System.Collections.Generic.IList<PathFigure>

Remarks

Based on the code in http://www.charlespetzold.com/blog/2009/01/canonical-splines-in-wpf-and-silverlight.html.

FindIntersection(Point, Point, Geometry, Double, Boolean)

Finds the intersection.

Declaration
public static Point FindIntersection(Point sourcePoint, Point targetPoint, Geometry geometry, double edgeThick, bool isArrow)
Parameters
Point sourcePoint

The source point.

Point targetPoint

The target point.

Geometry geometry

The geometry.

System.Double edgeThick

The edge thick.

System.Boolean isArrow

If set to true [is arrow].

Returns
Point

GetGeometry(PathGeometry)

Declaration
public static GraphicsPath GetGeometry(PathGeometry geometry)
Parameters
PathGeometry geometry

Returns
System.Drawing.Drawing2D.GraphicsPath

GetSplineFigureTangents(IList<Point>, out Point, out Point, Double, Boolean)

Gets the tangents of the spline figure.

Declaration
public static void GetSplineFigureTangents(IList<Point> points, out Point startTangentPoint, out Point endTangentPoint, double tension = 0.5, bool isClosed = false)
Parameters
System.Collections.Generic.IList<Point> points

The points of the connection.

Point startTangentPoint

The start tangent point.

Point endTangentPoint

The end tangent point.

System.Double tension

The tension.

System.Boolean isClosed

If set to true [is closed].

GetString(Geometry)

Converts the geometry object to its string equivalent.

Declaration
public static string GetString(this Geometry geometry)
Parameters
Geometry geometry

The geometry.

Returns
System.String

Was this article helpful?

Tell us how we can improve this article

Skip
Getting Started
  • Install Now
  • Demos
  • Step-by-Step Tutorial
  • Sample Applications
  • SDK Samples
  • Visual Studio Extensions
Support Resources
  • Code Library
  • Knowledge Base
  • Videos
Community
  • Forums
  • Blogs
  • Feedback Portal
  • Document Processing Feedback Portal

Copyright © 2018 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.