Skip to content

Commit ab52581

Browse files
authored
Update Rect3DExtension (helix-toolkit#2025)
1 parent b090b5d commit ab52581

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Source/HelixToolkit.Wpf.Shared/ExtensionMethods/Rect3DExtensions.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public static class Rect3DExtensions
2020
/// </summary>
2121
/// <param name="rect">The given Rect3D</param>
2222
/// <returns>The center point of given Rect3D</returns>
23-
public static Point3D GetCenterPoint3D(this Rect3D rect)
23+
public static Point3D GetCenter(this Rect3D rect)
2424
{
2525
return new Point3D(
2626
rect.X + rect.SizeX / 2,
@@ -35,7 +35,7 @@ public static Point3D GetCenterPoint3D(this Rect3D rect)
3535
/// <param name="rect3d">The given Rect3D</param>
3636
/// <param name="expand">Amount of expansion</param>
3737
/// <returns>A newly expanded Rect3D</returns>
38-
public static Rect3D ExpandRect3D(Rect3D rect3d, double expand)
38+
public static Rect3D Expand(this Rect3D rect3d, double expand)
3939
{
4040
if (rect3d == Rect3D.Empty
4141
|| double.IsNaN(expand)
@@ -58,7 +58,7 @@ public static Rect3D ExpandRect3D(Rect3D rect3d, double expand)
5858
/// </summary>
5959
/// <param name="rects">Collection Rect3D</param>
6060
/// <returns>A newly total Rect3D</returns>
61-
public static Rect3D MergeRect3D(IEnumerable<Rect3D> rects)
61+
public static Rect3D Merge(this IEnumerable<Rect3D> rects)
6262
{
6363
Rect3D result = Rect3D.Empty;
6464
foreach (var rect in rects)
@@ -96,7 +96,7 @@ public static PlaneIntersectionType Intersects(this Rect3D rect, Point3D planePo
9696

9797
planeNormal.Normalize();
9898
Vector3D absPlaneNormal = new Vector3D(Math.Abs(planeNormal.X), Math.Abs(planeNormal.Y), Math.Abs(planeNormal.Z));
99-
Point3D center = rect.GetCenterPoint3D();
99+
Point3D center = rect.GetCenter();
100100
Vector3D centerToCorner = center - rect.Location;
101101
double extents = Vector3D.DotProduct(centerToCorner, absPlaneNormal);
102102
double distance = center.DistanceToPlane(planePosition, planeNormal);

0 commit comments

Comments
 (0)