Files
RevitArchive/HYJigPro/Class2.cs
2026-02-23 14:58:05 +08:00

60 lines
2.8 KiB
C#

using System;
using System.Drawing;
using Autodesk.Revit.DB;
internal class Class2
{
public static bool smethod_0(Point point_0, Point point_1, Point point_2, ref RectangleF rectangleF_0, ref double double_0, ref double double_1)
{
try
{
Class2.Class3 @class = Class2.Class3.smethod_0(point_0, point_1, point_2);
XYZ xyz = new XYZ((double)point_0.X, (double)point_0.Y, 0.0);
XYZ xyz2 = new XYZ((double)point_1.X, (double)point_1.Y, 0.0);
XYZ xyz3 = new XYZ((double)@class.DgspelApwn.X, (double)@class.DgspelApwn.Y, 0.0);
XYZ xyz4 = new XYZ((double)point_2.X, (double)point_2.Y, 0.0);
XYZ xyz5 = -XYZ.BasisZ;
rectangleF_0 = new RectangleF((float)(xyz3.X - @class.cjupkDlcnu), (float)(xyz3.Y - @class.cjupkDlcnu), (float)(2.0 * @class.cjupkDlcnu), (float)(2.0 * @class.cjupkDlcnu));
XYZ xyz6 = xyz2 - xyz;
XYZ xyz7 = xyz4 - xyz;
XYZ xyz8 = xyz;
XYZ xyz9 = xyz2;
if (!xyz6.CrossProduct(xyz7).Normalize().IsAlmostEqualTo(xyz5))
{
xyz8 = xyz2;
xyz9 = xyz;
}
double_0 = XYZ.BasisX.AngleOnPlaneTo(xyz8 - xyz3, -xyz5);
double_1 = (xyz8 - xyz3).AngleOnPlaneTo(xyz9 - xyz3, -xyz5);
double_0 *= 57.295779513082323;
double_1 *= 57.295779513082323;
}
catch (Exception)
{
return false;
}
return true;
}
private class Class3
{
public static Class2.Class3 smethod_0(Point point_0, Point point_1, Point point_2)
{
Class2.Class3 @class = new Class2.Class3();
double num = (point_1.X * point_1.X + point_1.Y * point_1.Y - (point_0.X * point_0.X + point_0.Y * point_0.Y)) * (2 * (point_2.Y - point_0.Y)) - (point_2.X * point_2.X + point_2.Y * point_2.Y - (point_0.X * point_0.X + point_0.Y * point_0.Y)) * (2 * (point_1.Y - point_0.Y));
double num2 = 2 * (point_1.X - point_0.X) * (point_2.X * point_2.X + point_2.Y * point_2.Y - (point_0.X * point_0.X + point_0.Y * point_0.Y)) - 2 * (point_2.X - point_0.X) * (point_1.X * point_1.X + point_1.Y * point_1.Y - (point_0.X * point_0.X + point_0.Y * point_0.Y));
double num3 = 4 * ((point_1.X - point_0.X) * (point_2.Y - point_0.Y) - (point_2.X - point_0.X) * (point_1.Y - point_0.Y));
@class.DgspelApwn.X = (int)(num / num3);
@class.DgspelApwn.Y = (int)(num2 / num3);
@class.cjupkDlcnu = Math.Sqrt((double)((point_0.X - @class.DgspelApwn.X) * (point_0.X - @class.DgspelApwn.X) + (point_0.Y - @class.DgspelApwn.Y) * (point_0.Y - @class.DgspelApwn.Y)));
return @class;
}
public Point DgspelApwn;
public double cjupkDlcnu;
}
}