添加项目文件。
This commit is contained in:
59
HYJigPro/Class2.cs
Normal file
59
HYJigPro/Class2.cs
Normal file
@@ -0,0 +1,59 @@
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user