当前位置:网站首页>2021-07-17c /cad secondary development creation circle (5)
2021-07-17c /cad secondary development creation circle (5)
2022-07-02 06:59:00 【Xu Jirong】
Circle c1 = new Circle();
c1.Center = new Point3d(50, 50, 0);
c1.Radius = 50;
Circle c2 = new Circle(new Point3d(100, 100, 0), new Vector3d(0, 0, 1), 50);
Create a class of circles Circle There are two methods above :
Through the first Circle Create an object , Then give him the center 、 Radius assignment
Or assign values directly when creating .
Drawing a circle is the same as an arc , Package to AddEnityTool.ca The code is as follows
/// <summary>
/// Draw the circle
/// </summary>
/// <param name="db"> Graphic database </param>
/// <param name="center"> center of a circle </param>
/// <param name="radius"> radius </param>
/// <returns></returns>
public static ObjectId AddCircleModelSpace(Database db, Point3d center, double radius)
{
return AddEnityTool.AddEnityToModelSpace(db, new Circle(center, new Vector3d(0, 0, 1), radius));
}
/// <summary>
/// Draw a circle at two points
/// </summary>
/// <param name="db"> Graphic database </param>
/// <param name="point1"> The first point </param>
/// <param name="point2"> Second points </param>
/// <returns>ObjectId</returns>
public static ObjectId AddCircleModelSpace(Database db, Point3d point1, Point3d point2)
{
// Get the center point
Point3d center = BaseTool.GetCenterPointBetweenTwoPoint(point1, point2);
// Get the radius
double radius = BaseTool.GetDistanceBetweenTwoPoint(point1, center);
return AddEnityTool.AddCircleModelSpace(db, center, radius);
}
/// <summary>
/// Three point drawing circle
/// </summary>
/// <param name="db"> Graphic database </param>
/// <param name="point1"> The first point </param>
/// <param name="point2"> Second points </param>
/// <param name="point3"> The third point </param>
/// <returns>ObjectId</returns>
public static ObjectId AddCircleModelSpace(Database db, Point3d point1, Point3d point2, Point3d point3)
{
// First judge whether the three points are on the same straight line
if (BaseTool.IsOnOneLine(point1, point2, point3))
{
return ObjectId.Null;
}
// Declare the geometry class CircularArc3d object
CircularArc3d cArc = new CircularArc3d(point1, point2, point3);
return AddEnityTool.AddCircleModelSpace(db, cArc.Center, cArc.Radius);
}
}
}
边栏推荐
- Latex compilation error I found no \bibstyle &\bibdata &\citation command
- Stress test modification solution
- Unexpected inconsistency caused by abnormal power failure; Run fsck manually problem resolved
- php中删除指定文件夹下的内容
- 蚂蚁集团g6初探
- 2020-9-23 use of QT timer qtimer class.
- IDEA2020中测试PySpark的运行出错
- Record RDS troubleshooting once -- RDS capacity increases dramatically
- Wechat applet Foundation
- UEditor .Net版本任意文件上传漏洞复现
猜你喜欢

CVE-2015-1635(MS15-034 )远程代码执行漏洞复现

IDEA2020中PySpark的两表关联(字段名相同)

Sqli-labs customs clearance (less6-less14)

sqli-labs通關匯總-page2

Latex参考文献引用失败 报错 LaTeX Warning: Citation “*****” on page y undefined on input line *

SQLI-LABS通关(less15-less17)

How to try catch statements that return promise objects in JS

Cve-2015-1635 (ms15-034) Remote Code Execution Vulnerability recurrence

Sentry搭建和使用

VSCODE 安装LATEX环境,参数配置,常见问题解决
随机推荐
Cve - 2015 - 1635 (ms15 - 034) réplication de la vulnérabilité d'exécution de code à distance
php中删除指定文件夹下的内容
JS divides an array into groups of three
Kotlin - verify whether the time format is yyyy MM DD hh:mm:ss
The table component specifies the concatenation parallel method
Sqli - Labs Clearance (less6 - less14)
[daily question] - Huawei machine test 01
js中map和forEach的用法
Brief analysis of PHP session principle
In depth study of JVM bottom layer (3): garbage collector and memory allocation strategy
js删除字符串的最后一位
php中通过集合collect的方法来实现把某个值插入到数组中指定的位置
PIP install
Linux MySQL 5.6.51 Community Generic 安装教程
MySQL index
How to try catch statements that return promise objects in JS
Latex warning: citation "*****" on page y undefined on input line*
AWD learning
How to debug wechat built-in browser applications (enterprise number, official account, subscription number)
js创建一个自定义json数组